77 ALLOWED_CIDRS ,
88 BLOCK_NETWORK ,
99 CACHE_VOLUME_NAME ,
10- IDLE_TIMEOUT_SECONDS ,
1110 MODAL_REGION ,
1211 RUNNER_VERSION ,
1312 SANDBOX_EXTRA_ENV ,
@@ -109,12 +108,10 @@ def build_runner_image() -> modal.Image:
109108# Pre-built image instance for reuse
110109runner_image = build_runner_image ()
111110
112- # Sandbox entrypoint — unified dockerd + runner in a single command chain.
113- # dockerd starts in background. The dockerd wait + image load are also backgrounded,
114- # so the runner starts IMMEDIATELY without waiting for dockerd.
111+ # Sandbox entrypoint — starts dockerd in background and immediately launches the runner.
112+ # The dockerd wait + image load run in the background so the runner starts without delay.
115113# Non-Docker jobs skip the 60s dockerd startup entirely.
116- # After the runner exits, sleep infinity keeps the sandbox alive.
117- # idle_timeout terminates the sandbox after a period of inactivity.
114+ # After the runner exits, the entrypoint ends and the sandbox terminates normally.
118115SANDBOX_CMD = (
119116 "bash -c '/start-dockerd.sh &'"
120117 " && (for i in $(seq 1 60); do docker info > /dev/null 2>&1 && break; sleep 1; done;"
@@ -123,7 +120,6 @@ def build_runner_image() -> modal.Image:
123120 " && export RUNNER_ALLOW_RUNASROOT=1"
124121 " && export DOCKER_BUILDKIT=1"
125122 " && ./run.sh --jitconfig \" $GHA_JIT_CONFIG\" 2>&1 | tee /tmp/runner.log"
126- " && sleep infinity"
127123)
128124
129125
@@ -151,8 +147,6 @@ async def spawn_sandbox(
151147 volumes = sandbox_volumes ,
152148 experimental_options = {"enable_docker" : True },
153149 )
154- if IDLE_TIMEOUT_SECONDS > 0 :
155- sandbox_kwargs ["idle_timeout" ] = IDLE_TIMEOUT_SECONDS
156150 if MODAL_REGION :
157151 sandbox_kwargs ["region" ] = MODAL_REGION
158152
0 commit comments