-
Notifications
You must be signed in to change notification settings - Fork 17k
[Containers] Document scheduling policies and snapshots #33531
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
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
63506c7
Add docs and changelog for containers snapshots
gpanders dd5c049
[Containers] Document Durable Object scheduling policy
thomasgauvin aa34d08
[Containers] Fix scheduling policy card icon
thomasgauvin 8b5d150
[Containers] Use Durable Object Container API name
thomasgauvin 1846040
[Containers] Mark snapshots as public beta
thomasgauvin 2a7e652
[Containers] Clarify snapshot immutability
thomasgauvin 9023441
[Containers] Refine scheduling policy changelog
thomasgauvin ad1cff2
Publish Containers changelogs on September 30
thomasgauvin 03b773b
[Containers] Expand scheduling policy image guidance
thomasgauvin eb544d0
[Containers] Clarify external registry support
thomasgauvin 7e65c31
Clarify scheduling policy field compatibility
thomasgauvin a83bf02
Document Container field policy compatibility
thomasgauvin 810c483
Split Container fields by scheduling policy
thomasgauvin ad09a49
Clarify snapshot image compatibility
thomasgauvin e5c0b2c
Use standard snapshot compatibility terminology
thomasgauvin a524175
Document Cloudflare managed Container image
thomasgauvin 4436a55
Scope managed Container image to Durable Objects
thomasgauvin 7a1bd29
Document scheduling policy migration
thomasgauvin eaede2d
Rename scheduling policy migration guide
thomasgauvin 859cbef
Clarify snapshot scheduling policy requirement
thomasgauvin f917823
Update src/content/docs/workers/wrangler/configuration.mdx
thomasgauvin 53ed8ef
Update src/content/docs/containers/configuration/scheduling-policy/mo…
thomasgauvin c1f64b6
Update src/content/docs/containers/guides/image-management.mdx
thomasgauvin 7bdd9bf
Update src/content/docs/containers/guides/image-management.mdx
thomasgauvin 5528c94
Update src/content/changelog/containers/2026-09-30-durable-object-sch…
thomasgauvin f6ded93
Update src/content/docs/containers/configuration/scheduling-policy/in…
thomasgauvin 9322266
Update src/content/changelog/containers/2026-09-30-snapshots.mdx
thomasgauvin 2e0229a
Update src/content/docs/containers/guides/snapshots.mdx
thomasgauvin 52451fc
Update src/content/docs/workers/wrangler/configuration.mdx
thomasgauvin 5e49007
Resolve rebase against production
thomasgauvin 918d444
[Containers] Schedule changelog announcements
thomasgauvin 8b636f0
[Containers] Restore future changelog publication
thomasgauvin 9a38c8c
[Containers] Clarify snapshot changelog title
thomasgauvin 04e5be4
[Containers] Schedule changelog announcements
thomasgauvin da8447d
[Containers] Clarify snapshot scheduling policy
thomasgauvin 9ac2f44
[Containers] Clarify snapshot policy requirement
thomasgauvin 21d5f29
[Containers] Highlight managed Debian image
thomasgauvin 11e469d
[Containers] Reposition snapshot policy note
thomasgauvin 0dcf4b6
[Containers] Use prose for snapshot policy
thomasgauvin 4f9e5af
[Containers] Combine snapshot changelog example
thomasgauvin 60f410e
[Containers] Clarify new managed image
thomasgauvin be74711
[Containers] Simplify images attribute example
thomasgauvin 391a4de
[Containers] Label policy-specific images attribute
thomasgauvin b47443c
[Containers] Clarify scheduling policy API support
thomasgauvin 8c5e873
[Containers] Label snapshot restore parameter
thomasgauvin 35071dc
[Containers] Reorder Container class guidance
thomasgauvin 3db7b79
[Containers] Separate Container class setup
thomasgauvin 0490c98
[Containers] Introduce Container class setup
thomasgauvin 926cce6
[Containers] Link images attribute to Wrangler configuration
thomasgauvin ca9b266
[Containers] Distinguish start options by policy
thomasgauvin 6d85d0c
[Containers] Document ContainerInfo and start labels
thomasgauvin 0557d4e
[Containers] Combine start policy examples
thomasgauvin 9d80681
[Containers] Define ContainerSnapshot return value
thomasgauvin d57f6d8
[Containers] Simplify inspect example
thomasgauvin 9a8b649
[Containers] Simplify snapshot API example
thomasgauvin fa263ca
[Containers] Note default start instance size
thomasgauvin 98c7d04
[Containers] Clarify application-controlled image updates
thomasgauvin 0cce886
[Containers] Move scheduling policy migration to guides
thomasgauvin b169147
[Containers] Link scheduling policy rollouts
thomasgauvin e25ebfd
[Containers] Reorder migration guides after snapshots
thomasgauvin a40f87d
[Containers] Make scheduling policy docs timeless
thomasgauvin 34e6fd5
[Containers] Prefer declarative Durable Object exports
thomasgauvin b71070b
[Containers] Clarify when named images are built
thomasgauvin e16d440
[Containers] Identify named image Wrangler field
thomasgauvin b64e3cf
[Containers] Address review feedback on scheduling policy docs (#33824)
thomasgauvin cee86a6
[Containers] Label Durable Object policy beta
thomasgauvin 77a34e8
[Wrangler] Review fixes for Containers scheduling policy config refer…
thomasgauvin 921e4e4
[Containers] Image management review fixes for #33531 (#33828)
thomasgauvin 54f1bfa
[Containers] Fix DO Container API examples and inspect() image docs (…
thomasgauvin db5cfb2
[Containers] Review fixes for scheduling policy migration guide (#33827)
thomasgauvin 33f4f33
[Containers] Clarify when inspect() reports an empty image (#33830)
thomasgauvin cc4f9e1
[Containers] Document snapshot limits
thomasgauvin 1a126cc
[Containers] Restore flat scheduling policy path
thomasgauvin 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
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
src/content/changelog/containers/2026-09-30-durable-object-scheduling-policy.mdx
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 |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| --- | ||
| title: New scheduling policy for Containers to configure image and instance from Durable Objects | ||
| description: The durable_object scheduling policy gives each Durable Object control of Container configuration. | ||
| products: | ||
| - containers | ||
| date: "2026-09-30T08:45:00-04:00" | ||
| publish_future_dated_entry: true | ||
| --- | ||
|
|
||
| import { TypeScriptExample, WranglerConfig } from "~/components"; | ||
|
|
||
| [Containers](/containers/) now support the `durable_object` scheduling policy in public beta. This policy lets a Durable Object select the image and instance size for a Container at runtime instead of using one centrally managed configuration for the application. | ||
|
|
||
| To use custom images, configure the policy and one or more named images in Wrangler: | ||
|
|
||
| <WranglerConfig> | ||
|
|
||
| ```jsonc | ||
| { | ||
| "containers": [ | ||
| { | ||
| "class_name": "AgentComputer", | ||
| "scheduling_policy": "durable_object", | ||
| "images": { | ||
| "base": { | ||
| "dockerfile": "./container/Dockerfile", | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| } | ||
| ``` | ||
|
|
||
| </WranglerConfig> | ||
|
|
||
| Wrangler prepares each image and exposes its immutable reference through `ctx.container.images`. Supply that reference and an instance size when you start the Container: | ||
|
|
||
| <TypeScriptExample filename="src/index.ts"> | ||
|
|
||
| ```ts | ||
| this.ctx.container.start({ | ||
| image: this.ctx.container.images.base, | ||
|
thomasgauvin marked this conversation as resolved.
|
||
| enableInternet: false, | ||
| instance: "standard-2", | ||
| }); | ||
| ``` | ||
|
|
||
| </TypeScriptExample> | ||
|
|
||
| The `durable_object` policy also supports the new [`cloudflare/debian-trixie` Cloudflare-managed image](/containers/guides/image-management/#use-the-cloudflare-managed-image), which includes Node.js 24.20.0 on Debian Trixie slim. Start it directly without configuring a named image. | ||
|
|
||
| Durable Object-managed Container instances have independent lifecycles and do not participate in application-wide image rollouts. | ||
|
|
||
| For configuration, runtime sizing, snapshots, and update behavior, refer to [Scheduling Policies](/containers/configuration/scheduling-policy/). | ||
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 |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| title: Snapshot and restore Container filesystem | ||
| description: Persist point-in-time container filesystem with snapshot APIs in public beta. | ||
| products: | ||
| - containers | ||
| date: "2026-09-30T08:45:00-04:00" | ||
| publish_future_dated_entry: true | ||
| --- | ||
|
|
||
| import { TypeScriptExample } from "~/components"; | ||
|
|
||
| [Containers](/containers/) now support snapshot APIs in public beta for saving and restoring point-in-time filesystem state. Create a snapshot first, then pass it back to `start()` to restore files after container sleep, restart, or handoff to another Durable Object. | ||
|
|
||
| Use `snapshotContainer()` through the [Durable Object Container API](/containers/api/durable-object-container/) to capture the full container filesystem. Create a snapshot from a running Container, store its handle, and pass that handle to `start()` when you restore it later: | ||
|
|
||
| <TypeScriptExample filename="src/index.ts"> | ||
|
|
||
| ```ts | ||
| import { DurableObject } from "cloudflare:workers"; | ||
|
|
||
| export class MyDurableObject extends DurableObject { | ||
| async saveSnapshot() { | ||
| // Create a snapshot from the running Container. | ||
| const containerSnapshot = await this.ctx.container.snapshotContainer({}); | ||
|
|
||
| await this.ctx.storage.put("containerSnapshot", containerSnapshot); | ||
| } | ||
|
|
||
| async restoreSnapshot() { | ||
| // Restore the saved snapshot later. | ||
| const containerSnapshot = | ||
| await this.ctx.storage.get<ContainerSnapshot>("containerSnapshot"); | ||
|
|
||
| if (!containerSnapshot) { | ||
| return; | ||
| } | ||
|
|
||
| this.ctx.container.start({ containerSnapshot, enableInternet: false }); | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </TypeScriptExample> | ||
|
|
||
| Snapshots are only supported for Container applications that use the [`durable_object` scheduling policy](/containers/configuration/scheduling-policy/#use-the-durable-object-scheduling-policy). Snapshots are immutable, so create a new snapshot to persist filesystem changes made after a restore. | ||
|
|
||
| For more information, refer to [Snapshots](/containers/guides/snapshots/) and the [Durable Object Container API](/containers/api/durable-object-container/). |
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
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
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
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
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
Oops, something went wrong.
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.