@rizom/ops 0.2.0-alpha.350 → 0.2.0-alpha.352
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/README.md +4 -0
- package/dist/brains-ops.js +219 -219
- package/dist/deploy.js +22 -23
- package/dist/directory-sync-stress.d.ts +92 -82
- package/dist/entries/deploy.d.ts +1 -1
- package/dist/images.d.ts +23 -18
- package/dist/index.d.ts +1 -1
- package/dist/index.js +242 -243
- package/dist/schema.d.ts +34 -32
- package/dist/stage-legacy-crossover.d.ts +6 -4
- package/package.json +1 -1
- package/templates/rover-pilot/.github/workflows/build.yml +1 -1
- package/templates/rover-pilot/README.md +2 -2
- package/templates/rover-pilot/deploy/scripts/create-predeploy-backup.ts +25 -14
- package/templates/rover-pilot/deploy/scripts/helpers.ts +1 -2
- package/templates/rover-pilot/deploy/scripts/provision-server.ts +51 -21
- package/templates/rover-pilot/deploy/scripts/resolve-user-config.ts +4 -8
- package/templates/rover-pilot/deploy/scripts/update-dns.ts +35 -12
- package/templates/rover-pilot/docs/operator-playbook.md +15 -11
|
@@ -1,87 +1,97 @@
|
|
|
1
1
|
import type { FetchLike } from "@brains/deploy-support/origin-ca";
|
|
2
2
|
import { z } from "@brains/utils/zod";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
export
|
|
78
|
-
export declare const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export
|
|
3
|
+
export declare const directorySyncStressProfileSchema: z.ZodEnum<{
|
|
4
|
+
regression: "regression";
|
|
5
|
+
load: "load";
|
|
6
|
+
stress: "stress";
|
|
7
|
+
}>;
|
|
8
|
+
export type DirectorySyncStressProfile = z.output<typeof directorySyncStressProfileSchema>;
|
|
9
|
+
export declare const directorySyncStressOperationSchema: z.ZodEnum<{
|
|
10
|
+
add: "add";
|
|
11
|
+
update: "update";
|
|
12
|
+
rename: "rename";
|
|
13
|
+
delete: "delete";
|
|
14
|
+
}>;
|
|
15
|
+
export type DirectorySyncStressOperation = z.output<typeof directorySyncStressOperationSchema>;
|
|
16
|
+
export declare const directorySyncStressPhaseSchema: z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
operation: typeof directorySyncStressOperationSchema;
|
|
19
|
+
count: z.ZodNumber;
|
|
20
|
+
targetProbeCount: z.ZodNumber;
|
|
21
|
+
settleMs: z.ZodNumber;
|
|
22
|
+
}>;
|
|
23
|
+
export type DirectorySyncStressPhase = z.output<typeof directorySyncStressPhaseSchema>;
|
|
24
|
+
export declare const directorySyncStressPlanSchema: z.ZodObject<{
|
|
25
|
+
profile: typeof directorySyncStressProfileSchema;
|
|
26
|
+
maximumProbeCount: z.ZodNumber;
|
|
27
|
+
maximumExternalAiCalls: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
phases: z.ZodArray<typeof directorySyncStressPhaseSchema>;
|
|
29
|
+
}>;
|
|
30
|
+
export type DirectorySyncStressPlan = z.output<typeof directorySyncStressPlanSchema>;
|
|
31
|
+
export declare const stressBaselineSchema: z.ZodObject<{
|
|
32
|
+
entities: z.ZodNumber;
|
|
33
|
+
notes: z.ZodNumber;
|
|
34
|
+
version: z.ZodString;
|
|
35
|
+
}>;
|
|
36
|
+
export type StressBaseline = z.output<typeof stressBaselineSchema>;
|
|
37
|
+
export declare const stressHealthSampleSchema: z.ZodObject<{
|
|
38
|
+
timestamp: z.ZodISODateTime;
|
|
39
|
+
endpoint: z.ZodString;
|
|
40
|
+
status: z.ZodNumber;
|
|
41
|
+
durationMs: z.ZodNumber;
|
|
42
|
+
ok: z.ZodBoolean;
|
|
43
|
+
error: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}>;
|
|
45
|
+
export type StressHealthSample = z.output<typeof stressHealthSampleSchema>;
|
|
46
|
+
export declare const stressRuntimeSampleSchema: z.ZodObject<{
|
|
47
|
+
timestamp: z.ZodISODateTime;
|
|
48
|
+
cpuPercent: z.ZodNumber;
|
|
49
|
+
memoryPercent: z.ZodNumber;
|
|
50
|
+
pids: z.ZodNumber;
|
|
51
|
+
}>;
|
|
52
|
+
export type StressRuntimeSample = z.output<typeof stressRuntimeSampleSchema>;
|
|
53
|
+
export declare const stressPhaseResultSchema: z.ZodObject<{
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
operation: typeof directorySyncStressOperationSchema;
|
|
56
|
+
count: z.ZodNumber;
|
|
57
|
+
success: z.ZodBoolean;
|
|
58
|
+
commitLatencyMs: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
persistenceLatencyMs: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
error: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}>;
|
|
62
|
+
export type StressPhaseResult = z.output<typeof stressPhaseResultSchema>;
|
|
63
|
+
export declare const stressCleanupResultSchema: z.ZodObject<{
|
|
64
|
+
success: z.ZodBoolean;
|
|
65
|
+
probesRemaining: z.ZodNumber;
|
|
66
|
+
finalEntities: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
finalNotes: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
contentTreeRestored: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
error: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}>;
|
|
71
|
+
export type StressCleanupResult = z.output<typeof stressCleanupResultSchema>;
|
|
72
|
+
export declare const stressContainerStateSchema: z.ZodObject<{
|
|
73
|
+
status: z.ZodString;
|
|
74
|
+
restartCount: z.ZodNumber;
|
|
75
|
+
oomKilled: z.ZodBoolean;
|
|
76
|
+
}>;
|
|
77
|
+
export type StressContainerState = z.output<typeof stressContainerStateSchema>;
|
|
78
|
+
export declare const stressMetricsSchema: z.ZodObject<{
|
|
79
|
+
health: z.ZodArray<typeof stressHealthSampleSchema>;
|
|
80
|
+
runtime: z.ZodArray<typeof stressRuntimeSampleSchema>;
|
|
81
|
+
externalAiCalls: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
container: z.ZodOptional<typeof stressContainerStateSchema>;
|
|
83
|
+
}>;
|
|
84
|
+
export type StressMetrics = z.output<typeof stressMetricsSchema>;
|
|
85
|
+
export declare const directorySyncStressReportSchema: z.ZodObject<{
|
|
86
|
+
profile: typeof directorySyncStressProfileSchema;
|
|
87
|
+
success: z.ZodBoolean;
|
|
88
|
+
baseline: typeof stressBaselineSchema;
|
|
89
|
+
phases: z.ZodArray<typeof stressPhaseResultSchema>;
|
|
90
|
+
cleanup: typeof stressCleanupResultSchema;
|
|
91
|
+
metrics: typeof stressMetricsSchema;
|
|
92
|
+
failure: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}>;
|
|
94
|
+
export type DirectorySyncStressReport = z.output<typeof directorySyncStressReportSchema>;
|
|
85
95
|
export interface DirectorySyncStressTarget {
|
|
86
96
|
handle: string;
|
|
87
97
|
domain: string;
|
package/dist/entries/deploy.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { readJsonResponse, parseEnvFile, parseEnvSchema, parseEnvSchemaFile, requireEnv, writeGitHubOutput, writeGitHubEnv, } from "@brains/deploy-support";
|
|
2
2
|
export type { EnvSchemaEntry } from "@brains/deploy-support";
|
|
3
|
-
export {
|
|
3
|
+
export { runtimeImageTag, sitePackagesFor, requiredImages, resolveImageBuilds, runResolveMissingImages, type ImageRequirementSource, type RequiredImage, type ResolveImageBuildsOptions, type RunResolveMissingImagesOptions, } from "../images";
|
package/dist/images.d.ts
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import { type ResolvedSiteOverride } from "./load-registry";
|
|
2
2
|
import { type RunCommand } from "./run-subprocess";
|
|
3
3
|
/**
|
|
4
|
-
* Resolve
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* import this — never recompute it independently.
|
|
8
|
-
*
|
|
9
|
-
* The default path is deliberately untouched: an instance with no site packages
|
|
10
|
-
* resolves to the plain `brain-{version}` tag every other fleet instance uses.
|
|
11
|
-
* A site override is a per-instance opt-in that hashes only *that instance's*
|
|
12
|
-
* package set into a distinct `brain-{version}-sites-{hash}` image, so it can
|
|
13
|
-
* never collide with — or leak into — the shared default image.
|
|
4
|
+
* Resolve the immutable runtime image shared by every fleet instance on one
|
|
5
|
+
* Brain version. Build and Deploy both import this function so their tags can
|
|
6
|
+
* never disagree.
|
|
14
7
|
*/
|
|
15
|
-
export declare function
|
|
8
|
+
export declare function runtimeImageTag(brainVersion: string): string;
|
|
16
9
|
/**
|
|
17
|
-
* The npm packages a site override
|
|
10
|
+
* The npm packages a site override contributes to its version's shared image.
|
|
18
11
|
* A @rizom-scoped theme is independently published and installs at its own
|
|
19
12
|
* explicit version; @brains/* themes are bundled inside @rizom/brain and must
|
|
20
13
|
* not be npm-installed.
|
|
@@ -28,15 +21,13 @@ export interface ImageRequirementSource {
|
|
|
28
21
|
export interface RequiredImage {
|
|
29
22
|
tag: string;
|
|
30
23
|
brainVersion: string;
|
|
31
|
-
/** Sorted, deduped
|
|
24
|
+
/** Sorted, deduped package specs installed into this runtime image. */
|
|
32
25
|
sitePackages: string[];
|
|
33
26
|
}
|
|
34
27
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* Derived purely from resolved users (pass `registry.users`), so CI can build
|
|
39
|
-
* exactly what a config push declares — nothing reactive, nothing manual.
|
|
28
|
+
* Derive one immutable image per effective Brain version. Each image contains
|
|
29
|
+
* the union of exact site/theme package pins required by every instance on
|
|
30
|
+
* that version.
|
|
40
31
|
*/
|
|
41
32
|
export declare function requiredImages(users: ImageRequirementSource[]): RequiredImage[];
|
|
42
33
|
export interface ResolveImageBuildsOptions {
|
|
@@ -67,6 +58,20 @@ export interface RunResolveMissingImagesOptions {
|
|
|
67
58
|
writeOutput: (key: string, value: string) => void;
|
|
68
59
|
log?: (line: string) => void;
|
|
69
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Whether the registry already holds this tag.
|
|
63
|
+
*
|
|
64
|
+
* `docker manifest inspect` exits non-zero when the manifest is unknown, so a
|
|
65
|
+
* command failure is the "absent" answer. A failure to run docker at all is
|
|
66
|
+
* not: answering false there would let resolveImageBuilds past its
|
|
67
|
+
* tag-immutability guard and overwrite a published tag, which is exactly what
|
|
68
|
+
* that guard exists to prevent. Those propagate.
|
|
69
|
+
*
|
|
70
|
+
* A non-zero exit caused by an auth or network problem is still read as
|
|
71
|
+
* absent — docker reports it the same way it reports an unknown manifest, and
|
|
72
|
+
* telling them apart means matching stderr text that shifts between versions.
|
|
73
|
+
*/
|
|
74
|
+
export declare function imageTagExists(run: RunCommand, imageRepository: string, tag: string): Promise<boolean>;
|
|
70
75
|
/**
|
|
71
76
|
* The Build workflow's resolve step: derive the image set the declared fleet
|
|
72
77
|
* state (pilot.yaml + cohorts + users) requires, probe the container registry
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { initPilotRepo } from "./init";
|
|
2
2
|
export { loadPilotRegistry, type LoadPilotRegistryOptions, } from "./load-registry";
|
|
3
|
-
export {
|
|
3
|
+
export { runtimeImageTag, sitePackagesFor, requiredImages, resolveImageBuilds, runResolveMissingImages, type ImageRequirementSource, type RequiredImage, type ResolveImageBuildsOptions, type RunResolveMissingImagesOptions, } from "./images";
|
|
4
4
|
export { derivePreviewDomain, type PreviewDomainOptions, } from "./preview-domain";
|
|
5
5
|
export { writeUsersTable } from "./render-users-table";
|
|
6
6
|
export { onboardUser } from "./onboard-user";
|