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

Fermée
#176 0 commentaires 1 réaction 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@aron-cf y travaille déjà.

Depuis le 30/9/2026.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

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.
Langage dominant
TypeScript
Étoiles
9.7k
Forks
577
Merge moyen
1 j 15 h
PR mergées (30 j)
79

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de cloudflare/computer

Toutes les issues de cloudflare/computer

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.