feat(gantry): improve cold-start distribution and benchmark automation - #586
Merged
Vaibhav Patel (vpatelsj) merged 62 commits intoAug 7, 2026
Merged
Conversation
added 30 commits
August 4, 2026 22:45
…code Resolve 105 golangci-lint findings across the packages touched by the benchmark observability work: - govet shadow: rename the local `benchmark` values in the monitoring coverage tests, which shadowed the `benchmark` type declaration. - staticcheck ST1005: lowercase the Prometheus range-response size error string to match the surrounding error text. - wsl_v5/gofumpt: apply the repository formatters. No behavior change. Verified by diffing with whitespace ignored: the only semantic edits are the two lint fixes above plus a gofumpt var-block consolidation in preflight.go.
Add the run-20260806-142719-660ecfb3 sample to the byte reduction, pod startup latency, and audit-filtered aggregate tables. Result was PASS: 99.479% byte reduction, 99.800% pull reduction, 59.759% P95 improvement, and zero fallbacks.
The transfer plugin override caused problems during benchmark runs, so return to the containerd default of 3 concurrent downloads. Remove the setting from the conf.d drop-in, its readiness assertion, and the manifest test guard. The debug log level and 15m image pull progress timeout are unchanged. Redeploy propagates the removal: the drop-in is replaced wholesale and its content hash changes, so the DaemonSet restarts containerd.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands Gantry agent and gantry-benchmark observability by adding new Prometheus metrics and benchmark-side telemetry capture, while also hardening prefetch/peer addressing behaviors and improving benchmark deployment/run workflows.
Changes:
- Add new Gantry metrics (mirror response completion timestamps, peer fetch timestamps/latencies, containerd commit observation timing) and wire them through agent/mirror/commit tracking paths.
- Improve cold-start prefetch reliability and dispatch behavior (live stream-through manifest prefetch fix, bounded group concurrency, coordinator election, jitter/rotation).
- Enhance gantry-benchmark operational tooling (full-stack deploy workflow, node observer DaemonSet + PodMonitors, richer operator VM status/watch output, live monitor tool).
Reviewed changes
Copilot reviewed 68 out of 69 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/agent/phases/nodestart/cri_test.go | Adds coverage asserting generated containerd config includes pull-progress timeout and debug stanza. |
| pkg/agent/phases/nodestart/assets/containerd.toml | Updates default containerd config template to enable debug logging and set image pull progress timeout. |
| internal/gantry/mirror/mirror.go | Adds hook for mirror response completion and ensures manifest prefetch fires for peer-served manifests in live stream-through mode. |
| internal/gantry/mirror/mirror_prefetch_test.go | Adds regression test ensuring prefetch triggers for peer-served manifests when live stream-through is enabled. |
| internal/gantry/mirror/byte_metrics_test.go | Extends mirror byte-metric tests to assert response-completion hook behavior across cache/peer/origin paths. |
| internal/gantry/discovery/discovery.go | Deduplicates/merges peer AddrInfo entries and implements bounded bootstrap dialing with accumulated success quorum. |
| internal/gantry/discovery/discovery_test.go | Adds unit test for merging AddrInfo by peer ID and combining addresses. |
| internal/gantry/containerdstore/store.go | Preserves context cancellation/deadline errors rather than mapping them to availability errors. |
| internal/gantry/containerdstore/store_test.go | Adds tests ensuring context errors are not remapped to ErrUnavailable. |
| internal/gantry/config/config.go | Introduces prefetch dispatch config knobs and increases default peer fetch timeout to 15m with updated rationale. |
| internal/gantry/config/config_test.go | Updates default expectations and adds env/flag/validation tests for new prefetch dispatch settings. |
| internal/gantry/coldstart/prefetch.go | Implements coordinator election, deterministic dispatch jitter/rotation, bounded remote group concurrency, and per-group outcome metrics. |
| internal/gantry/coldstart/prefetch_test.go | Adds tests for group outcome reporting, bounded concurrency, and deterministic coordinator dispatch behavior. |
| internal/gantry/coldstart/prefetch_internal_test.go | Adds internal tests for deterministic dispatch planning and disabled jitter behavior. |
| internal/gantry/coldstart/coldstart.go | Extends options and metrics hooks for prefetch group tracking and defaults max concurrent groups. |
| internal/gantry/coldstart/coldstart_test.go | Updates helper to pass MetricsHooks into resolver construction. |
| images/gantry-benchmark-source/Containerfile | Adds a source-carrier image for private benchmark branches/revisions. |
| hack/gantry-benchmark/RUNBOOK.md | Updates runbook guidance for deploy.sh-first workflow, 1000-node contract defaults, and containerd config application steps. |
| hack/gantry-benchmark/RESULTS.md | Adds new benchmark result rows and expanded interpretation/footnotes for recent runs. |
| hack/gantry-benchmark/README.md | Documents full-stack deploy workflow, required instrumentation, and new live monitor usage/details. |
| hack/gantry-benchmark/operator-vm-watch.sh | Adds run-command locking, uses local status script via Fine Free File Command (@file), and prints timestamped snapshot headers. |
| hack/gantry-benchmark/operator-vm-status.sh | Expands operator status reporting for image build/push state, job progress rendering, and active operations. |
| hack/gantry-benchmark/operator-vm-run.sh | Adds structured logging, supports adopt-prepared images, and improves lifecycle messaging. |
| hack/gantry-benchmark/operator-vm-provision.sh | Plumbs source image/revision and adopt-image parameters into operator VM bootstrap/run invocation. |
| hack/gantry-benchmark/operator-vm-build-images.sh | New script to build/push deployment images on the operator VM and persist digest state. |
| hack/gantry-benchmark/manifests/monitoring.yaml.tmpl | Expands metric allowlist, adds gantry_benchmark labeling, and introduces node-observer DaemonSet + PodMonitor. |
| hack/gantry-benchmark/manifests/containerd.yaml | Adds a DaemonSet to enforce benchmark containerd drop-in config (debug, pull timeout, download concurrency) with readiness checks and restart gating. |
| hack/gantry-benchmark/Makefile | Adds deploy/monitor targets, operator script checks, and prepare-adopt target for direct mode. |
| hack/gantry-benchmark/deploy.env.example | Adds full-stack deploy contract example with adoption knobs and tightened benchmark gate defaults. |
| hack/gantry-benchmark/.gitignore | Ignores deploy.env alongside env.local. |
| hack/cmd/gantry-benchmark/run.go | Captures and persists per-phase diagnostic deltas and performance telemetry artifacts for baseline and Gantry phases. |
| hack/cmd/gantry-benchmark/results.go | Extends JSON results schema with diagnostic measurement and performance telemetry artifact references. |
| hack/cmd/gantry-benchmark/preflight.go | Adds Prometheus scrape coverage checks and supports multiple Azure diagnostic settings response shapes. |
| hack/cmd/gantry-benchmark/preflight_monitoring_test.go | Adds unit tests for metric coverage retry behavior and timeout error formatting. |
| hack/cmd/gantry-benchmark/performance_telemetry_test.go | Adds tests for query_range generation, bounded containerd query selection, and response/pod coverage validation. |
| hack/cmd/gantry-benchmark/peer_telemetry.go | Adds Gantry diagnostic snapshot/timestamp capture, per-pod delta computation, and validation helpers. |
| hack/cmd/gantry-benchmark/peer_telemetry_test.go | Adds tests for timestamp windowing, required final-layer timestamps, metric keying, and delta subtraction behavior. |
| hack/cmd/gantry-benchmark/main.go | Adds timestamped stdout/stderr writers, and introduces prepare-adopt CLI subcommand. |
| hack/cmd/gantry-benchmark/job.go | Adds live pull job progress reporting, and persists per-pod start/finish timing details in results. |
| hack/cmd/gantry-benchmark/job_test.go | Extends job observation test to validate per-pod timing capture. |
| hack/cmd/gantry-benchmark/job_progress_test.go | Adds tests for progress state classification and progress reporter lifecycle behavior. |
| hack/cmd/gantry-benchmark/image.go | Streams long-running build/push output with prefixing, adds payload generation/hashing progress, and adds prepare-adopt implementation. |
| hack/cmd/gantry-benchmark/image_test.go | Extends tests to assert progress output and validate adopt-prepared image behavior and input validation. |
| hack/cmd/gantry-benchmark/gantry_only.go | Adds diagnostic and performance telemetry capture to Gantry-only benchmark mode results. |
| hack/cmd/gantry-benchmark/enable.go | Passes node OS/arch to monitoring manifest and waits for node-observer rollout. |
| hack/cmd/gantry-benchmark/enable_test.go | Validates expanded monitoring manifest contents and asserts containerd benchmark manifest expectations. |
| hack/cmd/gantry-benchmark/config.go | Adds BENCHMARK_JOB_PROGRESS_INTERVAL config field and default. |
| hack/cmd/gantry-benchmark/command.go | Adds optional streaming command runner, prefix writer, timestamp writer, and makes writeAll nil-safe. |
| hack/cmd/gantry-benchmark/command_streaming_test.go | Adds tests for streaming delivery, stderr capture, prefix/timestamp writer behaviors and concurrency safety. |
| hack/cmd/gantry-benchmark/azure_preflight_test.go | Adds tests for decoding Azure diagnostic settings in both CLI and ARM response shapes. |
| hack/cmd/gantry-benchmark-monitor/pods.go | Implements Kubernetes watch-based pod state tracking for live monitoring. |
| hack/cmd/gantry-benchmark-monitor/pods_test.go | Adds tests for pod state classification and snapshot aggregation. |
| hack/cmd/gantry-benchmark-monitor/monitor_test.go | Adds tests for Prometheus range parsing/aggregation and monitor rendering. |
| deploy/gantry/configmap.yaml.tmpl | Updates Gantry default config to include new prefetch dispatch settings and updated peer fetch timeout. |
| cmd/gantry/stream_commit_tracker.go | Tracks per-stream completion timestamps and reports observation durations in completion-time order. |
| cmd/gantry/stream_commit_tracker_test.go | Adds tests for duration reporting and ordering guarantees. |
| cmd/gantry/prefetch_manifest_test.go | Adds tests for manifest open retry loop under live stream-through timing. |
| cmd/gantry/membership_peer_resolver_test.go | Adds tests ensuring membership-based resolver installs pod addresses and rejects identity mismatches. |
| cmd/gantry/main.go | Wires new metrics hooks, adds peerstore-aware membership resolver, and implements manifest open retry + PrefetchManifestChildren usage. |
| cmd/gantry/agent_byte_metrics_test.go | Updates startup metric materialization expectations to include new metric families. |
| .dockerignore | Expands exclusions for env files, kubeconfigs, keys, and cloud credential directories. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 11 commits
August 7, 2026 08:22
Vaibhav Patel (vpatelsj)
force-pushed
the
wip/gantry-benchmark-observability
branch
from
August 7, 2026 20:10
eabe0f5 to
f3426c0
Compare
Vaibhav Patel (vpatelsj)
marked this pull request as ready for review
August 7, 2026 22:18
Jason Wilder (jwilder)
approved these changes
Aug 7, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR expands the Gantry benchmark into a reproducible, observable large-cluster workflow and includes targeted Gantry product changes identified while exercising that workflow. Product behavior changes are listed first; benchmark-only infrastructure and tuning are separated below.
Product changes
Gantry cold-start and transfer behavior
206 Partial Content; positioning failures return500.HasandOpenretry paths immediately when their context has already been canceled.Product configuration and observability
image_pull_progress_timeout = "15m"in the containerd configuration generated for Unbounded-managed nodes. Production containerd debug logging is not enabled; debug logging remains confined to the benchmark-only containerd manifest.pprofendpoints. Profiling is disabled by default, accepts only loopback listeners, and does not own Gantry data-plane availability.p2p_prefetch_pullers_per_manifestfrom linear buckets1..10to exponential buckets1..1024..dockerignore.Benchmark workflow
Benchmark infrastructure and operations
Documentation
Test coverage