Skip to content

Bake provenance JSON into images and auto-populate post_results.py args#338

Draft
misiugodfrey wants to merge 4 commits into
mainfrom
misiug/benchmarkProvenance
Draft

Bake provenance JSON into images and auto-populate post_results.py args#338
misiugodfrey wants to merge 4 commits into
mainfrom
misiug/benchmarkProvenance

Conversation

@misiugodfrey
Copy link
Copy Markdown
Contributor

@misiugodfrey misiugodfrey commented May 7, 2026

Summary

  • Writes /opt/velox-testing/provenance.json into each Presto image at build time (both native_build.dockerfile and provenance_labels.dockerfile)
  • Each launch script (launch_presto_servers.sh, launch_coordinator.sh) copies that file into the shared LOGS_DIR at container startup as worker_provenance.json / coordinator_provenance.json, so run_context.py running on the host (Docker) or inside the coordinator container (SLURM/Enroot) can read it via the existing logs bind-mount. The in-container /opt/velox-testing/provenance.json path is kept as a fallback for callers running directly inside an image that has the file baked in.
  • SLURM functions.sh: adds ${LOGS}:/opt/presto-server/logs to both coordinator and worker srun --container-mounts so the same scheme works across the cluster, mirrors the provenance cp in the inline worker bash and COORD_SCRIPT, and exports LOGS_DIR=/opt/presto-server/logs in run_queries so the in-container pytest looks at the mounted path.
  • run_context.py reads the provenance file and merges presto_sha/branch/repo and velox_sha/branch/repo into the benchmark context dict written to benchmark_result.json. Resolver prefers worker_provenance.json (full presto+velox fields) over coordinator_provenance.json (presto only on CI builds).
  • post_results.py auto-populates --velox-branch, --velox-repo, --presto-branch, --presto-repo from the benchmark_result.json context; CLI args still take precedence; older result files without provenance fields are handled gracefully.
  • presto-build.yml: replaces the labels: input on the deps and coordinator build steps with a second provenance_labels.dockerfile wrapper step — buildx labels: applies OCI metadata only and does not execute RUN steps, so the provenance file would not have been written via that path.

Test plan

  • Build a new native worker image: presto/scripts/start_native_cpu_presto.sh
  • Confirm provenance file exists: docker run --rm presto-native-worker-cpu:$USER cat /opt/velox-testing/provenance.json
  • Run a short benchmark: presto/scripts/run_benchmark.sh -b tpch -s bench_sf1
  • Confirm benchmark_result.json context has velox_branch, velox_repo, presto_branch, presto_repo populated
  • Run post_results.py --dry-run without branch/repo args; confirm payload engine_config shows values auto-populated from the result file
  • Run with --velox-branch override; confirm CLI value wins over the label
  • Test with an older result file (no provenance in context); confirm the fields are absent from engine_config without error
  • Trigger a CI build to produce images via the updated presto-build.yml; pull the resulting image into a SLURM/Enroot context and run a quick benchmark to confirm provenance fields are populated via the shared logs path

Writes /opt/velox-testing/provenance.json into each Presto image at build
time (both native_build.dockerfile and provenance_labels.dockerfile), so
run_context.py can read it from the container filesystem in both Docker and
SLURM/Enroot environments.

run_context.py: reads the provenance file and merges presto_sha/branch/repo
and velox_sha/branch/repo into the benchmark context dict.

post_results.py: auto-populates --velox-branch, --velox-repo, --presto-branch,
--presto-repo from the benchmark_result.json context section; CLI args still
take precedence. BenchmarkMetadata gains 6 optional provenance fields.

presto-build.yml: replaces the labels: input on the deps and coordinator build
steps with a second provenance_labels.dockerfile wrapper step, so CI and local
builds both write the provenance file (buildx labels: applies OCI metadata only
and does not execute RUN steps).
@misiugodfrey misiugodfrey requested a review from a team as a code owner May 7, 2026 18:48
@misiugodfrey misiugodfrey marked this pull request as draft May 19, 2026 21:32
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 19, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

The provenance.json baked into images at /opt/velox-testing/provenance.json
is only visible from inside the container, but pytest runs on the host in
the Docker flow (run_benchmark.sh:294) and inside the coord container in
SLURM/Enroot. The host has no /opt/velox-testing/provenance.json, so
run_context.py's _get_image_provenance() returned {} and the six provenance
fields were silently missing from benchmark_result.json's context.

Have each launch script copy the baked-in file into LOGS_DIR at startup
(worker_provenance.json from launch_presto_servers.sh, coordinator_provenance.json
from launch_coordinator.sh). In Docker the dir is bind-mounted to the host,
so pytest reads it directly. In SLURM, add ${LOGS}:/opt/presto-server/logs
to both coord and worker srun --container-mounts so the same scheme works
across the cluster, and export LOGS_DIR=/opt/presto-server/logs in
run_queries so the in-container pytest looks in the right place.

run_context.py replaces the hardcoded path constant with a resolver that
prefers worker_provenance.json (full presto+velox fields) over
coordinator_provenance.json (presto only in CI builds), then falls back to
the original /opt/velox-testing/provenance.json for callers running
directly inside a container that has the file baked in.
…nance

# Conflicts:
#	presto/slurm/presto-nvl72/functions.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant