-
Notifications
You must be signed in to change notification settings - Fork 12
fix(ci): migrate benchmarks to benchmarking-platform trigger #607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jbachorik
wants to merge
29
commits into
main
Choose a base branch
from
jb/bench-bp-trigger
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
3fc25e8
fix(ci): migrate benchmarks to benchmarking-platform trigger
jbachorik 2be4d5a
feat(ci): add reliability table to benchmark PR comment
jbachorik ba307c6
feat(ci): add delta%, upload count, issues to reliability table
jbachorik e527a2f
fix(ci): use boto3 for S3 download; add benchmarking-platform SA to p…
jbachorik 200d347
fix(ci): fetch BP artifacts via GitLab API instead of aws s3 sync
jbachorik 5f658b0
fix(ci): diagnose API errors explicitly, no silent set -e kill
jbachorik 7580df2
fix: pass MAVEN_REPOSITORY_PROXY to BP trigger
jbachorik 7d9f679
fix: extend octo-sts trust to BP; wait for benchmarks-trigger before …
jbachorik 62f834f
fix: remove post-benchmarks-pr-comment (BP handles it); fix gh-pages …
jbachorik 4a791f7
chore: remove MAVEN_REPOSITORY_PROXY trigger var (not needed)
jbachorik 321cf9d
fix: restore MAVEN_REPOSITORY_PROXY trigger var
jbachorik b64d1f1
ci: retrigger to pick up BP curl fix
jbachorik c8e0b58
fix: remove MAVEN_REPOSITORY_PROXY from trigger vars (BP owns it now)
jbachorik 05f1c4c
ci: trigger benchmark pipeline
jbachorik 2d51776
ci: trigger benchmark pipeline
jbachorik 2ca358c
ci: trigger benchmark pipeline
jbachorik 0da28e9
ci: trigger benchmark pipeline
jbachorik 8a9ea3a
ci: trigger benchmark pipeline
jbachorik 827f069
ci: trigger benchmark pipeline
jbachorik a6983ee
ci: trigger benchmark pipeline
jbachorik b62c08c
ci: re-trigger BP renaissance run (result JSON corruption fix)
jbachorik 8f03d10
ci: trigger BP renaissance run
jbachorik 5be53e4
ci: trigger BP renaissance run (pr-commenter)
jbachorik 81073a7
ci: trigger BP renaissance run (octo-sts pr:write)
jbachorik dc0947e
ci: re-trigger BP renaissance run (fix iteration grep)
jbachorik 2876475
ci: re-trigger BP renaissance run (iters fix + JFR counters)
jbachorik 710bd5e
ci: re-trigger BP run (noise-aware deltas, outliers summary)
jbachorik bc5c810
ci: re-trigger BP run (counter ratio thresholds)
jbachorik 1b03a1c
ci: remove local benchmark steps superseded by benchmarking-platform
jbachorik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ stages: | |
| - integration-test | ||
| - reliability | ||
| - benchmarks | ||
| - post-benchmarks | ||
| - fuzz | ||
| - notify | ||
|
|
||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #!/usr/bin/env bash | ||
| # Downloads result JSONs from the BP downstream pipeline via the GitLab CI API. | ||
| # | ||
| # Requires only curl and python3 (stdlib) — no aws CLI, pip, or boto3 needed. | ||
| # BP jobs already store artifacts in GitLab; this fetches them directly from | ||
| # the downstream pipeline triggered by benchmarks-trigger. | ||
| set -uo pipefail # intentionally no -e: we handle errors explicitly | ||
|
|
||
| DEST="${1:-reports}" | ||
| mkdir -p "${DEST}" | ||
|
|
||
| TMPDIR_LOCAL=$(mktemp -d) | ||
| trap 'rm -rf "${TMPDIR_LOCAL}"' EXIT | ||
|
|
||
| # ── helper: curl with explicit HTTP status checking ────────────────────────── | ||
| # Usage: api_get <url> <output_file> | ||
| # Returns 0 on 2xx, prints diagnostics and returns 1 otherwise. | ||
| api_get() { | ||
| local url="$1" out="$2" | ||
| local http_code | ||
| http_code=$(curl -s -o "${out}" -w "%{http_code}" \ | ||
| --header "JOB-TOKEN: ${CI_JOB_TOKEN}" "${url}") | ||
| if [[ "${http_code}" != 2* ]]; then | ||
| echo " API ${url##*/}: HTTP ${http_code} — $(cat "${out}" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('message','?'))" 2>/dev/null || echo 'see above')" | ||
| return 1 | ||
| fi | ||
| return 0 | ||
| } | ||
|
|
||
| # ── 1. find the benchmarks-trigger bridge ──────────────────────────────────── | ||
| BRIDGES_FILE="${TMPDIR_LOCAL}/bridges.json" | ||
| echo "Querying bridges for pipeline ${CI_PIPELINE_ID}…" | ||
| if ! api_get \ | ||
| "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/bridges" \ | ||
| "${BRIDGES_FILE}"; then | ||
| echo "Cannot read pipeline bridges (job token may lack Reporter access) — skipping download" | ||
| exit 0 | ||
| fi | ||
|
|
||
| read -r BP_PROJECT_ID DOWNSTREAM_PIPELINE_ID < <(python3 - "${BRIDGES_FILE}" <<'PYEOF' | ||
| import json, sys | ||
| with open(sys.argv[1]) as f: | ||
| bridges = json.load(f) | ||
| for b in bridges: | ||
| if b.get("name") == "benchmarks-trigger": | ||
| dp = b.get("downstream_pipeline") or {} | ||
| if dp.get("id") and dp.get("project_id"): | ||
| print(dp["project_id"], dp["id"]) | ||
| sys.exit(0) | ||
| print("", "") | ||
| PYEOF | ||
| ) | ||
|
|
||
| if [ -z "${DOWNSTREAM_PIPELINE_ID:-}" ]; then | ||
| echo "benchmarks-trigger bridge not found or did not run — skipping download" | ||
| exit 0 | ||
| fi | ||
| echo "BP downstream pipeline: project=${BP_PROJECT_ID} pipeline=${DOWNSTREAM_PIPELINE_ID}" | ||
|
|
||
| # ── 2. list jobs in the downstream pipeline ────────────────────────────────── | ||
| JOBS_FILE="${TMPDIR_LOCAL}/jobs.json" | ||
| echo "Listing BP pipeline jobs…" | ||
| if ! api_get \ | ||
| "${CI_API_V4_URL}/projects/${BP_PROJECT_ID}/pipelines/${DOWNSTREAM_PIPELINE_ID}/jobs?per_page=100" \ | ||
| "${JOBS_FILE}"; then | ||
| echo "Cannot list BP pipeline jobs — skipping download" | ||
| exit 0 | ||
| fi | ||
|
|
||
| JOB_IDS=$(python3 -c " | ||
| import json | ||
| with open('${JOBS_FILE}') as f: | ||
| print(' '.join(str(j['id']) for j in json.load(f))) | ||
| ") | ||
|
|
||
| # ── 3. download result_*.json from each job's artifact zip ─────────────────── | ||
| DOWNLOADED=0 | ||
| for JOB_ID in ${JOB_IDS}; do | ||
| ART_ZIP="${TMPDIR_LOCAL}/art_${JOB_ID}.zip" | ||
| ART_STATUS=$(curl -s -o "${ART_ZIP}" -w "%{http_code}" \ | ||
| --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \ | ||
| "${CI_API_V4_URL}/projects/${BP_PROJECT_ID}/jobs/${JOB_ID}/artifacts" 2>/dev/null) | ||
| if [[ "${ART_STATUS}" == 2* ]]; then | ||
| # -j: junk paths (strip artifacts/ prefix), -q: quiet, -o: overwrite | ||
| if unzip -q -j "${ART_ZIP}" "artifacts/result_*.json" -d "${DEST}/" 2>/dev/null; then | ||
| DOWNLOADED=$((DOWNLOADED + 1)) | ||
| fi | ||
| fi | ||
| done | ||
|
|
||
| RESULT_COUNT=$(find "${DEST}" -name "result_*.json" | wc -l) | ||
| echo "result_*.json files: ${RESULT_COUNT} (from ${DOWNLOADED} BP job(s))" | ||
|
|
||
| if [ "${RESULT_COUNT}" -eq 0 ]; then | ||
| echo "WARNING: no result JSONs found — BP jobs may not have run or produced artifacts yet" | ||
| exit 1 | ||
| fi |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.