fix(agent-data-plane): support ARMv7 compile target#1866
Conversation
Binary Size Analysis (Agent Data Plane)Baseline: cf03337 · Comparison: 1899d62 · diff ✅ Binary size difference within thresholdChanges by Module
Detailed Symbol Changes |
This comment has been minimized.
This comment has been minimized.
# Conflicts: # docker/Dockerfile.agent-data-plane
Regression Detector (Agent Data Plane)Run ID: Optimization Goals: ✅ No significant changes detectedFine details of change detection per experiment (5)Experiments configured
Bounds Checks: ✅ Passed (5)
ExplanationA change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression ( |
| pub(crate) mod state; | ||
|
|
||
| #[cfg(all(target_os = "linux", not(system_allocator)))] | ||
| #[cfg(all(target_os = "linux", not(target_arch = "arm"), not(system_allocator)))] |
There was a problem hiding this comment.
Note that arm here is only 32-bit, does not include arm64
ARMv7 emulated Rust tests updateValidated Rust test binaries under ARMv7 emulation with an explicit QEMU runner: docker run --rm \
-v "$PWD:/work" \
-v "$PWD/target/docker-cargo-home:/usr/local/cargo/registry" \
-v "$PWD/target/docker-target:/work/target" \
-w /work \
-e CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
-e CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER='qemu-arm -L /usr/arm-linux-gnueabihf' \
-e CC_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
-e CXX_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++ \
-e AR_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-ar \
-e RUSTFLAGS='--cfg tokio_unstable' \
rust:1.96-bookworm \
bash -euxo pipefail -c '
apt-get update >/dev/null
apt-get install -y --no-install-recommends \
gcc-arm-linux-gnueabihf \
g++-arm-linux-gnueabihf \
libc6-dev-armhf-cross \
qemu-user \
pkg-config \
cmake \
protobuf-compiler \
perl \
make \
file >/dev/null
rustup target add armv7-unknown-linux-gnueabihf
cargo test --package stringtheory --package resource-accounting --package saluki-io --target armv7-unknown-linux-gnueabihf
'Result: passed. This initially exposed 32-bit layout assumptions in |
ARMv7 standalone runtime smokeValidated the full ADP image in standalone mode under ARMv7 QEMU emulation: docker run --rm --platform linux/arm/v7 \
-v "$CERT_DIR:/mnt/cert:ro" \
-e DD_API_KEY=test-api-key \
-e DD_HOSTNAME=armv7-standalone-smoke \
-e DD_DD_URL=http://127.0.0.1:9 \
-e DD_DATA_PLANE_ENABLED=true \
-e DD_DATA_PLANE_STANDALONE_MODE=true \
-e DD_DATA_PLANE_REMOTE_AGENT_ENABLED=false \
-e DD_DATA_PLANE_USE_NEW_CONFIG_STREAM_ENDPOINT=false \
--entrypoint sh \
saluki-images/agent-data-plane:testing-release \
-euxc '...
timeout 15s /usr/local/bin/agent-data-plane --config /tmp/datadog.yaml run 2>&1 | tee /tmp/adp-standalone.log
grep "Agent Data Plane running" /tmp/adp-standalone.log
grep "Serving unprivileged API" /tmp/adp-standalone.log
grep "Serving privileged API" /tmp/adp-standalone.log
grep "DogStatsD listener started" /tmp/adp-standalone.log
grep "Topology healthy. Waiting for interrupt" /tmp/adp-standalone.log
! grep -Ei "panic|panicked|bus error|segmentation fault|Failed to|No data pipelines" /tmp/adp-standalone.log
'Result: passed. The ARMv7 binary reached standalone mode, started the unprivileged and privileged APIs, started DogStatsD, reported topology healthy, and waited for interrupt with no panic/bus error/segfault/failure log. |
Self-review follow-upI ran a focused self-review plus fresh reviewer passes. Two concrete issues were found and fixed:
Post-fix validation:
Remaining intentional scope gap: CI/release fanout for publishing ARMv7 artifacts is still not added in this draft. This PR proves the local build/runtime/test path; the CI/release matrix can be added once we decide the exact artifact publishing shape. |
Summary
Adds build and smoke-test support for Agent Data Plane on the Datadog IoT Agent's current Linux ARMv7 hard-float package target.
The current IoT Agent ARMv7 packages map to Debian
armhf/ RPMarmv7hl, so this PR targets Rust'sarmv7-unknown-linux-gnueabihftarget.Key changes
stringtheoryon 32-bit little-endian platforms and makes its inline capacity documentation/tests word-size aware.resource-accountingand Unix ancillary credential sizing.thp:neverjemalloc config aborts before CLI startup.--platform linux/arm/v7forBUILD_TARGET=armv7-unknown-linux-gnueabihf, producing an actual ARMv7 image while cross-compiling from the build platform.rustup.ddprof-armis unavailable.Out of scope for this draft
linux/arm/v7/armv7.Validation
docker run --privileged --rm tonistiigi/binfmt --install arm.docker run --rm --platform linux/arm/v7 arm32v7/debian:bookworm-slim sh -c 'uname -m; dpkg --print-architecture; test -e /lib/ld-linux-armhf.so.3'.7.80.3-1_armhf.deb; its main Agent binary is ARM EABI5 and only references up toGLIBC_2.8.make fmtcargo test --package stringtheory --package resource-accounting --package saluki-iocargo check --workspacecargo check --workspace --testsBUILD_TARGET=armv7-unknown-linux-gnueabihf make build-adp-image-releasedocker image inspect saluki-images/agent-data-plane:testing-release --format 'os={{.Os}} arch={{.Architecture}} variant={{.Variant}}'→os=linux arch=arm variant=v7docker run --rm --platform linux/arm/v7 saluki-images/agent-data-plane:testing-release version→v1.3.0-3abca41ef7docker run --rm --platform linux/arm/v7 \ -e DD_DATA_PLANE_ENABLED=false \ -e DD_DATA_PLANE_STANDALONE_MODE=false \ -e DD_DATA_PLANE_REMOTE_AGENT_ENABLED=false \ -e DD_DATA_PLANE_USE_NEW_CONFIG_STREAM_ENDPOINT=false \ --entrypoint sh \ saluki-images/agent-data-plane:testing-release \ -euxc 'printf "{}\n" > /tmp/datadog.yaml; /usr/local/bin/agent-data-plane --config /tmp/datadog.yaml run 2>&1 | tee /tmp/adp-run.log; grep -E "Agent Data Plane starting|Agent Data Plane is not enabled" /tmp/adp-run.log'Notes from local ARMv7 investigation
exec format erroruntil installingtonistiigi/binfmt --install arm.GLIBC_2.38, which failed on Debian bookworm armhf. The local ARMv7 Makefile path now builds withrust:1.96-bookwormto keep the runtime glibc requirement compatible with bookworm.