-
Notifications
You must be signed in to change notification settings - Fork 0
agent: support recreating a running devcontainer #481
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
Comments
I did some experimentation to verify the role of For instance, "entering devcontainer" in VS Code does not specify any custom labels, these defaults will be used: {
"devcontainer.config_file": "/home/coder/coder/.devcontainer/devcontainer.json",
"devcontainer.local_folder": "/home/coder/coder"
} These are the same ones created by
VS Code is also able to connect into the new container created by Where things get a bit interesting is when For instance, a dev container started with:
Will not create either {
"coder": "coder"
} This devcontainer won't be detected by VS Code and will also be filtered out by our current agentcontainers implementation/usage. We don't need to support the custom label use-case, and we can always expect that For container re-recreation, we can specify both from the docker container label just to be sure that's the one we re-create. |
This change implements an interface for running `@devcontainers/cli up` and an API endpoint on the agent for triggering recreate for a running devcontainer. A couple of limitations: 1. Synchronous HTTP request, meaning the browser might choose to time it out before it's done => no result/error (and devcontainer cli command probably gets killed via ctx cancel). 2. Logs are only written to agent logs via slog, not as a "script" in the UI. Both 1 and 2 will be improved in future refactors. Fixes coder/internal#481 Fixes coder/internal#482
Required by coder/coder#16424
Given a running devcontainer, provide the ability for the agent to recreate the devcontainer.
Here is the sample invocation of recreating a devcontainer as performed by the VSCode Devcontainer plugin:
Things to note:
devcontainer-cli
really needs--id-label
in conjunction with--remove-existing-container
in order for it to know which container to delete.devcontainer.json
(for example,userEnvProbe
can be specified in devcontainer.json), and which we need to figure out on the fly.The text was updated successfully, but these errors were encountered: