@rizom/ops 0.2.0-alpha.351 → 0.2.0-alpha.353
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 +2 -2
- package/dist/brains-ops.js +213 -213
- package/dist/deploy.js +29 -30
- package/dist/directory-sync-stress.d.ts +92 -82
- package/dist/entries/deploy.d.ts +1 -2
- package/dist/images.d.ts +25 -23
- package/dist/index.d.ts +2 -2
- package/dist/index.js +250 -251
- package/dist/schema.d.ts +34 -40
- package/dist/stage-legacy-crossover.d.ts +6 -4
- package/package.json +1 -1
- package/templates/rover-pilot/.github/workflows/build.yml +0 -9
- package/templates/rover-pilot/README.md +2 -2
- package/templates/rover-pilot/deploy/scripts/helpers.ts +0 -2
- package/templates/rover-pilot/deploy/scripts/resolve-user-config.ts +3 -10
- package/templates/rover-pilot/docs/operator-playbook.md +12 -12
- package/templates/rover-pilot/pilot.yaml +0 -1
|
@@ -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,4 +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 {
|
|
4
|
-
export { SHARED_FLEET_IMAGE_CONTRACT, ISOLATED_SITE_IMAGE_CONTRACT, imageContractSchema, type ImageContract, } from "../schema";
|
|
3
|
+
export { runtimeImageTag, sitePackagesFor, requiredImages, resolveImageBuilds, runResolveMissingImages, type ImageRequirementSource, type RequiredImage, type ResolveImageBuildsOptions, type RunResolveMissingImagesOptions, } from "../images";
|
package/dist/images.d.ts
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import { type ResolvedSiteOverride } from "./load-registry";
|
|
2
2
|
import { type RunCommand } from "./run-subprocess";
|
|
3
|
-
import { type ImageContract } from "./schema";
|
|
4
3
|
/**
|
|
5
|
-
* Resolve
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* import this — never recompute it independently.
|
|
9
|
-
*
|
|
10
|
-
* The default path is deliberately untouched: an instance with no site packages
|
|
11
|
-
* resolves to the plain `brain-{version}` tag every other fleet instance uses.
|
|
12
|
-
* A site override is a per-instance opt-in that hashes only *that instance's*
|
|
13
|
-
* package set into a distinct `brain-{version}-sites-{hash}` image, so it can
|
|
14
|
-
* 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.
|
|
15
7
|
*/
|
|
16
|
-
export declare function
|
|
17
|
-
/** Resolve the runtime tag selected by the pilot's explicit image contract. */
|
|
18
|
-
export declare function runtimeImageTag(imageContract: ImageContract, brainVersion: string, sitePackages: string[]): string;
|
|
8
|
+
export declare function runtimeImageTag(brainVersion: string): string;
|
|
19
9
|
/**
|
|
20
|
-
* The npm packages a site override
|
|
10
|
+
* The npm packages a site override contributes to its version's shared image.
|
|
21
11
|
* A @rizom-scoped theme is independently published and installs at its own
|
|
22
12
|
* explicit version; @brains/* themes are bundled inside @rizom/brain and must
|
|
23
13
|
* not be npm-installed.
|
|
@@ -35,15 +25,13 @@ export interface RequiredImage {
|
|
|
35
25
|
sitePackages: string[];
|
|
36
26
|
}
|
|
37
27
|
/**
|
|
38
|
-
* Derive
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* images get one tag per distinct version/package set.
|
|
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.
|
|
42
31
|
*/
|
|
43
|
-
export declare function requiredImages(users: ImageRequirementSource[]
|
|
32
|
+
export declare function requiredImages(users: ImageRequirementSource[]): RequiredImage[];
|
|
44
33
|
export interface ResolveImageBuildsOptions {
|
|
45
34
|
users: ImageRequirementSource[];
|
|
46
|
-
imageContract?: ImageContract | undefined;
|
|
47
35
|
/**
|
|
48
36
|
* Explicit dispatch override — the manual/backfill path. When set, exactly
|
|
49
37
|
* this one image is built, skipping the registry-derived resolve. Published
|
|
@@ -70,13 +58,27 @@ export interface RunResolveMissingImagesOptions {
|
|
|
70
58
|
writeOutput: (key: string, value: string) => void;
|
|
71
59
|
log?: (line: string) => void;
|
|
72
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>;
|
|
73
75
|
/**
|
|
74
76
|
* The Build workflow's resolve step: derive the image set the declared fleet
|
|
75
77
|
* state (pilot.yaml + cohorts + users) requires, probe the container registry
|
|
76
78
|
* for each tag, and emit the missing ones as a GitHub Actions build matrix
|
|
77
79
|
* (`images_json`, entries `{tag, brain_version, site_packages}`). Dispatch
|
|
78
|
-
* inputs `BRAIN_VERSION_INPUT`/`SITE_PACKAGES_INPUT
|
|
79
|
-
*
|
|
80
|
+
* inputs `BRAIN_VERSION_INPUT`/`SITE_PACKAGES_INPUT` force a single explicit
|
|
81
|
+
* build instead. Deriving and probing here means a config push builds exactly
|
|
80
82
|
* what it declares — nothing reactive, nothing manual.
|
|
81
83
|
*/
|
|
82
84
|
export declare function runResolveMissingImages(options: RunResolveMissingImagesOptions): Promise<RequiredImage[]>;
|
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";
|
|
@@ -18,4 +18,4 @@ export { assertDirectorySyncStressTarget, directorySyncStressPlanSchema, directo
|
|
|
18
18
|
export { cleanupDirectorySyncStress, runDeployedDirectorySyncStress, verifyDirectorySyncStressAccess, type CleanupDirectorySyncStressOptions, type CleanupDirectorySyncStressResult, type DeployedDirectorySyncStressOptions, type DeployedDirectorySyncStressResult, type VerifyDirectorySyncStressAccessOptions, type VerifyDirectorySyncStressAccessResult, } from "./directory-sync-stress-system";
|
|
19
19
|
export { assertHealthWatchdogSmokeTarget, cleanupHealthWatchdogSmoke, renderHealthWatchdogSmokeRemoteScript, runHealthWatchdogSmoke, type CleanupHealthWatchdogSmokeOptions, type CleanupHealthWatchdogSmokeResult, type HealthWatchdogSmokeOptions, type HealthWatchdogSmokeResult, type HealthWatchdogSmokeTarget, } from "./health-watchdog-smoke";
|
|
20
20
|
export { runCommand, type CommandResult } from "./run-command";
|
|
21
|
-
export { pilotSchema, cohortSchema, canonicalBundleIdSchema, CAPABILITY_BUNDLE_CONTRACT,
|
|
21
|
+
export { pilotSchema, cohortSchema, canonicalBundleIdSchema, CAPABILITY_BUNDLE_CONTRACT, type PilotConfig, type CohortConfig, } from "./schema";
|