Repository navigation
Description
Context
Filing from calque (github.com/spore-host/calque), a spike consuming spawn as a Go library. calque's design spec assumed a seam of: "lagotto acquires a live instance, then spawn brings it up (launches the workload/container on the already-acquired instance)." Reading the actual source (v0.63.0 checkout, go.mod on main), that seam does not exist as written — filing to confirm the intended model rather than guess.
What we found
-
spawn owns the launch, not "bring-up on a pre-acquired instance."
launcher.Provision(ctx, client, LaunchConfig, Options)(pkg/launcher/provision.go:59) and(*aws.Client).Launch(pkg/aws/client.go:315) call EC2RunInstancesinternally (pkg/aws/client.go:511). There is no exported function that consumes a pre-acquired live-instance handle and launches a workload onto it (noBringUp/Deploy/Run(handle, image)). The only existing-instance surface is the(region, instanceID string)SSM/lifecycle methods:WaitForSSMOnline,RunShellScript,GetInstanceState/PublicIP,WaitForRunning,Terminate,Stop/StartInstance.The package docs actually state the inverse of our assumption: SDK consumers like lagotto call
Provision, andProvisionreturns immediately onInsufficientInstanceCapacity"the case lagotto retries on" (provision.go:133-139). So the real model appears to be spawn = acquisition mechanism (RunInstances), lagotto = retry policy above it. Can you confirm? (Companion issue on lagotto: TBD-link.) -
No exported ECR/container API. All
docker login/pull/runlogic lives inpackage cmd(cmd/app.go,cmd/app_byo.go) and is DCV-streaming-specific — not importable. The library path runs a shell command via cloud-init user-data (LaunchConfig.JobArrayCommand) or SSMRunShellScript. A downstream that wants "run this ECR image" must hand-build theaws ecr get-login-password | docker login && docker pull && docker run <ref>string itself.Ask: is a headless "run container image ref" library primitive (host provisioning + docker run, no DCV) something you'd want? If not, we'll build the command string in calque and log it as an integration leak — just confirming there isn't an exported helper we missed.
-
LaunchResultcarries no launch timestamp and no Region.LaunchResult(pkg/aws/client.go:266) hasInstanceID/Name/PublicIP/PrivateIP/AvailabilityZone/State/KeyNamebut no time field, andTerminatereturns onlyerror. For measuring launch→terminate "rectangle-seconds" (calque's cost basis), we timestamp with our own wall-clock around Launch/Terminate — which is fine, but a returned launch time would remove ambiguity. Minor; flagging only.
None of this blocks calque — we'll adapt to the real API. Filing to (a) confirm the acquisition seam so we build against the intended split, and (b) surface the container/ECR gap in case a library primitive is on your roadmap.
/cc downstream: spore-host/calque
Activity
scttfrdmn commentedon Jul 15, 2026
Confirmed all three findings against current source (now v0.73.0, not the v0.63.0 you read — I checked the delta; see below). Your reading of the model is correct.
The acquisition seam — confirmed as you found it (your assumption was inverted)
spawn owns acquisition (
RunInstances); lagotto is the retry policy above it. There is no "lagotto acquires, spawn brings up a pre-acquired instance" seam, and there shouldn't be. Grounding:launcher.Provision(pkg/launcher/provision.go:59) →client.Launch(provision.go:136) →RunInstances(pkg/aws/client.go:511). spawn is the thing that callsRunInstances.Provision's own doc (provision.go:42-46): it's "the headless equivalent ofspawn launch… so SDK consumers get a fully-functional spore… instead of a naked instance." Andprovision.go:133-139names your exact case: onInsufficientInstanceCapacityit returns immediately, no retry — "the case lagotto retries on."RunInstances+ spored + command + TTL/idle/on-complete); lagotto = the retry/watch policy that callsProvisionrepeatedly. There's no pre-acquired-handle bring-up because bring-up is fused into the launch (user-data), not a second step against a live handle. The existing existing-instance surface is only the(region, instanceID)SSM/lifecycle methods you listed (RunShellScript,WaitForSSMOnline,GetInstanceState/PublicIP,WaitForRunning,Terminate,Stop/StartInstance) — all confirmed present.For calque: build against
launcher.Provisionas the acquire+bring-up primitive; don't expect aBringUp(handle). If you need retry, that's lagotto's job (see lagotto#73) or your own loop keyed onLaunchError.Code(client.go:283, carries the verbatim AWS code — classify without string-matching).2. Headless "run container image ref" primitive — real gap, and I want it
Confirmed: all
docker login/pull/run+ ECR logic lives inpackage cmd(cmd/app.go,cmd/app_byo.go), is not importable, and is DCV-session-bound (the run wrapper wiresDISPLAY/XAUTHORITY/X11 into the container — GUI streaming, not headless). Note this is newer than your v0.63.0 checkout — the BYO-ECR / container-app features landed in v0.69.0 (#290, #392) — but they stayed incmdand DCV-only, so your gap still holds at v0.73.0.Today the headless path is: build the
aws ecr get-login-password | docker login && docker pull && docker run <ref>string yourself and pass it asLaunchConfig.JobArrayCommand(cloud-init) or viaRunShellScript(SSM). That works but pushes ECR-login/GPU-flag/--gpus allknowledge into every consumer.Yes, a headless container primitive is worth having — it's the natural pkg-level extraction of what
cmd/app.goalready does minus DCV. Likely shape: aLaunchConfig.ContainerImage(+ optional registry-auth mode) thatProvisionturns into the login/pull/run bootstrap, so a consumer says "run this image ref" without hand-assembling the string. I'll scope it as a follow-up (it's more than a doc answer). For now, calque hand-building the command string is the correct interim — flag it as the integration leak you already called it.3.
LaunchResulthas no timestamp / no Region — confirmed, will addLaunchResult(pkg/aws/client.go:266) is exactlyInstanceID/Name/PublicIP/PrivateIP/AvailabilityZone/State/KeyName— no launch time, no Region (unchanged since initial release). Adding both is cheap and unambiguously useful (you're timestamping with your own wall-clock for rectangle-seconds; a server-authoritativeLaunchTime+ theRegionthe instance actually landed in removes the guesswork). I'll addLaunchTime time.TimeandRegion stringtoLaunchResult. Low-risk additive change.Net
Provision.docker run, DCV-free). Interim: hand-built command string.LaunchResultRegion + LaunchTime: will add (small additive change, next release).I'll open the
LaunchResultchange now and file a separate tracking issue for the headless-container primitive; will link both here.scttfrdmn commentedon Jul 15, 2026
Follow-up filed. The
LaunchResultRegion + LaunchTime addition is in #352. The headless container-run primitive is tracked separately in #353 (it's a larger design than a doc answer). This issue can close once #352 merges; #353 carries the container work.