Fixed WaitingQueue bug #120
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SLO | |
| on: | |
| pull_request: | |
| type: [labeled] | |
| jobs: | |
| ydb-slo-action: | |
| if: contains(github.event.pull_request.labels.*.name, 'SLO') | |
| name: Run YDB SLO Tests | |
| runs-on: large-runner-java-sdk | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| workload: | |
| - name: java-query-kv | |
| module: query | |
| - name: java-jdbc-kv | |
| module: jdbc | |
| - name: java-spring-data-jdbc-kv | |
| module: spring-data-jdbc | |
| - name: java-spring-data-jpa-kv | |
| module: spring-data-jpa | |
| concurrency: | |
| group: slo-${{ github.ref }}-${{ matrix.workload.name }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| set -euxo pipefail | |
| YQ_VERSION=v4.48.2 | |
| BUILDX_VERSION=0.30.1 | |
| COMPOSE_VERSION=2.40.3 | |
| sudo curl -fLo /usr/local/bin/yq \ | |
| "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" | |
| sudo chmod +x /usr/local/bin/yq | |
| sudo mkdir -p /usr/local/lib/docker/cli-plugins | |
| sudo curl -fLo /usr/local/lib/docker/cli-plugins/docker-buildx \ | |
| "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64" | |
| sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-buildx | |
| sudo curl -fLo /usr/local/lib/docker/cli-plugins/docker-compose \ | |
| "https://github.com/docker/compose/releases/download/v${COMPOSE_VERSION}/docker-compose-linux-x86_64" | |
| sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose | |
| yq --version | |
| docker --version | |
| docker buildx version | |
| docker compose version | |
| - name: Checkout current SDK version | |
| uses: actions/checkout@v5 | |
| with: | |
| path: sdk-current | |
| fetch-depth: 0 | |
| - name: Determine baseline commit | |
| id: baseline | |
| working-directory: sdk-current | |
| run: | | |
| set -euo pipefail | |
| BASELINE=$(git merge-base HEAD origin/master) | |
| echo "sha=${BASELINE}" >> "$GITHUB_OUTPUT" | |
| if git merge-base --is-ancestor "${BASELINE}" origin/master && \ | |
| [ "$(git rev-parse origin/master)" = "${BASELINE}" ]; then | |
| BASELINE_REF="master" | |
| else | |
| BRANCH=$(git branch -r --contains "${BASELINE}" | grep -v HEAD | head -1 | sed 's|.*/||' || echo "") | |
| if [ -n "${BRANCH}" ]; then | |
| BASELINE_REF="${BRANCH}@${BASELINE:0:7}" | |
| else | |
| BASELINE_REF="${BASELINE:0:7}" | |
| fi | |
| fi | |
| echo "ref=${BASELINE_REF}" >> "$GITHUB_OUTPUT" | |
| - name: Checkout baseline SDK version | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ steps.baseline.outputs.sha }} | |
| path: sdk-baseline | |
| fetch-depth: 1 | |
| - name: Checkout ydb-java-examples | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ydb-platform/ydb-java-examples | |
| ref: master | |
| path: examples | |
| - name: Build current workload image | |
| run: | | |
| set -euxo pipefail | |
| chmod +x sdk-current/.github/scripts/build-slo-image.sh | |
| sdk-current/.github/scripts/build-slo-image.sh \ | |
| --sdk sdk-current \ | |
| --examples examples \ | |
| --workload ${{ matrix.workload.module }} \ | |
| --tag "ydb-app-current-${{ matrix.workload.module }}" | |
| - name: Build baseline workload image | |
| run: | | |
| set -euxo pipefail | |
| sdk-current/.github/scripts/build-slo-image.sh \ | |
| --sdk sdk-baseline \ | |
| --examples examples \ | |
| --workload ${{ matrix.workload.module }} \ | |
| --tag "ydb-app-baseline-${{ matrix.workload.module }}" \ | |
| --fallback-image "ydb-app-current-${{ matrix.workload.module }}" | |
| - name: Run SLO Tests | |
| uses: ydb-platform/ydb-slo-action/init@v2 | |
| timeout-minutes: 30 | |
| with: | |
| github_issue: ${{ github.event.pull_request.number }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| workload_name: ${{ matrix.workload.name }} | |
| workload_duration: "600" | |
| workload_current_ref: ${{ github.head_ref || github.ref_name }} | |
| workload_current_image: ydb-app-current-${{ matrix.workload.module }} | |
| workload_current_command: --read-rps 1000 --write-rps 100 | |
| workload_baseline_ref: ${{ steps.baseline.outputs.ref }} | |
| workload_baseline_image: ydb-app-baseline-${{ matrix.workload.module }} | |
| workload_baseline_command: --read-rps 1000 --write-rps 100 | |
| publish-slo-report: | |
| needs: ydb-slo-action | |
| name: Publish YDB SLO Report | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| checks: write | |
| steps: | |
| - name: Publish YDB SLO Report | |
| uses: ydb-platform/ydb-slo-action/report@v2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| github_run_id: ${{ github.run_id }} | |
| github_issue: ${{ github.event.pull_request.number }} | |
| - name: Remove SLO label from PR | |
| if: github.event_name == 'pull_request' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| gh pr edit "${{ github.event.pull_request.number }}" \ | |
| --repo "${{ github.repository }}" \ | |
| --remove-label SLO |