Repository navigation
fix(apple): translate Docker tmpfs-mode mount option - #1537
Conversation
Render structured tmpfs mounts using Apple container's native --tmpfs syntax.
Retain octal modes, exact byte capacities, Docker size suffixes and zero-as-unset
defaults, boolean spellings, and last-option-wins precedence. Reject unsupported
or unrepresentable input rather than dropping restrictions. Explicit runArgs,
other mount types and other providers keep their existing paths.
Validate with Apple unit/race tests, devcontainer/config tests, CI-parity lint,
and a real Apple container 1.5.0 probe for modes, page-exact capacities and write
rejection. A minimal workspace now starts with generated file/terminal secret
mounts and the requested permissions.
The full unit suite is not green in six unchanged packages; focused baseline
runs reproduce two failures. Complete user-configured tmpfs workspace validation
also remains blocked by Apple 1.5.0 rejecting embedded equals in metadata labels.
## Evidence
Apple 1.5.0 rejects tmpfs-mode as an unknown --mount directive. The runtime probe
observes modes 755/700/1770 and tmpfs block counts 1/257 at 4096 bytes per block;
it also checks size suffixes, zero defaults, boolean aliases, duplicate settings
and read-only write rejection. The separate label parser failure reproduces with
-l probe.key=a=b and is outside this fix.
## Transcript
- U1:
> $dig <private-consumer-wrapper> にapple containerのworkaroundがある。これをprovider側修正としてPRする案
- A: Read the consumer wrapper and current Apple driver. The wrapper translates Docker tmpfs-mode mount directives into Apple --tmpfs options. Asked whether the provider fix should cover generated secrets mounts, all structured tmpfs mounts, or raw runArgs.
- U2:
> A or B, apple containerの仕様とdocker仕様の差異が原典で確実ならB
- Selection: Q1 / B
> 利用者定義のtmpfsも含め、mode・size・read-onlyの変換まで保証する。対応仕様と検証範囲が広がる。
- A: Checked Apple container 1.5.0 parser source and Docker primary documentation/implementation. Adopted the conditional B scope after confirming mode, size and read-only representations; selected --tmpfs to avoid Apple --mount size rounding. Asked for the validation scope.
- U3:
> A
- Selection: Q2 / A
> 最小devcontainerで、wrapperなしの起動、mode・size・read-only、secrets用mountを検証する。
- A: Accepted a public minimal devcontainer validation scope. Proposed preserving structured tmpfs semantics while excluding raw runArgs rewriting, consumer changes, DinD remounts and other providers; limited execution to local changes, validation and PR preparation.
- U4:
> A
- Selection: Q3 / A
> この内容で確定し、実装依頼promptを作る。
- A: Produced a self-contained implementation request for the agreed scope. No push or PR creation was authorized.
- U5:
> ジック
- A: Asked whether the short message meant execution.
- U6:
> 実行
- A: Fetched origin and confirmed the current task branch matched main. Applied repository and observability guidance; classified the changed argument conversion as a deterministic local path using existing errors and runtime evidence. Implemented structured tmpfs conversion, Docker byte/suffix and zero-default semantics, explicit input validation and regression/runtime tests. An independent reviewer found true-spelling and duplicate-option differences; fixed them using sequential typed parsing and added unit/runtime cases. Delta review had no actionable findings. Apple unit/race tests, relevant devcontainer/config tests, CI-parity lint and real Apple 1.5.0 probes pass. A minimal isolated workspace with dummy mounted and attached secrets starts; guest tmpfs modes and dummy file presence were checked. User-defined tmpfs metadata still hits an independent Apple label parser error on embedded equals, reproduced directly. The full CLI suite failed six unchanged packages; a baseline source overlay reproduced tunnelserver ignore-policy and Docker image inspection failures, while the other four focused groups passed. Removed all task containers, isolated homes/dummy stores, fixture, binaries and temporary HTTP server; retained local review/test artifacts and the public PR draft. The staged diff exactly matches the reviewed snapshot. No remote writes were performed.
Co-authored-by: Codex <noreply@openai.com>
Keep --mount and translate only Docker's tmpfs-mode= and tmpfs-size= directive
names to Apple's mode= and size=. Preserve values, directive order and unknown
forms so the native CLI owns their interpretation across versions.
Remove host-side value parsing, whole-mount admission checks, --tmpfs lowering
and the added buildRunArgs error return. Keep existing Docker Desktop cleanup,
other mount types and explicit runArgs behavior unchanged.
Apple driver/config race tests and CI-parity lint pass. A real Apple 1.5.0
--mount test verifies generated secret directory permissions, native mode/size,
duplicate size selection and read-only behavior. Fresh independent review has
no actionable findings. Full workspace secret injection was not rerun in this
follow-up; native size rounding and metadata-label limitations remain documented
in the prepared PR text.
## Transcript
- U1:
> atty303にpush
- A: Pushed the existing signed tmpfs change to atty303/apple and verified that the remote ref matched d1081e1. No PR was created.
- U2:
> orcaのenv4 workspaceで起動した。修正が実際に利用されているか確認して
- A: Read-only inspection matched the selected Orca worktree to its Apple workspace. Host and guest used v0.0.0-atty.4 revision 04d22c4, which includes the original fix; its runargs source blob matched d1081e1. Saved driver path was container, and live tmpfs permissions were 0755 and 0700. No workspace settings were changed.
- U3:
> この修正が有効でありPRできると判断するか?
- A: Judged the original secrets-startup fix suitable for a PR with explicit native-label and unrelated full-suite validation limits.
- U4:
> func (d *appleDriver) buildRunArgs(params *driver.RunImageDevContainerParams) ([]string, error) {
> errorを追加したのは必須なの?
- A: Explained that the error return was introduced by added host-side validation rather than required by the original syntax mismatch.
- U5:
> 解析失敗をerrorにする必要ある? 解析できなかったら変換せずにパスしたほうが元の挙動を維持できてPRとして安全じゃない?
- A: Agreed that native CLI interpretation is safer than a new Devsy refusal condition. Initially proposed whole-mount pass-through.
- U6:
> 「解析できないエラー」これが今後containerの更新に対しても常に妥当であることを保証できるか?
- A: Acknowledged that a local parser cannot classify future CLI input validity and must not become a compatibility gate.
- U7:
> 修正して
- A: Started the requested follow-up in the current branch, fetched origin, and reproduced the rejection regression. Removed the public argument-generation error path. A preliminary pass-through implementation and runtime checks were subsequently superseded by the clarified minimal contract.
- U8:
> 解析できない指定が一つでもあれば ← なんで? 解析できたものだけ変換すればいいだろう?
- A: Acknowledged that whole-mount gating came from changing the CLI flag. Explored per-directive conversion while retaining the native mount path; that intermediate variant was not committed.
- U9:
> 最大限container cliに解析を任せ、確実にサポートしていないことがわかる形式を変換するのが目的だ。理解しているか?
- A: Removed independent value parsing and admission checks. Final implementation maps only exact tmpfs-mode= and tmpfs-size= names to native mode= and size= in structured tmpfs mounts, preserving raw values, order and unknown directives. Native CLI semantics include units, duplicates, malformed values and zero values.
- U10:
> > --mount から --tmpfs へ切り替える実装
>
> これ必要なの? --mountのままtmpfs指定を変換できないの?
- A: Confirmed that --mount supports mode and size directly and retained that flag. Restored buildRunArgs and its callers to []string, removed Docker-value emulation, and updated PR text around native parsing ownership and its known size/label limitations.
- U11:
> それがこちらの意図する最小PRだ
- A: Final source adds only directive-name translation to the pre-fix production path. Apple/config race tests, CI-parity lint and real Apple 1.5.0 --mount tests pass. Tests cover opaque values, duplicates, unknown directives and input immutability; runtime checks cover secret directory modes, native size/mode, last size selection and read-only writes. Fresh independent review found no actionable issues. Integration resources were cleaned up. The reviewed diff matches the staged snapshot. Existing env4 and installed binaries were not changed; no push or PR creation was performed for this follow-up.
Co-authored-by: Codex <noreply@openai.com>
✅ Deploy Preview for devsydev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for images-devsy-sh canceled.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
|
Thanks for this fix! |
Workspaces using file-mounted or terminal secrets fail to start with the Apple provider. Devsy generates
tmpfs-modefor these mounts, but Apple container expectsmodeand rejects the generated arguments withunknown directive tmpfs-mode.Translate
tmpfs-modetomodewhen building tmpfs mount arguments for the Apple provider (workspace mount and additional mounts). Shared Docker/Compose mount config is unchanged; rawrunArgsare untouched.Known limitation:
tmpfs-sizetmpfs-sizeis intentionally not translated. Apple container 1.5.0 parses--mount type=tmpfs,size=below 1 MiB as zero, which removes the cap (apple/container#2340, fix #2341 still open). A Docker-styletmpfs-size=is passed through unchanged so the CLI rejects it instead of silently creating an uncapped mount. Safe size compatibility is left to a separate change. Nativesize=written by the user passes through as-is.Validation
go test -race -count=1 ./pkg/driver/apple ./pkg/apple ./pkg/devcontainer ./pkg/devcontainer/configand./pkg/driver/dockerpass; lint clean on the changed code.DEVSY_APPLE_E2E=1 go test -count=1 -v -run '^TestTmpfsMountsIntegration$' ./pkg/driver/apple): waits for running state before exec, usesghcr.io/devsy-org/test-images/base:ubuntu, asserts capacity in bytes, cleans up on failed runs. Native result at the final head: see the PR comment (must be recorded before merge).Summary by CodeRabbit