Skip to content
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

feat: allow presets to define prebuilds #363

Closed
wants to merge 3 commits into from
Closed

Conversation

SasSwart
Copy link
Contributor

@SasSwart SasSwart commented Mar 17, 2025

This PR introduces the definition of workspace prebuilds into the coder terraform provider.
For a given preset, template authors can now define a desired number of prebuilds. Supported versions of Coder will provision and maintain workspaces in reserve as requested by this parameter. These prebuilds will then be assigned to users when they create new workspaces, thereby reducing the time from first click to workspace use.

closes #362

Signed-off-by: Danny Kopping <[email protected]>

# Conflicts:
#	provider/agent.go
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
// This should be a real authentication token!
resourceData.SetId(uuid.NewString())
err := resourceData.Set("token", uuid.NewString())

// CODER_RUNNING_WORKSPACE_AGENT_TOKEN is *only* used for prebuilds. We pass it down when we want to rebuild a prebuilt workspace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder: we agreed to split the agent part out of this PR since it's logically separate.

@SasSwart
Copy link
Contributor Author

SasSwart commented Apr 4, 2025

Closing in favor of #373

@SasSwart SasSwart closed this Apr 4, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Apr 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for defining prebuilds on workspace_presets
2 participants