|
| 1 | +name: SLO |
| 2 | + |
1 | 3 | on: |
2 | 4 | push: |
3 | | - branches: [main] |
| 5 | + branches: |
| 6 | + - main |
4 | 7 | pull_request: |
5 | | - branches: [main] |
| 8 | + branches: |
| 9 | + - main |
6 | 10 | workflow_dispatch: |
7 | | - |
8 | | -name: SLO |
| 11 | + inputs: |
| 12 | + github_pull_request_number: |
| 13 | + required: true |
| 14 | + slo_workload_duration_seconds: |
| 15 | + default: '600' |
| 16 | + required: false |
| 17 | + slo_workload_read_max_rps: |
| 18 | + default: '1000' |
| 19 | + required: false |
| 20 | + slo_workload_write_max_rps: |
| 21 | + default: '1000' |
| 22 | + required: false |
9 | 23 |
|
10 | 24 | jobs: |
11 | | - test-slo: |
12 | | - concurrency: |
13 | | - group: slo-${{ github.ref }} |
| 25 | + ydb-slo-action: |
14 | 26 | if: (!contains(github.event.pull_request.labels.*.name, 'no slo')) |
15 | 27 |
|
16 | | - runs-on: ubuntu-latest |
17 | 28 | name: SLO test |
18 | | - permissions: |
19 | | - checks: write |
20 | | - pull-requests: write |
21 | | - contents: read |
22 | | - issues: write |
23 | | - |
| 29 | + runs-on: ubuntu-latest |
| 30 | + strategy: |
| 31 | + matrix: |
| 32 | + workload: |
| 33 | + - AdoNet |
| 34 | + |
| 35 | + concurrency: |
| 36 | + group: slo-${{ github.ref }}-${{ matrix.workload }} |
| 37 | + cancel-in-progress: true |
| 38 | + |
24 | 39 | steps: |
25 | 40 | - name: Checkout repository |
26 | 41 | uses: actions/checkout@v4 |
27 | | - if: env.DOCKER_REPO != null |
28 | | - env: |
29 | | - DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }} |
30 | 42 |
|
31 | | - - name: Run SLO |
32 | | - uses: ydb-platform/slo-tests@main |
33 | | - if: env.DOCKER_REPO != null |
34 | | - env: |
35 | | - DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }} |
36 | | - continue-on-error: true |
| 43 | + - name: Install .NET |
| 44 | + uses: actions/setup-dotnet@v4 |
| 45 | + with: |
| 46 | + dotnet-version: 8.0.x |
| 47 | + |
| 48 | + - name: Initialize YDB SLO |
| 49 | + uses: ydb-platform/ydb-slo-action/init@main |
37 | 50 | with: |
38 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
39 | | - KUBECONFIG_B64: ${{ secrets.SLO_KUBE_CONFIG }} |
40 | | - AWS_CREDENTIALS_B64: ${{ secrets.SLO_AWS_CREDENTIALS }} |
41 | | - AWS_CONFIG_B64: ${{ secrets.SLO_AWS_CONFIG }} |
42 | | - DOCKER_USERNAME: ${{ secrets.SLO_DOCKER_USERNAME }} |
43 | | - DOCKER_PASSWORD: ${{ secrets.SLO_DOCKER_PASSWORD }} |
44 | | - DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }} |
45 | | - DOCKER_FOLDER: ${{ secrets.SLO_DOCKER_FOLDER }} |
46 | | - s3_endpoint: ${{ secrets.SLO_S3_ENDPOINT }} |
47 | | - s3_images_folder: ${{ vars.SLO_S3_IMAGES_FOLDER }} |
48 | | - grafana_domain: ${{ vars.SLO_GRAFANA_DOMAIN }} |
49 | | - # grafana_dashboard: ${{ vars.SLO_GRAFANA_DASHBOARD }} |
50 | | - grafana_dashboard: dca60386-0d3d-43f5-a2af-5f3fd3e3b295 |
51 | | - grafana_dashboard_width: 2000 |
52 | | - grafana_dashboard_height: 2300 |
53 | | - ydb_version: 'newest' |
54 | | - timeBetweenPhases: 30 |
55 | | - shutdownTime: 30 |
| 51 | + github_pull_request_number: ${{ github.event.inputs.github_pull_request_number }} |
| 52 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + workload_name: ${{ matrix.workload }} |
| 54 | + ydb_database_node_count: 5 |
| 55 | + |
| 56 | + - name: Prepare SLO Database |
| 57 | + run: | |
| 58 | + cd slo/src/${{ matrix.workload }} |
| 59 | + dotnet run create grpc://localhost:2135 /Root/testdb |
| 60 | +
|
| 61 | + - name: Run SLO Tests |
| 62 | + run: | |
| 63 | + cd slo/src/${{ matrix.workload }} |
| 64 | + dotnet run run grpc://localhost:2135 /Root/testdb \ |
| 65 | + --prom-pgw http://localhost:9091 \ |
| 66 | + --report-period 250 \ |
| 67 | + --time ${{inputs.slo_workload_duration_seconds || 600 }} \ |
| 68 | + --read-rps ${{inputs.slo_workload_read_max_rps || 1000 }} \ |
| 69 | + --write-rps ${{inputs.slo_workload_write_max_rps || 1000 }} \ |
| 70 | + --read-timeout 1000 \ |
| 71 | + --write-timeout 1000 |
56 | 72 |
|
57 | | - language_id0: 'table-service' |
58 | | - workload_path0: 'slo/src' |
59 | | - language0: '.NET SDK over table-service' |
60 | | - workload_build_context0: ../.. |
61 | | - workload_build_options0: -f Dockerfile --build-arg SRC_PATH=TableService |
62 | | - |
63 | | - language_id1: 'ado-net' |
64 | | - workload_path1: 'slo/src' |
65 | | - language1: 'ADO.NET over query-service' |
66 | | - workload_build_context1: ../.. |
67 | | - workload_build_options1: -f Dockerfile --build-arg SRC_PATH=AdoNet |
| 73 | + - if: always() |
| 74 | + name: Store ydb chaos testing logs |
| 75 | + run: | |
| 76 | + docker logs ydb-chaos > chaos-ydb.log |
68 | 77 |
|
69 | | - - uses: actions/upload-artifact@v3 |
70 | | - if: always() && env.DOCKER_REPO != null |
71 | | - env: |
72 | | - DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }} |
| 78 | + - if: always() |
| 79 | + uses: actions/upload-artifact@v4 |
73 | 80 | with: |
74 | | - name: slo-logs |
75 | | - path: logs/ |
| 81 | + name: ${{ matrix.workload }}-chaos-ydb.log |
| 82 | + path: ./chaos-ydb.log |
| 83 | + retention-days: 1 |
0 commit comments