Skip to content

Performance benchmark workflow #1

Performance benchmark workflow

Performance benchmark workflow #1

Workflow file for this run

name: Benchmark
on:
workflow_dispatch:
push:
branches:
- main
- 1.*
- 2.*
pull_request:
branches:
- main
- 1.*
- 2.*
env:
JAVA_VERSION: 21
OPENSEARCH_VERSION: 3.0.0
OPENSEARCH_ADMIN_PASSWORD: Hello_World123
jobs:
benchmark:
runs-on: ubuntu-latest
name: Benchmark
steps:
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
- name: Checkout Branch
uses: actions/checkout@v4
- name: Set up gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-disabled: false
- name: Assemble target plugin
run: ./gradlew assemble
- name: Prepare Security Plugin
run: mv ./build/distributions/opensearch-security-*.zip ./benchmark/docker/
- name: Build Docker Image
run: docker build --platform linux/amd64 --build-arg VERSION=${{ env.OPENSEARCH_VERSION }} -f benchmark/docker/benchmark.dockerfile -t opensearchproject/security-benchmark:latest benchmark/docker/
- name: Run Benchmark Cluster
uses: isbang/[email protected]
with:
compose-file: "./benchmark/docker-compose.yml"
env:
OPENSEARCH_INITIAL_ADMIN_PASSWORD: ${{ env.OPENSEARCH_ADMIN_PASSWORD }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Benchmark
run: pip install opensearch-benchmark
- name: Execute Benchmarks
run: opensearch-benchmark execute-test --pipeline=benchmark-only --results-format=csv --results-file=./results.csv --on-error=abort --workload=percolator --target-host=https://localhost:9200 --client-options=basic_auth_user:admin,basic_auth_password:${{ env.OPENSEARCH_ADMIN_PASSWORD }},verify_certs:false,timeout:60
- name: Prepare Benchmark Results
run: python benchmark/result_rewriter.py ./results.csv ./results.json
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: Store Benchmark Results
uses: benchmark-action/github-action-benchmark@v1
with:
tool: customSmallerIsBetter
output-file-path: ./results.json
external-data-json-path: ./cache/benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-alert: true
alert-threshold: '150%'