Repository navigation
feat(instance): wire remote instancer API for spawn, extend, flag, and ps - #62
Merged
Merged
Conversation
ademboukabes
force-pushed
the
feat/instance-remote-control-plane
branch
from
October 13, 2026 19:59
84417a9 to
e7d23e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #48.
Extends the remote instancer control plane so all
mctf instancesubcommands (spawn,extend,flag,ps, alongside existinglistanddestroy) drive the dedicated remote instancer admin API wheninstancer.urlis configured inmctf.config.yml. Falls back to the local on-disk store when unset.What changed
Client Expansion (
internal/instancer/apiclient.go):AdminSpawnRequestandAdminExtendRequeststructs.do()to handle optional JSON request bodies withContent-Type: application/jsonand validatec.adminKey.Spawn(ctx, req)hittingPOST /admin/api/instances/spawn.Extend(ctx, id, durationMinutes)hittingPOST /admin/api/instances/{id}/extend.Flag(ctx, id)hittingGET /admin/api/instances/{id}/flag.MCTF_INSTANCER_ADMIN_KEYis non-empty before making requests and returns clear error.internal/instancer/apiclient_test.gousing httptest servers.CLI Wiring (
cmd/instance.go):instanceSpawnCmdto dispatch tospawnRemoteInstancewhenremoteInstancerURL()is set.instanceExtendCmdto dispatch toextendRemoteInstancewhenremoteInstancerURL()is set.instanceFlagCmdto dispatch toflagRemoteInstancewhenremoteInstancerURL()is set.instancePsCmdto dispatch topsRemoteInstancewhenremoteInstancerURL()is set.newRemoteClienthelper.instancer.urlis unset.cmd/instance_remote_test.go.Documentation & Spec Updates (
docs/commands.md,docs/spec/architecture.md,docs/BACKLOG.md,cmd/instancer.go):docs/commands.mdnoting remote vs local capability.docs/spec/architecture.mddetailing the unified remote instancer control plane.cmd/instancer.gocommand documentation.docs/BACKLOG.md.Verification
make test-coverage: PASS (100% tests pass with race detector)make lint(go vet ./...+golangci-lint run ./...): PASS (0 issues)make build: PASS./mctf -C examples/sample-event validate: PASS./mctf -C examples/sample-event generate --check: PASS