@rizom/ops 0.2.0-alpha.22 → 0.2.0-alpha.221
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 +3 -1
- package/dist/brains-ops.js +229 -283
- package/dist/cert-bootstrap.d.ts +3 -1
- package/dist/content-repo-ref.d.ts +10 -0
- package/dist/content-repo.d.ts +1 -0
- package/dist/deploy.js +99 -166
- package/dist/entries/deploy.d.ts +3 -2
- package/dist/images.d.ts +76 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +268 -281
- package/dist/load-registry.d.ts +25 -2
- package/dist/observed-status.d.ts +1 -1
- package/dist/origin-ca.d.ts +1 -1
- package/dist/parse-args.d.ts +3 -0
- package/dist/preview-domain.d.ts +9 -0
- package/dist/push-secrets.d.ts +2 -9
- package/dist/push-target.d.ts +1 -2
- package/dist/run-command.d.ts +1 -1
- package/dist/run-subprocess.d.ts +1 -6
- package/dist/schema.d.ts +64 -155
- package/dist/secrets-encrypt.d.ts +5 -13
- package/dist/ssh-key-bootstrap.d.ts +1 -26
- package/dist/user-add.d.ts +15 -0
- package/dist/verify-user.d.ts +19 -0
- package/package.json +45 -42
- package/templates/rover-pilot/.env.schema +17 -3
- package/templates/rover-pilot/.github/workflows/build.yml +64 -17
- package/templates/rover-pilot/.github/workflows/deploy.yml +128 -61
- package/templates/rover-pilot/.github/workflows/reconcile.yml +21 -1
- package/templates/rover-pilot/README.md +5 -3
- package/templates/rover-pilot/deploy/scripts/decrypt-user-secrets.ts +78 -24
- package/templates/rover-pilot/deploy/scripts/helpers.ts +3 -0
- package/templates/rover-pilot/deploy/scripts/resolve-deploy-handles.ts +12 -3
- package/templates/rover-pilot/deploy/scripts/resolve-missing-images.ts +13 -0
- package/templates/rover-pilot/deploy/scripts/resolve-user-config.ts +44 -9
- package/templates/rover-pilot/deploy/scripts/sync-content-repo.ts +51 -47
- package/templates/rover-pilot/deploy/scripts/update-dns.ts +14 -4
- package/templates/rover-pilot/deploy/scripts/validate-secrets.ts +1 -1
- package/templates/rover-pilot/docs/onboarding-checklist.md +33 -13
- package/templates/rover-pilot/docs/operator-playbook.md +183 -10
- package/templates/rover-pilot/docs/user-onboarding.md +67 -332
- package/templates/rover-pilot/pilot.yaml +1 -1
- package/templates/rover-pilot/.kamal/hooks/pre-deploy +0 -9
- package/templates/rover-pilot/deploy/Dockerfile +0 -30
- package/templates/rover-pilot/deploy/kamal/deploy.yml +0 -40
package/dist/entries/deploy.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { readJsonResponse, parseEnvFile, parseEnvSchema, parseEnvSchemaFile, requireEnv, writeGitHubOutput, writeGitHubEnv, } from "@brains/
|
|
2
|
-
export type { EnvSchemaEntry } from "@brains/
|
|
1
|
+
export { readJsonResponse, parseEnvFile, parseEnvSchema, parseEnvSchemaFile, requireEnv, writeGitHubOutput, writeGitHubEnv, } from "@brains/deploy-support";
|
|
2
|
+
export type { EnvSchemaEntry } from "@brains/deploy-support";
|
|
3
|
+
export { siteImageTag, sitePackagesFor, requiredImages, resolveImageBuilds, runResolveMissingImages, type ImageRequirementSource, type RequiredImage, type ResolveImageBuildsOptions, type RunResolveMissingImagesOptions, } from "../images";
|
package/dist/images.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type ResolvedSiteOverride } from "./load-registry";
|
|
2
|
+
import { type RunCommand } from "./run-subprocess";
|
|
3
|
+
/**
|
|
4
|
+
* Resolve a fleet image tag as a pure function of a single instance's own
|
|
5
|
+
* config. This is the shared contract between the build (which tags the image
|
|
6
|
+
* it pushes) and the deploy (which waits for and runs that tag), so both must
|
|
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.
|
|
14
|
+
*/
|
|
15
|
+
export declare function siteImageTag(brainVersion: string, sitePackages: string[]): string;
|
|
16
|
+
/**
|
|
17
|
+
* The npm packages a site override installs into its per-instance image.
|
|
18
|
+
* A @rizom-scoped theme is an independently published package and rides along
|
|
19
|
+
* at the same lockstep version; @brains/* themes are bundled inside
|
|
20
|
+
* @rizom/brain and must not be npm-installed.
|
|
21
|
+
*/
|
|
22
|
+
export declare function sitePackagesFor(siteOverride: ResolvedSiteOverride | undefined): string[];
|
|
23
|
+
/** The per-user slice of the registry that determines which image it runs. */
|
|
24
|
+
export interface ImageRequirementSource {
|
|
25
|
+
brainVersion: string;
|
|
26
|
+
siteOverride?: ResolvedSiteOverride | undefined;
|
|
27
|
+
}
|
|
28
|
+
export interface RequiredImage {
|
|
29
|
+
tag: string;
|
|
30
|
+
brainVersion: string;
|
|
31
|
+
/** Sorted, deduped — build args for the image, empty for the default. */
|
|
32
|
+
sitePackages: string[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The image set the declared fleet state requires: one default
|
|
36
|
+
* `brain-{version}` per distinct brain version in use, plus one
|
|
37
|
+
* `brain-{version}-sites-{hash}` per distinct site-override package set.
|
|
38
|
+
* Derived purely from resolved users (pass `registry.users`), so CI can build
|
|
39
|
+
* exactly what a config push declares — nothing reactive, nothing manual.
|
|
40
|
+
*/
|
|
41
|
+
export declare function requiredImages(users: ImageRequirementSource[]): RequiredImage[];
|
|
42
|
+
export interface ResolveImageBuildsOptions {
|
|
43
|
+
users: ImageRequirementSource[];
|
|
44
|
+
/**
|
|
45
|
+
* Explicit dispatch override — the manual/backfill path. When set, exactly
|
|
46
|
+
* this one image is built, skipping both the registry and the exists check.
|
|
47
|
+
*/
|
|
48
|
+
brainVersionInput?: string | undefined;
|
|
49
|
+
sitePackagesInput?: string | undefined;
|
|
50
|
+
imageExists: (tag: string) => Promise<boolean>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Decide which images a Build run must produce: the declared required set
|
|
54
|
+
* filtered to tags the registry does not already hold, or the single image an
|
|
55
|
+
* explicit dispatch input forces.
|
|
56
|
+
*/
|
|
57
|
+
export declare function resolveImageBuilds(options: ResolveImageBuildsOptions): Promise<RequiredImage[]>;
|
|
58
|
+
export interface RunResolveMissingImagesOptions {
|
|
59
|
+
rootDir: string;
|
|
60
|
+
/** e.g. `ghcr.io/rizom-ai/rover-pilot` */
|
|
61
|
+
imageRepository: string;
|
|
62
|
+
env?: NodeJS.ProcessEnv;
|
|
63
|
+
runCommand?: RunCommand;
|
|
64
|
+
writeOutput: (key: string, value: string) => void;
|
|
65
|
+
log?: (line: string) => void;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The Build workflow's resolve step: derive the image set the declared fleet
|
|
69
|
+
* state (pilot.yaml + cohorts + users) requires, probe the container registry
|
|
70
|
+
* for each tag, and emit the missing ones as a GitHub Actions build matrix
|
|
71
|
+
* (`images_json`, entries `{tag, brain_version, site_packages}`). Dispatch
|
|
72
|
+
* inputs `BRAIN_VERSION_INPUT`/`SITE_PACKAGES_INPUT` force a single explicit
|
|
73
|
+
* build instead. Deriving and probing here means a config push builds exactly
|
|
74
|
+
* what it declares — nothing reactive, nothing manual.
|
|
75
|
+
*/
|
|
76
|
+
export declare function runResolveMissingImages(options: RunResolveMissingImagesOptions): Promise<RequiredImage[]>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { initPilotRepo } from "./init";
|
|
2
2
|
export { loadPilotRegistry, type LoadPilotRegistryOptions, } from "./load-registry";
|
|
3
|
+
export { siteImageTag, sitePackagesFor, requiredImages, resolveImageBuilds, runResolveMissingImages, type ImageRequirementSource, type RequiredImage, type ResolveImageBuildsOptions, type RunResolveMissingImagesOptions, } from "./images";
|
|
4
|
+
export { derivePreviewDomain, type PreviewDomainOptions, } from "./preview-domain";
|
|
3
5
|
export { writeUsersTable } from "./render-users-table";
|
|
4
6
|
export { onboardUser } from "./onboard-user";
|
|
7
|
+
export { addPilotUser } from "./user-add";
|
|
5
8
|
export { reconcileCohort } from "./reconcile-cohort";
|
|
6
9
|
export { reconcileAll } from "./reconcile-all";
|
|
7
10
|
export { parseArgs, type ParsedArgs } from "./parse-args";
|
|
@@ -10,4 +13,5 @@ export { bootstrapPilotSshKey, runPilotSshKeyBootstrap, } from "./ssh-key-bootst
|
|
|
10
13
|
export { bootstrapPilotOriginCertificate, runPilotCertBootstrap, } from "./cert-bootstrap";
|
|
11
14
|
export { encryptPilotSecrets } from "./secrets-encrypt";
|
|
12
15
|
export { pushPilotSecrets } from "./secrets-push";
|
|
16
|
+
export { verifyPilotUser } from "./verify-user";
|
|
13
17
|
export { runCommand, type CommandResult } from "./run-command";
|