Skip to content

Commit 035bcdc

Browse files
committed
Only process artifacts in the end
1 parent e54acf4 commit 035bcdc

File tree

2 files changed

+82
-13
lines changed

2 files changed

+82
-13
lines changed

.github/workflows/manual-benchmarks-cascade.yaml

Lines changed: 74 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ on:
2727
current_batch:
2828
description: "Current batch index (for cascading, internal use)"
2929
default: "0"
30+
workflow_run_ids:
31+
description: "Comma-separated list of workflow run IDs (for internal use)"
32+
default: ""
3033

3134
jobs:
3235
prepareBenchmarks:
@@ -37,6 +40,7 @@ jobs:
3740
has_next_batch: ${{ steps.prepare.outputs.has_next_batch }}
3841
next_batch: ${{ steps.prepare.outputs.next_batch }}
3942
benchmark_set: ${{ steps.prepare.outputs.benchmark_set }}
43+
workflow_run_ids: ${{ steps.prepare.outputs.workflow_run_ids }}
4044
steps:
4145
- uses: actions/checkout@v4
4246
with:
@@ -52,6 +56,15 @@ jobs:
5256
5357
echo "benchmark_set=$BENCHMARK_SET" >> $GITHUB_OUTPUT
5458
59+
# Accumulate workflow run IDs
60+
WORKFLOW_RUN_IDS="${{ inputs.workflow_run_ids }}"
61+
if [ -n "$WORKFLOW_RUN_IDS" ]; then
62+
WORKFLOW_RUN_IDS="${WORKFLOW_RUN_IDS},${{ github.run_id }}"
63+
else
64+
WORKFLOW_RUN_IDS="${{ github.run_id }}"
65+
fi
66+
echo "workflow_run_ids=$WORKFLOW_RUN_IDS" >> $GITHUB_OUTPUT
67+
5568
if [ "$BENCHMARK_SET" = "single" ]; then
5669
# Single benchmark - create a matrix with one item
5770
MATRIX_JSON='[{"index": 0, "qdrant_version": "'${{ inputs.qdrant_version }}'", "qdrant_version_sanitized": "'$(echo "${{ inputs.qdrant_version }}" | sed "s|/|-|g")'", "dataset": "'${{ inputs.dataset }}'", "engine_config": "'${{ inputs.engine_config }}'", "feature_flags_all": '${{ inputs.feature_flags_all }}'}]'
@@ -237,43 +250,92 @@ jobs:
237250
with:
238251
name: results-${{ matrix.config.qdrant_version_sanitized }}-${{ matrix.config.dataset }}-${{ matrix.config.engine_config }}-${{ matrix.config.index }}
239252
path: results/
240-
retention-days: 7
253+
retention-days: 1
241254

