Skip to content

Commit f3bf7be

Browse files
committed
fix: remove duplicate Docker Hub images, skip trailing cooldown, reliable exit code
- Remove library/{alpine,nginx,redis} from corpus -- already available via public ECR mirrors, saves Docker Hub rate limit quota - Document Docker Hub image dependency and rate limit in corpus header - Skip 30s cooldown after the last tool in each scenario - Write bench exit code to a file instead of relying on wait (race-safe) - Suppress ocync JSON stdout from operator stream (capture only) - Add [tool_name] prefix to stderr stream for tool identification
1 parent 06435fc commit f3bf7be

3 files changed

Lines changed: 31 additions & 20 deletions

File tree

bench/corpus.yaml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Benchmark image corpus.
22
#
3-
# Sources: Docker Hub (Jupyter + nvidia/cuda + tensorflow), Chainguard free
4-
# images, AWS Public ECR, SOCI workshop. Each image syncs to ECR under the
5-
# bench/ prefix.
3+
# Sources: Docker Hub, Chainguard (cgr.dev), AWS Public ECR, SOCI workshop.
4+
# Each image syncs to ECR under the bench/ prefix.
5+
#
6+
# Docker Hub images (docker.io): Jupyter, nvidia/cuda, tensorflow.
7+
# These require authenticated pulls (100/hr free tier). Credentials
8+
# are injected via DOCKERHUB_USERNAME and DOCKERHUB_ACCESS_TOKEN env vars.
9+
# The remaining Docker Hub official images (alpine, nginx, redis, postgres,
10+
# golang) are pulled from their public ECR mirrors instead to avoid
11+
# unnecessary rate limit consumption.
612
#
713
# Ordering: mount-exercising images first (Jupyter family shares GB-sized base
814
# layers across distinct source names and therefore distinct target repos --
@@ -105,14 +111,6 @@ images:
105111
- source: "public.ecr.aws/docker/library/golang"
106112
tags: ["1.22", "1.21"]
107113

108-
# ── Docker Hub library images ──────────────────────────────────────────────
109-
- source: "docker.io/library/alpine"
110-
tags: ["3.20", "latest"]
111-
- source: "docker.io/library/nginx"
112-
tags: ["latest"]
113-
- source: "docker.io/library/redis"
114-
tags: ["latest"]
115-
116114
# ── SOCI workshop images ──────────────────────────────────────────────────
117115
# Large multi-layer images from public.ecr.aws -- useful for chunked upload
118116
# and large-blob throughput; limited cross-repo mount potential (each image

xtask/src/bench/mod.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ async fn run_cold(
555555
));
556556
let mut runs = Vec::new();
557557

558-
for &tool in tools {
558+
for (tool_idx, &tool) in tools.iter().enumerate() {
559559
let mut iteration_runs = Vec::new();
560560

561561
for i in 0..args.iterations {
@@ -593,7 +593,9 @@ async fn run_cold(
593593
let median = iteration_runs.swap_remove(median_idx);
594594
runs.push(median);
595595

596-
cooldown().await;
596+
if tool_idx + 1 < tools.len() {
597+
cooldown().await;
598+
}
597599
}
598600

599601
Ok(ScenarioResult {
@@ -613,7 +615,7 @@ async fn run_warm(
613615
progress("bench: running warm scenario");
614616
let mut runs = Vec::new();
615617

616-
for &tool in tools {
618+
for (tool_idx, &tool) in tools.iter().enumerate() {
617619
progress(&format!(" warm: {} (priming)", tool));
618620

619621
ecr::create_repos(ecr_client, corpus).await?;
@@ -634,7 +636,9 @@ async fn run_warm(
634636

635637
ecr::delete_repos(ecr_client, corpus).await?;
636638

637-
cooldown().await;
639+
if tool_idx + 1 < tools.len() {
640+
cooldown().await;
641+
}
638642
}
639643

640644
Ok(ScenarioResult {
@@ -655,7 +659,7 @@ async fn run_partial(
655659
progress("bench: running partial scenario");
656660
let mut runs = Vec::new();
657661

658-
for &tool in tools {
662+
for (tool_idx, &tool) in tools.iter().enumerate() {
659663
progress(&format!(" partial: {} (priming)", tool));
660664

661665
ecr::create_repos(ecr_client, base_corpus).await?;
@@ -678,7 +682,9 @@ async fn run_partial(
678682

679683
ecr::delete_repos(ecr_client, base_corpus).await?;
680684

681-
cooldown().await;
685+
if tool_idx + 1 < tools.len() {
686+
cooldown().await;
687+
}
682688
}
683689

684690
Ok(ScenarioResult {

xtask/src/bench/remote.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,13 @@ mkdir -p "$TMPDIR"
188188
{registry_env}
189189
190190
# Launch detached with output to log file.
191+
EXIT_FILE=bench/.bench-run.exit
191192
> "$LOG_FILE"
193+
rm -f "$EXIT_FILE"
192194
(
193195
cargo xtask bench {bench_args} 2>&1
194196
BENCH_EXIT=$?
197+
echo "$BENCH_EXIT" > "$EXIT_FILE"
195198
echo "[bench-remote] exit code: $BENCH_EXIT"
196199
rm -f "$PID_FILE"
197200
exit $BENCH_EXIT
@@ -203,9 +206,13 @@ echo "bench-remote: started (PID $BENCH_PID), streaming log..."
203206
# Stream log until bench exits. --pid= makes tail exit when process dies.
204207
tail -n+1 -f "$LOG_FILE" --pid="$BENCH_PID"
205208
206-
# Propagate exit code.
207-
wait "$BENCH_PID" 2>/dev/null
208-
EXIT=$?
209+
# Read exit code from file (reliable, not subject to wait race).
210+
if [ -f "$EXIT_FILE" ]; then
211+
EXIT=$(cat "$EXIT_FILE")
212+
rm -f "$EXIT_FILE"
213+
else
214+
EXIT=1
215+
fi
209216
echo '[4/4] Benchmarks complete.'
210217
exit $EXIT
211218
"#

0 commit comments

Comments
 (0)