@caelo-cms/provisioning 0.11.4 → 0.11.6
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/agent-db.js +523 -105
- package/dist/compose.d.ts +7 -0
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +20 -0
- package/dist/compose.js.map +1 -1
- package/dist/converge-job.d.ts.map +1 -1
- package/dist/converge-job.js +6 -2
- package/dist/converge-job.js.map +1 -1
- package/dist/pool-budget-stack.d.ts +78 -0
- package/dist/pool-budget-stack.d.ts.map +1 -0
- package/dist/pool-budget-stack.js +78 -0
- package/dist/pool-budget-stack.js.map +1 -0
- package/package.json +2 -2
- package/src/compose.ts +22 -0
- package/src/converge-job.test.ts +28 -0
- package/src/converge-job.ts +6 -2
- package/src/gateway-env-isolation.test.ts +2 -0
- package/src/pool-budget-stack.ts +116 -0
- package/src/pool-budget-stacks.test.ts +100 -0
- package/src/self-hosted-compose.test.ts +23 -0
- package/src/stack-contract-parity.test.ts +6 -2
- package/stacks/aws/Pulumi.yaml +12 -0
- package/stacks/aws/README.md +1 -0
- package/stacks/aws/index.ts +36 -0
- package/stacks/azure/Pulumi.yaml +4 -0
- package/stacks/azure/README.md +1 -0
- package/stacks/azure/index.ts +35 -2
- package/stacks/gcp/Pulumi.yaml +16 -8
- package/stacks/gcp/README.md +7 -3
- package/stacks/gcp/index.ts +45 -20
- package/stacks/gcp-firebase/Pulumi.yaml +5 -1
- package/stacks/gcp-firebase/index.ts +27 -3
- package/stacks/self-hosted/README.md +4 -0
|
@@ -37,6 +37,11 @@ import {
|
|
|
37
37
|
MCP_IAP_SERVICE_ACCOUNT_ID,
|
|
38
38
|
runServiceAccountId,
|
|
39
39
|
} from "../../dist/gcp-names.js";
|
|
40
|
+
import {
|
|
41
|
+
DEFAULT_GATEWAY_MAX_INSTANCES,
|
|
42
|
+
DEFAULT_MAX_CONNECTIONS,
|
|
43
|
+
stackPoolBudget,
|
|
44
|
+
} from "../../dist/pool-budget-stack.js";
|
|
40
45
|
import {
|
|
41
46
|
ADMIN_MEMORY_DEFAULT,
|
|
42
47
|
adminEnvContract,
|
|
@@ -93,7 +98,21 @@ const adminMinInstances = Number.parseInt(cfg.get("adminMinInstances") ?? "0", 1
|
|
|
93
98
|
const adminMemory = cfg.get("adminMemory") ?? ADMIN_MEMORY_DEFAULT;
|
|
94
99
|
const adminMaxInstances = Number.parseInt(cfg.get("adminMaxInstances") ?? "5", 10);
|
|
95
100
|
const gatewayMinInstances = Number.parseInt(cfg.get("gatewayMinInstances") ?? "0", 10);
|
|
96
|
-
|
|
101
|
+
// #1254 — part of the connection budget (stacks/gcp has the long comment).
|
|
102
|
+
const gatewayMaxInstances = Number.parseInt(
|
|
103
|
+
cfg.get("gatewayMaxInstances") ?? String(DEFAULT_GATEWAY_MAX_INSTANCES),
|
|
104
|
+
10,
|
|
105
|
+
);
|
|
106
|
+
const maxConnections = Number.parseInt(
|
|
107
|
+
cfg.get("maxConnections") ?? String(DEFAULT_MAX_CONNECTIONS["gcp-firebase"]),
|
|
108
|
+
10,
|
|
109
|
+
);
|
|
110
|
+
// #1254 — every service's pool sizes, from the server's max_connections.
|
|
111
|
+
const poolBudget = stackPoolBudget("gcp-firebase", {
|
|
112
|
+
maxConnections,
|
|
113
|
+
adminMaxInstances,
|
|
114
|
+
gatewayMaxInstances,
|
|
115
|
+
});
|
|
97
116
|
const backupRetentionDays = Number.parseInt(cfg.get("backupRetentionDays") ?? "7", 10);
|
|
98
117
|
const iapAllowlistRaw = cfg.get("iapAllowlist");
|
|
99
118
|
const iapAllowlist =
|
|
@@ -655,7 +674,7 @@ const envContractInputs = {
|
|
|
655
674
|
const gatewaySvc = cloudRunService({
|
|
656
675
|
serviceName: "gateway",
|
|
657
676
|
minInstances: gatewayMinInstances,
|
|
658
|
-
maxInstances:
|
|
677
|
+
maxInstances: gatewayMaxInstances,
|
|
659
678
|
memory: "512Mi",
|
|
660
679
|
// #806 — remote MCP: chat turns stream through the gateway for minutes
|
|
661
680
|
// (stack-contract.ts GATEWAY_TIMEOUT_SECONDS). The Firebase Hosting
|
|
@@ -670,7 +689,11 @@ const gatewaySvc = cloudRunService({
|
|
|
670
689
|
// request passes its rate limits, captcha and honeypot; staging requests
|
|
671
690
|
// pass the staging access gate.
|
|
672
691
|
ingress: "INGRESS_TRAFFIC_ALL",
|
|
673
|
-
contractEnv: [
|
|
692
|
+
contractEnv: [
|
|
693
|
+
...gatewayEnvContract(envContractInputs),
|
|
694
|
+
...remoteMcpEnv.gateway,
|
|
695
|
+
...poolBudget.env.gateway,
|
|
696
|
+
],
|
|
674
697
|
});
|
|
675
698
|
|
|
676
699
|
const adminSvc = cloudRunService({
|
|
@@ -693,6 +716,7 @@ const adminSvc = cloudRunService({
|
|
|
693
716
|
gatewayService: gatewaySvc.name,
|
|
694
717
|
}),
|
|
695
718
|
...remoteMcpEnv.admin,
|
|
719
|
+
...poolBudget.env.admin,
|
|
696
720
|
],
|
|
697
721
|
mediaVolume: adminMediaVolumeTemplate(adminMediaVolume(project, env)),
|
|
698
722
|
});
|
|
@@ -32,6 +32,10 @@ pulumi stack output bootstrapUrl
|
|
|
32
32
|
|
|
33
33
|
Open that URL once Caddy has issued the cert (~30 s).
|
|
34
34
|
|
|
35
|
+
## Connection budget
|
|
36
|
+
|
|
37
|
+
The generated Compose file starts Postgres with `max_connections=100` and sizes every pool from it (#1254, docs/dev/connection-budget.md): the admin gets a cms_admin pool of 77 and a cms_public pool of 4, the gateway a pool of 2, and static builds 2 per pool.
|
|
38
|
+
|
|
35
39
|
## Destroy
|
|
36
40
|
|
|
37
41
|
```bash
|