diff --git a/.github/workflows/slo-report.yml b/.github/workflows/slo-report.yml new file mode 100644 index 0000000..8f5e2ab --- /dev/null +++ b/.github/workflows/slo-report.yml @@ -0,0 +1,22 @@ +name: SLO Report + +on: + workflow_run: + workflows: ["SLO"] + types: + - completed + +jobs: + ydb-slo-action-report: + runs-on: ubuntu-latest + name: Publish YDB SLO Report + permissions: + contents: read + pull-requests: write + if: github.event.workflow_run.conclusion == 'success' + steps: + - name: Publish YDB SLO Report + uses: ydb-platform/ydb-slo-action/report@main + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + github_run_id: ${{ github.event.workflow_run.id }} diff --git a/.github/workflows/slo.yml b/.github/workflows/slo.yml new file mode 100644 index 0000000..36e0876 --- /dev/null +++ b/.github/workflows/slo.yml @@ -0,0 +1,83 @@ +name: SLO + +on: + push: + branches: + - main + pull_request: + branches: + - main + 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: + if: (!contains(github.event.pull_request.labels.*.name, 'no slo')) + + name: Run YDB SLO Tests + runs-on: ubuntu-latest + + strategy: + matrix: + workload: + - sync-table + - sync-query + + concurrency: + group: slo-${{ github.ref }}-${{ matrix.workload }} + cancel-in-progress: true + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - 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 }} + workload_name: ${{ matrix.workload }} + ydb_database_node_count: 5 + + - name: Prepare SLO Database + run: | + echo "Preparing SLO database..." + + - name: Run SLO Tests + run: | + ./workload grpc://localhost:2135 /Root/testdb \ + --prom-pgw localhost:9091 \ + --report-period 250 \ + --time ${{inputs.slo_workload_duration_seconds || 600}} \ + --read-rps ${{inputs.slo_workload_read_max_rps || 1000}} \ + --write-rps ${{inputs.slo_workload_write_max_rps || 100}} \ + --read-timeout 1000 \ + --write-timeout 1000 + + - if: always() + name: Cleanup SLO Database + run: | + echo "Cleaning up SLO database..." + + - if: always() + name: Store ydb chaos testing logs + run: | + docker logs ydb-chaos > chaos-ydb.log + + - if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.workload }}-chaos-ydb.log + path: ./chaos-ydb.log + retention-days: 1 diff --git a/.github/workflows/ydb-slo-action-test-init.yml b/.github/workflows/ydb-slo-action-test-init.yml deleted file mode 100644 index 8e5b86f..0000000 --- a/.github/workflows/ydb-slo-action-test-init.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: ydb-slo-action-test-init - -on: - pull_request: - workflow_dispatch: - inputs: - github_pull_request_number: - required: true - -jobs: - ydb-slo-action: - name: Test YDB SLO Action Init - runs-on: ubuntu-latest - strategy: - matrix: - workload: ["w1", "w2"] - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Inititialize YDB SLO Test - uses: ydb-platform/ydb-slo-action/init@main - with: - github_pull_request_number: ${{ github.event.inputs.github_pull_request_number }} - ydb_workload_name: ${{ matrix.workload }} - - - name: Run chaos testing - run: | - echo 'Performing chaos testing...' - sleep 10 - - - name: Run user workload - run: | - echo 'Running user workload...'; - sleep 10 diff --git a/.github/workflows/ydb-slo-action-test-report.yml b/.github/workflows/ydb-slo-action-test-report.yml deleted file mode 100644 index 5d1cf62..0000000 --- a/.github/workflows/ydb-slo-action-test-report.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: ydb-slo-action-test-report - -on: - workflow_run: - workflows: ['ydb-slo-action-test-init'] - types: - - completed - -jobs: - test-ydb-slo-action: - runs-on: ubuntu-latest - name: Test YDB SLO Action Report - permissions: - contents: read - pull-requests: write - if: github.event.workflow_run.conclusion == 'success' - steps: - - name: Publish YDB SLO Report - uses: ydb-platform/ydb-slo-action/report@main - with: - token: ${{ secrets.GITHUB_TOKEN }} - run_id: ${{ github.event.workflow_run.id }}