You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Standalone workspace directly on Coder host, no templates #2108
For simple Coder deployments, it would be great to code directly on the Coder host (where you deployed Coder). Similar to cloud shells in AWS, GCP, Azure, or Proxmox.
deploy Coder and instantly have a workspace + web IDE
create/edit templates directly via the web terminal/code-server
deploy Coder on AWS with one-click, log in, add templates
use Coder in "single player mode" without having to create templates
quick time to IDE like code-server, but with support for desktop IDEs + JetBrains
install cloud CLIs for use with templates (aws-cli, terraform, gcloud, kubectl)
Since this poses a risk for large-scale deployments or IaC-only environments, a feature like this should be:
optional: enabled/disabled via an environment variable
role-restricted: only admins (or the "admin" user) can use it
Would something based on Docker or Docker Compose be appropriate here?
I imagine this would be similar/equivalent to (pre)installing the Docker template on Coder and creating a workspace? I think this would work well in many cases. A "kitchensink" Dockerfile with aws-cli, gcloud, terraform, kubectl, and code-server can be provided. However, it's unclear to me how the user would add additional dependencies to an image, if they wanted to authenticate with more cloud CLIs or use the host as a single-user dev machine.
Serving a workspace directly on the host achieves something closer to code-server's Install -> Add dependencies -> Start coding flow. There's no need to modify container images or templates. Just set up like any new computer. There are advantages and disadvantages to both 🤷🏼
It's also worth mentioning that Proxmox and GitHub Enterprise give the "installer/admin account" direct access to the host through their product (for configuration/debug purposes). Because of this, I'm not convinced this feature request is an anti-pattern, but I see why it should be disabled in many deployments that prefer to use IaC/GitOps to the manage Coder host environment and templates.
I think @spikecurtis has ideas here that could solve this.
I don't think it's wise to give what's basically a remote shell on a service host. Those others can do whatever they want; I see too much risk here. I'm surprised they get by security reviews with that; maybe being able to disable it suffices? I'm willing to force a small inconvenience on a customer to enable this in exchange for avoiding the chance that this capability exists and surprises them, potentially in a bad way.
The more I think about it, it doesn't really matter if a container has aws-cli or gcloud, because it must be present on the host itself to work with Coder templates.
Maybe some mounted home volume magic on a container could give us the best of both worlds
@bpmct for those who might not be familiar, can you explain what you mean by Coder host? Like is this a sandbox, is this a "trial provider" or something else?
And also the motivation (maybe mention time to first workspace, reducing friction for trying out the product)
A Coder host would be whatever machine you are hosting Coder on (laptop, AWS VM, container, etc) @khorne3 is working on a doc that should help us align on terminology ;)
Re: "time to first workspace" - we discussed how this compares in v2 vs code-server. Hoping that using a Coder host would reduce this and make it easier to try out the product.
Calling direct, un-encapsulated access to the Coder host a "workspace" feels like a bad plan. After all, the person who deploys coder to a server almost certainly already has SSH (or similar) access to that machine. We are not providing any value by recreating that access.
One other observation is that currently, the coder install just installs the coder binary, and so basically everything will fail because Terraform isn't installed. So, there is a whole pre-req that we need to include in our installer or document. We could include an optional step to get Docker installed, at which point we could get a Dockerized workspace running on the same host fairly easily.
so basically everything will fail because Terraform isn't installed
Terraform isn't required on the host to use Coder.
After all, the person who deploys coder to a server almost certainly already has SSH (or similar) access to that machine. We are not providing any value by recreating that access.
I think it would provide equal value as code-server (use web IDE) + additional value to connect to different web apps or IDEs. If we want to consider Coder a natural progression from using code-server, this "direct host" model starts to make a bit more sense, but I can see the downsides.
We could include an optional step to get Docker installed, at which point we could get a Dockerized workspace running on the same host fairly easily.
I do agree this is the best solution, if the home volume in the container shared with a host "coder" user. Then, for example, one could authenticate with AWS from the container and ~/.aws/config is used by the host. Same for kube context, google cloud, etc.
I'm in support of the proposal. We are adding value through convenience. Want to quickly manage your Coder deployment? Open it up in code-server.
I think we can achieve this without additional configuration, too.
The admin role as it stands is a misnomer. It should probably be "root" or "deployer". I prefer "root" since everyone knows you're not supposed to use "root" except transiently. Everyone also knows "root" is dangerous.
Our "root" user already has full shell access to every workspace, letting them steal secrets and manipulate workspaces at will. We have clear instructions from our customer that this is a Big Bad. Our major deployments will disable the root user. Thus, we're only adding marginal risk by letting the root user shell into the box.
Finally, this is a convenience feature so it's easily reversed. If the security costs outweigh the virality benefits, we remove it.
Terraform isn't required on the host to use Coder.
It's not required for coderd, but it is for provisionerd and today, these run in the same process. We have future plans to allow people to run a standalone provisionerd, but it is not yet supported. In any case, the scenario we're discussing here is a single-machine deployment of Coder and so terraform needs to be installed. Ignore me here, wasn't aware that the provisioner downloads terraform if it isn't present.
Want to quickly manage your Coder deployment? Open it up in code-server.
This makes some sense to me for provisionerd, since we recommend that they run it with the environment authenticated with cloud providers.
With the caveat that coderd and provisionerd are currently joined at the hip, I don't think it makes sense to configure coderd with a remote IDE, because other than very low level config required for coderd to function at all (postgres connect string, access URL, etc), coderd doesn't have persistent state on the host machine. Our goal is to allow all the configuration that matters for coderd to be configured via APIs (and by extension, the CLI and WebUI).
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
Activity
ketang commentedon Jun 7, 2022
Absolutely positively disabled by default.
Would something based on Docker or Docker Compose be appropriate here?
bpmct commentedon Jun 7, 2022
I imagine this would be similar/equivalent to (pre)installing the Docker template on Coder and creating a workspace? I think this would work well in many cases. A "kitchensink" Dockerfile with
aws-cli,gcloud,terraform,kubectl, andcode-servercan be provided. However, it's unclear to me how the user would add additional dependencies to an image, if they wanted to authenticate with more cloud CLIs or use the host as a single-user dev machine.Serving a workspace directly on the host achieves something closer to code-server's
Install->Add dependencies->Start codingflow. There's no need to modify container images or templates. Just set up like any new computer. There are advantages and disadvantages to both 🤷🏼It's also worth mentioning that Proxmox and GitHub Enterprise give the "installer/admin account" direct access to the host through their product (for configuration/debug purposes). Because of this, I'm not convinced this feature request is an anti-pattern, but I see why it should be disabled in many deployments that prefer to use IaC/GitOps to the manage Coder host environment and templates.
ketang commentedon Jun 7, 2022
I think @spikecurtis has ideas here that could solve this.
I don't think it's wise to give what's basically a remote shell on a service host. Those others can do whatever they want; I see too much risk here. I'm surprised they get by security reviews with that; maybe being able to disable it suffices? I'm willing to force a small inconvenience on a customer to enable this in exchange for avoiding the chance that this capability exists and surprises them, potentially in a bad way.
bpmct commentedon Jun 7, 2022
The more I think about it, it doesn't really matter if a container has aws-cli or gcloud, because it must be present on the host itself to work with Coder templates.
Maybe some mounted home volume magic on a container could give us the best of both worlds
jsjoeio commentedon Jun 7, 2022
@bpmct for those who might not be familiar, can you explain what you mean by Coder host? Like is this a sandbox, is this a "trial provider" or something else?
And also the motivation (maybe mention time to first workspace, reducing friction for trying out the product)
bpmct commentedon Jun 7, 2022
A Coder host would be whatever machine you are hosting Coder on (laptop, AWS VM, container, etc) @khorne3 is working on a doc that should help us align on terminology ;)
Added one sentence about time to first workspace
jsjoeio commentedon Jun 7, 2022
Re: "time to first workspace" - we discussed how this compares in v2 vs code-server. Hoping that using a Coder host would reduce this and make it easier to try out the product.
spikecurtis commentedon Jun 7, 2022
Calling direct, un-encapsulated access to the Coder host a "workspace" feels like a bad plan. After all, the person who deploys coder to a server almost certainly already has SSH (or similar) access to that machine. We are not providing any value by recreating that access.
One other observation is that currently, the coder install just installs the coder binary, and so basically everything will fail because Terraform isn't installed. So, there is a whole pre-req that we need to include in our installer or document. We could include an optional step to get Docker installed, at which point we could get a Dockerized workspace running on the same host fairly easily.
bpmct commentedon Jun 7, 2022
Terraform isn't required on the host to use Coder.
I think it would provide equal value as code-server (use web IDE) + additional value to connect to different web apps or IDEs. If we want to consider Coder a natural progression from using code-server, this "direct host" model starts to make a bit more sense, but I can see the downsides.
I do agree this is the best solution, if the home volume in the container shared with a host "coder" user. Then, for example, one could authenticate with AWS from the container and
~/.aws/configis used by the host. Same for kube context, google cloud, etc.ammario commentedon Jun 7, 2022
I'm in support of the proposal. We are adding value through convenience. Want to quickly manage your Coder deployment? Open it up in code-server.
I think we can achieve this without additional configuration, too.
The admin role as it stands is a misnomer. It should probably be "root" or "deployer". I prefer "root" since everyone knows you're not supposed to use "root" except transiently. Everyone also knows "root" is dangerous.
Our "root" user already has full shell access to every workspace, letting them steal secrets and manipulate workspaces at will. We have clear instructions from our customer that this is a Big Bad. Our major deployments will disable the root user. Thus, we're only adding marginal risk by letting the root user shell into the box.
Finally, this is a convenience feature so it's easily reversed. If the security costs outweigh the virality benefits, we remove it.
ammario commentedon Jun 7, 2022
Here is some precedent from GitHub Enterprise for giving superadmins shell access to the deployment.
spikecurtis commentedon Jun 7, 2022
It's not required for coderd, but it is for provisionerd and today, these run in the same process. We have future plans to allow people to run a standalone provisionerd, but it is not yet supported. In any case, the scenario we're discussing here is a single-machine deployment of Coder and so terraform needs to be installed.Ignore me here, wasn't aware that the provisioner downloads terraform if it isn't present.spikecurtis commentedon Jun 7, 2022
This makes some sense to me for provisionerd, since we recommend that they run it with the environment authenticated with cloud providers.
With the caveat that coderd and provisionerd are currently joined at the hip, I don't think it makes sense to configure coderd with a remote IDE, because other than very low level config required for coderd to function at all (postgres connect string, access URL, etc), coderd doesn't have persistent state on the host machine. Our goal is to allow all the configuration that matters for coderd to be configured via APIs (and by extension, the CLI and WebUI).
3 remaining items
bpmct commentedon Jun 8, 2022
Some things discussed synchronously, still subject to change:
github-actions commentedon Aug 17, 2022
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
ammario commentedon Aug 31, 2022
#3331 moves us towards the goals of this issue in a simpler fashion.