@caelo-cms/provisioning 0.10.29 → 0.10.30
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.
- package/dist/admin-domain.d.ts +54 -0
- package/dist/admin-domain.d.ts.map +1 -0
- package/dist/admin-domain.js +122 -0
- package/dist/admin-domain.js.map +1 -0
- package/dist/cli.js +65 -6
- package/dist/cli.js.map +1 -1
- package/dist/compose.d.ts +7 -9
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +17 -1
- package/dist/compose.js.map +1 -1
- package/dist/deployed-release.d.ts +67 -0
- package/dist/deployed-release.d.ts.map +1 -0
- package/dist/deployed-release.js +144 -0
- package/dist/deployed-release.js.map +1 -0
- package/dist/gcloud-retry.d.ts +16 -0
- package/dist/gcloud-retry.d.ts.map +1 -0
- package/dist/gcloud-retry.js +17 -0
- package/dist/gcloud-retry.js.map +1 -0
- package/dist/gcloud.d.ts.map +1 -1
- package/dist/gcloud.js +2 -0
- package/dist/gcloud.js.map +1 -1
- package/dist/gcp-names.d.ts +58 -0
- package/dist/gcp-names.d.ts.map +1 -0
- package/dist/gcp-names.js +88 -0
- package/dist/gcp-names.js.map +1 -0
- package/dist/install-state.d.ts +31 -0
- package/dist/install-state.d.ts.map +1 -1
- package/dist/install-state.js +38 -0
- package/dist/install-state.js.map +1 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +314 -46
- package/dist/lifecycle.js.map +1 -1
- package/dist/mcp-iap.d.ts +5 -26
- package/dist/mcp-iap.d.ts.map +1 -1
- package/dist/mcp-iap.js +6 -18
- package/dist/mcp-iap.js.map +1 -1
- package/dist/migration-runner.d.ts +25 -0
- package/dist/migration-runner.d.ts.map +1 -1
- package/dist/migration-runner.js +60 -19
- package/dist/migration-runner.js.map +1 -1
- package/dist/operator-access.d.ts +83 -0
- package/dist/operator-access.d.ts.map +1 -0
- package/dist/operator-access.js +562 -0
- package/dist/operator-access.js.map +1 -0
- package/dist/runtime-secrets.d.ts +128 -0
- package/dist/runtime-secrets.d.ts.map +1 -0
- package/dist/runtime-secrets.js +444 -0
- package/dist/runtime-secrets.js.map +1 -0
- package/dist/stack-contract.d.ts +231 -0
- package/dist/stack-contract.d.ts.map +1 -0
- package/dist/stack-contract.js +455 -0
- package/dist/stack-contract.js.map +1 -0
- package/dist/stack-converge.d.ts +183 -0
- package/dist/stack-converge.d.ts.map +1 -0
- package/dist/stack-converge.js +513 -0
- package/dist/stack-converge.js.map +1 -0
- package/dist/wizard.d.ts.map +1 -1
- package/dist/wizard.js +8 -1
- package/dist/wizard.js.map +1 -1
- package/dist/wizards/gcp-cost.d.ts +6 -10
- package/dist/wizards/gcp-cost.d.ts.map +1 -1
- package/dist/wizards/gcp-cost.js +34 -2
- package/dist/wizards/gcp-cost.js.map +1 -1
- package/dist/wizards/gcp-pulumi.d.ts +32 -1
- package/dist/wizards/gcp-pulumi.d.ts.map +1 -1
- package/dist/wizards/gcp-pulumi.js +60 -5
- package/dist/wizards/gcp-pulumi.js.map +1 -1
- package/dist/wizards/gcp.d.ts.map +1 -1
- package/dist/wizards/gcp.js +79 -16
- package/dist/wizards/gcp.js.map +1 -1
- package/package.json +3 -3
- package/stacks/aws/Pulumi.yaml +4 -0
- package/stacks/aws/index.ts +11 -0
- package/stacks/azure/Pulumi.yaml +4 -0
- package/stacks/azure/index.ts +10 -1
- package/stacks/gcp/Pulumi.yaml +4 -3
- package/stacks/gcp/README.md +13 -2
- package/stacks/gcp/index.ts +200 -140
- package/stacks/gcp-firebase/Pulumi.yaml +4 -0
- package/stacks/gcp-firebase/index.ts +165 -75
- package/stacks/self-hosted/Pulumi.yaml +4 -0
- package/stacks/self-hosted/index.ts +3 -0
package/stacks/aws/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ import * as awsx from "@pulumi/awsx";
|
|
|
32
32
|
import * as pulumi from "@pulumi/pulumi";
|
|
33
33
|
import type { CloudAdapterOutputs, DnsRecord } from "../../dist/adapter.js";
|
|
34
34
|
import { generateBootstrapToken } from "../../dist/bootstrap-token.js";
|
|
35
|
+
import { ADMIN_MEMORY_DEFAULT, memoryQuantityMiB } from "../../dist/stack-contract.js";
|
|
35
36
|
|
|
36
37
|
const cfg = new pulumi.Config();
|
|
37
38
|
const domain = cfg.require("domain");
|
|
@@ -40,6 +41,16 @@ const _region = cfg.get("region") ?? "us-east-1";
|
|
|
40
41
|
const rdsInstanceClass = cfg.get("rdsInstanceClass") ?? "db.t4g.small";
|
|
41
42
|
const _fargateCpu = cfg.get("fargateCpu") ?? "512";
|
|
42
43
|
const _fargateMemoryMb = cfg.get("fargateMemoryMb") ?? "1024";
|
|
44
|
+
// #553 — the admin's memory, same knob + default as every adapter
|
|
45
|
+
// (stack-contract.ts). This stack does not define ECS task definitions for
|
|
46
|
+
// any Caelo service yet (see `fargateCpu` / `fargateMemoryMb`); the value
|
|
47
|
+
// is validated now so a config set today fails loudly instead of being
|
|
48
|
+
// ignored, and the admin task definition sizes itself from it.
|
|
49
|
+
const adminMemory = cfg.get("adminMemory") ?? ADMIN_MEMORY_DEFAULT;
|
|
50
|
+
const _adminMemoryMiB = memoryQuantityMiB(adminMemory);
|
|
51
|
+
if (_adminMemoryMiB === null) {
|
|
52
|
+
throw new Error(`caelo-aws:adminMemory "${adminMemory}" is not a memory quantity (e.g. 2Gi)`);
|
|
53
|
+
}
|
|
43
54
|
|
|
44
55
|
// Pulumi stack name doubles as the environment label so a single
|
|
45
56
|
// project supports `pulumi stack init dev|staging|production`.
|
package/stacks/azure/Pulumi.yaml
CHANGED
|
@@ -31,6 +31,10 @@ config:
|
|
|
31
31
|
type: string
|
|
32
32
|
default: westeurope
|
|
33
33
|
description: Azure region. Container Apps regional availability is checked at preview.
|
|
34
|
+
caelo-azure:adminMemory:
|
|
35
|
+
type: string
|
|
36
|
+
default: "2Gi"
|
|
37
|
+
description: Admin container memory (CPU follows at 2 GiB per vCPU). 2Gi leaves room for the Lighthouse quality audit.
|
|
34
38
|
caelo-azure:flexibleServerSku:
|
|
35
39
|
type: string
|
|
36
40
|
default: Standard_B2s
|
package/stacks/azure/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ import * as azure from "@pulumi/azure-native";
|
|
|
40
40
|
import * as pulumi from "@pulumi/pulumi";
|
|
41
41
|
import type { CloudAdapterOutputs, DnsRecord } from "../../dist/adapter.js";
|
|
42
42
|
import { generateBootstrapToken } from "../../dist/bootstrap-token.js";
|
|
43
|
+
import { ADMIN_MEMORY_DEFAULT, azureContainerAppResources } from "../../dist/stack-contract.js";
|
|
43
44
|
|
|
44
45
|
const cfg = new pulumi.Config();
|
|
45
46
|
const domain = cfg.require("domain");
|
|
@@ -48,6 +49,11 @@ const subscription = cfg.require("subscription");
|
|
|
48
49
|
const rgName = cfg.get("resourceGroup") ?? "caelo-rg";
|
|
49
50
|
const location = cfg.get("location") ?? "westeurope";
|
|
50
51
|
const flexibleServerSku = cfg.get("flexibleServerSku") ?? "Standard_B2s";
|
|
52
|
+
// #553 — the admin runs the Lighthouse quality audit; same knob + default
|
|
53
|
+
// as every adapter (stack-contract.ts). Container Apps only accepts fixed
|
|
54
|
+
// CPU/memory pairs (2 GiB per vCPU), so the admin's CPU follows its memory
|
|
55
|
+
// and an unsupported size is refused here.
|
|
56
|
+
const adminResources = azureContainerAppResources(cfg.get("adminMemory") ?? ADMIN_MEMORY_DEFAULT);
|
|
51
57
|
|
|
52
58
|
const env = pulumi.getStack() as "dev" | "staging" | "production";
|
|
53
59
|
const namePrefix = `caelo${env}`; // Azure resource names disallow hyphens in some types.
|
|
@@ -200,6 +206,8 @@ const cappEnv = new azure.app.ManagedEnvironment(`${namePrefix}-capp-env`, {
|
|
|
200
206
|
interface ContainerAppArgs {
|
|
201
207
|
readonly serviceName: string;
|
|
202
208
|
readonly extraEnv?: ReadonlyArray<{ name: string; value: pulumi.Input<string> }>;
|
|
209
|
+
/** Defaults to 0.5 vCPU / 1 GiB. */
|
|
210
|
+
readonly resources?: { readonly cpu: number; readonly memory: string };
|
|
203
211
|
}
|
|
204
212
|
|
|
205
213
|
function containerApp(args: ContainerAppArgs): azure.app.ContainerApp {
|
|
@@ -236,7 +244,7 @@ function containerApp(args: ContainerAppArgs): azure.app.ContainerApp {
|
|
|
236
244
|
},
|
|
237
245
|
...(args.extraEnv ?? []),
|
|
238
246
|
],
|
|
239
|
-
resources: { cpu: 0.5, memory: "1.0Gi" },
|
|
247
|
+
resources: args.resources ?? { cpu: 0.5, memory: "1.0Gi" },
|
|
240
248
|
},
|
|
241
249
|
],
|
|
242
250
|
},
|
|
@@ -245,6 +253,7 @@ function containerApp(args: ContainerAppArgs): azure.app.ContainerApp {
|
|
|
245
253
|
|
|
246
254
|
const adminApp = containerApp({
|
|
247
255
|
serviceName: "admin",
|
|
256
|
+
resources: adminResources,
|
|
248
257
|
// #551 — the public site URL; the admin seeds site_defaults.site_base_url
|
|
249
258
|
// from it (canonical, og:url, sitemap) when it is not configured yet.
|
|
250
259
|
extraEnv: [{ name: "CAELO_SITE_URL", value: `https://${domain}` }],
|
package/stacks/gcp/Pulumi.yaml
CHANGED
|
@@ -50,6 +50,10 @@ config:
|
|
|
50
50
|
type: string
|
|
51
51
|
default: "0"
|
|
52
52
|
description: Admin Cloud Run min instances. 0 = scale to zero. 1 = no cold start (+~$15/mo).
|
|
53
|
+
caelo-gcp:adminMemory:
|
|
54
|
+
type: string
|
|
55
|
+
default: "2Gi"
|
|
56
|
+
description: Admin Cloud Run memory. 2Gi leaves room for the Lighthouse quality audit next to editor requests; billed only while an instance runs.
|
|
53
57
|
caelo-gcp:adminMaxInstances:
|
|
54
58
|
type: string
|
|
55
59
|
default: "5"
|
|
@@ -87,8 +91,5 @@ config:
|
|
|
87
91
|
default: false
|
|
88
92
|
description: Block `pulumi destroy` on Cloud SQL + Cloud Run. Defaults off for operator-friendly teardown; flip true for production deploys you never want to accidentally destroy.
|
|
89
93
|
# Optional config NOT declared above:
|
|
90
|
-
# caelo-gcp:resendApiKey (secret) — Resend API key for newsletter / auth
|
|
91
|
-
# plugin email transport. Set via `cat key | pulumi config set --secret`.
|
|
92
|
-
# Omit to ship without email transport (plugins log to stderr until wired).
|
|
93
94
|
# caelo-gcp:image-admin / image-gateway — image tags for Cloud Run services.
|
|
94
95
|
# Default `<region>-docker.pkg.dev/<project>/caelo/<service>:latest`.
|
package/stacks/gcp/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Pulumi stack provisioning Caelo on GCP managed services. Implements the shared `
|
|
|
11
11
|
| CDN | Cloud CDN backend bucket (operator wires the URL map + load balancer for v1; full LB in P15 review-pass) |
|
|
12
12
|
| Edge compute (A/B + redirects) | Cloud Run service `<env>-edge-router` running `edge-handler.ts` with `@caelo-cms/edge-router` |
|
|
13
13
|
| Container runtime | Four Cloud Run services (admin / gateway / orchestrator / runner) |
|
|
14
|
-
| Secret store | Secret Manager
|
|
14
|
+
| Secret store | Secret Manager: postgres-password + secret-kek (Pulumi), internal-secret + tool-approval-secret (created by the CLI before `pulumi up`, see `src/runtime-secrets.ts`). Cloud Run reads each as a `secretKeyRef`; database URLs carry no password. |
|
|
15
15
|
| Edge-log sink | Cloud Logging project sink → BigQuery dataset `<env>_edge_logs` (queryable by P12A analytics plugin) |
|
|
16
16
|
|
|
17
17
|
The Caelo runtime never knows it's on GCP — every Cloud Run service consumes plain `DATABASE_URL` / `MEDIA_STORAGE_URL` / `SECRETS_PROVIDER` env vars.
|
|
@@ -37,12 +37,23 @@ gcloud auth configure-docker us-central1-docker.pkg.dev
|
|
|
37
37
|
gcloud builds submit ... --tag us-central1-docker.pkg.dev/$PROJECT/caelo/admin:latest
|
|
38
38
|
# Repeat for gateway, orchestrator, runner, edge-router.
|
|
39
39
|
|
|
40
|
+
# The stack references two secrets it does not create (the CLI wizard and
|
|
41
|
+
# `upgrade` create them; a direct `pulumi up` needs them first). Values go
|
|
42
|
+
# on stdin, never argv. Match --replication-policy to the stack's
|
|
43
|
+
# secretReplication config (`automatic` or `user-managed --locations=<region>`).
|
|
44
|
+
for s in internal-secret tool-approval-secret; do
|
|
45
|
+
openssl rand -hex 32 | tr -d '\n' | gcloud secrets create "caelo-production-$s" \
|
|
46
|
+
--project=$PROJECT --replication-policy=automatic --data-file=-
|
|
47
|
+
done
|
|
48
|
+
|
|
40
49
|
# Bring the stack up.
|
|
41
50
|
pulumi up
|
|
42
51
|
|
|
43
52
|
# Sync outputs into cms_admin.provisioning_outputs so the admin's
|
|
44
53
|
# /security/dns page surfaces the required DNS records.
|
|
45
|
-
|
|
54
|
+
CAELO_INTERNAL_SECRET=$(gcloud secrets versions access latest \
|
|
55
|
+
--secret=caelo-production-internal-secret --project=$PROJECT) \
|
|
56
|
+
CAELO_ADMIN_URL=https://admin.example.com \
|
|
46
57
|
bunx cms-provision pulumi-output-sync --environment production
|
|
47
58
|
```
|
|
48
59
|
|