@caelo-cms/provisioning 0.12.4 → 0.12.5
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 +8 -3
- package/dist/cli-routing.d.ts.map +1 -1
- package/dist/cli-routing.js +6 -5
- package/dist/cli-routing.js.map +1 -1
- package/dist/cli.js +18 -1
- package/dist/cli.js.map +1 -1
- package/dist/gcp-names.d.ts +51 -0
- package/dist/gcp-names.d.ts.map +1 -1
- package/dist/gcp-names.js +75 -0
- package/dist/gcp-names.js.map +1 -1
- package/dist/infra-contract.d.ts +1 -1
- package/dist/infra-contract.d.ts.map +1 -1
- package/dist/infra-contract.js +42 -1
- package/dist/infra-contract.js.map +1 -1
- package/dist/install-state.d.ts +8 -0
- package/dist/install-state.d.ts.map +1 -1
- package/dist/install-state.js +12 -0
- package/dist/install-state.js.map +1 -1
- package/dist/install-version.d.ts +110 -0
- package/dist/install-version.d.ts.map +1 -0
- package/dist/install-version.js +162 -0
- package/dist/install-version.js.map +1 -0
- package/dist/lifecycle.d.ts +6 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +46 -1
- package/dist/lifecycle.js.map +1 -1
- package/dist/release-candidate.d.ts +67 -0
- package/dist/release-candidate.d.ts.map +1 -0
- package/dist/release-candidate.js +138 -0
- package/dist/release-candidate.js.map +1 -0
- package/dist/reporting-job-setup.d.ts +102 -0
- package/dist/reporting-job-setup.d.ts.map +1 -0
- package/dist/reporting-job-setup.js +347 -0
- package/dist/reporting-job-setup.js.map +1 -0
- package/dist/self-hosted-upgrade.d.ts.map +1 -1
- package/dist/self-hosted-upgrade.js +18 -3
- package/dist/self-hosted-upgrade.js.map +1 -1
- package/dist/stack-contract.d.ts +30 -5
- package/dist/stack-contract.d.ts.map +1 -1
- package/dist/stack-contract.js +74 -10
- package/dist/stack-contract.js.map +1 -1
- package/dist/upgrade/admin-image-jobs.d.ts +13 -5
- package/dist/upgrade/admin-image-jobs.d.ts.map +1 -1
- package/dist/upgrade/admin-image-jobs.js +22 -2
- package/dist/upgrade/admin-image-jobs.js.map +1 -1
- package/dist/upgrade/converge.d.ts.map +1 -1
- package/dist/upgrade/converge.js +99 -9
- package/dist/upgrade/converge.js.map +1 -1
- package/dist/upgrade/release-images.d.ts +6 -2
- package/dist/upgrade/release-images.d.ts.map +1 -1
- package/dist/upgrade/release-images.js +5 -5
- package/dist/upgrade/release-images.js.map +1 -1
- package/dist/upgrader-iam-preflight.d.ts.map +1 -1
- package/dist/upgrader-iam-preflight.js +19 -1
- package/dist/upgrader-iam-preflight.js.map +1 -1
- package/dist/upgrader-setup.d.ts.map +1 -1
- package/dist/upgrader-setup.js +16 -1
- package/dist/upgrader-setup.js.map +1 -1
- package/dist/wizard.d.ts +7 -0
- package/dist/wizard.d.ts.map +1 -1
- package/dist/wizard.js +20 -5
- package/dist/wizard.js.map +1 -1
- package/dist/wizards/gcp-cost.d.ts +7 -11
- package/dist/wizards/gcp-cost.d.ts.map +1 -1
- package/dist/wizards/gcp-cost.js +47 -36
- package/dist/wizards/gcp-cost.js.map +1 -1
- package/dist/wizards/gcp-firebase.d.ts +4 -0
- package/dist/wizards/gcp-firebase.d.ts.map +1 -1
- package/dist/wizards/gcp-firebase.js +2 -0
- package/dist/wizards/gcp-firebase.js.map +1 -1
- package/dist/wizards/gcp-install-job.d.ts +10 -0
- package/dist/wizards/gcp-install-job.d.ts.map +1 -1
- package/dist/wizards/gcp-install-job.js +41 -10
- package/dist/wizards/gcp-install-job.js.map +1 -1
- package/dist/wizards/gcp.d.ts +7 -0
- package/dist/wizards/gcp.d.ts.map +1 -1
- package/dist/wizards/gcp.js +191 -9
- package/dist/wizards/gcp.js.map +1 -1
- package/package.json +2 -2
- package/src/cli-routing.test.ts +1 -1
- package/src/cli-routing.ts +6 -5
- package/src/cli.ts +18 -1
- package/src/cpu-idle.test.ts +7 -2
- package/src/gcp-names.ts +87 -0
- package/src/infra-contract.test.ts +6 -3
- package/src/infra-contract.ts +42 -1
- package/src/install-state.ts +12 -0
- package/src/install-version.test.ts +366 -0
- package/src/install-version.ts +205 -0
- package/src/lifecycle.ts +65 -3
- package/src/release-candidate.test.ts +191 -0
- package/src/release-candidate.ts +172 -0
- package/src/reporting-job-setup.test.ts +392 -0
- package/src/reporting-job-setup.ts +431 -0
- package/src/self-hosted-upgrade.ts +18 -3
- package/src/stack-contract.test.ts +24 -0
- package/src/stack-contract.ts +87 -9
- package/src/stack-converge-secrets.test.ts +2 -0
- package/src/stack-converge.test.ts +3 -3
- package/src/upgrade/admin-image-jobs.ts +35 -6
- package/src/upgrade/converge.ts +137 -8
- package/src/upgrade/release-images.test.ts +2 -2
- package/src/upgrade/release-images.ts +6 -4
- package/src/upgrade/upgrade.test.ts +165 -4
- package/src/upgrader-iam-preflight.test.ts +58 -0
- package/src/upgrader-iam-preflight.ts +21 -0
- package/src/upgrader-job.test.ts +3 -0
- package/src/upgrader-setup.test.ts +6 -0
- package/src/upgrader-setup.ts +18 -0
- package/src/wizard.ts +30 -5
- package/src/wizards/gcp-cost.test.ts +11 -13
- package/src/wizards/gcp-cost.ts +49 -36
- package/src/wizards/gcp-firebase.ts +6 -0
- package/src/wizards/gcp-install-job.ts +46 -12
- package/src/wizards/gcp.ts +250 -7
- package/stacks/aws/index.ts +10 -0
- package/stacks/azure/index.ts +10 -0
package/src/wizards/gcp.ts
CHANGED
|
@@ -30,7 +30,12 @@ import { randomBytes } from "node:crypto";
|
|
|
30
30
|
import { existsSync, readFileSync } from "node:fs";
|
|
31
31
|
import { homedir } from "node:os";
|
|
32
32
|
import { join } from "node:path";
|
|
33
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
CAELO_VERSION,
|
|
35
|
+
CLOUD_SQL_CA_BUNDLE,
|
|
36
|
+
provisioningCommand,
|
|
37
|
+
verifyFullQuery,
|
|
38
|
+
} from "@caelo-cms/shared";
|
|
34
39
|
import { cancel, confirm, isCancel, log, note, select, spinner } from "@clack/prompts";
|
|
35
40
|
import { bold, cyan, dim, green, red, yellow } from "kleur/colors";
|
|
36
41
|
import { checkAdcImpersonation } from "../adc-impersonation.js";
|
|
@@ -75,7 +80,10 @@ import {
|
|
|
75
80
|
serviceAccountExists,
|
|
76
81
|
} from "../gcloud.js";
|
|
77
82
|
import {
|
|
83
|
+
auditRunnerServiceAccountEmail,
|
|
84
|
+
buildCarrierServiceAccountEmail,
|
|
78
85
|
GCP_STACK_ENV,
|
|
86
|
+
importCrawlServiceAccountEmail,
|
|
79
87
|
schedulerServiceAccountEmail,
|
|
80
88
|
upgraderServiceAccountEmail,
|
|
81
89
|
} from "../gcp-names.js";
|
|
@@ -99,6 +107,7 @@ import {
|
|
|
99
107
|
writeMetadata,
|
|
100
108
|
writeSecret,
|
|
101
109
|
} from "../install-state.js";
|
|
110
|
+
import { decideInstallVersion, releaseToConfirm } from "../install-version.js";
|
|
102
111
|
import {
|
|
103
112
|
ensureOperatorAccessSync,
|
|
104
113
|
installIapAllowlist,
|
|
@@ -114,6 +123,11 @@ import {
|
|
|
114
123
|
} from "../provisioner-identity.js";
|
|
115
124
|
import { revokePublicRoleMemberships } from "../public-role-isolation.js";
|
|
116
125
|
import { decideRegion, detectCliRegion, installableRegions, suggestRegion } from "../regions.js";
|
|
126
|
+
import {
|
|
127
|
+
confirmReleaseCandidate,
|
|
128
|
+
isPrereleaseVersion,
|
|
129
|
+
RELEASE_CANDIDATE_RETENTION_DAYS,
|
|
130
|
+
} from "../release-candidate.js";
|
|
117
131
|
import {
|
|
118
132
|
checkRemoteMcpIdentityEnv,
|
|
119
133
|
ensureRemoteMcpEdge,
|
|
@@ -121,6 +135,11 @@ import {
|
|
|
121
135
|
type RemoteMcpTarget,
|
|
122
136
|
resolveStackRemoteMcpIdentity,
|
|
123
137
|
} from "../remote-mcp.js";
|
|
138
|
+
import {
|
|
139
|
+
ensureAuditRunnerJob,
|
|
140
|
+
ensureBuildCarrierJob,
|
|
141
|
+
ensureImportCrawlJob,
|
|
142
|
+
} from "../reporting-job-setup.js";
|
|
124
143
|
import type { RunMode } from "../run-mode.js";
|
|
125
144
|
import { ensureSchedulerTick } from "../scheduler-setup.js";
|
|
126
145
|
import { selfCommand } from "../self-command.js";
|
|
@@ -151,6 +170,7 @@ import {
|
|
|
151
170
|
releaseImageRef,
|
|
152
171
|
releaseVersionForDigest,
|
|
153
172
|
resolveOpsImageRef,
|
|
173
|
+
resolveReleaseImages,
|
|
154
174
|
verifyCosignAll,
|
|
155
175
|
} from "../upgrade/release-images.js";
|
|
156
176
|
import { ensureUpgraderJob, resolveUpgraderTarget } from "../upgrader-setup.js";
|
|
@@ -179,6 +199,13 @@ export interface GcpWizardOpts {
|
|
|
179
199
|
* install job in the project. Default `local`.
|
|
180
200
|
*/
|
|
181
201
|
runMode?: RunMode;
|
|
202
|
+
/**
|
|
203
|
+
* #1558 — `--version`: the release a new install runs (a release candidate
|
|
204
|
+
* included) instead of the newest stable one. See install-version.ts.
|
|
205
|
+
*/
|
|
206
|
+
version?: string;
|
|
207
|
+
/** #1558 — `--accept-release-candidate`: confirms a release candidate without a prompt. */
|
|
208
|
+
acceptReleaseCandidate?: boolean;
|
|
182
209
|
}
|
|
183
210
|
|
|
184
211
|
export async function runGcpWizard(opts: GcpWizardOpts): Promise<void> {
|
|
@@ -206,6 +233,14 @@ export async function runGcpWizard(opts: GcpWizardOpts): Promise<void> {
|
|
|
206
233
|
const region = await stepRegion(opts, projectId, meta);
|
|
207
234
|
if (meta) writeMetadata(installId, { ...meta, projectId, region });
|
|
208
235
|
|
|
236
|
+
// === 2.7. The release to install: `--version` (#1558) ===
|
|
237
|
+
// Settled before anything is created: a release candidate is confirmed
|
|
238
|
+
// here, and in local mode the release's images are resolved and
|
|
239
|
+
// cosign-verified now, so a mistyped or deleted release stops the run with
|
|
240
|
+
// nothing changed. In job mode the launcher verifies the release's signed
|
|
241
|
+
// manifest instead.
|
|
242
|
+
const version = await stepRequestedRelease(installId, projectId, provider, runMode, opts);
|
|
243
|
+
|
|
209
244
|
// === 3. Project create ===
|
|
210
245
|
await stepProjectCreate(installId, projectId, opts.domain);
|
|
211
246
|
|
|
@@ -299,6 +334,7 @@ export async function runGcpWizard(opts: GcpWizardOpts): Promise<void> {
|
|
|
299
334
|
region,
|
|
300
335
|
provisionerEmail: saEmail,
|
|
301
336
|
nonInteractive: opts.nonInteractive,
|
|
337
|
+
...(version ? { version } : {}),
|
|
302
338
|
});
|
|
303
339
|
return;
|
|
304
340
|
}
|
|
@@ -395,8 +431,13 @@ export async function runGcpConverge(opts: GcpConvergeOpts): Promise<void> {
|
|
|
395
431
|
}
|
|
396
432
|
const imageDigests = choice.digests;
|
|
397
433
|
if (choice.source !== "latest") {
|
|
434
|
+
const admin = dim(`${imageDigests.admin.slice(0, 19)}...`);
|
|
435
|
+
// A record on an install that has not been provisioned yet comes from
|
|
436
|
+
// `--version` or an earlier run that stopped (#1558).
|
|
398
437
|
log.info(
|
|
399
|
-
|
|
438
|
+
deployed
|
|
439
|
+
? `Keeping the release this install runs (admin ${admin}). Change versions with ${bold("upgrade")}.`
|
|
440
|
+
: `Installing the release recorded for this install${meta.releaseVersion ? ` (v${meta.releaseVersion})` : ""} (admin ${admin}).`,
|
|
400
441
|
);
|
|
401
442
|
}
|
|
402
443
|
|
|
@@ -578,6 +619,31 @@ export async function runGcpConverge(opts: GcpConvergeOpts): Promise<void> {
|
|
|
578
619
|
// Before the upgrader, which gets actAs on the job's service account.
|
|
579
620
|
await stepAuditJob(projectId, region, provider);
|
|
580
621
|
|
|
622
|
+
// === 11.32. The quality-audit runner: a Stage's audit in its own job (#1359) ===
|
|
623
|
+
// After the audit job (it starts its Lighthouse tasks), before the
|
|
624
|
+
// upgrader (actAs on its account) and operator access (keeps it on IAP).
|
|
625
|
+
await stepReportingJob(projectId, region, provider, ownerEmail, {
|
|
626
|
+
starting: "Setting up the quality-audit runner (audits outside the admin)...",
|
|
627
|
+
ready: "Quality-audit runner ready",
|
|
628
|
+
ensure: ensureAuditRunnerJob,
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
// === 11.33. The site-import crawler: a site import's crawl in its own job (#1360) ===
|
|
632
|
+
// Before the upgrader and operator access, for the same reasons.
|
|
633
|
+
await stepReportingJob(projectId, region, provider, ownerEmail, {
|
|
634
|
+
starting: "Setting up the site-import crawler (crawls outside the admin)...",
|
|
635
|
+
ready: "Site-import crawler ready",
|
|
636
|
+
ensure: ensureImportCrawlJob,
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
// === 11.34. The build carrier: holds the request a build nobody waits for runs in (#1574) ===
|
|
640
|
+
// Before the upgrader and operator access, for the same reasons.
|
|
641
|
+
await stepReportingJob(projectId, region, provider, ownerEmail, {
|
|
642
|
+
starting: "Setting up the build carrier (builds that outlast their request)...",
|
|
643
|
+
ready: "Build carrier ready",
|
|
644
|
+
ensure: ensureBuildCarrierJob,
|
|
645
|
+
});
|
|
646
|
+
|
|
581
647
|
// === 11.35. The capture job: server-side screenshots outside the admin (#1217) ===
|
|
582
648
|
// Before the upgrader as well, which gets actAs on its service account.
|
|
583
649
|
await stepCaptureJob(projectId, region, provider);
|
|
@@ -609,7 +675,13 @@ export async function runGcpConverge(opts: GcpConvergeOpts): Promise<void> {
|
|
|
609
675
|
provider,
|
|
610
676
|
ownerEmail,
|
|
611
677
|
keepSigner ? [`serviceAccount:${upgraderServiceAccountEmail(projectId, GCP_STACK_ENV)}`] : [],
|
|
612
|
-
|
|
678
|
+
[
|
|
679
|
+
...(keepScheduler ? [schedulerServiceAccountEmail(projectId, GCP_STACK_ENV)] : []),
|
|
680
|
+
// #1359 / #1360 / #1574 — set up above (a failure stops the wizard there).
|
|
681
|
+
auditRunnerServiceAccountEmail(projectId, GCP_STACK_ENV),
|
|
682
|
+
importCrawlServiceAccountEmail(projectId, GCP_STACK_ENV),
|
|
683
|
+
buildCarrierServiceAccountEmail(projectId, GCP_STACK_ENV),
|
|
684
|
+
],
|
|
613
685
|
);
|
|
614
686
|
|
|
615
687
|
// === 11.6. Remote MCP (#806): LB rules (gcp) + a check of the identity env ===
|
|
@@ -684,10 +756,11 @@ export async function runGcpConverge(opts: GcpConvergeOpts): Promise<void> {
|
|
|
684
756
|
* fresh release doesn't trigger a new Cloud Run revision because the
|
|
685
757
|
* image reference in the stack (":latest") is unchanged.
|
|
686
758
|
*
|
|
687
|
-
* `latest` = newest release — the same channel `cms-provision
|
|
688
|
-
* defaults to.
|
|
689
|
-
*
|
|
690
|
-
*
|
|
759
|
+
* `latest` = newest stable release — the same channel `cms-provision
|
|
760
|
+
* upgrade` defaults to. The mirror holds releases and release candidates
|
|
761
|
+
* only (#1558; docs/maintainer-public-registry-setup.md, "Retention"), and
|
|
762
|
+
* `latest` never names a release candidate. `--version` installs a named
|
|
763
|
+
* release instead (install-version.ts).
|
|
691
764
|
*/
|
|
692
765
|
async function resolveImageDigests(): Promise<ImageDigests> {
|
|
693
766
|
// The Caelo public image registry — not the install region.
|
|
@@ -851,6 +924,125 @@ async function stepRegion(
|
|
|
851
924
|
return choice as string;
|
|
852
925
|
}
|
|
853
926
|
|
|
927
|
+
/**
|
|
928
|
+
* `--version` (#1558): settle the release a new install runs, before
|
|
929
|
+
* anything is created. Returns the version for the job-mode launcher, or
|
|
930
|
+
* null without `--version`. A release candidate needs the operator's
|
|
931
|
+
* confirmation (release-candidate.ts), named or not: in job mode the
|
|
932
|
+
* launcher installs the CLI's own release, a candidate's installer that
|
|
933
|
+
* candidate. In local mode the named release's images are resolved and
|
|
934
|
+
* cosign-verified here and recorded in install.json, where the release
|
|
935
|
+
* choice of runGcpConverge picks them up.
|
|
936
|
+
*/
|
|
937
|
+
async function stepRequestedRelease(
|
|
938
|
+
installId: string,
|
|
939
|
+
projectId: string,
|
|
940
|
+
provider: "gcp" | "gcp-firebase",
|
|
941
|
+
runMode: RunMode,
|
|
942
|
+
opts: GcpWizardOpts,
|
|
943
|
+
): Promise<string | null> {
|
|
944
|
+
const meta = readMetadata(installId);
|
|
945
|
+
const deployed = isStepDone(installId, `pulumi-up-${projectId}`);
|
|
946
|
+
const decision = decideInstallVersion({
|
|
947
|
+
requested: opts.version,
|
|
948
|
+
deployed,
|
|
949
|
+
recordedVersion: meta?.releaseVersion,
|
|
950
|
+
});
|
|
951
|
+
if (decision.kind === "refuse") {
|
|
952
|
+
log.error(red(decision.error));
|
|
953
|
+
cancel("Aborted — nothing was changed.");
|
|
954
|
+
process.exit(1);
|
|
955
|
+
}
|
|
956
|
+
if (decision.kind === "keep") {
|
|
957
|
+
log.info(`Release: ${bold(`v${decision.version}`)} ${dim("(this install runs it already)")}`);
|
|
958
|
+
return decision.version;
|
|
959
|
+
}
|
|
960
|
+
const installs = releaseToConfirm({
|
|
961
|
+
decision,
|
|
962
|
+
runMode,
|
|
963
|
+
cliVersion: CAELO_VERSION,
|
|
964
|
+
deployed,
|
|
965
|
+
recorded: meta ? recordedImageDigests(meta) : null,
|
|
966
|
+
});
|
|
967
|
+
if (installs !== null) {
|
|
968
|
+
const confirmed = await confirmReleaseCandidate(
|
|
969
|
+
{
|
|
970
|
+
version: installs,
|
|
971
|
+
action: "install",
|
|
972
|
+
// A pipe or CI run without --non-interactive cannot answer either.
|
|
973
|
+
interactive: !opts.nonInteractive && process.stdin.isTTY === true,
|
|
974
|
+
accepted: opts.acceptReleaseCandidate === true,
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
warn: (lines) => log.warn(yellow(lines.join("\n"))),
|
|
978
|
+
confirm: async (message) => {
|
|
979
|
+
const answer = await confirm({ message, initialValue: false });
|
|
980
|
+
return !isCancel(answer) && answer === true;
|
|
981
|
+
},
|
|
982
|
+
},
|
|
983
|
+
);
|
|
984
|
+
if (!confirmed.ok) {
|
|
985
|
+
cancel(confirmed.message);
|
|
986
|
+
process.exit(confirmed.reason === "declined" ? 0 : 1);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
if (decision.kind === "none") return null;
|
|
990
|
+
const { version } = decision;
|
|
991
|
+
if (version !== CAELO_VERSION) {
|
|
992
|
+
log.warn(
|
|
993
|
+
yellow(
|
|
994
|
+
`This installer is v${CAELO_VERSION}, not v${version}. To install v${version} exactly as released, run its own installer: ${provisioningCommand(version, ["--provider", provider, "--version", version])}`,
|
|
995
|
+
),
|
|
996
|
+
);
|
|
997
|
+
}
|
|
998
|
+
if (runMode === "job") {
|
|
999
|
+
log.info(
|
|
1000
|
+
`Release: ${bold(`v${version}`)} — the install job checks its signed release manifest before it starts.`,
|
|
1001
|
+
);
|
|
1002
|
+
return version;
|
|
1003
|
+
}
|
|
1004
|
+
await stepResolveRelease(installId, version);
|
|
1005
|
+
return version;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* Resolve `version`'s images in the public mirror (the upgrade path's
|
|
1010
|
+
* resolver), verify their signatures and record them with the version, so
|
|
1011
|
+
* the converge deploys exactly that release (#1558).
|
|
1012
|
+
*/
|
|
1013
|
+
async function stepResolveRelease(installId: string, version: string): Promise<void> {
|
|
1014
|
+
const s = spinner();
|
|
1015
|
+
s.start(`Resolving the v${version} release images...`);
|
|
1016
|
+
const resolved = await resolveReleaseImages(version);
|
|
1017
|
+
if (!resolved.ok) {
|
|
1018
|
+
s.stop(red(`Could not resolve the v${version} release images`));
|
|
1019
|
+
log.error(
|
|
1020
|
+
isPrereleaseVersion(version)
|
|
1021
|
+
? `${resolved.error}\nA release candidate's images are deleted from the registry ${RELEASE_CANDIDATE_RETENTION_DAYS} days after it was published.`
|
|
1022
|
+
: resolved.error,
|
|
1023
|
+
);
|
|
1024
|
+
cancel("Aborted — nothing was changed.");
|
|
1025
|
+
process.exit(1);
|
|
1026
|
+
}
|
|
1027
|
+
const { admin, gateway } = resolved.images;
|
|
1028
|
+
const proxy = resolved.images["mcp-auth-proxy"];
|
|
1029
|
+
s.stop(green(`v${version}: admin ${dim(`${admin.digest.slice(0, 19)}...`)}`));
|
|
1030
|
+
const verified = await verifyCosignAll([
|
|
1031
|
+
{ slug: "admin", digest: admin.digest },
|
|
1032
|
+
{ slug: "gateway", digest: gateway.digest },
|
|
1033
|
+
{ slug: "mcp-auth-proxy", digest: proxy.digest },
|
|
1034
|
+
]);
|
|
1035
|
+
if (!verified) {
|
|
1036
|
+
cancel(`Aborted — the v${version} images' signatures did not verify; nothing was changed.`);
|
|
1037
|
+
process.exit(1);
|
|
1038
|
+
}
|
|
1039
|
+
recordImageDigests(
|
|
1040
|
+
installId,
|
|
1041
|
+
{ admin: admin.digest, gateway: gateway.digest, "mcp-auth-proxy": proxy.digest },
|
|
1042
|
+
version,
|
|
1043
|
+
);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
854
1046
|
async function stepProjectCreate(
|
|
855
1047
|
installId: string,
|
|
856
1048
|
projectId: string,
|
|
@@ -1320,6 +1512,57 @@ async function stepAuditJob(
|
|
|
1320
1512
|
s.stop(green(`Quality-audit job ready (${r.done.length} steps)`));
|
|
1321
1513
|
}
|
|
1322
1514
|
|
|
1515
|
+
/**
|
|
1516
|
+
* #1359 / #1360 — set up a reporting job (reporting-job-setup.ts) on the
|
|
1517
|
+
* deployed admin's image: the quality-audit runner (a Stage's whole audit)
|
|
1518
|
+
* or the site-import crawler (a site import's crawl), each reporting back
|
|
1519
|
+
* through IAP. A failure stops the wizard: without it that work fails.
|
|
1520
|
+
* Idempotent, so it runs on every wizard pass.
|
|
1521
|
+
*/
|
|
1522
|
+
async function stepReportingJob(
|
|
1523
|
+
projectId: string,
|
|
1524
|
+
region: string,
|
|
1525
|
+
provider: "gcp" | "gcp-firebase",
|
|
1526
|
+
ownerEmail: string,
|
|
1527
|
+
job: {
|
|
1528
|
+
readonly starting: string;
|
|
1529
|
+
readonly ready: string;
|
|
1530
|
+
readonly ensure: typeof ensureAuditRunnerJob;
|
|
1531
|
+
},
|
|
1532
|
+
): Promise<void> {
|
|
1533
|
+
const s = spinner();
|
|
1534
|
+
s.start(job.starting);
|
|
1535
|
+
const image = await resolveAdminImage({ projectId, region, env: GCP_STACK_ENV });
|
|
1536
|
+
const resolved = image.ok
|
|
1537
|
+
? await resolveOperatorAccessTarget({
|
|
1538
|
+
provider,
|
|
1539
|
+
projectId,
|
|
1540
|
+
region,
|
|
1541
|
+
env: GCP_STACK_ENV,
|
|
1542
|
+
ownerEmail,
|
|
1543
|
+
})
|
|
1544
|
+
: null;
|
|
1545
|
+
const r = !image.ok
|
|
1546
|
+
? { ok: false as const, done: [], error: image.error }
|
|
1547
|
+
: !resolved?.ok
|
|
1548
|
+
? { ok: false as const, done: [], error: resolved?.error ?? "no IAP resource" }
|
|
1549
|
+
: await job.ensure({
|
|
1550
|
+
provider,
|
|
1551
|
+
projectId,
|
|
1552
|
+
region,
|
|
1553
|
+
env: GCP_STACK_ENV,
|
|
1554
|
+
adminImageRef: image.imageRef,
|
|
1555
|
+
resource: resolved.target.resource,
|
|
1556
|
+
});
|
|
1557
|
+
if (!r.ok) {
|
|
1558
|
+
s.stop(red(`Failed: ${r.error}`));
|
|
1559
|
+
log.error("Re-run the wizard once the cause is fixed (this step is idempotent).");
|
|
1560
|
+
cancel("Aborted.");
|
|
1561
|
+
process.exit(1);
|
|
1562
|
+
}
|
|
1563
|
+
s.stop(green(`${job.ready} (${r.done.length} steps)`));
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1323
1566
|
/**
|
|
1324
1567
|
* Set up the capture job (capture-job-setup.ts) on the deployed admin's
|
|
1325
1568
|
* image. A failure stops the wizard: without the job every server-side
|
package/stacks/aws/index.ts
CHANGED
|
@@ -455,6 +455,16 @@ new aws.cloudwatch.LogDelivery(
|
|
|
455
455
|
// (quality/lighthouse-runner-select.ts) instead of measuring on its own
|
|
456
456
|
// shared CPU. Nothing is staged on AWS before #749 either.
|
|
457
457
|
//
|
|
458
|
+
// FIXME(issue #749): no reporting-job task yet (#1359, #1360, #1574). On GCP
|
|
459
|
+
// a Stage's whole quality audit and a site import's crawl each run in their
|
|
460
|
+
// own job that reports back to the admin, and the build carrier holds the
|
|
461
|
+
// request a build nobody else waits for runs in (src/reporting-job-setup.ts);
|
|
462
|
+
// the AWS equivalent is an ECS task per audit, crawl or carried build behind
|
|
463
|
+
// admin-core reporting-jobs/launcher.ts `JobLauncher`, reporting through the
|
|
464
|
+
// ALB's Cognito gate. Until it exists the admin records every audit, every
|
|
465
|
+
// site import and every carried build as failed with that gap instead of
|
|
466
|
+
// running it on its own CPU.
|
|
467
|
+
//
|
|
458
468
|
// FIXME(issue #749): no capture task definition yet. On GCP every
|
|
459
469
|
// server-side browser render (screenshots, external page renders, the
|
|
460
470
|
// site-import crawl) runs in its own short-lived container (#1217,
|
package/stacks/azure/index.ts
CHANGED
|
@@ -432,6 +432,16 @@ const logWorkspace = new azure.operationalinsights.Workspace(`${namePrefix}-logs
|
|
|
432
432
|
// instead of measuring on its own shared CPU. Nothing is staged on Azure
|
|
433
433
|
// before #750 either.
|
|
434
434
|
//
|
|
435
|
+
// FIXME(issue #750): no reporting-job Container Apps job yet (#1359, #1360,
|
|
436
|
+
// #1574). On GCP a Stage's whole quality audit and a site import's crawl each
|
|
437
|
+
// run in their own job that reports back to the admin, and the build carrier
|
|
438
|
+
// holds the request a build nobody else waits for runs in
|
|
439
|
+
// (src/reporting-job-setup.ts); the Azure equivalent is a Container Apps job
|
|
440
|
+
// execution per audit, crawl or carried build behind admin-core
|
|
441
|
+
// reporting-jobs/launcher.ts `JobLauncher`, reporting through Easy Auth.
|
|
442
|
+
// Until it exists the admin records every audit, every site import and every
|
|
443
|
+
// carried build as failed with that gap instead of running it on its own CPU.
|
|
444
|
+
//
|
|
435
445
|
// FIXME(issue #750): no capture Container Apps job yet. On GCP every
|
|
436
446
|
// server-side browser render (screenshots, external page renders, the
|
|
437
447
|
// site-import crawl) runs in its own short-lived container (#1217,
|