Skip to content

Build containers without account ID #9765

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

Conversation

hasip-timurtas
Copy link
Contributor

@hasip-timurtas hasip-timurtas commented Jun 26, 2025

This allows us to build containers in dry run mode. When we push the container to the managed registry, we re-tag it to include the account ID. We only ever push when not in dry run mode though, so when pushing we can safely grab the account information.

Related: #9813, #9811


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bug fix
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: do not backport containers changes

@hasip-timurtas hasip-timurtas requested a review from a team as a code owner June 26, 2025 14:41
Copy link

changeset-bot bot commented Jun 26, 2025

🦋 Changeset detected

Latest commit: ec6bd2e

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

This PR includes changesets to release 3 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

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
Contributor

@emily-shen emily-shen left a comment

Choose a reason for hiding this comment

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

hey thanks so much for the contribution! are you able to add a test and a changeset? you can find more details in our contributing guide: https://github.com/cloudflare/workers-sdk/blob/main/CONTRIBUTING.md#testing but feel free to ask here as well if you get stuck :)

@hasip-timurtas
Copy link
Contributor Author

@emily-shen I tested manually, it fixes the issue I had 😅
But yep sure, I will add the changeset and unit test as well. Will push soon, thanks for checking.

@hasip-timurtas
Copy link
Contributor Author

@emily-shen check it again please

Copy link

pkg-pr-new bot commented Jul 2, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: ec6bd2e

@hasip-timurtas hasip-timurtas requested a review from a team as a code owner July 2, 2025 08:33
@hasip-timurtas
Copy link
Contributor Author

CI Failures - Unrelated to Container Fix

The CI failures appear to be flaky test issues unrelated to the container dry-run changes:

Main Fix Status ✅

The core wrangler test suite passed (325/325 tests), including the new test for the container URL parsing fix.

Failed Tests (Infrastructure Issues)

  1. vitest-pool-workers - Network error (ECONNRESET)
  2. create-cloudflare e2e - Authentication timeout (tries to open browser in CI)
  3. dev-registry - Tail event timing issue (failed 3x, likely race condition)

These test different components (test infrastructure, CLI scaffolding, dev session communication) than the container deployment code I modified.

Success rate: 91/95 test suites passed (95.8%)

Could someone re-run the failed jobs? The container dry-run URL parsing fix is working correctly.

@petebacondarwin
Copy link
Contributor

The C3 tests will always fail right now due to this PR being on a fork. The other failures are probably just flakes.

@petebacondarwin
Copy link
Contributor

I'll rebase and rerun once we fix the C3 tests.

@petebacondarwin petebacondarwin force-pushed the fix/container-dry-run-url-parsing-error branch 2 times, most recently from 5f0186b to 4ccb4cc Compare July 2, 2025 15:31
Copy link
Member

@gpanders gpanders left a comment

Choose a reason for hiding this comment

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

I'd like to suggest an alternative approach.

Right now, we don't fill out the OpenAPI configuration when we use dry run mode. This is actually a nice property because it gives us a kind of soft-guarantee that we won't interact with the API in dry run mode.

As you found, this breaks because buildAndMaybePush loads the user account limits using the API, even in dry run mode. However, it only does this to validate disk limits on the account before pushing.

I suggest changing buildAndMaybePush to only load the account and call ensureDiskLimits when dry run mode is disabled. That lets us maintain the property that we do not fill out the OpenAPI configuration in dry run mode and should only require changing buildAndMaybePush, which will be a much smaller and tighter scoped change.

@github-project-automation github-project-automation bot moved this from Untriaged to In Review in workers-sdk Jul 2, 2025
@hasip-timurtas hasip-timurtas requested a review from gpanders July 2, 2025 16:42
@hasip-timurtas hasip-timurtas force-pushed the fix/container-dry-run-url-parsing-error branch 2 times, most recently from 90b987c to e33d7f1 Compare July 2, 2025 18:18
@hasip-timurtas hasip-timurtas requested a review from gpanders July 2, 2025 20:08
@gpanders gpanders added the skip-v3-pr Skip validation of presence of a v3 backport PR label Jul 7, 2025
Copy link
Member

@gpanders gpanders left a comment

Choose a reason for hiding this comment

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

I've rebased on main and implemented the changes I suggested.

Thanks @hasip-timurtas for the issue report and initial work on this. Apologies for hijacking your PR, but in this case it was much faster to do it myself rather than go back and forth via GitHub. Thanks very much for your contribution :)

@github-project-automation github-project-automation bot moved this from In Review to Approved in workers-sdk Jul 7, 2025
@gpanders gpanders force-pushed the fix/container-dry-run-url-parsing-error branch from b013b57 to 1aa04e3 Compare July 7, 2025 20:51
gpanders and others added 2 commits July 8, 2025 12:24
This allows us to build containers in dry run mode. When we push the
container to the managed registry, we re-tag it to include the account
ID. We only ever push when not in dry run mode though, so when pushing
we can safely grab the account information.

Co-authored-by: Hasip Timurtaş <[email protected]>
Even in dry run mode we should check that Docker is installed, because
dry run mode uses docker commands too.
@gpanders gpanders force-pushed the fix/container-dry-run-url-parsing-error branch from 8ce4ad3 to ec6bd2e Compare July 8, 2025 17:25
@emily-shen emily-shen added this pull request to the merge queue Jul 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 9, 2025
@emily-shen emily-shen added this pull request to the merge queue Jul 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 9, 2025
@emily-shen emily-shen added this pull request to the merge queue Jul 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 9, 2025
@emily-shen emily-shen added this pull request to the merge queue Jul 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 9, 2025
@emily-shen emily-shen added this pull request to the merge queue Jul 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 9, 2025
@emily-shen emily-shen added this pull request to the merge queue Jul 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 9, 2025
@emily-shen emily-shen added this pull request to the merge queue Jul 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 9, 2025
@gpanders gpanders added this pull request to the merge queue Jul 9, 2025
@edmundhung edmundhung removed this pull request from the merge queue due to the queue being cleared Jul 9, 2025
@emily-shen emily-shen merged commit 05adc61 into cloudflare:main Jul 9, 2025
72 of 84 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Jul 9, 2025
@workers-devprod workers-devprod added the contribution [Holopin] Recognizes an open-source contribution, big or small label Jul 9, 2025
Copy link

holopin-bot bot commented Jul 9, 2025

Congratulations @hasip-timurtas, the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cmcw0m11w198807leui0ol2cf

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution [Holopin] Recognizes an open-source contribution, big or small skip-v3-pr Skip validation of presence of a v3 backport PR
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants