@ductape/cli 0.5.9 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -459,6 +459,7 @@ export const AZURE_DEPLOY_TROUBLESHOOTING = [
|
|
|
459
459
|
export const CLOUDFLARE_DEPLOY_ROLE_LIST = [
|
|
460
460
|
{ role: 'Account / Workers Scripts / Edit', for: 'create Worker versions and deployments, and the placeholder that stands in until a release is checked' },
|
|
461
461
|
{ role: 'Account / Workers KV Storage / Edit', for: 'keep release bundles in a namespace named ductape-releases until they are deployed' },
|
|
462
|
+
{ role: 'Account / Workers Containers / Edit', for: 'only to deploy container images (cloudflare_containers): copy them into the account\'s Cloudflare registry, prepare them and create the Container application; needs the Workers Paid plan' },
|
|
462
463
|
];
|
|
463
464
|
export const CLOUDFLARE_DEPLOY_CREATES = [
|
|
464
465
|
'A Workers KV namespace named ductape-releases, where each release bundle waits until it is deployed (the bundle stays in your account; Ductape keeps only its digest)',
|
|
@@ -466,15 +467,18 @@ export const CLOUDFLARE_DEPLOY_CREATES = [
|
|
|
466
467
|
'One Worker version per release, tagged with the release hash, carrying the deployment\'s signing key as a secret binding',
|
|
467
468
|
'One deployment per traffic change: Cloudflare\'s own gradual rollout, with the percentages you plan',
|
|
468
469
|
'A workers.dev address for each Worker and a preview address for each version, so a release is called and checked before it takes any traffic',
|
|
470
|
+
'For container images (cloudflare_containers): the image copied into registry.cloudflare.com under the account, one router Worker per deployment with a Durable Object class, one Container application, and each release\'s environment encrypted in Workers KV (only the key is a Worker secret)',
|
|
469
471
|
];
|
|
470
472
|
export const CLOUDFLARE_DEPLOY_SAFETY = 'Ductape only adds resources it tags as its own (ductape_managed), never changes or reuses one it did not create, and never deletes anything, including what it created. Removing deployed Workers is always your own action. A Worker has no cloud-level access check in front of it: the function\'s own signature check, which every call must pass, is the access control. Only functions can run on Workers, not services, and only TypeScript functions.';
|
|
471
473
|
export const CLOUDFLARE_DEPLOY_TROUBLESHOOTING = [
|
|
472
474
|
{ problem: 'Validation says the token lacks permissions', fix: 'Edit the API token and add Account / Workers Scripts / Edit and Account / Workers KV Storage / Edit, limited to this account, then validate again.' },
|
|
475
|
+
{ problem: 'A container deploy is refused while copying the image into the Cloudflare registry ("Authentication error", 10000)', fix: 'Edit the API token and add Account / Workers Containers / Edit (under Developer Platform). The account must be on the Workers Paid plan.' },
|
|
476
|
+
{ problem: 'The image is built for linux/arm64', fix: 'Cloudflare Containers run linux/amd64 only. Build with --platform linux/amd64, or publish a multi-platform image that includes it.' },
|
|
473
477
|
{ problem: '"has no workers.dev subdomain"', fix: 'Set one under Workers & Pages in the dashboard. Deployed functions are reached on it.' },
|
|
474
478
|
{ problem: '"not in this Cloudflare account (namespace ductape-releases)"', fix: 'Publish the bundle again with ductape deploy releases publish-worker. Releases are published through one connection and deployed through the same one.' },
|
|
475
479
|
{ problem: 'A plan says this release is a container image, or a Worker bundle', fix: 'A release is made of one kind of artifact. Bundles run only on cloudflare_workers targets and images only on the others.' },
|
|
476
480
|
{ problem: 'A plan is blocked on timeout', fix: 'A Worker is stopped after 30 seconds of CPU time. Lower the contract\'s timeout_ms, or deploy that function to Cloud Run, Lambda or Container Apps.' },
|
|
477
|
-
{ problem: 'The cloud refuses cpu, memory or instance settings', fix: 'Cloudflare manages size and scaling
|
|
481
|
+
{ problem: 'The cloud refuses cpu, memory or instance settings', fix: 'On Workers, Cloudflare manages size and scaling: remove the runtime block. On Containers only cpu, memory and maxInstances apply; they pick the instance type and how many containers share a release.' },
|
|
478
482
|
{ problem: 'Cloudflare only keeps the last 100 versions', fix: 'Rolling back to a release that is older than that fails with a clear message. Publish and deploy it again.' },
|
|
479
483
|
];
|
|
480
484
|
export const GCP_DEPLOY_APIS = [
|
|
@@ -562,12 +566,12 @@ export function connectionGuide(providerInput, purposeInput = 'resources') {
|
|
|
562
566
|
if (provider === 'cloudflare' && purpose === 'deploy') {
|
|
563
567
|
return {
|
|
564
568
|
...base, supported: true,
|
|
565
|
-
summary: 'Lets Ductape deploy your TypeScript functions to Cloudflare Workers in your own account, through an API token you create and can read. Workers have no container: you publish a JavaScript bundle.',
|
|
569
|
+
summary: 'Lets Ductape deploy your TypeScript functions to Cloudflare Workers, and container images (services included) to Cloudflare Containers, in your own account, through an API token you create and can read. Workers have no container: you publish a JavaScript bundle. Containers take a linux/amd64 image, which Ductape copies into the account\'s Cloudflare registry.',
|
|
566
570
|
steps: [
|
|
567
571
|
{ step: 1, who: 'you', title: 'Find your account id', notes: ['In the Cloudflare dashboard, open Workers & Pages. The account id is on the right and is 32 characters. Make sure the account has a workers.dev subdomain.'] },
|
|
568
572
|
{
|
|
569
|
-
step: 2, who: 'you', title: 'Create an API token
|
|
570
|
-
notes: ['Manage Account, Account API Tokens, Create Token, Create Custom Token. Add Account / Workers Scripts / Edit and Account / Workers KV Storage / Edit
|
|
573
|
+
step: 2, who: 'you', title: 'Create an API token',
|
|
574
|
+
notes: ['Manage Account, Account API Tokens, Create Token, Create Custom Token. Add Account / Workers Scripts / Edit and Account / Workers KV Storage / Edit. To deploy container images also add Account / Workers Containers / Edit (listed under Developer Platform); the account then needs the Workers Paid plan. Limit it to this account and create it. Cloudflare shows the token once.'],
|
|
571
575
|
},
|
|
572
576
|
{ step: 3, who: 'you', title: 'Put the token in an environment variable', commands: ['read -s CLOUDFLARE_API_TOKEN && export CLOUDFLARE_API_TOKEN'], notes: ['This keeps the token out of the command line and shell history.'] },
|
|
573
577
|
{ step: 4, who: 'ductape', title: 'Create the connection', commands: ['ductape cloud connections create --provider cloudflare --name "<NAME>" --tag <TAG> --deploy'] },
|
|
@@ -580,6 +584,7 @@ export function connectionGuide(providerInput, purposeInput = 'resources') {
|
|
|
580
584
|
next: [
|
|
581
585
|
'Publish a release: ductape deploy releases publish-worker --file release.json --connection <TAG> --entry src/index.ts (or --bundle dist/index.js). The file holds product, function, version, contract, config and verification, and no image.',
|
|
582
586
|
'Plan and apply as usual with a target of kind cloudflare_workers on that connection. Release, plan, approval, canary and rollback work the same as on the other clouds.',
|
|
587
|
+
'For a container image: register it with ductape deploy releases register (a public image on Docker Hub or GHCR, or one already in registry.cloudflare.com under the account), then plan with a target of kind cloudflare_containers. runtime.cpu and runtime.memory pick the instance type and runtime.maxInstances how many containers share a release.',
|
|
583
588
|
CLOUDFLARE_DEPLOY_SAFETY,
|
|
584
589
|
],
|
|
585
590
|
};
|
package/package.json
CHANGED