|
1 | | -name: SLO |
| 1 | +name: slo |
| 2 | + |
2 | 3 | on: |
3 | 4 | pull_request: |
4 | 5 | branches: |
5 | 6 | - master |
6 | 7 | - release-* |
7 | 8 | workflow_dispatch: |
| 9 | + inputs: |
| 10 | + github_pull_request_number: |
| 11 | + required: true |
| 12 | + slo_workload_duration_seconds: |
| 13 | + default: '600' |
| 14 | + required: false |
| 15 | + slo_workload_read_max_rps: |
| 16 | + default: '1000' |
| 17 | + required: false |
| 18 | + slo_workload_write_max_rps: |
| 19 | + default: '100' |
| 20 | + required: false |
| 21 | + |
8 | 22 | jobs: |
9 | | - test-slo: |
10 | | - concurrency: |
11 | | - group: slo-${{ github.ref }} |
| 23 | + ydb-slo-action-init: |
12 | 24 | if: (!contains(github.event.pull_request.labels.*.name, 'no slo')) |
13 | 25 |
|
| 26 | + name: Run YDB SLO Tests |
14 | 27 | runs-on: ubuntu-latest |
15 | | - name: SLO test |
16 | | - permissions: |
17 | | - checks: write |
18 | | - pull-requests: write |
19 | | - contents: read |
20 | | - issues: write |
| 28 | + |
| 29 | + strategy: |
| 30 | + matrix: |
| 31 | + sdk: |
| 32 | + - id: database_sql |
| 33 | + name: database-sql |
| 34 | + path: ./database/sql |
| 35 | + label: database/sql |
| 36 | + - id: native_query |
| 37 | + name: native-query |
| 38 | + path: ./native/query |
| 39 | + label: native/query |
| 40 | + - id: native_table |
| 41 | + name: native-table |
| 42 | + path: ./native/table |
| 43 | + label: native/table |
| 44 | + - id: gorm |
| 45 | + name: gorm |
| 46 | + path: ./gorm |
| 47 | + label: gorm |
| 48 | + - id: xorm |
| 49 | + name: xorm |
| 50 | + path: ./xorm |
| 51 | + label: xorm |
| 52 | + |
| 53 | + concurrency: |
| 54 | + group: slo-${{ github.ref }}-${{matrix.sdk.name}} |
21 | 55 |
|
22 | 56 | steps: |
23 | 57 | - name: Checkout repository |
24 | 58 | uses: actions/checkout@v4 |
25 | 59 |
|
26 | | - - name: Run SLO |
27 | | - uses: ydb-platform/slo-tests@main |
28 | | - continue-on-error: true |
| 60 | + - name: Install Go |
| 61 | + uses: actions/setup-go@v5 |
29 | 62 | with: |
30 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
31 | | - KUBECONFIG_B64: ${{ secrets.SLO_KUBE_CONFIG }} |
32 | | - AWS_CREDENTIALS_B64: ${{ secrets.SLO_AWS_CREDENTIALS }} |
33 | | - AWS_CONFIG_B64: ${{ secrets.SLO_AWS_CONFIG }} |
34 | | - DOCKER_USERNAME: ${{ secrets.SLO_DOCKER_USERNAME }} |
35 | | - DOCKER_PASSWORD: ${{ secrets.SLO_DOCKER_PASSWORD }} |
36 | | - DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }} |
37 | | - DOCKER_FOLDER: ${{ secrets.SLO_DOCKER_FOLDER }} |
38 | | - s3_endpoint: ${{ secrets.SLO_S3_ENDPOINT }} |
39 | | - s3_images_folder: ${{ vars.SLO_S3_IMAGES_FOLDER }} |
40 | | - grafana_domain: ${{ vars.SLO_GRAFANA_DOMAIN }} |
41 | | - grafana_dashboard: ${{ vars.SLO_GRAFANA_DASHBOARD }} |
42 | | - ydb_version: 'newest' |
43 | | - timeBetweenPhases: 30 |
44 | | - shutdownTime: 30 |
| 63 | + go-version: 1.23.x |
| 64 | + cache: true |
45 | 65 |
|
46 | | - language_id0: 'native-table' |
47 | | - workload_path0: 'tests/slo' |
48 | | - language0: 'Native ydb-go-sdk/v3 over table-service' |
49 | | - workload_build_context0: ../.. |
50 | | - workload_build_options0: -f Dockerfile --build-arg SRC_PATH=native/table --build-arg JOB_NAME=workload-native-table |
| 66 | + - name: Build workload |
| 67 | + run: | |
| 68 | + cd ./tests/slo |
| 69 | + go build -o .bin/${{matrix.sdk.id}}_linux_amd64 -ldflags "-X \"main.ref=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}\" -X \"main.label=${{matrix.sdk.label}}\" -X \"main.jobName=${{matrix.sdk.name}}\"" ${{matrix.sdk.path}} |
| 70 | + chmod +x .bin/${{matrix.sdk.id}}_linux_amd64 |
51 | 71 |
|
52 | | - language_id1: 'database-sql' |
53 | | - workload_path1: 'tests/slo' |
54 | | - language1: 'Go SDK database/sql' |
55 | | - workload_build_context1: ../.. |
56 | | - workload_build_options1: -f Dockerfile --build-arg SRC_PATH=database/sql --build-arg JOB_NAME=workload-database-sql |
57 | | - |
58 | | - language_id2: 'gorm' |
59 | | - workload_path2: 'tests/slo' |
60 | | - language2: 'Go SDK gorm' |
61 | | - workload_build_context2: ../.. |
62 | | - workload_build_options2: -f Dockerfile --build-arg SRC_PATH=gorm --build-arg JOB_NAME=workload-gorm |
63 | | - |
64 | | - language_id3: 'xorm' |
65 | | - workload_path3: 'tests/slo' |
66 | | - language3: 'Go SDK xorm' |
67 | | - workload_build_context3: ../.. |
68 | | - workload_build_options3: -f Dockerfile --build-arg SRC_PATH=xorm --build-arg JOB_NAME=workload-xorm |
69 | | - |
70 | | - language_id4: 'native-query' |
71 | | - workload_path4: 'tests/slo' |
72 | | - language4: 'Native ydb-go-sdk/v3 over query-service' |
73 | | - workload_build_context4: ../.. |
74 | | - workload_build_options4: -f Dockerfile --build-arg SRC_PATH=native/query --build-arg JOB_NAME=workload-native-query |
75 | | - |
76 | | - - uses: actions/upload-artifact@v4 |
77 | | - if: always() |
| 72 | + - name: Inititialize YDB SLO |
| 73 | + uses: ydb-platform/ydb-slo-action/init@main |
78 | 74 | with: |
79 | | - name: slo-logs |
80 | | - path: logs/ |
| 75 | + github_pull_request_number: ${{ github.event.inputs.github_pull_request_number }} |
| 76 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 77 | + sdk_name: ${{ matrix.sdk.name }} |
| 78 | + |
| 79 | + - name: Run SLO Tests |
| 80 | + run: | |
| 81 | + ./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 create grpc://localhost:2135 /Root/testdb |
| 82 | + ./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 run grpc://localhost:2135 /Root/testdb \ |
| 83 | + -prom-pgw localhost:9091 \ |
| 84 | + -report-period 500 \ |
| 85 | + -time ${{inputs.slo_workload_duration_seconds || 600}} \ |
| 86 | + -read-rps ${{inputs.slo_workload_read_max_rps || 1000}} \ |
| 87 | + -write-rps ${{inputs.slo_workload_write_max_rps || 100}} |
| 88 | + ./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 cleanup grpc://localhost:2135 /Root/testdb |
0 commit comments