Skip to content

Phase 1 (cont.) — MVP: Apple Containers backend, FileHost bridge, lifecycle orchestrator, dashboard UI - #2

Merged
jimwhite merged 10 commits into
mainfrom
copilot/update-roadmap-with-steps-5-6
Apr 27, 2026
Merged

jimwhite merged 10 commits into
mainfrom
copilot/update-roadmap-with-steps-5-6

Conversation

Copilot AI commented Apr 27, 2026

Copy link
Copy Markdown

Implements Steps 5–8 of ROADMAP.md, completing the Phase 1 MVP on top of the scaffold landed in the previous PR.

Step 5 — apple_containers runtime

  • Real pull / create / start / exec / logs / stop / remove shelling out to the container CLI via tokio::process.
  • Argv shaping and inspect / list JSON parsing extracted into pure functions (apple_containers/cli.rs) and unit-tested.
  • New LogChunk / LogStream / LogOptions surface added to ContainerRuntime; logs stream through a bounded mpsc::Receiver with kill_on_drop so dropping the receiver tears down container logs. Podman/Docker stubs updated.
  • Live integration test gated on the apple-containers-live Cargo feature drives the full pipeline against a fake container shell script — no real binary needed in CI.

Step 6 — FileHost bridge wired end-to-end

  • loadDevContainerConfig / loadAndSubmitDevContainerConfig in frontend/src/devcontainer-engine/index.ts: reads .devcontainer/devcontainer.json through the Tauri-backed FileHost, parses with jsonc-parser, runs pre-container variable substitution, and projects onto a runtime-agnostic ParsedDevContainer.
  • New submit_parsed_devcontainer Tauri command stores the result on the orchestrator keyed by workspace_id.

Step 7 — Lifecycle orchestrator

  • LifecycleOrchestrator owns per-workspace parsed config + container handle and serialises mutating ops with a per-workspace tokio::sync::Mutex.
  • up drives pull → create → start then runs onCreate / updateContent / postCreate / postStart / postAttach via runtime.exec (/bin/sh -c … for string form, raw argv for array form). stop / rebuild / remove are idempotent.
  • Status transitions and hook stdout/stderr emit as devcontainer://status and devcontainer://log Tauri events. container_* commands are thin wrappers; LifecycleCommand and ParsedDevContainer extended with the lifecycle-hook fields.

Step 8 — MVP UI

  • Dashboard with sidebar of workspaces and a detail pane (Up / Stop / Rebuild / Remove), plus an xterm.js log pane subscribed to the lifecycle events. "Open Folder…" uses @tauri-apps/plugin-dialog.

  • src-tauri/capabilities/default.json added so the dialog plugin and existing IPC commands are reachable from the WebView.

  • The deno-built engine bundle is mirrored into frontend/public/devcontainer-engine.js and dynamic-imported by main.ts:

    type EngineModule = typeof import('./devcontainer-engine');
    const engine = (await import(/* @vite-ignore */ '/devcontainer-engine.js')) as EngineModule;

    This keeps Vite from trying to bundle the spec slice's Node built-ins (which only the Deno bundler polyfills) while preserving editor types via the type-only import.

Notes for reviewers

  • initializeCommand is intentionally not executed yet — host-side command execution is gated on the permission model coming in Phase 2.
  • Features, Dockerfile, and Compose configs are still out of scope for v1; only image-based configs are projected onto a ContainerSpec.
  • ROADMAP.md ticked for Steps 5–8.

@jimwhite
jimwhite marked this pull request as ready for review April 27, 2026 09:41
@jimwhite

Copy link
Copy Markdown
Member

Lot of work Copilot locally and we've got something mostly working to run devcontainers using Apple Containers. Deno build time, Rust runtime.

@jimwhite
jimwhite merged commit 76dfbdc into main Apr 27, 2026
2 of 3 checks passed
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.

2 participants