Repository navigation
feat: enable container nesting by default - #14082
Conversation
2e1df8b to
06a79ff
Compare
5e1e012 to
6480b08
Compare
|
@grouville Don't think we need @shykes wdyt? |
6480b08 to
e3df00d
Compare
|
There is a legacy compatibility issue in |
|
@shykes: disableDaggerInDagger as a proposal from Solomon. |
shykes
left a comment
There was a problem hiding this comment.
Assuming ASR (Adversarial Self-Review) :)
Also assuming disableDaggerInDagger as argument name
b6acd79 to
b79c9ab
Compare
|
Rebased on #14291 and went through the review. Renamed @tiborvass good catch on While re-checking compat, I noticed that views drop the prerelease suffix, so every To check it end to end, I opened a playground on this branch with a scratch dir mounted: dagger -W ~/dagger --x-release=v1.0.0-beta.14 \
api call playground \
with-directory --path=/root/target --source=./nesting-play \
with-workdir --path=/root/target \
terminaland called core directly ( dagger -M api call container from --address=alpine with-exec --args=printenv,DAGGER_SESSION_PORT stdout
# prints the port
dagger -M api call container from --address=alpine with-exec --args=printenv,DAGGER_SESSION_PORT --disable-dagger-in-dagger stdout
# exit 1
dagger -M api call container from --address=alpine with-exec --args=printenv,DAGGER_SESSION_PORT --experimental-privileged-nesting --disable-dagger-in-dagger stdout
# accepted, still exit 1For older versions, I wrote three tiny Dang modules with the same code, where only
The earlier red checks were infra (registry 500 on provision/helm, plus the known |
b79c9ab to
90132de
Compare
Commands should be able to call Dagger without explicitly enabling experimentalPrivilegedNesting. From API v1.0.0-beta.12, enable nesting by default and expose disableNesting for commands that need an independent engine. A false-default opt-out also works with Go's zero-value options. Keep the old argument and opt-in behavior in older API views. Apply the same boundary to exec, services, up and terminals. Check each operation's API view with core.Supports. Internal SDK calls use the latest API even while loading older modules; checking the surrounding server's version instead breaks Python SDK setup. Cover this distinction, terminal defaults and the schema boundary in tests. Refs dagger#13668 Signed-off-by: Guillaume de Rouville <[email protected]>
Regenerate Go, TypeScript, Python, Elixir, PHP and Rust clients for the new API. Go exposes DisableNesting as a plain bool, with no pointer or new() required. Remove redundant opt-ins and empty options from current callers. Keep explicit opt-outs in helpers that connect to independent engines, and retain old arguments in fixtures pinned to older API versions. Cover default nesting, explicit opt-out and legacy opt-in through real execs and services. The nested-terminal test now exercises the default instead of passing the removed CLI flag. Verified with the targeted engine-dev integration set covering nesting, nested services, module versions, terminals and up across SDKs. Signed-off-by: Guillaume de Rouville <[email protected]>
Document v1.0.0-beta.12 as the migration boundary. New API callers can remove experimentalPrivilegedNesting: true; callers that must avoid the current engine use disableNesting: true instead. Older API views retain their opt-in behavior. Update the GraphQL and PHP API references alongside the release note so reviewers and users can see the same option across all entry points. Refs dagger#13668 Signed-off-by: Guillaume de Rouville <[email protected]>
Signed-off-by: Guillaume de Rouville <[email protected]>
Signed-off-by: Guillaume de Rouville <[email protected]>
Signed-off-by: Guillaume de Rouville <[email protected]>
Signed-off-by: Guillaume de Rouville <[email protected]>
Review feedback: name the opt-out after what it turns off, so the argument reads as "disable Dagger in Dagger" rather than a generic "nesting". Applies to withExec, asService, up, terminal, and withDefaultTerminalCmd, plus the regenerated SDK clients and docs. Signed-off-by: Guillaume de Rouville <[email protected]>
v1.0.0-beta.12 through beta.14 shipped while this branch was open, so gating there would retroactively enable nesting for three released versions. Move the boundary to the next unreleased version and pin the schema test rows on either side of it. Signed-off-by: Guillaume de Rouville <[email protected]>
Views drop the prerelease suffix, so every v1.0.0-beta.N client and module gets the v1.0.0 view. Removing experimentalPrivilegedNesting from that view broke released beta modules that still pass it: Go codegen no longer compiled and raw GraphQL calls failed on an unknown argument. Keep the argument in the new view, deprecated and ignored, since nesting is already the default. Older views keep the opt-in behavior. Regenerate SDKs and docs. Signed-off-by: Guillaume de Rouville <[email protected]>
terminalExec selects withExec at the latest view, where experimentalPrivilegedNesting is ignored, so the default terminal command's opt-out was lost. Pass disableDaggerInDagger instead. tui-qa targets v1.0.0 and passed the old argument, so nesting: false was silently ignored. Signed-off-by: Guillaume de Rouville <[email protected]>
1c442e1 to
a00b28f
Compare
….15 (#73) * fix: drop experimentalPrivilegedNesting from the Dang entrypoint The generated entrypoint/main.dang passed it on the exec that runs the TypeScript dispatcher, so the dispatcher could open its own session back to the engine. Container nesting has been on by default since dagger/dagger#14082, which makes the argument redundant everywhere the entrypoint can be loaded at all. Signed-off-by: Tom Chauveau <[email protected]> * feat: generate a module entrypoint by default The `entrypoint` setting becomes `legacyRuntime`, inverted: a module now declares an `[entrypoint]` with entrypoint/main.dang and the __dagger.dispatch.ts it shells out to, and the `[runtime]` layout — sdk/ as the package, a committed __dagger.entrypoint.ts — is what you opt into for an engine too old to load one. The 16 branch sites keep reading in terms of the path they pick, through one private derived field rather than an inverted condition each. The check suite stays on the path it was written against. Gen.scope defaults to `legacyRuntime: true` and says why; the checks that assert the legacy layout by path pin it, the three entrypoint checks pass `legacyRuntime: false`, and the engine-e2e CLI checks pass `--legacy-runtime` because their second half calls the module — which an `[entrypoint]` manifest cannot do until the builder emits a manifestVersion (dagger/dagger#14038). Signed-off-by: Tom Chauveau <[email protected]> * chore: target engine v1.0.0-beta.15 The entrypoint a module now generates by default is only read by an engine carrying dagger/dagger#14038, which first shipped in beta.15 — so that is the release this SDK's bundle is paired with. The nine managed fixture manifests move with it, which is what fixture-engine-version-check holds. The pairing moves without the vendored sources, and library/VENDOR.md records why rather than letting its "move together or not at all" rule go quietly stale: client.gen.ts is regenerated here and already matches beta.15's schema, and the runtimes checks run the committed bundle in a beta.15 engine. Upstream's beta.12–15 changes to the runtime sources are vendoring lag, and taking them is its own change. The SDK module's own engineVersion stays at beta.11: nothing here uses a newer core API, and raising it would lock out the engines --legacy-runtime exists to serve. Signed-off-by: Tom Chauveau <[email protected]> * chore: lock sdk-helpers at v1.0.6 The dependency is the range `dagger.io/sdk/helpers@v1`, so only the two lockfiles held v1.0.5. No call site changes: v1.0.6 makes the generic `withLegacyRuntime` public, and `withLegacyTypescriptRuntime` — which this SDK calls — was already a wrapper around it and is byte-identical in the release. `dagger lock update` also re-resolved four unrelated base-image digests (alpine, busybox, golang 1.26, verdaccio). Those are put back: moving the images everything builds on is its own change, not a dependency bump. The playground's workspace.lock is written by engine-e2e's generator, so the hand-applied edit there is only correct if the generator agrees — `engine-e-2-e:generate/stale` is what says it does. Signed-off-by: Tom Chauveau <[email protected]> * refactor: use legacyRuntime directly instead of a derived field Review: the private `entrypoint` alias was one name for the inverse of another, and a reader had to hold both. Gone — the 16 branch sites test the setting, keeping their branch order so the comment above each one still describes the branch under it. Two sites read better for it: the self-target condition is `legacyRuntime or selfRecorded` rather than a negation of a negation. Signed-off-by: Tom Chauveau <[email protected]> --------- Signed-off-by: Tom Chauveau <[email protected]>
Default nesting (#14082) gave the shell the outer engine's session, so its CLI skipped the dev engine and failed the ClientVersion check. Signed-off-by: Yves Brissaud <[email protected]>
Enable nesting by default, with
disableDaggerInDagger: trueto opt out.Applies to
withExec,asService,up,terminal, andwithDefaultTerminalCmd. API views before v1.0.0-beta.15 keepexperimentalPrivilegedNestingand their existing opt-in behavior. Newer views still accept it, deprecated and ignored, so existing callers keep working. This matters because views drop the prerelease suffix: everyv1.0.0-beta.Nmodule gets thev1.0.0view.Regenerate SDKs and remove redundant opt-ins from current callers. Keep legacy fixtures unchanged.
Compatibility uses the call's API view: internal SDK calls use the latest view even when loading older modules.
Verification
Schema regressions cover the version boundary, internal calls, and terminal defaults:
Engine-backed checks cover exec/service nesting, opt-out, legacy opt-in, nested services, module versions, terminals, and SDK startup:
Fixes #13668