Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

CloudflareContainerBackend: pass image, instance and containerSnapshot to ctx.container.start() for the durable_object scheduling policy

Chiusa
#176 0 commenti 1 reazione 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@aron-cf ci sta già lavorando.

Dal 30/9/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

CloudflareContainerBackend cannot start a container on an app that uses the new durable_object scheduling policy, because it never passes an image to ctx.container.start().

What happens today (main at ada64809, 2026-09-29; @cloudflare/computer 0.3.0)

  • ContainerLaunchSpec is { env, enableInternet }, and the host launches with ctx.container.start({ enableInternet, env }).
  • Under durable_object, monitor() rejects a start that names neither image nor containerSnapshot (scheduling policy).
  • With no instance, the container gets lite (1/16 vCPU, 256 MiB), which is too small for computerd plus a build toolchain.
  • #launchAs is private, so a Durable Object using withWorkspaceContainer cannot add these fields itself without replacing ctx.container.

What would fix it

  1. Optional image, instance and containerSnapshot on CloudflareContainerBackendOptions. Each would be a value or a function the backend calls at every launch, so the Durable Object can choose them per task.
  2. Carry the three through ContainerLaunchSpec, and include them in the launch record, so a running container started with a different spec is relaunched, as env and enableInternet already are.
  3. A snapshot(options) method on the host API that passes through to ctx.container.snapshotContainer(). A workspace could then save the container's own disk (tool caches) before setInactivityTimeout lets it sleep. /workspace is a mount, so a snapshot leaves it out, and it stays with the Workspace as now.

Why it matters to us

We run CloudflareContainerBackend inside our own Durable Object through withWorkspaceContainer. Moving to the new policy would give us:

  • the faster start path from the 2026-09-30 post;
  • an instance size chosen per task;
  • no app-wide rollout that replaces containers while a build is running.
Lingua principale
TypeScript
Stelle
9.5k
Fork
552
Merge medio
1g 21h
PR unite (30g)
42

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudflare/computer

Tutte le issue di cloudflare/computer

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.