Skip to content

Commit 49f32d1

Browse files
EdwardAngertSasSwartssncferreira
authored
docs: add dev containers and scheduling to prebuilt workspaces known issues (#18816)
closes #18806 - [x] scheduling limitation - [x] dev containers limitation - [x] edit intro [preview](https://coder.com/docs/@18806-prebuilds-known-limits/admin/templates/extending-templates/prebuilt-workspaces) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified the introduction and administrator responsibilities for prebuilt workspaces. * Integrated compatibility information about DevContainers and workspace scheduling more contextually. * Added explicit notes on limitations with dev containers integration and workspace autostart/autostop features. * Improved configuration examples and clarified scheduling instructions. * Enhanced explanations of scheduling behavior and lifecycle steps for better understanding. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Co-authored-by: Sas Swart <sas.swart.cdk@gmail.com> Co-authored-by: Susana Ferreira <susana@coder.com>
1 parent 5e49d8c commit 49f32d1

File tree

1 file changed

+18
-28
lines changed

1 file changed

+18
-28
lines changed

docs/admin/templates/extending-templates/prebuilt-workspaces.md

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
# Prebuilt workspaces
22

3-
> [!WARNING]
4-
> Prebuilds Compatibility Limitations:
5-
> Prebuilt workspaces currently do not work reliably with [DevContainers feature](../managing-templates/devcontainers/index.md).
6-
> If your project relies on DevContainer configuration, we recommend disabling prebuilds or carefully testing behavior before enabling them.
7-
>
8-
> We’re actively working to improve compatibility, but for now, please avoid using prebuilds with this feature to ensure stability and expected behavior.
3+
Prebuilt workspaces (prebuilds) reduce workspace creation time with an automatically-maintained pool of
4+
ready-to-use workspaces for specific parameter presets.
95

10-
Prebuilt workspaces allow template administrators to improve the developer experience by reducing workspace
11-
creation time with an automatically maintained pool of ready-to-use workspaces for specific parameter presets.
12-
13-
The template administrator configures a template to provision prebuilt workspaces in the background, and then when a developer creates
14-
a new workspace that matches the preset, Coder assigns them an existing prebuilt instance.
15-
Prebuilt workspaces significantly reduce wait times, especially for templates with complex provisioning or lengthy startup procedures.
6+
The template administrator defines the prebuilt workspace's parameters and number of instances to keep provisioned.
7+
The desired number of workspaces are then provisioned transparently.
8+
When a developer creates a new workspace that matches the definition, Coder assigns them an existing prebuilt workspace.
9+
This significantly reduces wait times, especially for templates with complex provisioning or lengthy startup procedures.
1610

1711
Prebuilt workspaces are:
1812

@@ -21,6 +15,9 @@ Prebuilt workspaces are:
2115
- Monitored and replaced automatically to maintain your desired pool size.
2216
- Automatically scaled based on time-based schedules to optimize resource usage.
2317

18+
Prebuilt workspaces are a special type of workspace that don't follow the
19+
[regular workspace scheduling features](../../../user-guides/workspace-scheduling.md) like autostart and autostop. Instead, they have their own reconciliation loop that handles prebuild-specific scheduling features such as TTL and prebuild scheduling.
20+
2421
## Relationship to workspace presets
2522

2623
Prebuilt workspaces are tightly integrated with [workspace presets](./parameters.md#workspace-presets):
@@ -53,7 +50,7 @@ instances your Coder deployment should maintain, and optionally configure a `exp
5350
prebuilds {
5451
instances = 3 # Number of prebuilt workspaces to maintain
5552
expiration_policy {
56-
ttl = 86400 # Time (in seconds) after which unclaimed prebuilds are expired (1 day)
53+
ttl = 86400 # Time (in seconds) after which unclaimed prebuilds are expired (86400 = 1 day)
5754
}
5855
}
5956
}
@@ -159,17 +156,17 @@ data "coder_workspace_preset" "goland" {
159156

160157
**Scheduling configuration:**
161158

162-
- **`timezone`**: The timezone for all cron expressions (required). Only a single timezone is supported per scheduling configuration.
163-
- **`schedule`**: One or more schedule blocks defining when to scale to specific instance counts.
164-
- **`cron`**: Cron expression interpreted as continuous time ranges (required).
165-
- **`instances`**: Number of prebuilt workspaces to maintain during this schedule (required).
159+
- `timezone`: (Required) The timezone for all cron expressions. Only a single timezone is supported per scheduling configuration.
160+
- `schedule`: One or more schedule blocks defining when to scale to specific instance counts.
161+
- `cron`: (Required) Cron expression interpreted as continuous time ranges.
162+
- `instances`: (Required) Number of prebuilt workspaces to maintain during this schedule.
166163

167164
**How scheduling works:**
168165

169166
1. The reconciliation loop evaluates all active schedules every reconciliation interval (`CODER_WORKSPACE_PREBUILDS_RECONCILIATION_INTERVAL`).
170-
2. The schedule that matches the current time becomes active. Overlapping schedules are disallowed by validation rules.
171-
3. If no schedules match the current time, the base `instances` count is used.
172-
4. The reconciliation loop automatically creates or destroys prebuilt workspaces to match the target count.
167+
1. The schedule that matches the current time becomes active. Overlapping schedules are disallowed by validation rules.
168+
1. If no schedules match the current time, the base `instances` count is used.
169+
1. The reconciliation loop automatically creates or destroys prebuilt workspaces to match the target count.
173170

174171
**Cron expression format:**
175172

@@ -227,7 +224,7 @@ When a template's active version is updated:
227224
1. Prebuilt workspaces for old versions are automatically deleted.
228225
1. New prebuilt workspaces are created for the active template version.
229226
1. If dependencies change (e.g., an [AMI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html) update) without a template version change:
230-
- You may delete the existing prebuilt workspaces manually.
227+
- You can delete the existing prebuilt workspaces manually.
231228
- Coder will automatically create new prebuilt workspaces with the updated dependencies.
232229

233230
The system always maintains the desired number of prebuilt workspaces for the active template version.
@@ -285,13 +282,6 @@ For example, the [`ami`](https://registry.terraform.io/providers/hashicorp/aws/l
285282
has [`ForceNew`](https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/ec2/ec2_instance.go#L75-L81) set,
286283
since the AMI cannot be changed in-place._
287284

288-
#### Updating claimed prebuilt workspace templates
289-
290-
Once a prebuilt workspace has been claimed, and if its template uses `ignore_changes`, users may run into an issue where the agent
291-
does not reconnect after a template update. This shortcoming is described in [this issue](https://github.com/coder/coder/issues/17840)
292-
and will be addressed before the next release (v2.23). In the interim, a simple workaround is to restart the workspace
293-
when it is in this problematic state.
294-
295285
### Monitoring and observability
296286

297287
#### Available metrics

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy