feat(#43): per-job tmp isolation β sandbox binds only the job's own directory - #103
Merged
Merged
Conversation
β¦irectory The sandbox had to expose all of /tmp read-write because the object file lived beside the job dir and the compiler wrote its intermediates there. Both now live INSIDE the job dir (object at <job_dir>/suco_out.o, TMPDIR set to the job dir), so the sandbox binds only that one directory. Concurrent jobs on a worker can no longer see or clobber each other's scratch files. The -o path is not embedded in the object (verified on g++ 15.2 for -O2 and -g), so this moves no output bytes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5 tasks
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.
Closes the remaining #43 item. The sandbox previously had to expose all of
/tmpread-write, because the object file lived beside the job dir and the compiler wrote its intermediates (cc*.s) there β so two concurrent jobs on one worker could see and clobber each other's scratch files.Now: the object lives at
<job_dir>/suco_out.oandTMPDIRpoints at the job dir, so the sandbox binds only that one directory (bwrap--bind <job_dir>, unshare equivalent).Verified on node3 (g++ 15.2), with the exact command the code now generates:
job_dirwritable/tmp(negative control)Moving the object is byte-safe: the
-opath is not embedded in the output (verified separately for-O2and-g), which is also why grid objects were already deterministic despite randomised temp names.Linux build clean (0 errors); the non-sandboxed path is unchanged apart from where the object is written, and
remove_all(job_dir)already cleans it up.π€ Generated with Claude Code