Skip to content
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

Add build and push subcommands to cloudchamber #7378

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

IRCody
Copy link
Contributor

@IRCody IRCody commented Nov 27, 2024

Describe your change...
Add build and push subcommands to cloudchamber that build a docker image and push to the cloudchamber managed registry using a local docker daemon.

  • Tests
    • [] TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • [] I don't know
    • Required
    • Not required because: No e2e test for Cloudchamber yet
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: product is private only for certain users.

@IRCody IRCody requested a review from mikenomitch November 27, 2024 21:18
Copy link

changeset-bot bot commented Nov 27, 2024

🦋 Changeset detected

Latest commit: 9aa3698

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

This PR includes changesets to release 2 packages
Name Type
wrangler Minor
@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

@IRCody IRCody force-pushed the cloudchamber-build branch 3 times, most recently from 5e7b0b0 to 138e8b2 Compare December 13, 2024 04:09
Copy link
Contributor

github-actions bot commented Dec 13, 2024

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/13017665530/npm-package-wrangler-7378

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7378/npm-package-wrangler-7378

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-wrangler-7378 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-cloudflare-workers-bindings-extension-7378 -O ./cloudflare-workers-bindings-extension.0.0.0-vc02b16f0b.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vc02b16f0b.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-create-cloudflare-7378 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-cloudflare-kv-asset-handler-7378

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-miniflare-7378

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-cloudflare-pages-shared-7378

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-cloudflare-unenv-preset-7378

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-cloudflare-vite-plugin-7378

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-cloudflare-vitest-pool-workers-7378

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-cloudflare-workers-editor-shared-7378

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-cloudflare-workers-shared-7378

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13017665530/npm-package-cloudflare-workflows-shared-7378

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20250124.0
workerd 1.20250124.0 1.20250124.0
workerd --version 1.20250124.0 2025-01-24

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@IRCody IRCody force-pushed the cloudchamber-build branch 2 times, most recently from 16f1c9f to 8e75c5e Compare December 13, 2024 18:27
packages/wrangler/src/cloudchamber/build.ts Outdated Show resolved Hide resolved
packages/wrangler/src/cloudchamber/build.ts Outdated Show resolved Hide resolved
.option("path-to-docker", {
type: "string",
default: "docker",
describe: "path to docker binary",
Copy link
Member

Choose a reason for hiding this comment

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

The option is called "path-to-docker" but accepts a command (i.e. "docker") so maybe docker-cmd is a better name? Path implies a full path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is used to find the binary for docker. So if it's on your $PATH you can use 'docker' but if not you can pass it here.

Maybe the description could be changed to something like:

Add the path to your docker binary if it's not on your $PATH?

packages/wrangler/src/cloudchamber/build.ts Outdated Show resolved Hide resolved
})
.option("platform", {
type: "string",
default: "linux/amd64",
Copy link
Member

Choose a reason for hiding this comment

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

Can we make the default whatever the user is using (e.g. linux/arm64 on an M1 Mac and linux/amd64 on x86)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reasoning for defaulting to linux/amd64 is that is the only supported platform in cc today.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah +1 to using amd64 as the default.

Shoudl we say in the description of build that it defaults to "architecture supported by Workers (linux/amd64)"?

Copy link
Contributor Author

@IRCody IRCody Jan 27, 2025

Choose a reason for hiding this comment

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

The default shows up in the help text:

...
--platform        platform to build for  [string] [default: "linux/amd64"]
...

We could add the extra text to the description I guess?

packages/wrangler/src/cloudchamber/build.ts Outdated Show resolved Hide resolved
@IRCody IRCody force-pushed the cloudchamber-build branch 2 times, most recently from 787af33 to 1bdae8d Compare January 28, 2025 00:24
@IRCody IRCody marked this pull request as ready for review January 28, 2025 00:26
@IRCody IRCody requested review from a team as code owners January 28, 2025 00:26
@IRCody IRCody force-pushed the cloudchamber-build branch from 1bdae8d to 9aa3698 Compare January 28, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Untriaged
Development

Successfully merging this pull request may close these issues.

4 participants