Repository navigation
⚙️ feat: Read Compose Execution Limits From .env - #368
Open
JeongCheolLee wants to merge 1 commit into
Open
JeongCheolLee wants to merge 1 commit into
JeongCheolLee wants to merge 1 commit into
Conversation
docker-compose.yaml hard-coded SANDBOX_OUTPUT_MAX_SIZE, SANDBOX_RUN_TIMEOUT and SANDBOX_RUN_CPU_TIME on the sandbox runner and passed neither JOB_TIMEOUT nor MAX_FILE_SIZE to the API, worker or egress gateway, so the matching .env entries were silently ignored and raising the 25 MiB upload cap required a Compose override file. Interpolate all five with the current values as defaults, so an unset .env renders the same configuration as before. JOB_TIMEOUT goes to every service that derives a deadline or grant lifetime from it. .env.example listed SANDBOX_RUN_TIMEOUT=15000 and SANDBOX_RUN_CPU_TIME=10000, which never took effect; they become commented defaults so a fresh copy keeps today's behavior. The Compose config test now checks defaults and overrides.
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.
Problem
The services already read their limits from the environment (
api/src/config.ts,service/src/config.ts), butdocker-compose.yamldoes not let.envreach them:sandbox-runnerhard-codesSANDBOX_OUTPUT_MAX_SIZE=65536,SANDBOX_RUN_TIMEOUT=300000andSANDBOX_RUN_CPU_TIME=300000, so the same keys in.envare ignored.JOB_TIMEOUTandMAX_FILE_SIZEare not passed toapi,service-workeroregress_gatewayat all. Uploads over 25 MiB are rejected with 413 by the upload route and the only way to raise the cap is a Compose override file..env.examplelistsSANDBOX_RUN_TIMEOUT=15000andSANDBOX_RUN_CPU_TIME=10000, which suggests they apply although they never did.Change
SANDBOX_RUN_TIMEOUT/SANDBOX_RUN_CPU_TIME=300000,SANDBOX_OUTPUT_MAX_SIZE=65536,JOB_TIMEOUT=300000(api, service-worker, egress_gateway — the gateway derives the egress grant TTL from it),MAX_FILE_SIZE=26214400(api, the upload route's busboy limit)..env.example: replace the two inert values with commented defaults plus a short explanation.tests/compose-bridge-config.cjs: assert the rendered defaults and that overrides reach each service.Compatibility
With no new keys in
.env,docker compose configrenders exactly the previous values.Upgrade note: an existing
.envcopied from the old.env.examplestill containsSANDBOX_RUN_TIMEOUT=15000andSANDBOX_RUN_CPU_TIME=10000. Those values will now take effect (15 s / 10 s instead of 300 s). Happy to name this in release notes, or drop the two runner timeouts from this PR (a small amend touching only those lines and their test entries) if you prefer.Testing
node tests/compose-bridge-config.cjs→ "Compose bridge configuration passed (pairing, opt-in recovery, durable Redis, execution limits)"; with the Compose change reverted, the new assertions fail (api JOB_TIMEOUT).git diff --checkclean.bun run testinapi/was not run on this branch (no TypeScript changed). For reference, onmainon a macOS host it gives 504 pass / 3 skip / 14 fail; the 14 are environment-dependent (scripts using GNUln -sfnT, plus 4 hardened-startup config tests), not related to this change.Checklist
.env.exampleupdated