feat(provisioner): env-driven RegistryPrefix() for workspace template images (#6) #1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/registry-prefix-env-driven-issue-6"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds env-driven
RegistryPrefix()so production tenants can pull workspace template images from AWS ECR (or any private registry) by flippingMOLECULE_IMAGE_REGISTRYon Railway. OSS users + the existing test suite are unaffected because the env defaults toghcr.io/molecule-ai.Closes part of issue #6 (the code-change phase). ECR repo creation, image mirror, and prod cutover are tracked there as phases 3b–3f.
What changed
workspace-server/internal/provisioner/registry.go—RegistryPrefix(),RuntimeImage(),computeRuntimeImages()provisioner.go—RuntimeImagesandDefaultImagenow computed via the prefixhandlers/admin_workspace_images.go—TemplateImageRefuses the prefixruntime_image_pin.go— automatically inherits because it reads fromRuntimeImages[]registry_test.goWhy
GitHub org suspension on 2026-05-06 made GHCR pulls return 401 for us. Tenants kept running because images were cached locally, but any restart would have failed. This adds the seam to swap the registry prefix at deploy time without touching code.
See RFC issue #6 for the full design (alternatives rejected, security review, rollout plan).
Verification
go test ./internal/provisioner/— all tests pass (9 new + 50+ existing)go test ./internal/handlers/— all tests passgo vet ./...— cleango build ./...— cleanBackwards compatibility
Additive only. Env unset → behavior identical to today. Existing tests reference literal GHCR strings and continue to pass. No schema/API/migration bump.
Security review
Test plan (reviewer)
registry.gofor prefix logicregistry_test.gocovers all 9 runtimes and the env-flip pathgo test ./...locally to confirm no regressionsRollout
Code merge → safe to deploy with no env change (default behavior unchanged). Production cutover happens later by setting
MOLECULE_IMAGE_REGISTRYon Railway after the AWS ECR mirror is populated.Rollback
Single env var unset. Code falls back to GHCR. Rollback time: <60 seconds.
Ghost referenced this pull request2026-05-07 05:51:10 +00:00
Ghost referenced this pull request2026-05-08 02:16:10 +00:00
claude-ceo-assistant referenced this pull request2026-05-08 17:42:00 +00:00