-
Notifications
You must be signed in to change notification settings - Fork 829
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
wrangler deploy: Be able to deploy containers #8586
base: main
Are you sure you want to change the base?
Conversation
gabivlj
commented
Mar 19, 2025
•
edited
Loading
edited
- Tests
- TODO (before merge)
- Tests included
- Tests not necessary because:
- Wrangler E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
- I don't know
- Required
- Not required because: no containers integration.
- Public documentation
- TODO (before merge)
- Cloudflare docs PR(s):
- Documentation not necessary because: private product at this point.
- Wrangler V3 Backport
- TODO (before merge)
- PR:
- Not necessary because: I don't think it's necessary.
🦋 Changeset detectedLatest commit: 84df6e2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-wrangler-8586 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8586/npm-package-wrangler-8586 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-wrangler-8586 dev path/to/script.js Additional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-cloudflare-workers-bindings-extension-8586 -O ./cloudflare-workers-bindings-extension.0.0.0-v6faaad36a.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v6faaad36a.vsix create-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-create-cloudflare-8586 --no-auto-update @cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-cloudflare-kv-asset-handler-8586 miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-miniflare-8586 @cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-cloudflare-pages-shared-8586 @cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-cloudflare-unenv-preset-8586 @cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-cloudflare-vite-plugin-8586 @cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-cloudflare-vitest-pool-workers-8586 @cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-cloudflare-workers-editor-shared-8586 @cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-cloudflare-workers-shared-8586 @cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14118078665/npm-package-cloudflare-workflows-shared-8586 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
5e68476
to
ac113c1
Compare
pre-release build worked great for me! |
ac113c1
to
67a0b15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Left a few minor comments.
appConfigNoDefaults.durable_objects.namespace_id | ||
) { | ||
crash( | ||
`Application "${prevApp.name}" is assigned to durable object ${prevApp.durable_objects.namespace_id}, but a new DO namespace is being assigned to the application, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call out how they can delete the container application in this message?
const [_result, err] = await wrap( | ||
promiseSpinner( | ||
RolloutsService.createApplicationRollout(action.id, { | ||
description: "Progressive update", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we expect users to introspect the rollouts api directly? If yes would it be helpful to add the container version in the rollout description?
@@ -0,0 +1,153 @@ | |||
import { readFileSync } from "fs"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this file should be here or under src/containers?
targetDurableObjectNamespace.type !== "durable_object_namespace" || | ||
targetDurableObjectNamespace.namespace_id === undefined | ||
) | ||
throw new Error("unreachable"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think I still like the brackets around these.
|
||
return defaultBuildCommand; | ||
if (options.args !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for cleaning up this file.
// not found, not a dockerfile, let's try parting the image ref as an URL? | ||
isDockerImage = false; | ||
try { | ||
if (!imageRef.includes(":")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A ":" doesn't guarantee a tag because you can specify a port as well even though I think that's less commonly used.
[HOST[:PORT]/]NAMESPACE/REPOSITORY[:TAG]
Maybe split on "/" and then check if the last section has a ':'?
throw new Error(`Error reading file ${imagePath}: ${err.message}`); | ||
} | ||
|
||
// not found, not a dockerfile, let's try parting the image ref as an URL? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/parting/parsing
throw new Error("image reference needs to include atleast a tag ':'"); | ||
} | ||
|
||
const url = new URL(`https://${imageRef}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What case is this catching?
2e64835
to
425852a
Compare
applications We are adding a new step into wrangler deploy that allows the user to deploy container applications through wrangler deploy. The main changes on this commit allow: 1. cloudchamber/build.ts to accomodate the needs of the new deploy path of containers. 2. cloudchamber/apply.ts to create a Cloudchamber rollout. 3. deploy.ts to call a method when containers option is defined. This method in cloudchamber/deploy.ts does the following: 1. Call fetchVersion to know what's the namespace_id of the target DOs. 2. Deploy each container application. Each container application might specify a Dockerfile or an image URI. If it's a Dockerfile, we will read it and build it.
5cf3a6d
to
84df6e2
Compare