Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Prebuild Cache Invalidation #17722

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

Open
SasSwart opened this issue May 8, 2025 · 0 comments
Open

Prebuild Cache Invalidation #17722

SasSwart opened this issue May 8, 2025 · 0 comments
Assignees

Comments

@SasSwart
Copy link
Contributor

SasSwart commented May 8, 2025

Prebuilt workspaces will become stale if not claimed. Examples:

  • A monorepo cloned during prebuild will fall behind its origin
  • A new VM AMI or container image may release after a workspace was created

When defining a prebuild, the following syntax should configure a maximum lifetime for a prebuild, after which such an unclaimed prebuild must be deleted and replaced.

resource "coder_workspace_preset" "us-nix" {
  name = "Nix US"
  
  parameters = {
    (data.coder_parameter.region.name)     = "us-pittsburgh"
    (data.coder_parameter.image_type.name) = "codercom/oss-dogfood-nix:latest"
  }
  
  # ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
  prebuilds = {
	  instances = 2
	  cache_invalidation = {
		  # See the Invalidation section for more
		  invalidate_after_secs = 86400
	  }
	  autoscaling = {
		  ... # See the Autoscaling section for examples
	  }
  }
}

Furthermore, it should be possible to invalidate a prebuild using the API. This might already be possible by using the endpoint that deletes a workspace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants