Skip to content

sync local containers with latest workerd #9576

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 1 commit into from
Jun 17, 2025
Merged

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Jun 12, 2025

The first commit populate the container : ContainerOptions in DurableObjectNamespace. Encoding the capnp struct fails for now as the the version of workerd used by miniflare does not support containers. Will need to update the generate code after the workerd update.

The second commit adds a container_engine configuration to wrangler. It should be either a unix socket unix:/path/to/socket or a full configuration. Note that as @danlapid mentioned, win32 is not supported ATM.

Edit:

I added 2 more fixup! commits.

  • fixup! do not add container to DurableObjectNamespaceDesignator fixes the first commit.
  • fixup! socket address default to WRANGLER_DOCKER_SOCKET reads the Socket address from WRANGLER_DOCKER_SOCKET when no value is specified in the wrangler config file. Open question: do we want to keep the config file option or always use the env var? Also note that Miniflare still uses the platform default when no value is provided (for people using Miniflare directly)

Edit:

  • WRANGLER_DOCKER_SOCKET renamed to WRANGLER_DOCKER_HOST in the review feedback fixup

  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because: will be covered by e2e
  • Wrangler / Vite E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: not affected
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: separate effort
  • Wrangler V3 Backport
    • TODO (before merge)
    • Wrangler PR:
    • Not necessary because: New feature

@vicb vicb requested a review from a team as a code owner June 12, 2025 11:06
Copy link

changeset-bot bot commented Jun 12, 2025

🦋 Changeset detected

Latest commit: 4366b16

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Jun 12, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@9576

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@9576

miniflare

npm i https://pkg.pr.new/miniflare@9576

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@9576

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@9576

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@9576

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@9576

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@9576

wrangler

npm i https://pkg.pr.new/wrangler@9576

commit: 4366b16

@vicb vicb force-pushed the vicb/container-in-do branch 3 times, most recently from 8235ba0 to c172c0e Compare June 12, 2025 20:16
@vicb vicb changed the title [Blocked] Sync the container config with workerd Sync the container config with workerd Jun 12, 2025
@vicb
Copy link
Contributor Author

vicb commented Jun 13, 2025

@emily-shen what about merging this PR as is?

We could discuss some points and create follow-up PRs if need be:

  • This PR supports both WRANGLER_DOCKER_SOCKET and a wrangler dev config to set the socket
  • Make sure we do the right thing for external DOs

@vicb vicb force-pushed the vicb/container-in-do branch from c172c0e to d740a64 Compare June 13, 2025 07:59
@vicb vicb changed the title Sync the container config with workerd sync local containers with latest workerd Jun 13, 2025
@emily-shen
Copy link
Contributor

emily-shen commented Jun 13, 2025

@emily-shen what about merging this PR as is?

We could discuss some points and create follow-up PRs if need be:

  • This PR supports both WRANGLER_DOCKER_SOCKET and a wrangler dev config to set the socket
  • Make sure we do the right thing for external DOs

looks like DOCKER_HOST is a standard: https://podman-desktop.io/docs/migrating-from-docker/using-the-docker_host-environment-variable.

totally fine to punt on external DOs, don't think its a big deal.

@vicb vicb force-pushed the vicb/container-in-do branch from d740a64 to 838602f Compare June 13, 2025 10:22
@vicb
Copy link
Contributor Author

vicb commented Jun 13, 2025

@emily-shen I renamed for the env var to WRANGLER_DOCKER_HOST.

I have tried to address the config thing but <rant>there is nothing that bothers me more that trying to understand code w/o comments - we have 10 different config types, most have no comments, function have no comments. There is probably a good reason to have all those different objects and functions but I will not spend more time trying to reverse engineering the code - I think we should do a better job commenting our codebase!</rant>

