Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: implement expiration policy logic for prebuilds#17996

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Changes from1 commit
Commits
Show all changes
15 commits
Select commitHold shift + click to select a range
a38ee7c
feat: implement cache invalidation logic for prebuilds
ssncferreiraMay 22, 2025
a904d3f
chore: add preset_id to log messages in reconciliation cycle
ssncferreiraMay 23, 2025
b0abd30
Merge remote-tracking branch 'origin/main' into ssncferreira/feat-pre…
ssncferreiraMay 23, 2025
f43ea2c
docs: add documentation regarding cache_invalidation to Prebuilt work…
ssncferreiraMay 23, 2025
c7e442c
fix: update code according to latest terraform schema expiration_poli…
ssncferreiraMay 23, 2025
28a6274
fix: proto comment
ssncferreiraMay 23, 2025
7482bfb
fix: preset_snapshot_test to create Preset with TTL via options
ssncferreiraMay 23, 2025
04c0e7c
chore: update Actual state count to include both expired and non-expi…
ssncferreiraMay 26, 2025
8e5caae
chore: update terraform-provider-coder to version v2.5.0
ssncferreiraMay 26, 2025
4b1fbb5
fix: run terraform generate.sh to update preset files
ssncferreiraMay 26, 2025
30771cf
fix: update resources_test to include ApiKeyScope parameter
ssncferreiraMay 26, 2025
266c445
Merge remote-tracking branch 'origin/main' into ssncferreira/feat-pre…
ssncferreiraMay 26, 2025
14be03f
chore: update Provisioner API version 1.6 with prebuilds' expiration …
ssncferreiraMay 26, 2025
7a24eea
chore: update preset snapshot tests test data for consistency
ssncferreiraMay 26, 2025
7666090
Merge remote-tracking branch 'origin/main' into ssncferreira/feat-pre…
ssncferreiraMay 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
docs: add documentation regarding cache_invalidation to Prebuilt work…
…spaces page
  • Loading branch information
@ssncferreira
ssncferreira committedMay 23, 2025
commitf43ea2cd951581e69abb189d9fa4c8c38b14cb39
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,7 +31,8 @@ Prebuilt workspaces are tightly integrated with [workspace presets](./parameters
## Enable prebuilt workspaces for template presets

In your template, add a `prebuilds` block within a `coder_workspace_preset` definition to identify the number of prebuilt
instances your Coder deployment should maintain:
instances your Coder deployment should maintain, and optionally configure a `cache_invalidation` block to set a TTL
(Time To Live) for unclaimed prebuilt workspaces to ensure stale resources are automatically cleaned up.

```hcl
data "coder_workspace_preset" "goland" {
Expand All@@ -43,13 +44,19 @@ instances your Coder deployment should maintain:
}
prebuilds {
instances = 3 # Number of prebuilt workspaces to maintain
cache_invalidation {
invalidate_after_secs = 86400 # Time (in seconds) after which unclaimed prebuilds are expired (1 day)
}
}
}
```

After you publish a new template version, Coder will automatically provision and maintain prebuilt workspaces through an
internal reconciliation loop (similar to Kubernetes) to ensure the defined `instances` count are running.

The `cache_invalidation` block ensures that any prebuilt workspaces left unclaimed for more than `invalidate_after_secs`
seconds is considered expired and automatically cleaned up.

## Prebuilt workspace lifecycle

Prebuilt workspaces follow a specific lifecycle from creation through eligibility to claiming.
Expand DownExpand Up@@ -95,6 +102,15 @@ Unclaimed prebuilt workspaces can be interacted with in the same way as any othe
However, if a Prebuilt workspace is stopped, the reconciliation loop will not destroy it.
This gives template admins the ability to park problematic prebuilt workspaces in a stopped state for further investigation.

### Cache Invalidation

Prebuilt workspaces support cache invalidation through the `invalidate_after_secs` setting inside the `cache_invalidation`
block. This value defines the Time To Live (TTL) of a prebuilt workspace, i.e., the duration in seconds that an unclaimed
prebuilt workspace can remain before it is considered expired and eligible for cleanup.

Expired prebuilt workspaces are removed during the reconciliation loop to avoid stale environments and resource waste.
New prebuilt workspaces are only created to maintain the desired count if needed.

### Template updates and the prebuilt workspace lifecycle

Prebuilt workspaces are not updated after they are provisioned.
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp