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
4139 strategy :
4240 matrix :
43- example :
44- - native
41+ sdk :
42+ - name : native
43+ label : native
4544 rust_version :
4645 - " RUST_VERSION_OLD"
4746 - " RUST_VERSION_NEW"
4847
4948 concurrency :
50- group : slo-${{ github.ref }}-${{ matrix.example }}-${{ matrix.rust_version }}
49+ group : slo-${{ github.ref }}-${{ matrix.sdk.name }}-${{ matrix.rust_version }}
5150 cancel-in-progress : true
5251
5352 steps :
54- - name : Checkout
53+ - name : Checkout repository
5554 uses : actions/checkout@v4
56- with :
57- submodules : true
5855
5956 - name : Install rust
6057 uses : dtolnay/rust-toolchain@v1
@@ -73,33 +70,36 @@ jobs:
7370 - name : Rust cache
7471 uses : Swatinem/rust-cache@v2
7572
73+ - name : Prepare envs
74+ run : |
75+ REF=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
76+ REF_SAFE=${REF//\//__}
77+ echo "METRICS_REF=$REF_SAFE" >> $GITHUB_ENV
78+ echo "METRICS_LABEL=${{ matrix.sdk.label }}" >> $GITHUB_ENV
79+ echo "METRICS_JOB_NAME=${{ matrix.sdk.name }}" >> $GITHUB_ENV
80+
7681 - name : Initialize YDB SLO
7782 uses : ydb-platform/ydb-slo-action/init@main
7883 with :
7984 github_pull_request_number : ${{ github.event.inputs.github_pull_request_number }}
8085 github_token : ${{ secrets.GITHUB_TOKEN }}
81- workload_name : ${{ matrix.example }}-${{ matrix.rust_version }}
86+ workload_name : ${{ matrix.sdk.name }}-${{ matrix.rust_version }}
8287 ydb_database_node_count : 5
8388
8489 - name : Prepare SLO Database
8590 run : |
86- cargo run --example ${{ matrix.example }} grpc://localhost:2135 /Root/testdb tableName create
91+ cargo run --example ${{ matrix.sdk.name }} grpc://localhost:2135 /Root/testdb tableName create
8792
8893 - name : Run SLO Tests
89- env :
90- REF : ' ${{ github.head_ref || github.ref }}'
9194 run : |
92- cargo run --example ${{ matrix.example }} grpc://localhost:2135 /Root/testdb tableName run \
95+ cargo run --example ${{ matrix.sdk.name }} grpc://localhost:2135 /Root/testdb tableName run \
96+ --prom-pgw localhost:9091 \
97+ --report-period 250 \
9398 --time ${{ inputs.slo_workload_duration_seconds || 600}} \
9499 --read-rps ${{ inputs.slo_workload_read_max_rps || 1000}} \
95100 --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
101+ --read-timeout 1000 \
102+ --write-timeout 1000 || true
103103
104104 - if : always()
105105 name : Store ydb chaos testing logs
@@ -109,6 +109,11 @@ jobs:
109109 - if : always()
110110 uses : actions/upload-artifact@v4
111111 with :
112- name : ${{ matrix.example }}-${{ matrix.rust_version }}-chaos-ydb.log
112+ name : ${{ matrix.sdk.name }}-${{ matrix.rust_version }}-chaos-ydb.log
113113 path : ./chaos-ydb.log
114- retention-days : 1
114+ retention-days : 1
115+
116+ - if : always()
117+ name : Cleanup SLO Database
118+ run : |
119+ cargo run --example ${{ matrix.sdk.name }} grpc://localhost:2135 /Root/testdb tableName cleanup || true
0 commit comments