Repository navigation
Conversation
Persist creation-time env vars in sandbox metadata and pass them back as EnvVars when resuming from a snapshot, so the post-upgrade /init can restore them after a resume-time envd self-upgrade. Refs e2b-dev/E2B#1947 Amp-Thread-ID: https://ampcode.com/threads/T-01a12f77-ba70-75be-896d-78a73de2ef1b Co-authored-by: Amp <amp@ampcode.com>
This branch has not been deployed
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.
Attempt at e2b-dev/E2B#1947: creation-time env vars go missing after a resume that self-upgrades envd.
Problem
The envd upgrade handover deliberately omits env vars and relies on the post-upgrade
/initto restore them. On resume,buildResumeSandboxDataFromSnapshotbuildsSandboxMetadatawithoutEnvVars, so that/inithas nothing to restore.Approach
sandbox_create.go: merge the request'senvVarsinto the sandbox metadata so they are persisted with the snapshot.sandbox_resume.go: read them back from snapshot metadata and pass them asSandboxMetadata.EnvVars, so the orchestrator sends them to/init.No proto, orchestrator, or envd changes.
Known limitations (feedback welcome)
go build/go vet; no tests yet, and I could not exercise the managed envd upgrade path.#3673 tackles the same issue in the orchestrator by capturing
/envsbefore the upgrade, which avoids the limitations above. Opening this as a draft for reference and discussion; happy to close it in favour of #3673 or rework it based on feedback.Refs e2b-dev/E2B#1947