1- name : SLO tests
1+ name : SLO
22
33on :
44 push :
3131
3232jobs :
3333 ydb-slo-action-init :
34- # // https://github.com/ydb-platform/ydb-rs-sdk/issues/227
35- if : ${{ false }}
3634 if : (!contains(github.event.pull_request.labels.*.name, 'no slo'))
3735
3836 name : Run YDB SLO Tests
3937 runs-on : ubuntu-latest
4038
39+ permissions :
40+ contents : read
41+ pull-requests : write
42+
4143 strategy :
4244 matrix :
43- example :
44- - native
45+ sdk :
46+ - name : native
47+ label : native
4548 rust_version :
4649 - " RUST_VERSION_OLD"
4750 - " RUST_VERSION_NEW"
4851
4952 concurrency :
50- group : slo-${{ github.ref }}-${{ matrix.example }}-${{ matrix.rust_version }}
53+ group : slo-${{ github.ref }}-${{ matrix.sdk.name }}-${{ matrix.rust_version }}
5154 cancel-in-progress : true
5255
5356 steps :
54- - name : Checkout
57+ - name : Checkout repository
5558 uses : actions/checkout@v4
56- with :
57- submodules : true
5859
5960 - name : Install rust
6061 uses : dtolnay/rust-toolchain@v1
@@ -73,33 +74,36 @@ jobs:
7374 - name : Rust cache
7475 uses : Swatinem/rust-cache@v2
7576
77+ - name : Prepare envs
78+ run : |
79+ REF=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
80+ REF_SAFE=${REF//\//__}
81+ echo "METRICS_REF=$REF_SAFE" >> $GITHUB_ENV
82+ echo "METRICS_LABEL=${{ matrix.sdk.label }}" >> $GITHUB_ENV
83+ echo "METRICS_JOB_NAME=${{ matrix.sdk.name }}" >> $GITHUB_ENV
84+
7685 - name : Initialize YDB SLO
7786 uses : ydb-platform/ydb-slo-action/init@main
7887 with :
7988 github_pull_request_number : ${{ github.event.inputs.github_pull_request_number }}
8089 github_token : ${{ secrets.GITHUB_TOKEN }}
81- workload_name : ${{ matrix.example }}-${{ matrix.rust_version }}
90+ workload_name : ${{ matrix.sdk.name }}-${{ matrix.rust_version }}
8291 ydb_database_node_count : 5
8392
8493 - name : Prepare SLO Database
8594 run : |
86- cargo run --example ${{ matrix.example }} grpc://localhost:2135 /Root/testdb tableName create
95+ cargo run --example ${{ matrix.sdk.name }} grpc://localhost:2135 /Root/testdb tableName create
8796
8897 - name : Run SLO Tests
89- env :
90- REF : ' ${{ github.head_ref || github.ref }}'
9198 run : |
92- cargo run --example ${{ matrix.example }} grpc://localhost:2135 /Root/testdb tableName run \
99+ cargo run --example ${{ matrix.sdk.name }} grpc://localhost:2135 /Root/testdb tableName run \
100+ --prom-pgw localhost:9091 \
101+ --report-period 250 \
93102 --time ${{ inputs.slo_workload_duration_seconds || 600}} \
94103 --read-rps ${{ inputs.slo_workload_read_max_rps || 1000}} \
95104 --write-rps ${{ inputs.slo_workload_write_max_rps || 100}} \
96- --read-timeout 10000 \
97- --write-timeout 10000 || true
98-
99- - if : always()
100- name : Cleanup SLO Database
101- run : |
102- cargo run --example ${{ matrix.example }} grpc://localhost:2135 /Root/testdb tableName cleanup
105+ --read-timeout 1000 \
106+ --write-timeout 1000 || true
103107
104108 - if : always()
105109 name : Store ydb chaos testing logs
@@ -109,6 +113,25 @@ jobs:
109113 - if : always()
110114 uses : actions/upload-artifact@v4
111115 with :
112- name : ${{ matrix.example }}-${{ matrix.rust_version }}-chaos-ydb.log
116+ name : ${{ matrix.sdk.name }}-${{ matrix.rust_version }}-chaos-ydb.log
113117 path : ./chaos-ydb.log
114- retention-days : 1
118+ retention-days : 1
119+
120+ - if : always()
121+ name : Cleanup SLO Database
122+ run : |
123+ cargo run --example ${{ matrix.sdk.name }} grpc://localhost:2135 /Root/testdb tableName cleanup || true
124+ test-ydb-slo-action :
125+ runs-on : ubuntu-latest
126+ needs : ydb-slo-action-init
127+ name : Publish YDB SLO Report
128+ permissions :
129+ contents : read
130+ pull-requests : write
131+ if : always()
132+ steps :
133+ - name : Publish YDB SLO Report
134+ uses : ydb-platform/ydb-slo-action/report@main
135+ with :
136+ github_token : ${{ secrets.GITHUB_TOKEN }}
137+ github_run_id : ${{ github.run_id }}
0 commit comments