Skip to content

Windows machine as a pool node: node agent and lanes in a Docker-in-Docker container #168

Open

Description

@7schmiede

Context

A Windows machine can join a pool and ask for lanes, but it cannot run lanes for others (pool.md: "a Windows machine asks for lanes but does not run them yet"). On Windows the share switch only reports capacity: no node agent runs, the machine reports no API, and the coordinator refuses it ("runs no node agent"). Other members never see it as a place to start.

A lane runs as a Linux container, with a static Linux devstack mounted into it (ADR-0028 point 2). The agent provides that binary only when it is a Linux build itself (linux_binary() in crates/devstack-node/src/node.rs). On Linux, the agent, Docker and the lanes share one kernel: the agent's paths are Docker's paths, its iptables are the bridges' iptables, /proc is the machine.

Direction (owner, 2026-10-21): real Docker-in-Docker. The Windows devstack starts one privileged Linux container (e.g. docker:dind) in Docker Desktop. That container holds its own Docker daemon, the node agent (the static Linux release binary of the same version) and every guest lane. The alternative was the agent beside Docker Desktop with the host's Docker socket (the existing "agent in a container" mode). Docker-in-Docker was preferred for two reasons:

  • A hard cap: --cpus/--memory on the one container bound all guest lanes together. That matters on a machine someone works at.
  • Separation: own image cache and disk (one volume, removable at once), and no access to the user's own containers.

This issue collects what to decide. An ADR follows (it extends ADR-0025 and ADR-0033; ADR-0011 is about Windows-native), then the code.

To decide

  1. Identity in the pool. The container needs its own membership, or it shares the Windows machine's.
    • Own membership: it joins once and an admin grants it as a node, so the machine appears twice. Needs a link ("node of ") in the pool view and in placement.
    • Shared membership: one member, two reporters (the hub and the agent). The coordinator would have to merge their reports.
  2. Lifecycle and UI.
    • Who starts and stops the container: the share switch on Windows, or devstack node host on|off, or both?
    • What happens when Docker Desktop is not running? Autostart with --restart unless-stopped?
    • Updates: the same version as the Windows devstack, swapped when it updates. Lanes running at that moment are drained or stopped.
  3. Image and binary.
    • Base: a stock docker:dind with the static musl devstack mounted from the Windows install (downloaded from the release, checked against SHA256SUMS), or our own image on ghcr?
    • Pinning: by version and digest.
  4. Capacity.
    • Inside the container /proc shows the WSL2 VM, not Windows.
    • Who computes "half of what is free": the Windows hub, which knows the real values, passing them in?
    • How caps from the share settings become --cpus/--memory, and what happens when they change: a restart of the container, or docker update.
  5. Network.
    • The agent's port (4261) published to the Windows host, plus a Windows firewall rule. Who creates the rule: does it need elevation once?
    • --api address: the LAN IP changes on a laptop. Report it fresh, or use a hostname?
    • Egress rules (ADR-0033): iptables of the inner daemon, inside the DinD container. Verify that guest traffic is filtered and that the user's LAN and the Windows host stay unreachable unless allowed.
  6. Security.
    • --privileged is needed for DinD. An escape lands in Docker Desktop's VM (not in Windows directly), but that VM also runs the user's own containers.
    • Is that acceptable for a developer machine?
    • Rootless DinD or Sysbox as alternatives?
  7. Storage.
    • Inner /var/lib/docker on a named volume, so images and kept lanes survive a restart.
    • Disk cap and pruning (keep_lanes_gib, ADR-0038).
    • The WSL2 ext4.vhdx grows and does not shrink by itself.
  8. Availability.
    • A laptop sleeps and Docker Desktop may be off, so such a node is never --dedicated.
    • What happens to leases on sleep: the lane's data outlives its lease (ADR-0038).
  9. GPU. Docker Desktop passes NVIDIA GPUs through WSL2 (--gpus). The inner daemon needs the NVIDIA container toolkit. Supported from the start, or later?
  10. Transparency. Guest lanes are invisible in Docker Desktop's UI (they run in the inner daemon). The dashboard shows them (guest lanes, feat(pool): show lanes of other members that run on this machine #167). Is that enough?

Spike before the ADR

On one Windows 11 machine with Docker Desktop (WSL2), by hand:

  1. docker:dind with caps.
  2. The static devstack in it, devstack join, an admin grants it as a node.
  3. A lane started from another member.

Check:

  • the egress rules,
  • the firewall,
  • the reported capacity,
  • a restart of Docker Desktop and of the machine,
  • disk use.

Meanwhile

On Windows the share switch is disabled and says why (#169). Today it reports capacity that nobody can use.

Activity

  1. added
    icebox
    on Oct 28, 2026
  2. added 4 commits that reference this issue on Nov 18, 2026
  3. 7schmiede commented on Nov 18, 2026

    @7schmiede
    MemberAuthor

    Spike result: a Windows machine's GPU as a pool node, through WSL2

    Branch spike/168-wsl-gpu-node (runbook, check.sh, a smoke stack). Not Docker-in-Docker: the released Linux node agent in a WSL2 distribution.

    Setup: Windows 11, WSL 2.6, an NVIDIA RTX 5070 Ti (16 GiB). A distribution of its own (Ubuntu 24.04) with Docker Engine and the NVIDIA Container Toolkit (Docker Desktop's WSL integration off for it), networkingMode=mirrored, a Hyper-V firewall rule for 4261, devstack 0.49.4. check.sh: 0 FAIL.

    Result:

    • The agent joined as a member of its own, an admin granted it as a node; it reports its CPU, memory and the GPU (devstack.node.gpus = 1).
    • Another member started the smoke lane on it with devstack up --on <pool>:<node>: lease, sync and start within seconds; the Compose service with an nvidia reservation printed nvidia-smi's table with the GPU. Other members reach the agent's port through mirrored networking and the Hyper-V rule.
    • ADR-0112 (a lane holds its GPUs, its container gets them) was not on the node yet: it takes the next release.

    Learned on the way:

    • devstack join run in PowerShell instead of the distribution finds the machine's existing membership and answers "joined" at once, with no new request.
    • wsl --shutdown (after changing .wslconfig) ends Docker Desktop too.
    • .wslconfig's memory= caps the whole distribution: the agent's --max-memory-gib belongs below it.
    • install.sh puts devstack in ~/.local/bin, not on PATH in a root shell wsl -d opens.
    • A lane's stack file must be at the root of its worktree.
    • The agent runs in a terminal window: closing it, or the machine sleeping, takes the node offline.

    For this issue's questions:

    • 9 (GPU): works through WSL2 with the toolkit in the distribution.
    • 5 (network): mirrored networking plus one Hyper-V firewall rule (elevated once).
    • 1 (identity): the machine shows twice (its Windows hub, the agent in WSL); the Windows side's node grant was taken back by hand.
    • 6 (security), 3 (image), Docker-in-Docker itself: not answered; this way needs no --privileged container, but a distribution with its own engine.
  4. 7schmiede commented on Nov 18, 2026

    @7schmiede
    MemberAuthor

    Released in 0.50.0: the share switch runs the node agent in a WSL2 distribution on Windows (ADR-0113, #580), the way of this issue's spike rather than Docker-in-Docker; GPUs per lane (ADR-0112, ADR-0114). Left open until the switch has run on a real Windows machine with WSL (the spike's machine is next); then this closes with what that showed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    icebox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions