@rizom/ops 0.2.0-alpha.557 → 0.2.0-alpha.559
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/brains-ops.js +178 -170
- package/dist/deploy.js +43 -43
- package/dist/index.js +182 -174
- package/dist/run-command.d.ts +2 -1
- package/dist/runtime-image-lock.d.ts +12 -0
- package/package.json +1 -1
- package/templates/rover-pilot/.github/workflows/build.yml +6 -5
- package/templates/rover-pilot/docs/operator-playbook.md +35 -1
package/dist/run-command.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FetchLike } from "@brains/utils/fetch-like";
|
|
2
2
|
import { type CommandDefinition, type FlagDefinitions, type ParsedCliArgs } from "@brains/deploy-support/cli-kit";
|
|
3
|
-
import type
|
|
3
|
+
import { type LoadPilotRegistryOptions } from "./load-registry";
|
|
4
4
|
import { type LookupHost } from "./observed-status";
|
|
5
5
|
import { type RunCommand as OpsRunCommand } from "@brains/deploy-support/run-subprocess";
|
|
6
6
|
import { type SshKeygen } from "./ssh-key-bootstrap";
|
|
@@ -23,6 +23,7 @@ export interface CommandDependencies extends LoadPilotRegistryOptions {
|
|
|
23
23
|
verificationRetryDelayMs?: number | undefined;
|
|
24
24
|
sleep?: ((delayMs: number) => Promise<void>) | undefined;
|
|
25
25
|
bootstrapRunCommand?: OpsRunCommand | undefined;
|
|
26
|
+
imageLockRunCommand?: OpsRunCommand | undefined;
|
|
26
27
|
sshKeygen?: SshKeygen | undefined;
|
|
27
28
|
directorySyncStressRunner?: typeof runDeployedDirectorySyncStress | undefined;
|
|
28
29
|
directorySyncStressAccessRunner?: typeof verifyDirectorySyncStressAccess | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RequiredImage } from "./image-types";
|
|
2
|
+
import { type RunCommand } from "@brains/deploy-support/run-subprocess";
|
|
3
|
+
/** Operator-owned build inputs, not generated per-user deploy output. */
|
|
4
|
+
export declare function runtimeImageLockDirectory(image: RequiredImage): string;
|
|
5
|
+
/** Fail before publishing when a required build has no reviewed, matching inputs. */
|
|
6
|
+
export declare function assertRuntimeImageLock(rootDir: string, image: RequiredImage): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Resolve once for operator review; CI and Docker only consume the frozen result.
|
|
9
|
+
* Existing entries are never refreshed or overwritten. Failed new entries retain
|
|
10
|
+
* their incomplete marker and diagnostic files and cannot be used by a build.
|
|
11
|
+
*/
|
|
12
|
+
export declare function lockRuntimeImage(rootDir: string, image: RequiredImage, run?: RunCommand): Promise<"created" | "existing">;
|
package/package.json
CHANGED
|
@@ -4,11 +4,11 @@ on:
|
|
|
4
4
|
workflow_dispatch:
|
|
5
5
|
inputs:
|
|
6
6
|
brain_version:
|
|
7
|
-
description: Build one Brain version
|
|
7
|
+
description: Build one Brain version from its checked-in runtime lock
|
|
8
8
|
required: false
|
|
9
9
|
type: string
|
|
10
10
|
site_packages:
|
|
11
|
-
description: "
|
|
11
|
+
description: "Exact site/theme pins for an explicit build; a matching checked-in runtime lock is required."
|
|
12
12
|
required: false
|
|
13
13
|
type: string
|
|
14
14
|
overwrite:
|
|
@@ -43,9 +43,11 @@ jobs:
|
|
|
43
43
|
ref: ${{ github.sha }}
|
|
44
44
|
|
|
45
45
|
- uses: oven-sh/setup-bun@v2
|
|
46
|
+
with:
|
|
47
|
+
bun-version: 1.4.0
|
|
46
48
|
|
|
47
49
|
- name: Install operator tooling
|
|
48
|
-
run: bun install
|
|
50
|
+
run: bun install --frozen-lockfile --ignore-scripts
|
|
49
51
|
|
|
50
52
|
- name: Log in to GHCR
|
|
51
53
|
uses: docker/login-action@v4
|
|
@@ -109,8 +111,7 @@ jobs:
|
|
|
109
111
|
target: fleet
|
|
110
112
|
push: true
|
|
111
113
|
build-args: |
|
|
112
|
-
|
|
113
|
-
SITE_PACKAGES=${{ matrix.image.site_packages }}
|
|
114
|
+
RUNTIME_IMAGE_TAG=${{ matrix.image.tag }}
|
|
114
115
|
tags: ${{ steps.meta.outputs.tags }}
|
|
115
116
|
labels: |
|
|
116
117
|
${{ steps.meta.outputs.labels }}
|
|
@@ -24,9 +24,43 @@ The fleet has one image topology:
|
|
|
24
24
|
- generated `users/<handle>/.env` carries `BRAIN_VERSION=<brainVersion>`, and `IMAGE_TAG=<tag>` for an instance with site pins
|
|
25
25
|
- build and deploy derive the same effective image tag from the resolved registry
|
|
26
26
|
|
|
27
|
+
## Reviewed runtime dependencies
|
|
28
|
+
|
|
29
|
+
Use Bun 1.4.0 to prepare the full dependency graph before building a new image:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
brains-ops images:lock .
|
|
33
|
+
# Or prepare one version/pin set before promotion:
|
|
34
|
+
brains-ops images:lock . --brain-version <exact-version> --site-packages "<exact site/theme pins>"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Review and commit each new `deploy/runtime/<image-tag>/package.json` and `bun.lock`
|
|
38
|
+
together with its desired-state change. The manifest pins Brain and exactly that
|
|
39
|
+
image's site/theme packages, and overrides `postcss-selector-parser` to 7.1.6.
|
|
40
|
+
Review fresh runtime audit and behavior checks; a frozen lock is not proof that
|
|
41
|
+
bundled code, operating-system packages, or every dependency is vulnerability-free.
|
|
42
|
+
|
|
43
|
+
The command resolves dependencies with lifecycle scripts disabled; it does not
|
|
44
|
+
build, publish, deploy, decrypt secrets, or inspect fleet hosts. Existing entries
|
|
45
|
+
are validated and left untouched, never refreshed. A failed new entry retains an
|
|
46
|
+
`.incomplete` marker and diagnostic files and blocks reuse; inspect and preserve
|
|
47
|
+
that evidence before separately approving any recovery.
|
|
48
|
+
|
|
49
|
+
Build refuses missing, incomplete, or mismatched manifests. Docker copies only the
|
|
50
|
+
reviewed manifest and lock for the selected tag and installs production packages
|
|
51
|
+
with `--frozen-lockfile --ignore-scripts`; it never resolves updates with `bun add`.
|
|
52
|
+
Commit both inputs: changing only the manifest without a matching lock fails the
|
|
53
|
+
frozen install before publication.
|
|
54
|
+
|
|
55
|
+
Existing published tags remain immutable and are not rebuilt by adopting this
|
|
56
|
+
scaffold. Existing-image verification still checks only the exact top-level Brain
|
|
57
|
+
and site/theme versions; it does not certify a legacy image's transitive graph.
|
|
58
|
+
The parser fix reaches running instances only through a separately approved new
|
|
59
|
+
image/version rollout, never by overwriting a deployed tag.
|
|
60
|
+
|
|
27
61
|
## Version bump flow
|
|
28
62
|
|
|
29
|
-
When `pilot.yaml.brainVersion` changes and you push:
|
|
63
|
+
First generate and review the matching runtime locks. When `pilot.yaml.brainVersion` changes and you push:
|
|
30
64
|
|
|
31
65
|
1. build publishes each missing image, named by Brain version and site pins, and verifies existing images against what their names say they hold
|
|
32
66
|
2. reconcile refreshes generated `users/<handle>/.env`
|