@@ -32,11 +32,14 @@ RUN --mount=type=bind,source=rust-toolchain.toml,target=/tmp/rust-toolchain.toml
3232# ---------------------------------------------------------------------------
3333# Build the instrumented Agent Data Plane.
3434#
35- # Coverage instrumentation uses the modern Antithesis Rust flow (post-2026-05-22): the
36- # `antithesis-instrumentation` crate (referenced once in main.rs behind the `antithesis` feature)
37- # provides the runtime shim, and these RUSTFLAGS enable LLVM sancov coverage. `--build-id` is
38- # required for symbolization; the release profile sets `debug = true`, so the binary keeps DWARF
39- # for /symbols. LTO is disabled to keep sancov instrumentation predictable.
35+ # Coverage instrumentation uses the modern Antithesis Rust flow
36+ # (post-2026-05-22): the `antithesis-instrumentation` crate (referenced once in
37+ # main.rs behind the `antithesis` feature) provides the runtime shim, and these
38+ # RUSTFLAGS enable LLVM sancov coverage. `--build-id` is required for
39+ # symbolization; the release profile sets `debug = true`, so the binary keeps
40+ # DWARF for /symbols. LTO is disabled to keep sancov instrumentation
41+ # predictable. `panic = "abort"` (antithesis build only) turns any ADP panic
42+ # into SIGABRT, caught as a hard crash.
4043# ---------------------------------------------------------------------------
4144FROM build-base AS adp-builder
4245ENV APP_FULL_NAME="Agent Data Plane" \
@@ -55,6 +58,7 @@ RUN --mount=type=cache,target=/adp/target,id=antithesis-adp-target \
5558 --mount=type=cache,target=/root/.cargo/git,id=cargo-git \
5659 cargo build --release --package agent-data-plane --features antithesis \
5760 --target x86_64-unknown-linux-gnu \
61+ --config 'profile.release.panic="abort"' \
5862 --config 'target.x86_64-unknown-linux-gnu.rustflags=["--cfg","tokio_unstable","-Ccodegen-units=1","-Cpasses=sancov-module","-Cllvm-args=-sanitizer-coverage-level=3","-Cllvm-args=-sanitizer-coverage-trace-pc-guard","-Clink-args=-Wl,--build-id"]' && \
5963 cp /adp/target/x86_64-unknown-linux-gnu/release/agent-data-plane /usr/local/bin/agent-data-plane && \
6064 echo "Validating Antithesis instrumentation symbols..." && \
@@ -74,11 +78,14 @@ RUN --mount=type=cache,target=/tools/target,id=antithesis-tools-target \
7478 --mount=type=cache,target=/root/.cargo/git,id=cargo-git \
7579 cargo build --release \
7680 --bin datadog-intake --bin millstone \
77- --bin parallel_driver_send_dogstatsd --bin finally_verify_delivery && \
81+ --bin parallel_driver_send_dogstatsd --bin finally_verify_delivery --bin eventually_adp_alive \
82+ --bin first_sample_config && \
7883 cp /tools/target/release/datadog-intake /usr/local/bin/datadog-intake && \
7984 cp /tools/target/release/millstone /usr/local/bin/millstone && \
8085 cp /tools/target/release/parallel_driver_send_dogstatsd /usr/local/bin/parallel_driver_send_dogstatsd && \
81- cp /tools/target/release/finally_verify_delivery /usr/local/bin/finally_verify_delivery
86+ cp /tools/target/release/finally_verify_delivery /usr/local/bin/finally_verify_delivery && \
87+ cp /tools/target/release/eventually_adp_alive /usr/local/bin/eventually_adp_alive && \
88+ cp /tools/target/release/first_sample_config /usr/local/bin/first_sample_config
8289
8390# ---------------------------------------------------------------------------
8491# Runtime: Agent Data Plane (SUT).
@@ -92,8 +99,12 @@ RUN apt-get update && \
9299COPY --from=adp-builder /usr/local/bin/agent-data-plane /usr/local/bin/agent-data-plane
93100# Expose DWARF/build-id symbols to Antithesis for symbolization (one-hop symlink to the unstripped binary).
94101RUN mkdir -p /symbols && ln -s /usr/local/bin/agent-data-plane /symbols/agent-data-plane
95- # main.rs requires the bootstrap config file to exist at the default path; ship a minimal standalone config.
102+ # main.rs requires the bootstrap config file to exist at the default path; ship a minimal standalone
103+ # config as a fallback. The boot wrapper overwrites it with the per-replay config written by the
104+ # `first_sample_config` workload command onto the shared `agent-config` volume.
96105COPY test/antithesis/deploy/adp/datadog.yaml /etc/datadog-agent/datadog.yaml
106+ # Boot wrapper: waits for the drawn config sentinel, copies the config into place, then execs ADP.
107+ COPY --chmod=755 test/antithesis/deploy/adp/entrypoint.sh /entrypoint.sh
97108# ADP's control-plane secure API requires an IPC TLS cert (a single PEM holding both certificate and
98109# private key) that the Core Agent normally generates. In standalone mode there is no Core Agent, so
99110# generate a self-signed cert+key. An empty auth_token satisfies the IPC auth config at startup.
@@ -103,7 +114,7 @@ RUN openssl req -x509 -newkey rsa:2048 -nodes -days 3650 \
103114 cat /tmp/ipc_cert.pem /tmp/ipc_key.pem > /etc/datadog-agent/ipc_cert.pem && \
104115 rm -f /tmp/ipc_cert.pem /tmp/ipc_key.pem && \
105116 touch /etc/datadog-agent/auth_token
106- ENTRYPOINT ["/usr/local/bin/agent-data-plane " ]
117+ ENTRYPOINT ["/entrypoint.sh " ]
107118CMD ["run" ]
108119
109120# ---------------------------------------------------------------------------
@@ -128,7 +139,9 @@ COPY --from=tools-builder /usr/local/bin/millstone /usr/local/bin/millstone
128139COPY --chmod=755 test/antithesis/deploy/workload/setup-complete.sh /opt/antithesis/setup-complete.sh
129140COPY test/antithesis/deploy/workload/test/ /opt/antithesis/test/
130141# Inject the compiled test-command binaries into the "main" test template.
142+ COPY --from=tools-builder --chmod=755 /usr/local/bin/first_sample_config /opt/antithesis/test/v1/main/first_sample_config
131143COPY --from=tools-builder --chmod=755 /usr/local/bin/parallel_driver_send_dogstatsd /opt/antithesis/test/v1/main/parallel_driver_send_dogstatsd
132144COPY --from=tools-builder --chmod=755 /usr/local/bin/finally_verify_delivery /opt/antithesis/test/v1/main/finally_verify_delivery
145+ COPY --from=tools-builder --chmod=755 /usr/local/bin/eventually_adp_alive /opt/antithesis/test/v1/main/eventually_adp_alive
133146COPY --chmod=755 test/antithesis/deploy/workload/entrypoint.sh /entrypoint.sh
134147ENTRYPOINT ["/entrypoint.sh" ]
0 commit comments