# infra/install.ps1: put a Windows machine to work for Unitfabric, through WSL2 (Plan U2). The site serves it; in an # administrator PowerShell: # $env:UNITFABRIC_SUPPLY_TOKEN = ''; & ([scriptblock]::Create((irm https://unitfabric-site.vercel.app/install.ps1))) -ControlUrl # The supply token comes from UNITFABRIC_SUPPLY_TOKEN or, left out, is asked for (without echoing it): never a parameter, # so that no process's command line carries it. The line above, as typed, stays in PowerShell's history for the token's # day: the token enrols only machines its org then confirms, and the org revokes it at once (the Machines page, or # `unitfabric supply tokens revoke`); leave out the line's first statement to be asked for the token instead. # Windows itself runs no jobs: a WSL2 distribution of its own does, Unitfabric (Ubuntu 24.04, imported fresh from Ubuntu's # image; the user's own distributions are never used or changed), with the GPU through the Windows NVIDIA driver (nothing # is installed for it inside Linux), no checkpointing (a lost lease's units restart, so only jobs whose units are short # come to it), no Windows drive mounted in it and no Windows program callable from it (automount and interop off), and its # agent under systemd. This, idempotently: # 1. checks the machine (-Check stops here, changing nothing); # 2. installs WSL if it is missing (Windows then restarts once: run this again afterwards), and imports the distribution; # 3. sizes the WSL2 VM in %UserProfile%\.wslconfig, adding only what it lacks (memory: three quarters of this machine's, # or -MemoryGB; swap -SwapGB), after a copy of it as it was (.wslconfig.unitfabric-