-
Notifications
You must be signed in to change notification settings - Fork 894
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
63a2ec1
wip: feat(agent): add devcontainer autostart support
mafredri d7480cb
docs
mafredri 9bfdfaf
expand
mafredri 304b1a1
devcontainer scripts and timings
mafredri e1048b1
use name, print warning
mafredri d85e9a2
refactor
mafredri 7954f8d
tmpl
mafredri 234fc25
test
mafredri 2d93ee3
add integration test
mafredri 9aca1c8
unfoo
mafredri 9c1bf01
add agentscripts test for execute option
mafredri ef089be
safe assign
mafredri 55c5c46
improve logger, fix config path realtive to workspace folder
mafredri 4676898
Update agent/agentcontainers/devcontainer.go
mafredri f797b41
skip path separator tests on windows
mafredri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
wip: feat(agent): add devcontainer autostart support
- Loading branch information
commit 63a2ec149b72145a10d466909e221e34a1f09e92
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package agentcontainers | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/google/uuid" | ||
|
||
"github.com/coder/coder/v2/codersdk" | ||
) | ||
|
||
func DevcontainerStartupScript(dc codersdk.WorkspaceAgentDevcontainer) codersdk.WorkspaceAgentScript { | ||
script := fmt.Sprintf("devcontainer up --workspace-folder %q", dc.WorkspaceFolder) | ||
if dc.ConfigPath != "" { | ||
script = fmt.Sprintf("%s --config %q", script, dc.ConfigPath) | ||
} | ||
return codersdk.WorkspaceAgentScript{ | ||
ID: uuid.New(), | ||
LogSourceID: uuid.Nil, // TODO(mafredri): Add a devcontainer log source? | ||
LogPath: "", | ||
Script: script, | ||
Cron: "", | ||
Timeout: 0, | ||
DisplayName: fmt.Sprintf("Dev Container (%s)", dc.WorkspaceFolder), | ||
} | ||
} |
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
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.
There was a problem hiding this comment.
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 on
WorkspaceAgentScript
in future.There was a problem hiding this comment.
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.