Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 20 additions & 23 deletions .github/workflows/slo_native.yml → .github/workflows/slo.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
name: SLO Native
name: SLO

on:
pull_request:
types: [opened, reopened, synchronize, labeled]

permissions:
contents: read

jobs:
ydb-slo-action:
if: contains(github.event.pull_request.labels.*.name, 'SLO')

name: Run YDB SLO Tests
name: Run YDB SLO Tests (${{ matrix.sdk.name }})
runs-on: ubuntu-latest

permissions:
contents: read
timeout-minutes: 120

strategy:
fail-fast: false
matrix:
sdk:
- name: cpp-key-value
preset: release-test-clang
dockerfile: tests/slo_workloads/Dockerfile
cache_scope: slo
command: ""
- name: cpp-key-value-userver
preset: release-test-clang
dockerfile: tests/slo_workloads/Dockerfile.userver
cache_scope: slo-userver
command: ""

concurrency:
Expand Down Expand Up @@ -116,9 +124,9 @@ jobs:
uses: actions/cache@v4
with:
path: ccache
key: slo-ccache-${{ matrix.sdk.preset }}-${{ github.run_id }}
key: ${{ matrix.sdk.cache_scope }}-ccache-${{ matrix.sdk.preset }}-${{ github.run_id }}
restore-keys: |
slo-ccache-${{ matrix.sdk.preset }}-
${{ matrix.sdk.cache_scope }}-ccache-${{ matrix.sdk.preset }}-

- name: Inject ccache into BuildKit
uses: reproducible-containers/buildkit-cache-dance@v3.1.2
Expand All @@ -127,30 +135,22 @@ jobs:
{
"ccache": "/root/.ccache"
}
# Always extract so newly-compiled TUs from this run are saved by
# actions/cache (key uses ${{ github.run_id }}, so each run gets
# its own snapshot). Without extraction the cache stays frozen at
# whatever was first persisted.
skip-extraction: false

# A clean build of the SLO image takes ~30 min because the Dockerfile
# rebuilds the full C++ toolchain + abseil/protobuf/grpc from source.
# The GHA cache lets subsequent runs reuse every layer up to the SDK
# source COPY, so only the actual workload link step reruns (~3 min).
- name: Build current workload image
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_SUMMARY: "false"
DOCKER_BUILD_RECORD_UPLOAD: "false"
with:
context: sdk-current
file: sdk-current/tests/slo_workloads/Dockerfile
file: sdk-current/${{ matrix.sdk.dockerfile }}
platforms: linux/amd64
tags: ydb-app-current
load: true
build-args: PRESET=${{ matrix.sdk.preset }}
cache-from: type=gha,scope=slo-${{ matrix.sdk.preset }}
cache-to: type=gha,mode=max,scope=slo-${{ matrix.sdk.preset }}
cache-from: type=gha,scope=${{ matrix.sdk.cache_scope }}-${{ matrix.sdk.preset }}
cache-to: type=gha,mode=max,scope=${{ matrix.sdk.cache_scope }}-${{ matrix.sdk.preset }}

- name: Build baseline workload image
id: baseline-build
Expand All @@ -161,16 +161,13 @@ jobs:
DOCKER_BUILD_RECORD_UPLOAD: "false"
with:
context: sdk-baseline
file: sdk-baseline/tests/slo_workloads/Dockerfile
file: sdk-baseline/${{ matrix.sdk.dockerfile }}
platforms: linux/amd64
tags: ydb-app-baseline
load: true
build-args: PRESET=${{ matrix.sdk.preset }}
cache-from: type=gha,scope=slo-${{ matrix.sdk.preset }}
cache-from: type=gha,scope=${{ matrix.sdk.cache_scope }}-${{ matrix.sdk.preset }}

# If the historical commit lacks the SLO Dockerfile or can't compile,
# reuse the current image so the SLO run is still comparable against
# itself rather than failing outright.
- name: Fall back to current image for baseline
if: steps.baseline-build.outcome == 'failure'
run: |
Expand Down
45 changes: 17 additions & 28 deletions .github/workflows/slo_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: SLO Report

on:
workflow_run:
workflows: ["SLO Native", "SLO Userver"]
workflows: ["SLO"]
types:
- completed

jobs:
publish-slo-report:
if: github.event.workflow_run.conclusion == 'success'
if: github.event.workflow_run.conclusion != 'skipped'
runs-on: ubuntu-latest
name: Publish YDB SLO Report
permissions:
Expand All @@ -25,35 +25,24 @@ jobs:

remove-slo-label:
needs: publish-slo-report
if: always() && github.event.workflow_run.event == 'pull_request'
if: github.event.workflow_run.conclusion != 'skipped' && github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-latest
name: Remove SLO Label
permissions:
pull-requests: write
steps:
- name: Remove SLO label from PR
uses: actions/github-script@v7
with:
script: |
const pullRequests = context.payload.workflow_run.pull_requests;
if (pullRequests && pullRequests.length > 0) {
for (const pr of pullRequests) {
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
name: 'SLO'
});
console.log(`Removed SLO label from PR #${pr.number}`);
} catch (error) {
if (error.status === 404) {
console.log(`SLO label not found on PR #${pr.number}, skipping`);
} else {
throw error;
}
}
}
} else {
console.log('No pull requests associated with this workflow run');
}
env:
PRS: ${{ toJSON(github.event.workflow_run.pull_requests) }}
REPO: ${{ github.event.workflow_run.repository.full_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
PR=$(jq -r '.[0].number' <<<"$PRS")
if [ "$PR" = "null" ] || [ -z "$PR" ]; then
echo "No pull requests associated with this workflow run"
exit 0
fi
gh pr edit "$PR" --repo "$REPO" --remove-label SLO || {
echo "SLO label not found on PR #${PR}, skipping"
}
172 changes: 0 additions & 172 deletions .github/workflows/slo_userver.yml

This file was deleted.

Loading