-
Notifications
You must be signed in to change notification settings - Fork 28
feat: update slo #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: update slo #216
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
18a26ec
feat: update slo
KirillKurdyukov 4fa63fa
fix log level
KirillKurdyukov b939cc5
fixes
KirillKurdyukov 88b5409
fix
KirillKurdyukov 5252cbc
fix
KirillKurdyukov 37be34b
feat: update slo.yml
KirillKurdyukov e5b62c4
change jobName on operation_type
KirillKurdyukov d815c42
feat update slo.yml
KirillKurdyukov 377aa21
update labels
KirillKurdyukov 809a7fd
fix name workload
KirillKurdyukov 63c4482
fix job name
KirillKurdyukov fc81da6
feat: update slo
KirillKurdyukov 56fac9b
fix: Gauge -> Counter
KirillKurdyukov e0889cb
update Run SLO Tests
KirillKurdyukov bc1dae4
refactor: replace Gauge with Counter for error tracking in SloContext
polRk 34db579
fix: update PromPgw option description and refactor MetricPusher init…
polRk 23710bd
fix: use TotalSeconds for operation latency measurement in SloContext
polRk 3a3def8
Merge branch 'main' into feat-update-slo
polRk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,75 +1,83 @@ | ||
| name: SLO | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: [main] | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| name: SLO | ||
| inputs: | ||
| github_pull_request_number: | ||
| required: true | ||
| slo_workload_duration_seconds: | ||
| default: '600' | ||
| required: false | ||
| slo_workload_read_max_rps: | ||
| default: '1000' | ||
| required: false | ||
| slo_workload_write_max_rps: | ||
| default: '1000' | ||
| required: false | ||
|
|
||
| jobs: | ||
| test-slo: | ||
| concurrency: | ||
| group: slo-${{ github.ref }} | ||
| ydb-slo-action: | ||
| if: (!contains(github.event.pull_request.labels.*.name, 'no slo')) | ||
|
|
||
| runs-on: ubuntu-latest | ||
| name: SLO test | ||
| permissions: | ||
| checks: write | ||
| pull-requests: write | ||
| contents: read | ||
| issues: write | ||
|
|
||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| workload: | ||
| - AdoNet | ||
|
|
||
| concurrency: | ||
| group: slo-${{ github.ref }}-${{ matrix.workload }} | ||
| cancel-in-progress: true | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| if: env.DOCKER_REPO != null | ||
| env: | ||
| DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }} | ||
|
|
||
| - name: Run SLO | ||
| uses: ydb-platform/slo-tests@main | ||
| if: env.DOCKER_REPO != null | ||
| env: | ||
| DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }} | ||
| continue-on-error: true | ||
| - name: Install .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 8.0.x | ||
|
|
||
| - name: Initialize YDB SLO | ||
| uses: ydb-platform/ydb-slo-action/init@main | ||
| with: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| KUBECONFIG_B64: ${{ secrets.SLO_KUBE_CONFIG }} | ||
| AWS_CREDENTIALS_B64: ${{ secrets.SLO_AWS_CREDENTIALS }} | ||
| AWS_CONFIG_B64: ${{ secrets.SLO_AWS_CONFIG }} | ||
| DOCKER_USERNAME: ${{ secrets.SLO_DOCKER_USERNAME }} | ||
| DOCKER_PASSWORD: ${{ secrets.SLO_DOCKER_PASSWORD }} | ||
| DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }} | ||
| DOCKER_FOLDER: ${{ secrets.SLO_DOCKER_FOLDER }} | ||
| s3_endpoint: ${{ secrets.SLO_S3_ENDPOINT }} | ||
| s3_images_folder: ${{ vars.SLO_S3_IMAGES_FOLDER }} | ||
| grafana_domain: ${{ vars.SLO_GRAFANA_DOMAIN }} | ||
| # grafana_dashboard: ${{ vars.SLO_GRAFANA_DASHBOARD }} | ||
| grafana_dashboard: dca60386-0d3d-43f5-a2af-5f3fd3e3b295 | ||
| grafana_dashboard_width: 2000 | ||
| grafana_dashboard_height: 2300 | ||
| ydb_version: 'newest' | ||
| timeBetweenPhases: 30 | ||
| shutdownTime: 30 | ||
| github_pull_request_number: ${{ github.event.inputs.github_pull_request_number }} | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| workload_name: ${{ matrix.workload }} | ||
| ydb_database_node_count: 5 | ||
|
|
||
| - name: Prepare SLO Database | ||
| run: | | ||
| cd slo/src/${{ matrix.workload }} | ||
| dotnet run create grpc://localhost:2135 /Root/testdb | ||
|
|
||
| - name: Run SLO Tests | ||
| run: | | ||
| cd slo/src/${{ matrix.workload }} | ||
| dotnet run run grpc://localhost:2135 /Root/testdb \ | ||
| --prom-pgw http://localhost:9091 \ | ||
| --report-period 250 \ | ||
| --time ${{inputs.slo_workload_duration_seconds || 600 }} \ | ||
| --read-rps ${{inputs.slo_workload_read_max_rps || 1000 }} \ | ||
| --write-rps ${{inputs.slo_workload_write_max_rps || 1000 }} \ | ||
| --read-timeout 1000 \ | ||
| --write-timeout 1000 | ||
|
|
||
| language_id0: 'table-service' | ||
| workload_path0: 'slo/src' | ||
| language0: '.NET SDK over table-service' | ||
| workload_build_context0: ../.. | ||
| workload_build_options0: -f Dockerfile --build-arg SRC_PATH=TableService | ||
|
|
||
| language_id1: 'ado-net' | ||
| workload_path1: 'slo/src' | ||
| language1: 'ADO.NET over query-service' | ||
| workload_build_context1: ../.. | ||
| workload_build_options1: -f Dockerfile --build-arg SRC_PATH=AdoNet | ||
| - if: always() | ||
| name: Store ydb chaos testing logs | ||
| run: | | ||
| docker logs ydb-chaos > chaos-ydb.log | ||
|
|
||
| - uses: actions/upload-artifact@v3 | ||
| if: always() && env.DOCKER_REPO != null | ||
| env: | ||
| DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }} | ||
| - if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: slo-logs | ||
| path: logs/ | ||
| name: ${{ matrix.workload }}-chaos-ydb.log | ||
| path: ./chaos-ydb.log | ||
| retention-days: 1 | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/bin/sh -e | ||
|
|
||
| get_random_container() { | ||
| # Get a list of all containers starting with ydb-database-* | ||
| containers=$(docker ps --format '{{.Names}}' | grep '^ydb-database-') | ||
|
|
||
| # Convert the list to a newline-separated string | ||
| containers=$(echo "$containers" | tr ' ' '\n') | ||
|
|
||
| # Count the number of containers | ||
| containersCount=$(echo "$containers" | wc -l) | ||
|
|
||
| # Generate a random number between 0 and containersCount - 1 | ||
| randomIndex=$(shuf -i 0-$(($containersCount - 1)) -n 1) | ||
|
|
||
| # Get the container name at the random index | ||
| nodeForChaos=$(echo "$containers" | sed -n "$(($randomIndex + 1))p") | ||
| } | ||
|
|
||
|
|
||
| sleep 60 | ||
|
|
||
| get_random_container | ||
|
|
||
| sh -c "docker stop ${nodeForChaos} -t 30" | ||
| sh -c "docker start ${nodeForChaos}" | ||
|
|
||
| sleep 60 | ||
|
|
||
| get_random_container | ||
|
|
||
| sh -c "docker restart ${nodeForChaos} -t 0" | ||
|
|
||
| sleep 60 | ||
|
|
||
| get_random_container | ||
|
|
||
| sh -c "docker kill -s SIGKILL ${nodeForChaos}" | ||
|
|
||
| sleep 60 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.