@emily-shen emily-shen force-pushed the vicb/container-in-do branch from 838602f to a4ea561 Compare June 13, 2025 13:00
@emily-shen emily-shen added the e2e Run wrangler + vite-plugin e2e tests on a PR label Jun 13, 2025
@emily-shen emily-shen closed this Jun 13, 2025
@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Jun 13, 2025
@emily-shen emily-shen reopened this Jun 13, 2025
@github-project-automation github-project-automation bot moved this from Done to Untriaged in workers-sdk Jun 13, 2025
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Jun 13, 2025
@emily-shen
Copy link
Contributor

blocked pending the next workerd release which has a bugfix.

Copy link
Contributor

Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the v3-maintenance branch with your changes. Thank you for helping us keep Wrangler v3 supported!

Depending on your changes, running git rebase --onto v3-maintenance main vicb/container-in-do might be a good starting point.

@emily-shen emily-shen added skip-v3-pr Skip validation of presence of a v3 backport PR blocked Blocked on other work labels Jun 13, 2025
@vicb vicb force-pushed the vicb/container-in-do branch 2 times, most recently from c55918b to e33be9f Compare June 15, 2025 17:18
@@ -1,6 +1,7 @@
import assert from "assert";
import { readFileSync } from "fs";
import fs from "fs/promises";
import { platform } from "node:os";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed

@emily-shen emily-shen removed the blocked Blocked on other work label Jun 17, 2025
@emily-shen emily-shen force-pushed the vicb/container-in-do branch from e33be9f to 4366b16 Compare June 17, 2025 15:59
@emily-shen emily-shen enabled auto-merge June 17, 2025 15:59
@emily-shen emily-shen added this pull request to the merge queue Jun 17, 2025
Merged via the queue into main with commit 2671e77 Jun 17, 2025
18 of 19 checks passed
@emily-shen emily-shen deleted the vicb/container-in-do branch June 17, 2025 16:19
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Jun 17, 2025
jseba added a commit to jseba/workers-sdk that referenced this pull request Jun 18, 2025
…seba/containers_scope

* 'main' of ssh://github.com/cloudflare/workers-sdk: (31 commits)
  Refactor preview mode and ensure compatibility with Vite 7 (cloudflare#9647)
  Block requests vulnerable to opennext vulnerability (cloudflare#9635)
  Add test for cloudchamber buildAndMaybePush (cloudflare#9638)
  chore: remove redundant binding guide superseded by internal docs (cloudflare#9648)
  add changeset to trigger release of workers/pages projects (cloudflare#9649)
  Add @handler to Python templates. (cloudflare#9305)
  Migrate from unbuild to obuild (cloudflare#9243)
  Version Packages (cloudflare#9650)
  fix changeset (cloudflare#9651)
  containers: Default scheduling policy should be the default (cloudflare#9621)
  Rename Mixed Mode to remote proxy/remote bindings depending on context (cloudflare#9586)
  Version Packages (cloudflare#9632)
  Correctly mock out getDockerImageDigest for testing buildAndMaybePush (cloudflare#9636)
  [C3] Bump create-remix from 2.16.6 to 2.16.8 in /packages/create-cloudflare/src/frameworks (cloudflare#9525)
  Remove "Cloudchamber" from user facing error messages (cloudflare#9628)
  sync local containers with latest workerd (cloudflare#9576)
  Bump the workerd-and-workers-types group with 2 updates (cloudflare#9591)
  [C3] Bump gatsby from 5.14.3 to 5.14.4 in /packages/create-cloudflare/src/frameworks (cloudflare#9524)
  [C3] Bump create-react-router from 7.6.1 to 7.6.2 in /packages/create-cloudflare/src/frameworks (cloudflare#9526)
  [C3] Bump create-docusaurus from 3.8.0 to 3.8.1 in /packages/create-cloudflare/src/frameworks (cloudflare#9527)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run wrangler + vite-plugin e2e tests on a PR no-changeset-required skip-v3-pr Skip validation of presence of a v3 backport PR
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants