Conversation
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
7df8b01 to
3954f36
Compare
Various small fixes Co-authored-by: Nikita Sharma <54369599+nikitassharma@users.noreply.github.com>
irvinebroque
left a comment
There was a problem hiding this comment.
^ copy suggestions for homepage, can take or leave
Co-authored-by: Brendan Irvine-Broque <birvine-broque@cloudflare.com>
irvinebroque
left a comment
There was a problem hiding this comment.
^ Notes on getting started docs
| ``` | ||
|
|
||
| - Making requests to `/lb` will load balance requests across several containers. | ||
| This uses a simple `getRandom` helper method currently, which picks an ID at random |
There was a problem hiding this comment.
| This uses a simple `getRandom` helper method currently, which picks an ID at random | |
| This uses a simple `getRandom` helper method, which picks an ID at random |
|
|
||
| - Making requests to `/lb` will load balance requests across several containers. | ||
| This uses a simple `getRandom` helper method currently, which picks an ID at random | ||
| from a set number (in this case 3), then routes to that Container instance. |
There was a problem hiding this comment.
| from a set number (in this case 3), then routes to that Container instance. | |
| from a set number (in this case 3), then routes to that Container instance. You can replace this with any routing or load balancing logic you choose to implement: |
(or maybe there is a good example we want to point towards)
| Currently, routing requests to one of many interchangeable Container instances is accomplished | ||
| with the `getRandom` helper. | ||
|
|
||
| This is a temporary solution until first-party support for utilization-aware autoscaling |
There was a problem hiding this comment.
| This is a temporary solution until first-party support for utilization-aware autoscaling | |
| This is temporary — we plan to add native support for latency-aware autoscaling and load balancing in the coming months. |
| with the `getRandom` helper. | ||
|
|
||
| This is a temporary solution until first-party support for utilization-aware autoscaling | ||
| and latency-aware load balancing is added to Cloudflare Containers. We plan to add this |
There was a problem hiding this comment.
| and latency-aware load balancing is added to Cloudflare Containers. We plan to add this |
|
|
||
| This is a temporary solution until first-party support for utilization-aware autoscaling | ||
| and latency-aware load balancing is added to Cloudflare Containers. We plan to add this | ||
| in the coming months. |
There was a problem hiding this comment.
| in the coming months. |
irvinebroque
left a comment
There was a problem hiding this comment.
^ re: Platform section
| @@ -0,0 +1,71 @@ | |||
| --- | |||
| pcx_content_type: navigation | |||
| title: Platform Details | |||
There was a problem hiding this comment.
| title: Platform Details | |
| title: Platform |
consistent with rest of docs
|
|
||
| import { WranglerConfig } from "~/components"; | ||
|
|
||
| This page containers general details about the Containers platform. |
There was a problem hiding this comment.
| This page containers general details about the Containers platform. |
| ## Instance Types | ||
|
|
||
| The memory, vCPU, and disk space for Containers are set through predefined instance types. | ||
| There are currently three instance types available for Containers users by default: |
There was a problem hiding this comment.
| There are currently three instance types available for Containers users by default: | |
| Three instance types are currently available: |
| | basic | 1 GiB | 1/4 | 4 GB | | ||
| | standard | 4 GiB | 1/2 | 4 GB | | ||
|
|
||
| These are specified using the `instance_type` property in wrangler config. |
There was a problem hiding this comment.
| These are specified using the `instance_type` property in wrangler config. | |
| These are specified using the [`instance_type` property](/workers/wrangler/configuration/#containers) in your Worker's Wrangler configuration file. Looking for larger instances? [Give us feedback here](/containers/beta-info/#feedback-wanted) and tell us what size instances you need, and what you want to use them for. |
|
|
||
| ## Limits | ||
|
|
||
| Containers limits are currently set per account. You may have higher |
There was a problem hiding this comment.
| Containers limits are currently set per account. You may have higher |
|
|
||
| | Feature | Workers Paid | | ||
| | ------------------------------------------------- | ------------ | | ||
| | GB Memory for concurrent live Container instances | 40GB [^1] | |
There was a problem hiding this comment.
| | GB Memory for concurrent live Container instances | 40GB [^1] | | |
| | GB Memory for all concurrent live Container instances | 40GB [^1] | |
| | Feature | Workers Paid | | ||
| | ------------------------------------------------- | ------------ | | ||
| | GB Memory for concurrent live Container instances | 40GB [^1] | | ||
| | vCPU for concurrent live Container instances | 20 [^1] | |
There was a problem hiding this comment.
| | vCPU for concurrent live Container instances | 20 [^1] | | |
| | vCPU for all concurrent live Container instances | 20 [^1] | |
| | ------------------------------------------------- | ------------ | | ||
| | GB Memory for concurrent live Container instances | 40GB [^1] | | ||
| | vCPU for concurrent live Container instances | 20 [^1] | | ||
| | GB Disk for concurrent live Container instances | 100GB [^1] | |
There was a problem hiding this comment.
| | GB Disk for concurrent live Container instances | 100GB [^1] | | |
| | GB Disk for all concurrent live Container instances | 100GB [^1] | |
| | vCPU for concurrent live Container instances | 20 [^1] | | ||
| | GB Disk for concurrent live Container instances | 100GB [^1] | | ||
| | Image size | 2 GB | | ||
| | Total image storage for account | 50 GB [^2] | |
There was a problem hiding this comment.
| | Total image storage for account | 50 GB [^2] | | |
| | Total image storage per account | 50 GB [^2] | |
|
|
||
| [^1]: This limit will be raised as we continue the beta. | ||
|
|
||
| [^2]: Delete images with `wrangler containers delete` to free up space. Note that reverted Workers may then break. |
There was a problem hiding this comment.
| [^2]: Delete images with `wrangler containers delete` to free up space. Note that reverted Workers may then break. | |
| [^2]: Delete container images with `wrangler containers delete` to free up space. Note that if you delete a container image and then [roll back](/workers/configuration/versions-and-deployments/rollbacks/) your Worker to a previous version, this version may no longer work. |
I'm actually not sure I could fully explain this given how we say this?
| @@ -0,0 +1,47 @@ | |||
| --- | |||
| pcx_content_type: reference | |||
| title: Local Dev | |||
There was a problem hiding this comment.
| title: Local Dev | |
| title: Local Development |
| order: 3 | ||
| --- | ||
|
|
||
| ## Local Development |
There was a problem hiding this comment.
Feels like something in getting started should reference?
| order: 3 | ||
| --- | ||
|
|
||
| ## Local Development |
| `wrangler dev` or `wrangler deploy`. | ||
|
|
||
| :::note | ||
| If your Worker app creates many container instances, you may hit local limits |
There was a problem hiding this comment.
| If your Worker app creates many container instances, you may hit local limits | |
| If your Worker app creates many container instances, your local machine may not be able to run as many containers concurrently as is possible when you deploy to Cloudflare. |
Suggest being clear that this isn't a limitation of the product but a limit of the end developer's machine that we are talking about here?
|
|
||
| :::note | ||
| If your Worker app creates many container instances, you may hit local limits | ||
| on concurrent containers. |
There was a problem hiding this comment.
| on concurrent containers. |
|
|
||
| ## Iterating on Container code | ||
|
|
||
| When using `wrangler dev`, standard Worker code is automatically reloaded by wrangler you save a change, |
There was a problem hiding this comment.
| When using `wrangler dev`, standard Worker code is automatically reloaded by wrangler you save a change, | |
| When you use `wrangler dev`, your Worker's code is automatically reloaded by Wrangler each time you save a change, |
| When using `wrangler dev`, standard Worker code is automatically reloaded by wrangler you save a change, | ||
| but code running within the container is not. | ||
|
|
||
| If you wish to rebuild your container with new code changes, you can hit the `[r]` key on your keyboard, and a |
There was a problem hiding this comment.
| If you wish to rebuild your container with new code changes, you can hit the `[r]` key on your keyboard, and a | |
| To rebuild your container with new code changes, you can hit the `[r]` key on your keyboard, which |
| but code running within the container is not. | ||
|
|
||
| If you wish to rebuild your container with new code changes, you can hit the `[r]` key on your keyboard, and a | ||
| rebuild will be triggered. Instances will be restarted with the new images. |
There was a problem hiding this comment.
| rebuild will be triggered. Instances will be restarted with the new images. | |
| triggers a rebuild. Container instances will then be restarted with the newly built images. |
| If you wish to rebuild your container with new code changes, you can hit the `[r]` key on your keyboard, and a | ||
| rebuild will be triggered. Instances will be restarted with the new images. | ||
|
|
||
| You may prefer to set up your code watchers and reloading mechanisms, or mount a local directory |
There was a problem hiding this comment.
| You may prefer to set up your code watchers and reloading mechanisms, or mount a local directory | |
| You may prefer to set up your own code watchers and reloading mechanisms, or mount a local directory |
|
|
||
| ```js | ||
| if (pathname.startsWith("/container")) { | ||
| let id = env.MY_CONTAINER.idFromName("container"); |
There was a problem hiding this comment.
Realizing that nothing in this page or elsewhere in docs links to or explains bindings
|
|
||
| ## Using existing images | ||
|
|
||
| If you wish to use a pre-built image, first, push it to the Cloudflare Registry: |
There was a problem hiding this comment.
Should we be louder here about public/private nature of the registry?
| You can run both your container and your Worker locally, without additional configuration, by running [`npx wrangler dev`](/workers/wrangler/commands/#dev) in your project's directory. | ||
|
|
||
| To develop Container-enabled Workers locally, you will need to first ensure that a | ||
| Docker compatible CLI tool is installed. For instance, you can use [Docker Desktop](https://docs.docker.com/desktop/) |
There was a problem hiding this comment.
| Docker compatible CLI tool is installed. For instance, you can use [Docker Desktop](https://docs.docker.com/desktop/) | |
| Docker compatible CLI tool and engine is installed. For instance, you can use [Docker Desktop](https://docs.docker.com/desktop/) |
users will also have to configure the docker host if its not docker desktop.
hopefully by this afternoon, they can do WRANGLER_DOCKER_HOST="unix:///Users/myUser/.colima/default/docker.sock" etc, or set that field in their wrangler config under dev.container_engine.
if we haven't got the release out yet, users can symlink the default docker socket e.g. sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
probably mention the symlink thing and i can put up an update PR to the docs when the wrangler release is out?
There was a problem hiding this comment.
do we also want to mention you have to expose any ports you call in your dockerfile?
|
|
||
| ### Reduction of log noise | ||
|
|
||
| Currently, the `Container` class uses Durable Object alarms to help manage Container shutdown. This |
There was a problem hiding this comment.
As an alternative for the user, if they need bigger control over their alarms, they can choose to use the ctx.container directly on a DurableObject?
| When using a [Container-enabled Durable Object](/containers), you can access the Durable Object's associated container via | ||
| the `container` object which is on the `ctx` property. This allows you to start, stop, and interact with the container. | ||
|
|
||
| :::note |
There was a problem hiding this comment.
It'd be nice to tell the user when is it preferable to use one or the other.
* Adds Containers docs * A variety of tweaks to containers docs * Fixes bad links * replace icon * remove extra file * Apply suggestions from code review Various small fixes Co-authored-by: Nikita Sharma <54369599+nikitassharma@users.noreply.github.com> * Removes unnecessary pre-req and wrong TCP statement * Apply suggestions from code review Co-authored-by: Brendan Irvine-Broque <birvine-broque@cloudflare.com> * Apply suggestions from code review * Update pricing docs, make sure to clarify what is part of Workers Paid plan * Various tweaks --------- Co-authored-by: kodster28 <kody@cloudflare.com> Co-authored-by: Nikita Sharma <54369599+nikitassharma@users.noreply.github.com> Co-authored-by: Brendan Irvine-Broque <birvine-broque@cloudflare.com>

Summary
Adds documentation for an upcoming feature 🤫 🤐 🙈
Documentation checklist