Repository navigation
Conversation
Author
Member
|
@dluman I just published them. |
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.
Description
Adds two minimal templates that serve Agent Relay sessions for both Claude Code and Cursor, one ephemeral workspace per session:
kubernetes-agent-relay: one Kubernetes Pod per session.docker-agent-relay: one Docker container per session.Each pool selects its runner through
template_parameters(self_hosted_provider=claudeorcursor), and only that runner's module is instantiated. Both templates useagent-relay-claude-code/agent-relay-cursor, report the requiredagent_relay_statusmetadata, declare thegithubexternal auth as optional, and addgit-config. Each keeps one prebuilt workspace per provider, through a preset that pins onlyself_hosted_provider, so a session claims a running workspace instead of starting cold.The READMEs carry the template-side guidance from the Agent Relay deployment guides: template settings (job cancellation, ACL, no quota, finite TTL, dormancy deletion), dedicated provisioners, image requirements, default-deny egress with the minimum hosts per provider, and log retention.
Both templates pin
agent-relay-claude-codeandagent-relay-cursorto1.0.0, which receive the relay's credential as an ephemeral workspace secret. That requires Coder 2.39.0 and Agent Relay v0.14.0 or newer; the module comments and READMEs give0.4.0/0.7.0as the pins for older deployments.Important
Draft until Coder 2.39.0 and Agent Relay v0.14.0 are released, so the templates can be exercised end to end.
Type of Change
Template Information
Path:
registry/coder/templates/kubernetes-agent-relay,registry/coder/templates/docker-agent-relayTesting & Validation
terraform fmt -check,prettier --check)go run ./cmd/readmevalidation)scripts/terraform_validate.shpasses for both against the published 1.0.0 modulesterraform applyagainst a local daemon created the container (image pulled on demand), anddestroycleaned it up. No Coder deployment was involved, so no relay session ran.prebuildsuser, then planned with a new owner and name,CODER_WORKSPACE_IS_PREBUILD_CLAIM=trueand the reused agent token. The container updates in place rather than being replaced.Related Issues
0.5.0/0.8.0, which were never tagged, so these templates point to0.4.0/0.7.0instead.Decision log
self_hosted_provideras the parameter name so existing pooltemplate_parameterswork unchanged.self_hosted_provider.self_hosted_provider. A build claims a prebuild only when every preset parameter is in the request with an equal value, and the relay sends only its own parameters plus the pool'stemplate_parameters. One instance each, expired hourly so a session never starts on a stale:latestimage or CLI.arch = "amd64":ghcr.io/coder/agent-relay-workspace:latestis published for amd64 only.restart_policy = "Never"(Kubernetes), 30s grace / stop timeout: the relay deletes the workspace when the runner exits, and the modules' stop scripts need about 30s.dockertemplate (socket variable,host.docker.internalrewrite) except for naming. A claim changes owner and workspace name, and Docker replaces a container whose name, hostname or labels change, so the container is namedcoder-<workspace id>, sets no hostname and carries only acoder.workspace_idlabel. The agent token is reused across a claim, soenvis stable. The Kubernetes Pod is named by workspace ID and keeps owner data in labels and annotations, which patch in place.agent_relay_session_attachedmetadata added (optional in the module READMEs) so an operator can see whether a runner holds a session.install_clileft at its default, with a comment. It is a no-op when the CLI is onPATH; forcingfalsewould break anyone who swaps in an image without the CLIs.coder_workspace_tagswould leave buildspendingon deployments without matching provisioners.coder_agent.dirpointing at it, and the Cursor module does not exposeagent_relay_cursor_repo_urlto the template (no output or env), so a template cannot clone the pool's repository today.Raised by Coder Agents on behalf of @dluman.