-
Notifications
You must be signed in to change notification settings - Fork 881
Use parameters to select a provisioner #5979
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
TIL, thanks! If this is a low-hanging fruit, then most likely we should look into this.
π BTW well described issue, Ben. |
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. |
Bump to remove the stale label, my team is still wishing for this feature. π |
It seems like this should both support targeting specific provisioners (e.g. single runner running on a VM) or tags/groups of provisioners (e.g. |
One thing we could do fairly straightforwardly is to allow rich parameters to set tags on the build job, which then can restrict which provisionerds are able to build the workspace. For simplicity, we should require the parameter to be immutable. Work items:
This gets us a basic working version, but falls short of
We'd have to depend on hardcoded values in the template, so there would have to be out-of-band coordination between the operators who set up the provisionerds with tags and the template authors who want to allow end users to tag their jobs. (This is basically the situation today, with tags set at the template version.) The difficulty in pulling a list of available provisioners is that Coder doesn't presently track the lifecycle of provisionerds. They get added to the database when they connect, but then are never updated when they disconnect. I also think latency isn't very sensible. Latency from what to what? Presumably users are interested in minimizing the latency from their computer to their workspace, but we can't measure that prior to building the workspace. Provisionerds don't respond to latency pings from end users, and adding that is difficult because there is no requirement for them to be externally reachable. While you might expect that provisionerds are often located near where the workspaces will be created, this is far from universal. Consider the case of public clouds like AWS: a provisioner job talking to the AWS APIs can create a workspace in any zone across the whole world. |
Yeah latency was a bit of a silly idea, we don't need to do that :) |
As this is part of this sprint, let's list changes in the terraform-provider.
@spikecurtis I'd like to follow up on your vision. Did you mean something like this: data "coder_parameter" "ci_provisioner" {
name = "ci_provisioner"
type = "string"
description = "Select a runner"
option {
name = "Ben's Macbook"
value = "bens-macbook"
}
option {
name = "US Pittsburgh"
value = "us-pittsburgh"
}
option {
name = "Sydney"
value = "sydney"
}
option {
name = "Ben's Thinkpad"
value = "bens-thinkpad"
}
role = "select_provisioner"
} In this case, option values would be tags:
Side note: Maybe we could just introduce another TF resource like |
Hey all, my team is one of the teams asking for this feature. We strictly need this aspect:
to support arbitrary developers spinning up workspaces on personal/local provisioners running on their laptops (see #909) that we can't pre-bake as hard-coded template parameter options. We're trying to improve the experience today where:
|
I think this is a good opportunity for us to have "magic parameters" where the options and validation are not defined Terraform but instead by
I suppose this could be a "pre-create-workspace-page plan" π but these kind of these things could be better solved without Terraform (good ol' REST APIs). I imagine this may cause some heavy refactors if we try to implement this in parameters and there is another risk in duplication if we introduce a different data source: data "coder_magic_parameter" "provisioner" {
options: "available provisioners"
} data "coder_magic_parameter" "pick_a_repo" {
options: "repos"
} This kind of reminds me how we do gitauth in Coder. https://coder.com/docs/v2/latest/admin/git-providers#require-git-authentication-in-templates I guess the parameter picker should be its own data source β |
This comment was marked as outdated.
This comment was marked as outdated.
Nice! I like this |
Would also like to suggest we add "provisioner metadata," which is very similar to agent metadata but can be used to display dynamic info about a provisioner. This does not have to be in the first version, but can easily inform users details about each provisioner (OS, number of GPUs on node, etc). Perhaps we provide some defaults but then the rest can be sent with an REST API request (no CLI definition or anything). Edit: made an issue for this: #10412 |
From a chat with @mtojek - we need to agree on whether this is a special rich parameter or done via a UI form control. I am leaning towards a parameter. I'll bring this up during our call with Kyle next week |
This comment was marked as outdated.
This comment was marked as outdated.
FYI I'm working on the RFC right now, and will come up with the design by the end of this week. |
This comment was marked as outdated.
This comment was marked as outdated.
The RFC does not discuss dynamic provisioner tags, so the short answer is: no, not yet. We can focus on the dynamic list of active tags later. |
@mtojek I agree, and I am writing down this idea for future reference. |
What will be the behavior when the provided tags do not match any provisioner? What is the plan to evict these build jobs from the build queue? As currently, the behavior is that they always stay stuck in a pending state. |
Stuck as it is now. We will need a separate RFC to describe a concept of "dead letter queue". It was mentioned in the RFC. |
@mtojek Thanks for the update. |
As all items have been implemented according to the RFC, I'm closing this issue now. |
We have a little-known feature that allows someone to run external provisioners outside of the coder server. However, there are some cases where a workspace owner wants to guarantee which "external provisioner/runner" their workspace is built on.
Templates can tag which runners they are compatible with, but this isn't done done per-workspace (a workspace may be re-built on a different runner with the same tag, leading to data loss or a failed build).
With an immutable, dynamic, runner parameter on the βcreate workspaceβ page, we can do both! Instead of hardcoded values, Coder pulls the list of available runners and perhaps shows latency.
We could also consider this for our dogfood template, removing provisioning load from the Coder server and relying on runners on each bare metal instance to provision containers with their respective local docker sockets. This has an added advantage of builds not failing when we redeploy Coder (we constantly update our dogfood environment when a new commit is merged into
main
)The text was updated successfully, but these errors were encountered: