Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(agent): add devcontainer autostart support#17076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mafredri merged 15 commits intomainfrommafredri/feat-agent-devcontainer-autostart
Mar 27, 2025

Conversation

mafredri
Copy link
Member

@mafredrimafredri commentedMar 24, 2025
edited
Loading

This change adds support for devcontainer autostart in workspaces. The preconditions for utilizing this feature are:

  1. Thecoder_devcontainer resource must be defined in Terraform
  2. By the time the startup scripts have completed,
    • The@devcontainers/cli tool must be installed
    • The given workspace folder must contain a devcontainer configuration

Example Terraform:

resource"coder_devcontainer""coder" {agent_id=coder_agent.main.idworkspace_folder="/home/coder/coder"config_path=".devcontainer/devcontainer.json"# (optional)}

Closes#16423

Demo of an auto-started Dev Container (logs, timings):

image

Demo of devcontainer defined in Terraform, but not enabled on the agent:

image

Demo of errors being propagated via script:

image

johnstcn reacted with heart emoji
mafredri added a commit that referenced this pull requestMar 25, 2025
In the presence of multiple devcontainers, it would be nice todifferentiate them by name. This change inherits the resource name fromterraform.Refs#17076
@mafredrimafredriforce-pushed themafredri/feat-agent-devcontainer-autostart branch fromcfea2b6 to779c763CompareMarch 25, 2025 13:14
@mafredrimafredriforce-pushed themafredri/feat-agent-devcontainer-autostart branch from779c763 toe1048b1CompareMarch 25, 2025 13:16
@mafredrimafredriforce-pushed themafredri/feat-agent-devcontainer-autostart branch from41fddac to1c5a1dbCompareMarch 26, 2025 12:50
@mafredrimafredriforce-pushed themafredri/feat-agent-devcontainer-autostart branch from1c5a1db to2d93ee3CompareMarch 26, 2025 12:52
@mafredrimafredri changed the titlewip: feat(agent): add devcontainer autostart supportfeat(agent): add devcontainer autostart supportMar 26, 2025
@mafredrimafredri marked this pull request as ready for reviewMarch 26, 2025 13:01
@mafredrimafredriforce-pushed themafredri/feat-agent-devcontainer-autostart branch 2 times, most recently fromc78665a toffc2981CompareMarch 26, 2025 13:41
@mafredrimafredriforce-pushed themafredri/feat-agent-devcontainer-autostart branch fromffc2981 to9c1bf01CompareMarch 26, 2025 13:43
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nothing blocking from my side!

@@ -80,6 +80,21 @@ func New(opts Options) *Runner {

type ScriptCompletedFunc func(context.Context, *proto.WorkspaceAgentScriptCompletedRequest) (*proto.WorkspaceAgentScriptCompletedResponse, error)

type runnerScript struct {
runOnPostStart bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

suggestion: this is fine for now, but I could see this being an option onWorkspaceAgentScript in future.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It's a good call-out 👍. I hope we figure out a better way to define dependencies or ordering for start scripts, though.

@mafredrimafredriforce-pushed themafredri/feat-agent-devcontainer-autostart branch from3e0c2a0 to55c5c46CompareMarch 26, 2025 16:37
Copy link
Contributor

@DanielleMaywoodDanielleMaywood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

looks good to me:shipit:

mafredriand others added2 commitsMarch 27, 2025 11:42
Co-authored-by: Danielle Maywood <danielle@themaywoods.com>
@mafredrimafredri merged commit7d4b3c8 intomainMar 27, 2025
30 checks passed
@mafredrimafredri deleted the mafredri/feat-agent-devcontainer-autostart branchMarch 27, 2025 10:31
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 27, 2025
@matifali
Copy link
Member

/cherry-pick release/2.21

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

@DanielleMaywoodDanielleMaywoodDanielleMaywood approved these changes

@defelmnqdefelmnqAwaiting requested review from defelmnq

Assignees

@mafredrimafredri

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Agent: allow automatically starting a devcontainer defined in template
4 participants
@mafredri@matifali@johnstcn@DanielleMaywood

[8]ページ先頭

©2009-2025 Movatter.jp