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

Skip to content

Prebuild invalidation #17722

Open
1 of 2 issues completed
Open
Feature
1 of 2 issues completed
@SasSwart

Description

@SasSwart

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.

Sub-issues

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions