Skip to content

Commit 5ec8151

Browse files
committed
Migrate ot v2 SLO Action
1 parent aac56d3 commit 5ec8151

File tree

1 file changed

+49
-120
lines changed

1 file changed

+49
-120
lines changed

.github/workflows/slo.yml

Lines changed: 49 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -45,55 +45,54 @@ jobs:
4545
name: database-sql-table
4646
path: ./database/sql/table
4747
label: database/sql/table
48-
run_extra_args: ''
49-
create_extra_args: ''
48+
run_extra_args: ""
49+
create_extra_args: ""
5050
- id: database_sql_query
5151
name: database-sql-query
5252
path: ./database/sql/query
5353
label: database/sql/query
54-
run_extra_args: ''
55-
create_extra_args: ''
54+
run_extra_args: ""
55+
create_extra_args: ""
5656
- id: native_query
5757
name: native-query
5858
path: ./native/query
5959
label: native/query
60-
run_extra_args: ''
61-
create_extra_args: ''
60+
run_extra_args: ""
61+
create_extra_args: ""
6262
- id: native_table
6363
name: native-table
6464
path: ./native/table
6565
label: native/table
66-
run_extra_args: ''
67-
create_extra_args: ''
66+
run_extra_args: ""
67+
create_extra_args: ""
6868
- id: native_table_over_query_service
6969
name: native-table-over-query-service
7070
path: ./native/table/over/query/service
7171
label: native/table/over/query/service
72-
run_extra_args: ''
73-
create_extra_args: ''
72+
run_extra_args: ""
73+
create_extra_args: ""
7474
- id: native_bulk_upsert
7575
name: native-bulk-upsert
7676
path: ./native/bulk-upsert
7777
label: native/bulk-upsert
78-
run_extra_args: '-batch-size=10'
79-
create_extra_args: ''
78+
run_extra_args: "-batch-size=10"
79+
create_extra_args: ""
8080
- id: native_node_hints
8181
name: native-node-hints
8282
path: ./native/node_hints
8383
label: native/node_hints
8484
slo_workload_read_max_rps: 100
8585
slo_workload_write_max_rps: 100
86-
run_extra_args: '-batch-size=10'
87-
create_extra_args: '-min-partitions-count 10'
86+
run_extra_args: "-batch-size=10"
87+
create_extra_args: "-min-partitions-count 10"
8888
- id: session_node_hints
8989
name: session-node-hints
9090
path: ./native/session_node_hints
9191
label: native/session_node_hints
9292
slo_workload_read_max_rps: 1000
9393
slo_workload_write_max_rps: 1
94-
run_extra_args: '-batch-size=10'
95-
create_extra_args: '-min-partitions-count 10'
96-
94+
run_extra_args: "-batch-size=10"
95+
create_extra_args: "-min-partitions-count 10"
9796