242255
processBenchmarks:
243-
name: Process Benchmark Results
256+
name: Process All Benchmark Results
244257
needs: [prepareBenchmarks, runBenchmarks]
258+
if: needs.prepareBenchmarks.outputs.has_next_batch == 'false'
245259
runs-on: ubuntu-latest
246260
container:
247261
image: python:3.11-slim
248262
steps:
249263
- uses: actions/checkout@v4
250264
with:
251265
ref: ${{ github.ref }}
266+
252267
- name: Install dependencies
253268
run: |
254269
pip install pandas jupyter nbconvert
255270
256-
- name: Download all benchmark artifacts
257-
uses: actions/download-artifact@v4
258-
with:
259-
path: artifacts/
271+
- name: Download artifacts from specific workflow runs
272+
run: |
273+
# Install GitHub CLI
274+
apt-get update && apt-get install -y curl unzip
275+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
276+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
277+
apt-get update && apt-get install -y gh
278+
279+
# Download artifacts from specific workflow runs
280+
mkdir -p artifacts
281+
282+
# Get workflow run IDs from the accumulated list
283+
WORKFLOW_RUN_IDS="${{ needs.prepareBenchmarks.outputs.workflow_run_ids }}"
284+
echo "Workflow run IDs: $WORKFLOW_RUN_IDS"
285+
286+
# Convert comma-separated list to array and download artifacts from each run
287+
IFS=',' read -ra RUN_IDS <<< "$WORKFLOW_RUN_IDS"
288+
for run_id in "${RUN_IDS[@]}"; do
289+
echo "Downloading artifacts from run $run_id"
290+
291+
# List artifacts for this run
292+
gh api repos/${{ github.repository }}/actions/runs/$run_id/artifacts \
293+
--jq '.artifacts[] | select(.name | startswith("results-")) | {name: .name, url: .archive_download_url}' \
294+
| while IFS= read -r line; do
295+
artifact_name=$(echo "$line" | jq -r '.name')
296+
artifact_url=$(echo "$line" | jq -r '.url')
297+
298+
if [ -n "$artifact_url" ] && [ "$artifact_url" != "null" ]; then
299+
echo "Downloading $artifact_name from run $run_id"
300+
gh api "$artifact_url" > "artifacts/${run_id}-${artifact_name}.zip" || true
301+
fi
302+
done
303+
done
304+
305+
# Extract all downloaded artifacts
306+
cd artifacts
307+
for zip_file in *.zip; do
308+
if [ -f "$zip_file" ]; then
309+
unzip -o "$zip_file" && rm "$zip_file"
310+
fi
311+
done
312+
cd ..
313+
314+
ls -la artifacts/
315+
env:
316+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
317+
260318
- name: Prepare results directory
261319
run: |
262320
mkdir -p results
263321
find artifacts/ -name "*.json" -exec cp {} results/ \;
264322
ls -la results/
323+
echo "Found $(ls results/*.json | wc -l) result files"
324+
265325
- name: Execute Jupyter notebook
266326
run: |
267327
cd scripts
268-
jupyter nbconvert --to notebook --execute process-benchmarks.ipynb
328+
jupyter nbconvert --to notebook --execute process-benchmarks.ipynb --output process-benchmarks-executed.ipynb
329+
ls -la .
269330
cd ..
331+
270332
- name: Upload processed results
271333
uses: actions/upload-artifact@v4
272334
with:
273-
name: processed-results
335+
name: final-processed-results
274336
path: |
275-
scripts/results.json
276-
retention-days: 7
337+
scripts/results*.json
338+
retention-days: 1
277339

278340
triggerNextBatch:
279341
name: Trigger Next Batch
@@ -294,7 +356,8 @@ jobs:
294356
-d "{
295357
\"inputs\": {
296358
\"benchmark_set\": \"${{ needs.prepareBenchmarks.outputs.benchmark_set }}\",
297-
\"current_batch\": \"${{ needs.prepareBenchmarks.outputs.next_batch }}\"
359+
\"current_batch\": \"${{ needs.prepareBenchmarks.outputs.next_batch }}\",
360+
\"workflow_run_ids\": \"${{ needs.prepareBenchmarks.outputs.workflow_run_ids }}\"
298361
},
299362
\"ref\": \"${{ github.ref }}\"
300363
}"

benchmark_cascade/benchmark-configs.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,15 @@
404404
"feature_flags_all": false
405405
},
406406
{
407-
"qdrant_version": "docker/master",
407+
"qdrant_version": "ghcr/dev",
408408
"dataset": "dbpedia-openai-1M-1536-angular",
409-
"engine_config": "qdrant-rps-m-16-ef-128",
409+
"engine_config": "qdrant-sq-rps-m-64-ef-512",
410+
"feature_flags_all": false
411+
},
412+
{
413+
"qdrant_version": "ghcr/dev",
414+
"dataset": "dbpedia-openai-1M-1536-angular",
415+
"engine_config": "latest-qdrant-bq-rps-m-32",
410416
"feature_flags_all": false
411417
}
412418
]

0 commit comments

Comments
 (0)