Skip to content

target: per-workspace engines, skrog target and skrog use (#539) - #541

Merged
zcsizmadia merged 1 commit into
mainfrom
feat/per-workspace-engines-539
Oct 13, 2026
Merged

zcsizmadia merged 1 commit into
mainfrom
feat/per-workspace-engines-539

Conversation

@zcsizmadia

Copy link
Copy Markdown
Collaborator

Closes #539. Implements the design in docs/design/per-workspace-engine.md (#140).

What

A named engine is a complete, independent install under <state>\engines\<name>: own distro, VHDX, supervisor, pipe (\.\pipe\skrog-<name>), docker context (skrog-<name>), settings and snapshots.

  • skrog target create|list|remove, skrog use <name>|local (remote use is now the same command)
  • supervisor derives its pipe and context from its state dir; never touches the shared skrog context
  • target: key in skrog.yaml
  • skrog autostart --engine <name> (one Run-key value per engine, opt-in)
  • engine, config, status act on the current target when --state-dir is absent (skipped entirely with no named engines)
  • tray follows the current target; doctor judges the disk floor across every engine's volume
  • shared rootfs download cache; install source selection extracted so install and target create share it
  • docs: docs/targets.md, design notes, cli-json, declarative-install, changelog; reference and completions regenerated

Differences from the design

  • yaml key is target:, not engine: (engine: already holds daemon.json settings)
  • skrog uninstall also removes named engines (prompt lists them), so "removes everything Skrog created" stays true. Running it on a named engine's own state dir is refused in favour of target remove
  • status is scoped to the current target too, since the tray reads it

Known limit

binfmt_misc emulation handlers are kernel-wide, so stopping or removing any engine deregisters them for all. Documented, not fixed.

Testing

  • go test ./..., go vet, gofmt, link check, reference/completions -Check: pass
  • New unit tests: internal/target, autostart per engine, skrogfile target:, doctor multi-engine disk, tray, cmd wiring and JSON shapes
  • New e2e stage PerWorkspaceEngineIsIsolated (create, list, use, image isolation, remove, nothing left behind). Compiled only; not yet run against real WSL. Please run it, or review the create/use/remove paths with that in mind.
  • internal/pipeproxy crashed once in Go's runtime with and without these changes; it passed on rerun.

A named engine is a complete, independent install under
<state>\engines\<name>: its own distro, VHDX, supervisor, pipe, docker
context, settings and snapshots. `skrog target create|list|remove` manages
them, `skrog use <name>|local` switches docker between the shared engine, a
named engine and a remote.

- supervisor derives its pipe and context from its state dir and never
  touches the shared `skrog` context
- `target:` key in skrog.yaml (not `engine:`, which holds daemon.json keys)
- `skrog autostart --engine <name>`: one Run-key value per engine
- engine, config and status act on the current target without --state-dir
- tray follows the current target; doctor judges the disk floor across
  every engine's volume
- shared rootfs download cache (provision.Options.CacheDir)
- install source selection extracted so install and target create share it
- uninstall also removes named engines and lists them in the prompt
- docs/targets.md, design notes, cli-json, changelog; reference and
  completions regenerated; e2e stage added

Known limit: binfmt_misc emulation handlers are kernel-wide, so stopping
any engine deregisters them for all.
@zcsizmadia
zcsizmadia merged commit c8fa8fe into main Oct 13, 2026
7 checks passed
@zcsizmadia
zcsizmadia deleted the feat/per-workspace-engines-539 branch October 13, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement per-workspace engines: target create/list/remove, use, skrog.yaml engine key

1 participant