9897
concurrency:
9998
group: slo-${{ github.ref }}-${{ matrix.sdk.name }}
@@ -188,15 +187,32 @@ jobs:
188187
--job-name "${{ matrix.sdk.name }}" \
189188
--fallback-image "ydb-app-current"
190189
191-
- name: Initialize YDB SLO
192-
id: ydb_slo
193-
uses: ydb-platform/ydb-slo-action/init@13c687b7d4b2879da79dd12932dee0ed2b65dd1c
190+
- name: Run SLO Tests
191+
uses: ydb-platform/ydb-slo-action/init@v2
192+
timeout-minutes: 15
194193
with:
195194
github_issue: ${{ github.event.inputs.github_issue }}
196195
github_token: ${{ secrets.GITHUB_TOKEN }}
197196
workload_name: ${{ matrix.sdk.name }}
197+
workload_duration: ${{ inputs.slo_workload_duration_seconds || '600' }}
198198
workload_current_ref: ${{ github.head_ref || github.ref_name }}
199+
workload_current_image: ydb-app-current
200+
workload_current_command: >-
201+
all grpc://ydb:2136 /Root/testdb
202+
${{ matrix.sdk.create_extra_args }}
203+
${{ matrix.sdk.run_extra_args }}
204+
--time ${{ inputs.slo_workload_duration_seconds || '600' }}
205+
--read-rps ${{ matrix.sdk.slo_workload_read_max_rps || inputs.slo_workload_read_max_rps || '1000' }}
206+
--write-rps ${{ matrix.sdk.slo_workload_write_max_rps || inputs.slo_workload_write_max_rps || '100' }}
199207
workload_baseline_ref: ${{ steps.baseline.outputs.ref }}
208+
workload_baseline_image: ydb-app-baseline
209+
workload_baseline_command: >-
210+
all grpc://ydb:2136 /Root/testdb
211+
${{ matrix.sdk.create_extra_args }}
212+
${{ matrix.sdk.run_extra_args }}
213+
--time ${{ inputs.slo_workload_duration_seconds || '600' }}
214+
--read-rps ${{ matrix.sdk.slo_workload_read_max_rps || inputs.slo_workload_read_max_rps || '1000' }}
215+
--write-rps ${{ matrix.sdk.slo_workload_write_max_rps || inputs.slo_workload_write_max_rps || '100' }}
200216
# to disable chaos testing for node hint workloads
201217
disable_compose_profiles: "${{ (matrix.sdk.id == 'native_node_hints' || matrix.sdk.id == 'session_node_hints') && 'chaos' || '' }}"
202218
metrics_yaml: |
@@ -205,104 +221,17 @@ jobs:
205221
type: instant
206222
query: sum by(ref) (workload_node_hints_misses)
207223
208-
- name: Prepare SLO Database
209-
run: |
210-
echo "Preparing SLO database..."
211-
CREATE_EXTRA_ARGS="${{ matrix.sdk.create_extra_args }}"
212-
docker run --rm --network ydb_ydb-net \
213-
--add-host "ydb:172.28.0.11" \
214-
--add-host "ydb:172.28.0.12" \
215-
--add-host "ydb:172.28.0.13" \
216-
--add-host "ydb:172.28.0.99" \
217-
ydb-app-current create grpc://ydb:2136 /Root/testdb $CREATE_EXTRA_ARGS
218-
219-
- name: Run SLO Tests (parallel)
220-
timeout-minutes: 15
221-
env:
222-
DURATION: ${{ matrix.sdk.slo_workload_duration_seconds || 600 }}
223-
READ_RPS: ${{ matrix.sdk.slo_workload_read_max_rps || 1000 }}
224-
WRITE_RPS: ${{ matrix.sdk.slo_workload_write_max_rps || 1000 }}
225-
RUN_EXTRA_ARGS: ${{ format('{0} -prometheus-endpoint {1}',matrix.sdk.run_extra_args,steps.ydb_slo.outputs.ydb-prometheus-url)}}
226-
run: |
227-
ARGS="run grpc://ydb:2136 /Root/testdb \
228-
-otlp-endpoint prometheus:9090 \
229-
-report-period 250 \
230-
-time $DURATION \
231-
-read-rps $READ_RPS \
232-
-write-rps $WRITE_RPS \
233-
-read-timeout 100 \
234-
-write-timeout 100 \
235-
$RUN_EXTRA_ARGS"
236-
237-
echo "Starting ydb-app-current..."
238-
docker run -d \
239-
--name ydb-app-current \
240-
--network ydb_ydb-net \
241-
--add-host "ydb:172.28.0.11" \
242-
--add-host "ydb:172.28.0.12" \
243-
--add-host "ydb:172.28.0.13" \
244-
--add-host "ydb:172.28.0.99" \
245-
ydb-app-current $ARGS
246-
247-
echo "Starting ydb-app-baseline..."
248-
docker run -d \
249-
--name ydb-app-baseline \
250-
--network ydb_ydb-net \
251-
--add-host "ydb:172.28.0.11" \
252-
--add-host "ydb:172.28.0.12" \
253-
--add-host "ydb:172.28.0.13" \
254-
--add-host "ydb:172.28.0.99" \
255-
ydb-app-baseline $ARGS
256-
257-
# Show initial logs
258-
echo ""
259-
echo "==================== INITIAL CURRENT LOGS ===================="
260-
docker logs -n 15 ydb-app-current 2>&1 || echo "No current container"
261-
echo ""
262-
echo "==================== INITIAL BASELINE LOGS ===================="
263-
docker logs -n 15 ydb-app-baseline 2>&1 || echo "No baseline container"
264-
echo ""
265-
266-
# Wait for workloads to complete
267-
echo "Waiting for workloads to complete (${DURATION}s)..."
268-
sleep ${DURATION}
269-
270-
# Stop containers after workload duration and wait for graceful shutdown
271-
echo "Stopping containers after ${DURATION}s..."
272-
docker stop --timeout=30 ydb-app-current ydb-app-baseline 2>&1 || true
273-
274-
# Force kill if still running
275-
docker kill ydb-app-current ydb-app-baseline 2>&1 || true
276-
277-
# Check exit codes
278-
CURRENT_EXIT=$(docker inspect ydb-app-current --format='{{.State.ExitCode}}' 2>/dev/null || echo "1")
279-
BASELINE_EXIT=$(docker inspect ydb-app-baseline --format='{{.State.ExitCode}}' 2>/dev/null || echo "0")
280-
281-
echo "Current container exit code: $CURRENT_EXIT"
282-
echo "Baseline container exit code: $BASELINE_EXIT"
283-
284-
# Show final logs
285-
echo ""
286-
echo "==================== FINAL CURRENT LOGS ===================="
287-
docker logs -n 15 ydb-app-current 2>&1 || echo "No current container"
288-
echo ""
289-
echo "==================== FINAL BASELINE LOGS ===================="
290-
docker logs -n 15 ydb-app-baseline 2>&1 || echo "No baseline container"
291-
echo ""
292-
293-
echo "SUCCESS: Workloads completed successfully"
294-
295-
- if: always()
296-
name: Store logs
297-
run: |
298-
docker logs ydb-app-current > current.log 2>&1 || echo "No current container"
299-
docker logs ydb-app-baseline > baseline.log 2>&1 || echo "No baseline container"
300-
301-
- if: always()
302-
uses: actions/upload-artifact@v4
224+
ydb-slo-report:
225+
needs: ydb-slo-action
226+
runs-on: ubuntu-latest
227+
name: Publish YDB SLO Report
228+
permissions:
229+
checks: write
230+
contents: read
231+
pull-requests: write
232+
steps:
233+
- name: Publish YDB SLO Report
234+
uses: ydb-platform/ydb-slo-action/report@v2
303235
with:
304-
name: ${{matrix.sdk.name}}-logs
305-
path: |
306-
./current.log
307-
./baseline.log
308-
retention-days: 1
236+
github_token: ${{ secrets.GITHUB_TOKEN }}
237+
github_run_id: ${{ github.run_id }}

0 commit comments

Comments
 (0)