-
Notifications
You must be signed in to change notification settings - Fork 888
User-local provisioner daemons #909
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
@kconley-sq I was able to get this working. It's not scoped to a specific user right now, but we are able to use the Docker Terraform Provider to spin up a workspace. This is a basic template that lets you specify an image. Pretty neat! terraform {
required_providers {
coder = {
source = "coder/coder"
version = "~> 0.3.1"
}
docker = {
source = "kreuzwerker/docker"
version = "~> 2.16.0"
}
}
}
provider "coder" {
url = "http://host.docker.internal:3000/"
}
provider "docker" {
host = "unix:///var/run/docker.sock"
}
resource "coder_agent" "dev" {
arch = "amd64"
os = "linux"
}
resource "docker_image" "go" {
name = "mcr.microsoft.com/vscode/devcontainers/go:1"
}
resource "docker_container" "go" {
image = docker_image.go.latest
name = "go"
entrypoint = ["sh", "-c", coder_agent.dev.init_script]
user = "vscode"
host {
host = "host.docker.internal"
ip = "host-gateway"
}
env = [
"CODER_TOKEN=${coder_agent.dev.token}"
]
} |
@arivictor would something like this work for your use case of local machines? |
I am adding this one into Community MVP milestone. It unblocks specific use cases we've heard from multiple people now. |
Please add your planning poker estimate with ZenHub @kylecarbs |
It sounds like there are a few prerequisites to being able to implement this as more than just a demo: First of all, we need to decide on a notion of identity for provisioners, so that we can distinguish between different instances of the Terraform provisioner. Simplest thing is probably just to assign each of them a UUID, but we might also want to consider namespacing them, so that you'd have e.g. Secondly, we need to think about security (authn/authz). #44 covers authentication between coderd and provisionerd. For authorization, @kconley-sq's proposed defaults sound great, but I can think of some other potential things to consider:
And then there are lifecycle issues. It probably doesn't make sense to delete a provisioner instance if there are existing workspaces associated with it. But if the provisioner goes away unexpectedly (e.g. your laptop dies) then we probably need a way to clean up its state. |
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. |
Provisioner daemons and template versions will gain the concept of tags. Tags must match for a provision job to execute on the daemon. Tags will be defined in the frontmatter of a template's README: ---
tags:
- scope: organization
- environment: staging
---
# Title
Some additional information... When a provisioner job is queued (like template creation or workspace build), it will be clear to the user that the job is pending on a set of tags. If # Registers and starts a new provisioner daemon with a set of tags
$ coder provisionerd start --tag environment=staging --tag scope=organization The The following tags will be specified by default but can be overridden by the user:
|
This is done! |
@bpmct @kylecarbs, We currently do not have the ability to run a workspace on the developer's local docker daemon (as requested originally in the issue); I think we should reopen this. |
Our team's developers need to access their local USB devices in their Coder workspaces via USB/IP, and to minimize the latency between a USB/IP server running on a developer's local machine (which serves the USB hardware they have connected to their machine) and the USB/IP client running in a Coder workspace (which attaches that USB hardware remotely over the network), we'd like our developers to be able to provision Coder workspaces to run on their local machines (e.g. using the Docker Terraform provider).
I was describing this use case to @kylecarbs on Slack, and he mentioned:
That sounds exactly like what we were hoping for, so I've created this GitHub issue to formally request this feature in Coder. 😃
Building on what @kylecarbs suggested above, I think enabling something like the following would meet our requirements:
coder provisioner
) to launch a local provisioner that is associated/authenticated with coderd using the credentials/URL the developer previously provided viacoder login
.coder workspace create
like--provisioner-daemon <PROVISIONER_DAEMON_ID>
where a developer specifies the name/reference to the provisioner daemon of interest via<PROVISIONER_DAEMON_ID>
?What do you think?
cc @sunilvenkatraman
The text was updated successfully, but these errors were encountered: