fix(master): refuse tmpfs options Swarm cannot express - #65
Conversation
The Swarm backend translated a docker-run tmpfs spec by keeping size= and discarding everything else. The own_runner job container installs the miner agent into /tmp/.local under a read-only rootfs, so its spec carries exec; tmpfs is noexec unless told otherwise. Routing that workload through Swarm therefore produced a noexec /tmp, where the agent loads no shared object and fails with "failed to map segment from shared object" -- a symptom that took hours to trace back to a dropped mount flag. Swarm cannot express the flag at all: against Docker 29.2.1 a bare exec is rejected as a non key=value field and tmpfs-options is an unknown option, so only tmpfs-size and tmpfs-mode survive. Translate those two, accept the flags Swarm already applies by default, and refuse anything else -- exec loudest of all -- rather than dropping it and failing far from the cause.
|
Warning Review limit reached
Next review available in: 6 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why
The Swarm backend translated a docker-run tmpfs spec by keeping
size=and discarding every other option.The own_runner job container installs the miner agent into
/tmp/.localunder a read-only rootfs, so its spec is/tmp:rw,nosuid,exec,size=2g. tmpfs isnoexecunless told otherwise. Routing that workload through Swarm produced a noexec /tmp, where the agent loads no shared object and dies withfailed to map segment from shared object— the same symptom that already cost hours to trace on the broker path (fixed in #64).The broker path is what production runs today, so this was latent, not live. It becomes live the moment the Swarm path is enabled.
What
Swarm cannot express the flag at all. Verified against Docker 29.2.1 on the prod host:
type=tmpfs,...,execinvalid field 'exec' must be a key=value pairtype=tmpfs,...,tmpfs-options=execunknown option 'tmpfs-options'type=tmpfs,destination=/tmp,tmpfs-size=1048576So translation is impossible and silence is the worst option. This change:
size=andmode=totmpfs-size/tmpfs-mode;rw,noexec,nosuid,nodev);exec, and refuses any other untranslatable option, instead of dropping it.Tests
New
tests/unit/test_swarm_tmpfs_exec.py, written failing first: the two refusal tests failed withDID NOT RAISEbefore the change while the three translation tests already passed, pinning that existing specs keep working. 5 passed after.