-
Notifications
You must be signed in to change notification settings - Fork 881
Devcontainer Integration (coderd, agent, ui and IDEs) #15143
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
If any contributors or developers from coder want to work on the blockers I'll be more than happy. Any feedback and help appreciated. Feel free to reach me on slack/discord |
@ggjulio That's a wonderfully detailed comment, thank you! I'm going to take some time to read through it and make sure I don't miss anything. |
I like your idea of a This would allow a customizable and tight integration that template authors can tailor to their needs.
Some other comments:
Noted -- we'll have to take devcontainers into account with our upcoming prebuilds feature.
More docs are always good, but "any VM" is a fairly broad statement. Could you clarify what you mean by this?
I'm not too familiar with the internals of VSCode or JetBrains IDEs, but updating the Coder UI to reflect the port configurations would be fairly trivial if the parsed devcontainer spec were available in the template as HCL.
As far as I can tell, this is simply a case of being able to run a command and send the logs to Coder. There are existing API endpoints for logging, but AFAIK they're not too friendly for piping logs from a CLI tool. There's probably scope for improvement here. |
Thank you for the rapid feedback. data "coder_parameter" "some_secret" {
name = "some_secret"
sensitive = true # TODO
}
data ... {
// [...]
secrets = {
# user should get prompted for this at build time
"some_secret": data.coder_parameter.some_secret.value
}
} This approach creates coupling between the template and repositories.
I wrote how devcontainer secrets could be implemented in a generic manner. ( any feedback appreciated. ) Proposal in shortBased on the user input of Once we have the secrets saved in the DB or vault, provisionerd will start do it's job on the generic template. --secrets-file Path to a json file containing secret environment variables as key-value pairs. [string] We could create a new command that will query Output of the command : // file /path/to/secrets.json
{
"API_KEY_SERVICE_1": "secret-value1",
"API_KEY_SERVICE_2": "secret-value2",
"ARTIFACTORY_TOKEN": "secret-value2",
"...": "..."
} Then simply running the devcontainer would to the job : What are your concerns about the scm interface + implem being part of the
The issue with this approach it's that devcontainer spec may change without a reprovision of the workspace via provisionerd.
IMHO, things like reflecting the ports should be done at runtime. Further, if the agent can read devcontainer configs it may fix other issues and let more room for improvements/features
Not sure if that's the best way to do. Which also then would makes it's easier to implement other IDEs extentions, like fleet, cursor, zed ?
Agree I wasn't clear about this, I'll should have explained... In short I provision VMs internally and currently I can only provision some Rhel based distro, and never got dind feature working.
Agree, a friendly way of piping any command would be nice. |
Thanks a lot for the detailed feedback! |
Coder was the first alternative to
codespaces
.But as of Oct. 2024 it lack behind
gitpod
anddaytona
in term ofdevcontainer
support.IMHO this is a critical issue that should be fixed.
Context
Since the first release of
envbuilder
in sept 2023 we got a bunch of really nice releases notes. 🚀But none included a mention of some form of devcontainer integration with
coder
. 💔Coder's concurrents don't care about re-implementing the whole
devcontainer spec
.Instead they just use the devcontainer cli and focus their time on the
UX
andintegration
.The only advantage of
envbuilder
I see is for running workspaces as pod, that's it.For workspaces as VM
envbuilder
currently does not make any sense to me.The official implem is currently much better because it implements the whole spec.
(prebuilds, secrets, merge configs (features, extensions, etc..), output effective conf, lock file, dotfiles, compose...)
As a user I really like coder's flexibility, but the devcontainer DevX is just bad.
It's makes me reconsider less flexible alternatives like
daytona
.I hope
coder
will focus now on filling the feature parity gap withdaytona
,gitpod
and hopefullycodespaces
.Implementation Proposal
In a similar way github do,
coder
should query the SCMaaS provider to know which branches exists and fetch the current configuration.In short
coderd
and theagent
must be able to parse a devcontainer config.Respectively before
provisioning time
and duringruntime
.Before the workspace creation form is submitted
coderd
must fetch and parse the devcontainer config. (for features like secrets, prebuilds, hardware requirements... )How
SCM provider
interface + implement each supported providers ( github, gitlab, bitbucket server...)kind
incoder_parameter
. (whenkind
is setvalidate
field become useless)Each values bind to it's own method in
coderd
.Theses methods will autocomplete / validate the
coder_parameter
through websockets. (they'll use the scm interface for fetching data)Config example :
First it will improve the DevX with completion / validation on fields like
branch
,devcontainer config
.And then enable implementing important features such as devcontainer secrets and
prebuilds
...Going further
The proposal above is quite flexible and could be reused outside of
devcontainers
.The SCM provider could be extended for other use-cases.
As example it could be reused for features related to gitops and the new coderd tf provider.
It could show infos of the gitops repo(s) right in the UI or CLI. (taking inspiration from
argocd
)It also enable fetching a config file like
coder.yaml
from a repository to configure features like prebuilds.The
kind
field can also be used for other purposes.We could think of a way to let template admins define their own custom
values
andmethods
to validatecoder_parameters
.Some examples would be validate / autocomplete :
artifactory
or equivalent.Any feedback / enhancements welcomed, feel free to reach out to me on slack/discord
Happy to help
If the proposal is accepted as is, here are the blockers to solve.
Issues (blockers)
SCMaaS
interface and implement each supported providers. (github, gitlab, bitbucket server...)coderd
andcoder agent
must be able to parse a devcontainer spec. (reuseenvbuilder
code ?)kind
incoder_parameter
. See exampleValues of
kind
aregit_branch
,git_repository
,devcontainer_config
, maybescm_provider
andscm_project
Devcontainer Issues (partially sorted by criticality)
vscode
<-->web ui
vscode web
share ports trough url. (current workaround -> useweb ui
)customization.jetbrain.*
)devcontainer-cli
<->coder agent
, ( see solution)Maybe a new cmd to makes it easier :
CODER_TOKEN=... coder exec -- echo 'Agent not started yet but this appears in the UI.'
The text was updated successfully, but these errors were encountered: