From fb0ef896247e86920c20f6f007ca2c0c42a23d4d Mon Sep 17 00:00:00 2001 From: Priya Raman Date: Fri, 4 Sep 2026 00:38:52 +0000 Subject: [PATCH] fix(cargo): apply the network config in the Daytona build and harden the test Copy the repository .cargo directory into the Daytona runner Docker build stage, so the production cargo build picks up the raised retry count and transfer timeout instead of the cargo defaults. Add .cargo to the audited Daytona image input paths, so a future change to that file invalidates the cached image. Make Arm B of the network stall differential harness unset CARGO_NET_RETRY and CARGO_HTTP_TIMEOUT before it runs cargo fetch, so the harness tests the repository config instead of a value the caller happens to have exported. Correct the .cargo/config.toml comment: the retry count rises from Cargo's default of 3 to 5, which is two more retries, not one. Co-authored-by: Paperclip --- .cargo/config.toml | 2 +- docker/daytona-runner/Dockerfile | 1 + scripts/cargo-network-stall-harness/run-differential.sh | 2 +- tests/runner-e2e/daytona-image-content.ts | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 7b6ea7115cf..e31fbf754db 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,7 +2,7 @@ # below 10 bytes per second for 30 seconds, then retry 3 times. On a # shared CI runner a brief network stall can cross that 30-second window # on every attempt, so the whole download fails even though the network -# recovers soon after. A wider timeout and one more retry give a stall +# recovers soon after. A wider timeout and two more retries give a stall # more time to pass before cargo gives up. # # Worst case for one dead crate: 6 attempts (1 try plus 5 retries) times diff --git a/docker/daytona-runner/Dockerfile b/docker/daytona-runner/Dockerfile index 294b5b12928..14b06f4e327 100644 --- a/docker/daytona-runner/Dockerfile +++ b/docker/daytona-runner/Dockerfile @@ -6,6 +6,7 @@ FROM rust:1.97-bookworm@sha256:408fe88047cef61a2087653b0c5255fa51c0f2d6d94ddedd7a2562a9b91a46f6 AS runnerd-build WORKDIR /workspace/packages/paperclip-runner/runner +COPY .cargo /workspace/.cargo COPY packages/paperclip-runner/runner/Cargo.toml packages/paperclip-runner/runner/Cargo.lock ./ COPY packages/paperclip-runner/runner/crates ./crates COPY packages/paperclip-runner/protocol ../protocol diff --git a/scripts/cargo-network-stall-harness/run-differential.sh b/scripts/cargo-network-stall-harness/run-differential.sh index f1f82d5e890..9241da4f321 100755 --- a/scripts/cargo-network-stall-harness/run-differential.sh +++ b/scripts/cargo-network-stall-harness/run-differential.sh @@ -106,7 +106,7 @@ echo "$ARM_A_OUTPUT" echo "Arm A exit status: $ARM_A_STATUS" set +e -ARM_B_OUTPUT="$(run_arm B env 2>&1)" +ARM_B_OUTPUT="$(run_arm B env -u CARGO_NET_RETRY -u CARGO_HTTP_TIMEOUT 2>&1)" ARM_B_STATUS=$? set -e echo "$ARM_B_OUTPUT" diff --git a/tests/runner-e2e/daytona-image-content.ts b/tests/runner-e2e/daytona-image-content.ts index ab566d7bd71..d796a74cc44 100644 --- a/tests/runner-e2e/daytona-image-content.ts +++ b/tests/runner-e2e/daytona-image-content.ts @@ -14,6 +14,7 @@ export const DAYTONA_IMAGE_DOCKERFILE_PATH = "docker/daytona-runner/Dockerfile"; // Keep it conservative: a false positive only rebuilds the image, while a // missing input could incorrectly reuse an incompatible paid-test image. export const DAYTONA_IMAGE_INPUT_PATHS = [ + ".cargo", ".dockerignore", ".npmrc", "docker/daytona-runner/Dockerfile",