Skip to content

Commit 8c9bd65

Browse files
ryan-williamsclaude
andcommitted
batch(entrypoint): configure the reproc remote from env at runtime
The image bakes a repo clone at build time, so a scratch remote in the (gitignored) `.dvc/config.local` never reaches the container. Instead the entrypoint sets up `reproc` from env — `REPROC_URL`/`REPROC_ENDPOINT` as job-def env, `R2_ACCESS_KEY_ID`/`R2_SECRET_ACCESS_KEY` via Secrets Manager. Keeps the scratch remote + creds out of both committed config and the image, and since the container only ever talks to `reproc` (R2), R2 keys suffice — no AWS/S3 creds baked in. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GgLAzeRJeNeyizG4XHWRBK
1 parent 95ee41c commit 8c9bd65

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

batch/entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ else
3030
echo "entrypoint: no FARGATE_GITHUB_RW_TOKEN set; no git push-back" >&2
3131
fi
3232

33+
# Configure the scratch `reproc` DVC remote from env — kept OUT of committed
34+
# config and the image; url/endpoint arrive as job-def env, creds via Secrets
35+
# Manager (R2_*). Idempotent (`-f`). The container talks only to this remote
36+
# (`dvx run --remote reproc`), so R2 keys suffice — no AWS/S3 creds needed.
37+
if [ -n "${REPROC_URL:-}" ]; then
38+
( cd /app
39+
dvx remote add --local -f reproc "$REPROC_URL"
40+
[ -n "${REPROC_ENDPOINT:-}" ] && dvx remote modify --local reproc endpointurl "$REPROC_ENDPOINT"
41+
[ -n "${R2_ACCESS_KEY_ID:-}" ] && dvx remote modify --local reproc access_key_id "$R2_ACCESS_KEY_ID"
42+
[ -n "${R2_SECRET_ACCESS_KEY:-}" ] && dvx remote modify --local reproc secret_access_key "$R2_SECRET_ACCESS_KEY" )
43+
echo "entrypoint: configured reproc remote -> $REPROC_URL" >&2
44+
fi
45+
3346
# Append the reproc target set to a `run` that names no explicit .dvc targets.
3447
is_run=no; has_target=no
3548
for a in "$@"; do

0 commit comments

Comments
 (0)