Add New GitHub Action for SLO Tests Integration with SDK #639
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: slo | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
- release-* | |
workflow_dispatch: | |
inputs: | |
github_pull_request_number: | |
required: true | |
slo_workload_duration_seconds: | |
default: '600' | |
required: false | |
slo_workload_read_max_rps: | |
default: '1000' | |
required: false | |
slo_workload_write_max_rps: | |
default: '100' | |
required: false | |
jobs: | |
ydb-slo-action-init: | |
if: (!contains(github.event.pull_request.labels.*.name, 'no slo')) | |
name: Run YDB SLO Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
sdk: | |
- py-sync-table | |
- py-sync-query | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Python3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --no-cache-dir --upgrade pip | |
python -m pip install --no-cache-dir -e . | |
python -m pip install --no-cache-dir -r tests/slo/requirements.txt | |
- name: Initialize YDB SLO | |
uses: ydb-platform/ydb-slo-action/init@main | |
with: | |
github_pull_request_number: ${{ github.event.inputs.github_pull_request_number }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
sdk_name: ${{ matrix.sdk }} | |
- name: Run SLO Tests | |
env: | |
REF: '${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}' | |
SDK_SERVICE: '${{ matrix.sdk }}' | |
run: | | |
python ./tests/slo/src create grpc://localhost:2135 /Root/testdb | |
python ./tests/slo/src run grpc://localhost:2135 /Root/testdb \ | |
--prom-pgw localhost:9091 \ | |
--report-period 250 \ | |
--read-rps ${{inputs.slo_workload_read_max_rps || 1000}} \ | |
--write-rps ${{inputs.slo_workload_write_max_rps || 100}} \ | |
--read-timeout 10000 \ | |
--write-timeout 10000 \ | |
--time ${{inputs.slo_workload_duration_seconds || 600}} | |
python ./tests/slo/src cleanup grpc://localhost:2135 /Root/testdb |