feat(runtime): switch shim config to file path and harden env delivery#260
feat(runtime): switch shim config to file path and harden env delivery#260shayne-snap wants to merge 4 commits intoboxlite-ai:mainfrom
Conversation
|
Hi @shayne-snap. The initial design is to make |
Oh, I see. I agree that The new shim config file is NOT a second source of truth; it mainly avoids argv size/quoting limits when spawning the shim and is not used for recovery or conflict checks. Should reduce the scope?(write less info into the file) or wait until things become more clear? |
Got it. Does this PR solve the silent exit issue of passing |
Yes. Works on my laptop. |
| for (key, value) in &guest_rootfs.env { | ||
| builder.with_env(key, value); | ||
| } | ||
| for (key, value) in &options.env { |
There was a problem hiding this comment.
Hi @shayne-snap. We add this to the guest because we allow the user to exec command in the guest vm directly through env BOXLITE_EXECUTOR=guest.
There was a problem hiding this comment.
Good catch!
For BOXLITE_EXECUTOR=guest, I merge BoxOptions.env into the exec-time env (with BoxCommand.env taking precedence), so guest-direct exec keeps the previous semantics without reintroducing cmdline-length risk.
7f1af85 to
21575b1
Compare
write InstanceSpec to per-box shim-config.json and spawn shim with --config-file to avoid oversized argv payloads keep shim compatible with legacy --config while preferring file-based config loading make guest entrypoint env overrides atomic and keep user container env delivery on the ContainerInit/gRPC path add unit and integration tests for env visibility and large env payload delivery
21575b1 to
1cd5803
Compare
Fix #227 (comment). Moving large configuration from command-line arguments to a file (--config-file) aligns with the Docker/Podman approach of using OCI
config.json.Key changes
--config-fileto avoid oversized argv payloadsTesting
./target/debug/boxlite run --rm $(printenv | sed 's/=.*//;s/^/-e /' | tr '\n' ' ') docker.io/library/alpine:latest echo oknode example/node/simplebox.js. Box fails to start when passing my host env vars:Timeout waiting for guest ready (30s) #222 (comment)make test:rust,make test:integration, andmake test:cli