-
Notifications
You must be signed in to change notification settings - Fork 943
chore: add prebuild docs #17580
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
Merged
Merged
chore: add prebuild docs #17580
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6b75c2e
chore: prebuild docs
dannykopping c806859
add prebuilt to manifest; make lint/fmt/gen
EdwardAngert 1ef926a
relative links
EdwardAngert 4b101f3
copy edit
EdwardAngert 8bebe5a
Merge branch 'main' into dk/prebuilds-docs
EdwardAngert 1c6aee4
chore: review comments & additions
dannykopping 5c603db
copy edit
EdwardAngert 4b3b0a9
link to groups roles
EdwardAngert 684ef43
Apply suggestions from code review
EdwardAngert a10402f
s/prebuilds/prebuilt workspaces
EdwardAngert 850581e
heading edit
EdwardAngert 88f918a
edit prebuilt workspace lifecycle steps
EdwardAngert 470f061
Merge branch 'main' into dk/prebuilds-docs
EdwardAngert d95806b
Apply suggestions from code review
EdwardAngert 6439616
less-specific resource replacement
EdwardAngert e4332d7
Merge branch 'main' into dk/prebuilds-docs
EdwardAngert ad056d7
Merge branch 'main' of github.com:/coder/coder into dk/prebuilds-docs
dannykopping 1edc98f
Merge branch 'dk/prebuilds-docs' of github.com:/coder/coder into dk/p…
dannykopping dfb7958
fix: copy updates
dannykopping 596d7a0
md/copy
EdwardAngert 14998a0
invisible/transparent
EdwardAngert ac21df1
chore: update provider version
dannykopping File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Apply suggestions from code review
Co-authored-by: Danny Kopping <danny@coder.com>
- Loading branch information
commit 684ef43e570be299cc99d7d8703d5c046bffa64c
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
# Prebuilt workspaces | ||
|
||
Prebuilt workspaces (Prebuilds) allow template administrators to improve the developer experience by reducing workspace | ||
Prebuilt workspaces allow template administrators to improve the developer experience by reducing workspace | ||
creation time with an automatically maintained pool of ready-to-use workspaces for specific parameter presets. | ||
|
||
The template administrator configures a template to be available with prebuilt workspaces, and then when a developer creates | ||
The template administrator configures a template to provision prebuilt workspaces in the background, and then when a developer creates | ||
a new workspace with matching parameters, Coder assigns them an existing prebuilt instance. | ||
Prebuilt workspaces significantly reduce wait times, especially for templates with complex provisioning or lengthy startup procedures. | ||
|
||
Prebuilt workspaces are: | ||
|
||
- Created and maintained automatically by Coder to match your specified preset configurations. | ||
- Claimed transparently when developers request matching workspaces. | ||
- Claimed transparently when developers create workspaces. | ||
- Monitored and replaced automatically to maintain your desired pool size. | ||
|
||
## Prerequisites | ||
|
||
- [**Premium license**](../../licensing/index.md) | ||
- [**Template administrator privileges**](../../users/groups-roles.md) | ||
- **Compatible Terraform provider**: Use `coder/coder` Terraform provider `>= 2.3.0-pre2`. (**TODO: update with latest version**) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NOTE: we must not merge until this is updated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dannykopping - once this is resolved, I think we're set ❗ |
||
- **Feature flag**: Enable the `workspace-prebuilds` [experiment](../../../reference/cli/server.md#--experiments). | ||
|
||
|
@@ -34,7 +33,7 @@ instances your Coder deployment should maintain: | |
memory = 16 | ||
} | ||
prebuilds { | ||
instances = 3 // Number of prebuilt workspaces to maintain | ||
instances = 3 # Number of prebuilt workspaces to maintain | ||
} | ||
} | ||
``` | ||
|
@@ -67,11 +66,11 @@ Expand each item in this list for more information about the stage: | |
|
||
1. The workspace is provisioned like a regular workspace. | ||
dannykopping marked this conversation as resolved.
Show resolved
Hide resolved
|
||
1. The workspace reaches `running` state. | ||
1. The agent connects and reports `ready` status. | ||
1. All bootstrap procedures and startup scripts complete successfully. | ||
1. The workspace is marked as `eligible` to be claimed. | ||
1. The agent connects to coderd. | ||
1. The agent starts its bootstrap procedures and startup scripts complete successfully. | ||
1. The agent reports `ready` status. | ||
|
||
Prebuilds that fail during provisioning are retried with an exponential backoff to prevent resource waste. | ||
Prebuilds that fail during provisioning are retried with an exponential backoff to prevent transient failures. | ||
|
||
</details> | ||
|
||
|
@@ -112,11 +111,9 @@ Prebuilt workspaces are tightly integrated with [workspace presets](./parameters | |
|
||
1. Each Prebuild is associated with a specific template preset. | ||
1. The preset must define all required parameters needed to build the workspace. | ||
1. Parameters that are not defined in the preset can still be customized by users when they claim a workspace. | ||
1. The preset parameters define the base configuration and are immutable after they're claimed. | ||
1. Prebuilds help presets deliver even faster workspace creation. | ||
1. Parameters that are not defined in the preset can still be customized by users when they claim a workspace. | ||
|
||
_Note: In future releases, we will allow operators to invalidate their prebuilt workspaces programmatically._ | ||
|
||
## Administration and troubleshooting | ||
|
||
|
@@ -127,15 +124,14 @@ Because unclaimed prebuilt workspaces are owned by the `prebuilds` user, you can | |
|
||
1. Configure quotas for any group that includes this user. | ||
1. Set appropriate limits to balance Prebuild availability with resource constraints. | ||
1. Monitor quota utilization through Coder's dashboard. | ||
|
||
If a quota is exceeded, the prebuilt workspace will fail provisioning the same way other workspaces do. | ||
|
||
### Template configuration best practices | ||
|
||
#### Preventing resource replacement | ||
|
||
When a prebuilt workspace is claimed, Terraform runs again with new values for the workspace owner and name. | ||
When a prebuilt workspace is claimed, another `terraform apply` run occurs with new values for the workspace owner and name. | ||
|
||
This can cause issues: | ||
|
||
|
@@ -214,5 +210,4 @@ These logs provide information about: | |
|
||
1. Creation and deletion attempts for prebuilds. | ||
1. Backoff events after failed builds. | ||
1. Eligibility state changes. | ||
1. Claiming operations. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.