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
- User creates a new workspace via the API or the Coder web UI.
55
-
- User selected a preset which has been configured for prebuilds.
56
-
- Prebuilt workspace is in an eligible state.
66
+
Before a prebuilt workspace is available to users:
57
67
58
-
The ownership of the prebuilt workspace will change to the requesting user, and this is referred to as a "claim".
68
+
1. The workspace is provisioned like a regular workspace.
69
+
1. The workspace reaches`running` state.
70
+
1. The agent connects and reports`ready` status.
71
+
1. All bootstrap procedures and startup scripts complete successfully.
72
+
1. The workspace is marked as`eligible` to be claimed.
59
73
60
-
##Eligibility
74
+
Prebuilds that fail during provisioning are retried with an exponential backoff to prevent resource waste.
61
75
62
-
When a prebuilt workspace is running, and its agent has completed all of its bootstrap procedures and executed its
63
-
startup scripts, the workspace will be marked eligible to be claimed.
76
+
</details>
64
77
65
-
##Relationship to workspace presets
78
+
1. <details><summary>Claiming process</summary>
66
79
67
-
[Workspace presets](./parameters.md#workspace-presets-beta) allow you to configure commonly used combinations of
68
-
parameters into a single option, which makes it easier for developers to pick one that fits their needs.
80
+
When a developer requests a new workspace, the claiming process occurs:
69
81
70
-
Prebuilt workspaces need to have a preset defined to match the base configuration of a workspace, i.e. the preset
71
-
needs to define all the required parameters needed to build a workspace. These parameters are necessary in order to
72
-
build workspaces in the background.
82
+
1. Developer selects a template and preset that has Prebuilds configured.
83
+
1. If an eligible prebuilt workspace exists, it's automatically assigned to the user.
84
+
1. Ownership transfers from the`prebuilds` user to the requesting user.
85
+
1. The workspace name changes to the user's requested name.
86
+
1. The process is transparent to the developer - they simply see a workspace ready faster than normal.
73
87
74
-
Parameters which are not required or not part of a preset can still be used with prebuilt workspaces.
75
-
The preset defines the minimum required set of parameters, and these are immutable.
88
+
This ownership transfer happens automatically without any special action required by the user.
76
89
77
-
##Update a prebuilt workspace
90
+
</details>
78
91
79
-
Prebuiltworkspacesare not automatically updated after they are created.
92
+
You can view available prebuiltworkspacesin the**Workspaces** view in the Coder dashboard:
80
93
81
-
When a template version changes, all prebuilt workspaces relating to an inactive template version are destroyed.
82
-
New prebuilt workspaces will be provisioned for the active template version.
94
+

83
95
84
-
You may want to invalidate a prebuilt workspace when your template version does not change but a referenced dependency does,
85
-
which is necessary for running an up-to-date workspace. For example, if
86
-
an[AMI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html) which is referenced by your template is updated,
87
-
you can simply delete the prebuilt workspaces, and they will be recreated with the latest AMI.
96
+
###Template updates and prebuilt lifecycle
88
97
89
-
_In future releases, we will allow operators to invalidate their prebuilt workspaces programmatically._
98
+
Prebuilt workspaces have specific behavior when templates are updated:
90
99
91
-
##Quotas
100
+
1. When a template version changes, Prebuilds for old versions are automatically deleted.
101
+
1. New Prebuilds are created for the active template version.
102
+
1. Prebuilds aren't automatically updated after creation.
103
+
1. If dependencies change (e.g., an[AMI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html) update) without a template version change, you can:
104
+
- Delete the existing Prebuilds manually.
105
+
- Coder will automatically create new prebuilt workspaces with the updated dependencies.
92
106
93
-
Prebuilt workspaces can be used in conjunction with[Resource Quotas](../../users/quotas.md). Given
94
-
that all unclaimed prebuilt workspaces are[owned](#workspace-ownership) by the`prebuilds` user, you may configure a quota for
95
-
any group which this user appears in.
107
+
The system always maintains the desired number of prebuilt workspaces for the active template version.
96
108
97
-
Once the quota is exceeded, prebuilt workspaces will fail provisioning like regular workspaces would.
109
+
###Relationship to workspace presets
98
110
99
-
##Current Limitations
111
+
Prebuilt workspaces are tightly integrated with[workspace presets](./parameters.md#workspace-presets-beta):
100
112
101
-
- Organizations
113
+
1. Each Prebuild is associated with a specific template preset.
114
+
1. The preset must define all required parameters needed to build the workspace.
115
+
1. Parameters that are not defined in the preset can still be customized by users when they claim a workspace.
116
+
1. The preset parameters define the base configuration and are immutable after they're claimed.
117
+
1. Prebuilds help presets deliver even faster workspace creation.
102
118
103
-
Prebuilt workspaces can only be utilized by the default organization.
119
+
_Note: In future releases, we will allow operators to invalidate their prebuilt workspaces programmatically._
In the above example, the`docker_container` would be created with a`name` attribute which includes references to the
156
-
initial owner (i.e.`prebuilds`), and will never change - even when the values of`data.coder_workspace_owner.me.name`
157
-
and`data.coder_workspace.me.name` change in the above example.`name` is immutable like`user_data` above.
158
-
159
-
You can read more about`ignore_changes`in the[Terraform documentation](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes).
160
-
161
-
Should certain mutable attributes be required to change, you can use a more targeted approach by providing a list of
162
-
attributes to`ignore_changes`:
164
+
For more targeted control, specify which attributes to ignore:
Learn more about`ignore_changes` in the[Terraform documentation](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes).
179
+
180
+
###Current limitations
181
+
182
+
The prebuilt workspaces feature has these current limitations:
183
+
184
+
-**Organizations**
185
+
186
+
Prebuilt workspaces can only be used with the default organization.