[Containers] Document scheduling policies and snapshots - #33531
thomasgauvin wants to merge 20 commits into
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://codex-containers-scheduling-policy.previews.developers.cloudflare.com (commit 1915d40)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
AI Review✅ Reviewed 👉 Fix in your agent 👈Fix the following review findings in PR #33531 (https://github.com/cloudflare/cloudflare-docs/pull/33531).
Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification.
- If you disagree, explain why.
- If you need clarification before deciding, ask those questions.
- Then share your plan for which issues to tackle and in what order.
After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.
The comment must come before the commit because the next review reads PR comments.
## Style Guide
- S-1527e939 | src/content/docs/containers/configuration/rollouts.mdx:14 | Semicolon joining two independent clauses
The prose joins two independent clauses with a semicolon: "do not participate in application-wide rollouts; application code selects their image". Per the style guide, break into two sentences.
- S-0cd4cd70 | src/content/docs/workers/wrangler/configuration.mdx:1288 | Use "refer to" instead of "see the" before a link
The prose uses "see the [instance types documentation]" before a link. The links rule requires replacing "see the [link]" with "refer to [link]".
- S-12045311 | src/content/docs/workers/wrangler/configuration.mdx:1289 | Use "refer to" instead of "see" before a link
The prose uses "see [Custom instance types]" before a link. The links rule requires replacing "see [link]" with "refer to [link]".Style Guide
Commands
|
Review coverage🟡 4 ownership areas need approval. Suggested reviewers: @dinasaur404 @irvinebroque @th0m @joshthoward @vy-ton
CODEOWNERS mappings for displayed areas (4)
|
|
|
||
| ### Choose an instance size at runtime | ||
|
|
||
| Set `instance` in `ctx.container.start()` to one of the following named instance types: |
There was a problem hiding this comment.
Could add a link to reference our instance types here? https://codex-containers-scheduling-policy.previews.developers.cloudflare.com/containers/platform/limits/#instance-types
There was a problem hiding this comment.
ah nvm I see this below as " Refer to".
Could also just link to them when mentioning instance types for the first time.
| To update a named image, change its Dockerfile or set `image` to a new digest-pinned reference. Then, deploy the Worker. The corresponding value in `ctx.container.images` now refers to the updated image. | ||
|
|
||
| Deploying an updated image map does not restart running Containers. A running Container continues to use its startup image. Durable Object code decides when to stop that Container and start it with the updated reference. This application-controlled restart is how you roll out image changes with the `durable_object` policy. | ||
|
|
There was a problem hiding this comment.
How about we also add something like this?
Keep the existing Container running and use the configured image on its next start:
if (!this.ctx.container.running) {
this.ctx.container.start({
image: this.ctx.container.images.base,
instance: "standard-2",
});
}
For an explicit upgrade, stop the existing Container and start with the configured image:
if ((await this.ctx.container.inspect())?.image !== this.ctx.container.images.base) {
if (this.ctx.container.running) {
await this.ctx.container.destroy();
}
this.ctx.container.start({
image: this.ctx.container.images.base,
instance: "standard-2",
});
}
Summary
durable_objectscheduling policy alongside the existingdefaultpolicy.Validation
pnpm run check(Astro: 0 errors, warnings, or hints; Worker TypeScript passed)git diff --checkDocumentation checklist