1
- name : SLO
1
+ name : slo
2
2
3
3
on :
4
+ push :
5
+ branches :
6
+ - main
4
7
pull_request :
5
- branches : [main]
8
+ branches :
9
+ - main
10
+ - release-*
6
11
workflow_dispatch :
12
+ inputs :
13
+ github_pull_request_number :
14
+ required : true
15
+ slo_workload_duration_seconds :
16
+ default : ' 600'
17
+ required : false
18
+ slo_workload_read_max_rps :
19
+ default : ' 1000'
20
+ required : false
21
+ slo_workload_write_max_rps :
22
+ default : ' 100'
23
+ required : false
7
24
8
25
jobs :
9
- test-slo :
10
- concurrency :
11
- group : slo-${{ github.ref }}
26
+ ydb-slo-action-init :
12
27
if : (!contains(github.event.pull_request.labels.*.name, 'no slo'))
13
28
29
+ name : Run YDB SLO Tests
14
30
runs-on : ubuntu-latest
15
- name : SLO test
16
- permissions :
17
- checks : write
18
- pull-requests : write
19
- contents : read
20
- issues : write
31
+
32
+ strategy :
33
+ matrix :
34
+ sdk :
35
+ - py-sync-table
36
+ - py-sync-query
21
37
22
38
steps :
23
39
- name : Checkout repository
24
- uses : actions/checkout@v3
25
- if : env.DOCKER_REPO != null
26
- env :
27
- DOCKER_REPO : ${{ secrets.SLO_DOCKER_REPO }}
40
+ uses : actions/checkout@v4
28
41
29
- - name : Run SLO
30
- uses : ydb-platform/slo-tests@main
31
- if : env.DOCKER_REPO != null
32
- env :
33
- DOCKER_REPO : ${{ secrets.SLO_DOCKER_REPO }}
34
- continue-on-error : true
42
+ - name : Install Python3
43
+ uses : actions/setup-python@v5
35
44
with :
36
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
37
- KUBECONFIG_B64 : ${{ secrets.SLO_KUBE_CONFIG }}
38
- AWS_CREDENTIALS_B64 : ${{ secrets.SLO_AWS_CREDENTIALS }}
39
- AWS_CONFIG_B64 : ${{ secrets.SLO_AWS_CONFIG }}
40
- DOCKER_USERNAME : ${{ secrets.SLO_DOCKER_USERNAME }}
41
- DOCKER_PASSWORD : ${{ secrets.SLO_DOCKER_PASSWORD }}
42
- DOCKER_REPO : ${{ secrets.SLO_DOCKER_REPO }}
43
- DOCKER_FOLDER : ${{ secrets.SLO_DOCKER_FOLDER }}
44
- s3_endpoint : ${{ secrets.SLO_S3_ENDPOINT }}
45
- s3_images_folder : ${{ vars.SLO_S3_IMAGES_FOLDER }}
46
- grafana_domain : ${{ vars.SLO_GRAFANA_DOMAIN }}
47
- grafana_dashboard : ${{ vars.SLO_GRAFANA_DASHBOARD }}
48
- ydb_version : ' newest'
49
- timeBetweenPhases : 30
50
- shutdownTime : 30
45
+ python-version : ' 3.8'
46
+ cache : ' pip'
51
47
52
- language_id0 : sync-python-table
53
- language0 : Python SDK over Table Service
54
- workload_path0 : tests/slo
55
- workload_build_context0 : ../. .
56
- workload_build_options0 : -f Dockerfile --build-arg SDK_SERVICE=sync-python-table
48
+ - name : Install dependencies
49
+ run : |
50
+ python -m pip install --no-cache-dir --upgrade pip
51
+ python -m pip install --no-cache-dir -e .
52
+ python -m pip install --no-cache-dir -r tests/slo/requirements.txt
57
53
58
- language_id1 : sync-python-query
59
- language1 : Python SDK over Query Service
60
- workload_path1 : tests/slo
61
- workload_build_context1 : ../..
62
- workload_build_options1 : -f Dockerfile --build-arg SDK_SERVICE=sync-python-query
54
+ - name : Initialize YDB SLO
55
+ uses : ydb-platform/ydb-slo-action/init@main
56
+ with :
57
+ github_pull_request_number : ${{ github.event.inputs.github_pull_request_number }}
58
+ github_token : ${{ secrets.GITHUB_TOKEN }}
59
+ sdk_name : ${{ matrix.sdk }}
63
60
64
- - uses : actions/upload-artifact@v3
65
- if : env.DOCKER_REPO != null
61
+ - name : Run SLO Tests
66
62
env :
67
- DOCKER_REPO : ${{ secrets.SLO_DOCKER_REPO }}
68
- with :
69
- name : slo-logs
70
- path : logs/
63
+ SDK_SERVICE : ' ${{ matrix.sdk }}'
64
+ run : |
65
+ python ./tests/slo create grpc://localhost:2135 /Root/testdb
66
+ python ./tests/slo run grpc://localhost:2135 /Root/testdb \
67
+ --prom-pgw localhost:9091 \
68
+ --report-period 250 \
69
+ --read-rps ${{inputs.slo_workload_read_max_rps || 1000}} \
70
+ --write-rps ${{inputs.slo_workload_write_max_rps || 100}} \
71
+ --read-timeout 10000
72
+ --write-timeout 10000
73
+ --time ${{inputs.slo_workload_duration_seconds || 600}} \\
74
+ --shutdown-time 30
75
+ python ./tests/slo cleanup grpc://localhost:2135 /Root/testdb
0 commit comments