alasio 6.0.0 → 8.0.0
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/cli/src/branches.js +106 -31
- package/dist/cli/src/branches.js.map +1 -1
- package/dist/cli/src/cluster/docker-engine.js +6 -4
- package/dist/cli/src/cluster/docker-engine.js.map +1 -1
- package/dist/cli/src/cluster/docker.js +49 -10
- package/dist/cli/src/cluster/docker.js.map +1 -1
- package/dist/cli/src/cluster/host.js +45 -19
- package/dist/cli/src/cluster/host.js.map +1 -1
- package/dist/cli/src/cluster/k3s.js +104 -5
- package/dist/cli/src/cluster/k3s.js.map +1 -1
- package/dist/cli/src/cluster/node.js +102 -51
- package/dist/cli/src/cluster/node.js.map +1 -1
- package/dist/cli/src/cluster/tar.js +43 -1
- package/dist/cli/src/cluster/tar.js.map +1 -1
- package/dist/cli/src/commands/branch.js +7 -3
- package/dist/cli/src/commands/branch.js.map +1 -1
- package/dist/cli/src/commands/init.js +54 -4
- package/dist/cli/src/commands/init.js.map +1 -1
- package/dist/cli/src/commands/lake.js +40 -6
- package/dist/cli/src/commands/lake.js.map +1 -1
- package/dist/cli/src/commands/restore-filer-store.js +56 -13
- package/dist/cli/src/commands/restore-filer-store.js.map +1 -1
- package/dist/cli/src/commands/status.js +182 -10
- package/dist/cli/src/commands/status.js.map +1 -1
- package/dist/cli/src/commands/up.js +40 -3
- package/dist/cli/src/commands/up.js.map +1 -1
- package/dist/cli/src/commands/upgrade.js +22 -6
- package/dist/cli/src/commands/upgrade.js.map +1 -1
- package/dist/cli/src/config.js +20 -8
- package/dist/cli/src/config.js.map +1 -1
- package/dist/cli/src/cpu-baseline.js +97 -0
- package/dist/cli/src/cpu-baseline.js.map +1 -0
- package/dist/cli/src/install.js +94 -13
- package/dist/cli/src/install.js.map +1 -1
- package/dist/cli/src/kept-releases.js +59 -0
- package/dist/cli/src/kept-releases.js.map +1 -0
- package/dist/cli/src/kube/api.js +9 -2
- package/dist/cli/src/kube/api.js.map +1 -1
- package/dist/cli/src/kube/apply.js +1 -1
- package/dist/cli/src/kube/apply.js.map +1 -1
- package/dist/cli/src/kube/rollout.js +79 -12
- package/dist/cli/src/kube/rollout.js.map +1 -1
- package/dist/cli/src/lake.js +124 -0
- package/dist/cli/src/lake.js.map +1 -0
- package/dist/cli/src/manifests/admission.js +183 -24
- package/dist/cli/src/manifests/admission.js.map +1 -1
- package/dist/cli/src/manifests/alasio.js +198 -27
- package/dist/cli/src/manifests/alasio.js.map +1 -1
- package/dist/cli/src/manifests/branch.js +2 -1
- package/dist/cli/src/manifests/branch.js.map +1 -1
- package/dist/cli/src/manifests/collector.js +229 -122
- package/dist/cli/src/manifests/collector.js.map +1 -1
- package/dist/cli/src/manifests/common.js +23 -8
- package/dist/cli/src/manifests/common.js.map +1 -1
- package/dist/cli/src/manifests/config.js +254 -21
- package/dist/cli/src/manifests/config.js.map +1 -1
- package/dist/cli/src/manifests/grafana.js +18 -6
- package/dist/cli/src/manifests/grafana.js.map +1 -1
- package/dist/cli/src/manifests/index.js +15 -6
- package/dist/cli/src/manifests/index.js.map +1 -1
- package/dist/cli/src/manifests/juicefs-csi.js +7 -6
- package/dist/cli/src/manifests/juicefs-csi.js.map +1 -1
- package/dist/cli/src/manifests/keda.js +2 -1
- package/dist/cli/src/manifests/keda.js.map +1 -1
- package/dist/cli/src/manifests/lake.js +340 -73
- package/dist/cli/src/manifests/lake.js.map +1 -1
- package/dist/cli/src/manifests/log.js +298 -0
- package/dist/cli/src/manifests/log.js.map +1 -0
- package/dist/cli/src/manifests/neon.js +282 -66
- package/dist/cli/src/manifests/neon.js.map +1 -1
- package/dist/cli/src/manifests/network-policies.js +211 -45
- package/dist/cli/src/manifests/network-policies.js.map +1 -1
- package/dist/cli/src/manifests/node-agent.js +116 -0
- package/dist/cli/src/manifests/node-agent.js.map +1 -0
- package/dist/cli/src/manifests/object-store.js +42 -10
- package/dist/cli/src/manifests/object-store.js.map +1 -1
- package/dist/cli/src/manifests/priorities.js +1 -0
- package/dist/cli/src/manifests/priorities.js.map +1 -1
- package/dist/cli/src/manifests/scalers.js.map +1 -1
- package/dist/cli/src/manifests/valkey.js +1 -1
- package/dist/cli/src/manifests/webhook.js +102 -0
- package/dist/cli/src/manifests/webhook.js.map +1 -0
- package/dist/cli/src/neon-storage.js +115 -0
- package/dist/cli/src/neon-storage.js.map +1 -0
- package/dist/cli/src/release.js +9 -6
- package/dist/cli/src/release.js.map +1 -1
- package/dist/cli/src/secrets.js +45 -4
- package/dist/cli/src/secrets.js.map +1 -1
- package/dist/cli/src/target.js +1 -1
- package/dist/cli/src/target.js.map +1 -1
- package/dist/cli/src/telegram.js +56 -10
- package/dist/cli/src/telegram.js.map +1 -1
- package/dist/cli/src/webhook.js +182 -0
- package/dist/cli/src/webhook.js.map +1 -0
- package/dist/cluster/node/pins.json +11 -2
- package/dist/neon/control/branches.js +146 -22
- package/dist/neon/control/branches.js.map +1 -1
- package/dist/neon/control/endpoints.js +117 -0
- package/dist/neon/control/endpoints.js.map +1 -0
- package/dist/neon/control/jwt.js +16 -3
- package/dist/neon/control/jwt.js.map +1 -1
- package/dist/neon/control/scram.js +13 -1
- package/dist/neon/control/scram.js.map +1 -1
- package/dist/neon/control/secrets.js +88 -14
- package/dist/neon/control/secrets.js.map +1 -1
- package/dist/src/kube/config.js +27 -3
- package/dist/src/kube/config.js.map +1 -1
- package/dist/src/kube/sandbox-shape.js +49 -3
- package/dist/src/kube/sandbox-shape.js.map +1 -1
- package/dist/src/node-agent/names.js +140 -0
- package/dist/src/node-agent/names.js.map +1 -0
- package/dist/src/telegram/deliveries.js +40 -0
- package/dist/src/telegram/deliveries.js.map +1 -0
- package/package.json +2 -2
- package/dist/cluster/node/config-v3.toml.tmpl +0 -12
|
@@ -4,15 +4,57 @@
|
|
|
4
4
|
* one, never rotated.
|
|
5
5
|
*/
|
|
6
6
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
7
|
-
|
|
7
|
+
import { scramVerifier } from "./scram.js";
|
|
8
|
+
/**
|
|
9
|
+
* The availability zone every pageserver is in: one, the tenant's home zone, as alasio's
|
|
10
|
+
* pageservers are no zones apart, so any of them may hold any shard attached.
|
|
11
|
+
*/
|
|
12
|
+
export const PAGESERVER_ZONE = "az-pageserver";
|
|
8
13
|
export const DATABASE = "alasio";
|
|
14
|
+
/** The roles of alasio's database: alasio's own, the one its spec gives every compute. */
|
|
9
15
|
export const ROLE = "alasio";
|
|
16
|
+
/** The analytics lake's (src/neon/lake.ts), which alasio makes. */
|
|
17
|
+
export const LAKE_ROLE = "lake";
|
|
18
|
+
/** The one the lake's query endpoint reads it as (src/neon/lake.ts), which alasio makes. */
|
|
19
|
+
export const LAKE_READER_ROLE = "lake_reader";
|
|
20
|
+
/** Grafana's (src/neon/grafana.ts), which alasio makes. */
|
|
21
|
+
export const GRAFANA_ROLE = "grafana";
|
|
22
|
+
/** neon-control's own (./computes.ts), which every compute's spec gives it, and no client connects as. */
|
|
23
|
+
export const MONITOR_ROLE = "neon_control";
|
|
24
|
+
/** The roles main's clients connect as, whose verifiers the stack keeps. */
|
|
25
|
+
export const CLIENT_ROLES = [ROLE, LAKE_ROLE, LAKE_READER_ROLE, GRAFANA_ROLE];
|
|
26
|
+
/**
|
|
27
|
+
* Main's environment's principals on the log, as cli/src/manifests/log.ts's
|
|
28
|
+
* environmentAccess("main") names them: its alasio's, which reads its Telegram updates and
|
|
29
|
+
* writes its wake topic, and its lake loader's, which reads that. A branch environment's
|
|
30
|
+
* are its own, which alasio's command line makes with it.
|
|
31
|
+
*/
|
|
32
|
+
export const MAIN_ENVIRONMENT_PRINCIPALS = ["alasio-main", "loader-main"];
|
|
33
|
+
/**
|
|
34
|
+
* The log's principals besides its admin, each with a password of its own: the collector's
|
|
35
|
+
* gateway, which writes the stack's telemetry to it; the lake's intake, which reads that;
|
|
36
|
+
* KEDA, which reads how much the intake has yet to; the webhook intake, which writes each
|
|
37
|
+
* environment's Telegram updates to it; and main's environment's (MAIN_ENVIRONMENT_PRINCIPALS).
|
|
38
|
+
*/
|
|
39
|
+
export const LOG_PRINCIPALS = ["gateway", "intake", "scaler", "webhook", ...MAIN_ENVIRONMENT_PRINCIPALS];
|
|
10
40
|
function hexId() {
|
|
11
41
|
return randomUUID().replaceAll("-", "");
|
|
12
42
|
}
|
|
13
43
|
function secret() {
|
|
14
44
|
return randomBytes(24).toString("base64url");
|
|
15
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* A KRaft cluster's id, as Kafka makes one (Uuid.randomUuid): 16 random bytes, in base64url,
|
|
48
|
+
* never beginning with "-", which kafka-storage's command line takes for an option, so that a
|
|
49
|
+
* node formatted with it fails to start.
|
|
50
|
+
*/
|
|
51
|
+
export function clusterId() {
|
|
52
|
+
for (;;) {
|
|
53
|
+
const id = randomBytes(16).toString("base64url");
|
|
54
|
+
if (!id.startsWith("-"))
|
|
55
|
+
return id;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
16
58
|
/**
|
|
17
59
|
* The stack's secrets, `existing` completed: made on first run and then only added to,
|
|
18
60
|
* never rotated. Each secret has a maker, and any absent is filled in, so a deployment
|
|
@@ -30,6 +72,14 @@ export function completeSecrets(existing = {}) {
|
|
|
30
72
|
};
|
|
31
73
|
// A secret already held keeps its place; one made is added after them, in this order.
|
|
32
74
|
const s3 = kept(stored.s3, () => ({}));
|
|
75
|
+
const verifiers = kept(stored.verifiers, () => ({}));
|
|
76
|
+
const passwords = {
|
|
77
|
+
alasioPassword: kept(stored.alasioPassword, () => secret()),
|
|
78
|
+
lakePassword: kept(stored.lakePassword, () => secret()),
|
|
79
|
+
lakeReaderPassword: kept(stored.lakeReaderPassword, () => secret()),
|
|
80
|
+
grafanaPassword: kept(stored.grafanaPassword, () => secret()),
|
|
81
|
+
};
|
|
82
|
+
const log = kept(stored.log, () => ({}));
|
|
33
83
|
const secrets = {
|
|
34
84
|
...stored,
|
|
35
85
|
tenantId: kept(stored.tenantId, () => hexId()),
|
|
@@ -38,24 +88,42 @@ export function completeSecrets(existing = {}) {
|
|
|
38
88
|
...s3,
|
|
39
89
|
neon: kept(s3.neon, () => ({ accessKey: `neon${hexId().slice(0, 12)}`, secretKey: secret() })),
|
|
40
90
|
admin: kept(s3.admin, () => ({ accessKey: `admin${hexId().slice(0, 12)}`, secretKey: secret() })),
|
|
91
|
+
backups: kept(s3.backups, () => ({ accessKey: `backups${hexId().slice(0, 12)}`, secretKey: secret() })),
|
|
41
92
|
lake: kept(s3.lake, () => ({ accessKey: `lake${hexId().slice(0, 12)}`, secretKey: secret() })),
|
|
42
93
|
lakeReader: kept(s3.lakeReader, () => ({ accessKey: `lakereader${hexId().slice(0, 12)}`, secretKey: secret() })),
|
|
43
94
|
workspaces: kept(s3.workspaces, () => ({ accessKey: `workspaces${hexId().slice(0, 12)}`, secretKey: secret() })),
|
|
95
|
+
snapshots: kept(s3.snapshots, () => ({ accessKey: `snapshots${hexId().slice(0, 12)}`, secretKey: secret() })),
|
|
44
96
|
},
|
|
45
97
|
controllerDbPassword: kept(stored.controllerDbPassword, () => secret()),
|
|
46
|
-
alasioPassword:
|
|
47
|
-
lakePassword:
|
|
98
|
+
alasioPassword: passwords.alasioPassword,
|
|
99
|
+
lakePassword: passwords.lakePassword,
|
|
48
100
|
computeControlToken: kept(stored.computeControlToken, () => secret()),
|
|
49
101
|
valkeyPassword: kept(stored.valkeyPassword, () => secret()),
|
|
50
|
-
lakeReaderPassword:
|
|
102
|
+
lakeReaderPassword: passwords.lakeReaderPassword,
|
|
51
103
|
lakeQueryToken: kept(stored.lakeQueryToken, () => secret()),
|
|
52
|
-
grafanaPassword:
|
|
104
|
+
grafanaPassword: passwords.grafanaPassword,
|
|
53
105
|
grafanaAdminPassword: kept(stored.grafanaAdminPassword, () => secret()),
|
|
54
106
|
grafanaSecretKey: kept(stored.grafanaSecretKey, () => secret()),
|
|
55
107
|
branchForkKey: kept(stored.branchForkKey, () => secret()),
|
|
56
108
|
filerStoreFilerPassword: kept(stored.filerStoreFilerPassword, () => secret()),
|
|
57
109
|
filerStoreCollectorPassword: kept(stored.filerStoreCollectorPassword, () => secret()),
|
|
58
110
|
filerStoreBackupPassword: kept(stored.filerStoreBackupPassword, () => secret()),
|
|
111
|
+
monitorKey: kept(stored.monitorKey, () => secret()),
|
|
112
|
+
// Each of its password above, whether that was kept or made now.
|
|
113
|
+
verifiers: {
|
|
114
|
+
...verifiers,
|
|
115
|
+
[ROLE]: kept(verifiers[ROLE], () => scramVerifier(passwords.alasioPassword)),
|
|
116
|
+
[LAKE_ROLE]: kept(verifiers[LAKE_ROLE], () => scramVerifier(passwords.lakePassword)),
|
|
117
|
+
[LAKE_READER_ROLE]: kept(verifiers[LAKE_READER_ROLE], () => scramVerifier(passwords.lakeReaderPassword)),
|
|
118
|
+
[GRAFANA_ROLE]: kept(verifiers[GRAFANA_ROLE], () => scramVerifier(passwords.grafanaPassword)),
|
|
119
|
+
},
|
|
120
|
+
nodeAgentToken: kept(stored.nodeAgentToken, () => secret()),
|
|
121
|
+
logClusterId: kept(stored.logClusterId, () => clusterId()),
|
|
122
|
+
log: {
|
|
123
|
+
...log,
|
|
124
|
+
admin: kept(log.admin, () => secret()),
|
|
125
|
+
...Object.fromEntries(LOG_PRINCIPALS.map((principal) => [principal, kept(log[principal], () => secret())])),
|
|
126
|
+
},
|
|
59
127
|
};
|
|
60
128
|
return { secrets, changed };
|
|
61
129
|
}
|
|
@@ -67,22 +135,32 @@ export function remoteStorage(prefix, { endpoint, bucket, region = "us-east-1" }
|
|
|
67
135
|
return `{ endpoint="${endpoint}", bucket_name="${bucket}", bucket_region="${region}", prefix_in_bucket="${prefix}" }`;
|
|
68
136
|
}
|
|
69
137
|
/**
|
|
70
|
-
* SeaweedFS's S3 identities: Neon, the lake
|
|
71
|
-
* on their own bucket of `buckets`; the
|
|
72
|
-
*
|
|
138
|
+
* SeaweedFS's S3 identities: Neon, the lake, workspace storage when it is on and the
|
|
139
|
+
* snapshots' when sandboxes are snapshotted, each on their own bucket of `buckets`; the
|
|
140
|
+
* lake's reader, which may only read the lake's; the backups', which writes the backups'
|
|
141
|
+
* bucket and reads the workspaces' metadata it backs up; and an admin of Neon's bucket
|
|
142
|
+
* alone, which gives it its lifecycle rules. The snapshots' identity is its bucket's admin,
|
|
143
|
+
* giving it its rules itself: what may write that bucket writes the images the node agents
|
|
144
|
+
* restore as root, so nothing else may.
|
|
73
145
|
*/
|
|
74
146
|
export function s3Identities(secrets, buckets) {
|
|
75
147
|
const on = (name) => [`Read:${name}`, `List:${name}`, `Tagging:${name}`, `Write:${name}`];
|
|
76
148
|
return {
|
|
77
149
|
identities: [
|
|
78
150
|
{ name: "neon", credentials: [secrets.s3.neon], actions: on(buckets.neon) },
|
|
79
|
-
{ name: "admin", credentials: [secrets.s3.admin], actions: [
|
|
151
|
+
{ name: "admin", credentials: [secrets.s3.admin], actions: [`Admin:${buckets.neon}`] },
|
|
152
|
+
{
|
|
153
|
+
name: "backups",
|
|
154
|
+
credentials: [secrets.s3.backups],
|
|
155
|
+
actions: [...on(buckets.backups), ...(buckets.workspaces === null ? [] : [`Read:${buckets.workspaces}`, `List:${buckets.workspaces}`])],
|
|
156
|
+
},
|
|
80
157
|
// Branch environments' lakes are given it too: a branch's lake reads main's files where they are (DuckLake keeps
|
|
81
158
|
// every file's path relative to one data path) and writes beside them, and SeaweedFS's Write, which writing
|
|
82
159
|
// needs, deletes as well, so it cannot be narrowed to a branch's own files (cli/src/branches.ts).
|
|
83
160
|
{ name: "lake", credentials: [secrets.s3.lake], actions: on(buckets.lake) },
|
|
84
161
|
{ name: "lakeReader", credentials: [secrets.s3.lakeReader], actions: [`Read:${buckets.lake}`, `List:${buckets.lake}`] },
|
|
85
162
|
...(buckets.workspaces === null ? [] : [{ name: "workspaces", credentials: [secrets.s3.workspaces], actions: on(buckets.workspaces) }]),
|
|
163
|
+
...(buckets.snapshots === null ? [] : [{ name: "snapshots", credentials: [secrets.s3.snapshots], actions: [...on(buckets.snapshots), `Admin:${buckets.snapshots}`] }]),
|
|
86
164
|
],
|
|
87
165
|
};
|
|
88
166
|
}
|
|
@@ -110,7 +188,7 @@ export function pageserverToml({ brokerUrl, controllerUrl, token, publicKeyPath,
|
|
|
110
188
|
`pg_distrib_dir=${toml("/usr/local/")}`,
|
|
111
189
|
`listen_pg_addr=${toml("0.0.0.0:6400")}`,
|
|
112
190
|
`listen_http_addr=${toml("0.0.0.0:9898")}`,
|
|
113
|
-
`availability_zone=${toml(
|
|
191
|
+
`availability_zone=${toml(PAGESERVER_ZONE)}`,
|
|
114
192
|
`control_plane_api=${toml(`${controllerUrl}/upcall/v1/`)}`,
|
|
115
193
|
`control_plane_api_token=${toml(token)}`,
|
|
116
194
|
`http_auth_type='NeonJWT'`,
|
|
@@ -121,8 +199,4 @@ export function pageserverToml({ brokerUrl, controllerUrl, token, publicKeyPath,
|
|
|
121
199
|
"",
|
|
122
200
|
].join("\n");
|
|
123
201
|
}
|
|
124
|
-
/** How the storage controller and computes reach the pageserver at `host`; it registers itself with these. */
|
|
125
|
-
export function pageserverMetadata(host) {
|
|
126
|
-
return JSON.stringify({ host, port: 6400, http_host: host, http_port: 9898, availability_zone_id: "az-pageserver" }) + "\n";
|
|
127
|
-
}
|
|
128
202
|
//# sourceMappingURL=secrets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../../../neon/control/secrets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../../../neon/control/secrets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAC/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;;;GAWG;AACH,MAAM,cAAc,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC;AAEzE;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAoB;IAC1G,OAAO;QACL,mBAAmB,IAAI,CAAC,SAAS,CAAC,EAAE;QACpC,kBAAkB,IAAI,CAAC,aAAa,CAAC,EAAE;QACvC,kBAAkB,IAAI,CAAC,cAAc,CAAC,EAAE;QACxC,oBAAoB,IAAI,CAAC,cAAc,CAAC,EAAE;QAC1C,qBAAqB,IAAI,CAAC,eAAe,CAAC,EAAE;QAC5C,qBAAqB,IAAI,CAAC,GAAG,aAAa,aAAa,CAAC,EAAE;QAC1D,2BAA2B,IAAI,CAAC,KAAK,CAAC,EAAE;QACxC,0BAA0B;QAC1B,wBAAwB;QACxB,mCAAmC,IAAI,CAAC,aAAa,CAAC,EAAE;QACxD,kBAAkB,OAAO,EAAE;QAC3B,6CAA6C,cAAc,CAAC,WAAW,qBAAqB,cAAc,CAAC,aAAa,IAAI;QAC5H,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
package/dist/src/kube/config.js
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* {
|
|
7
7
|
* "sessions": { "namespace", "port", "workspaceDir", "egressGate", "fullModeNameservers",
|
|
8
|
-
* "mountPodNamespace", "podTemplate", "volumeClaimTemplates", "clone"
|
|
8
|
+
* "mountPodNamespace", "podTemplate", "volumeClaimTemplates", "clone",
|
|
9
|
+
* "snapshots" },
|
|
9
10
|
* "host": { "namespace", "port", "stateRoot", "podTemplate" }
|
|
10
11
|
* }
|
|
11
12
|
*
|
|
@@ -53,6 +54,22 @@ const Clone = said(Schema.Struct({
|
|
|
53
54
|
}), "must be an object");
|
|
54
55
|
/** The variables a clone's Job is given, after its own, in this order (src/sandbox/index.ts). */
|
|
55
56
|
export const CLONE_VARIABLES = ["SOURCE_NAMESPACE", "SOURCE_CLAIM", "DESTINATION_NAMESPACE", "DESTINATION_CLAIM"];
|
|
57
|
+
const Count = said(Schema.Number.check(Schema.isInt({ message: "must be a whole number" }), Schema.isGreaterThan(0, { message: "must be positive" })), "must be a positive whole number");
|
|
58
|
+
/**
|
|
59
|
+
* Session sandboxes' whole-sandbox snapshots (../sandbox/snapshots.ts): how long a session
|
|
60
|
+
* runs no exec and no turn before its Sandbox is snapshotted and released; how often one
|
|
61
|
+
* whose execs run is snapshotted live, running on; the gVisor
|
|
62
|
+
* releases a snapshot is restored under, each by its RuntimeClass, the current one first;
|
|
63
|
+
* and where the node agents that take and prepare the snapshots are, by their pods'
|
|
64
|
+
* namespace and labels, and the port they serve on.
|
|
65
|
+
*/
|
|
66
|
+
const Snapshots = said(Schema.Struct({
|
|
67
|
+
releaseAfterSeconds: Count,
|
|
68
|
+
liveEverySeconds: Count,
|
|
69
|
+
releases: said(Schema.Array(Schema.Struct({ release: said(Schema.NonEmptyString, "must be a release"), runtimeClassName: said(Schema.NonEmptyString, "must be a RuntimeClass's name") }))
|
|
70
|
+
.check(Schema.isMinLength(1, { message: "must name a release" })), "must be a list of releases"),
|
|
71
|
+
agents: said(Schema.Struct({ namespace: Namespace, selector: said(Schema.NonEmptyString, "must be a label selector"), port: Port }), "must be an object"),
|
|
72
|
+
}), "must be an object");
|
|
56
73
|
/** Whether `podTemplate`, as the installation gives it, runs a container named `bayma`. */
|
|
57
74
|
function runsBayma(podTemplate) {
|
|
58
75
|
const containers = Predicate.hasProperty(podTemplate, "spec") && Predicate.hasProperty(podTemplate.spec, "containers")
|
|
@@ -81,6 +98,8 @@ const SessionsProfile = said(Schema.Struct({
|
|
|
81
98
|
volumeClaimTemplates: Schema.optional(VolumeClaimTemplates),
|
|
82
99
|
/** How a session's volume is cloned, where its storage can; none where it cannot, and sessions are not forked. */
|
|
83
100
|
clone: Schema.optional(Schema.NullOr(Clone)),
|
|
101
|
+
/** How sessions' Sandboxes are snapshotted as they are released, where they are; none where they are not. */
|
|
102
|
+
snapshots: Schema.optional(Schema.NullOr(Snapshots)),
|
|
84
103
|
}), "must be an object").check(Schema.makeFilter((profile) => (runsBayma(profile.podTemplate) ? undefined : baymaIssue)));
|
|
85
104
|
/** The template of folder workspaces' bayma (hostProfile in cli/src/manifests/alasio.ts). */
|
|
86
105
|
const HostProfile = said(Schema.Struct({
|
|
@@ -90,8 +109,13 @@ const HostProfile = said(Schema.Struct({
|
|
|
90
109
|
}), "must be an object").check(Schema.makeFilter((profile) => (runsBayma(profile.podTemplate) ? undefined : baymaIssue)));
|
|
91
110
|
/** A profile the deployment may leave out, which is then null. */
|
|
92
111
|
const optionalProfile = (schema) => said(Schema.NullOr(schema), "must be an object").pipe(Schema.withDecodingDefaultKey(Effect.succeed(null)));
|
|
93
|
-
/**
|
|
94
|
-
|
|
112
|
+
/**
|
|
113
|
+
* ALASIO_KUBE_TEMPLATES, checked: a profile the deployment does not render is null; and
|
|
114
|
+
* the sessions' profile before the current one, as `alasio up` carries it forward until
|
|
115
|
+
* their template changes again, which sessions' snapshots may restore onto
|
|
116
|
+
* (../sandbox/snapshots.ts), null where there is none.
|
|
117
|
+
*/
|
|
118
|
+
const KubeTemplates = said(Schema.Struct({ sessions: optionalProfile(SessionsProfile), previousSessions: optionalProfile(SessionsProfile), host: optionalProfile(HostProfile) }), "must be an object");
|
|
95
119
|
const formatIssue = SchemaIssue.makeFormatterStandardSchemaV1();
|
|
96
120
|
/** The first thing wrong with the templates, as alasio says it: the key's path, then what it must be. */
|
|
97
121
|
function describe(issue) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/kube/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/kube/config.ts"],"names":[],"mappings":"AAA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,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAC1I,CACF,CAAC;AAEJ;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA0E,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC1H,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACjG,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC,CAAC,IAAI,kBAAkB,CAAC,EAAE,OAAO,EAAE,2EAA2E,EAAE,CAAC,CAAC;IAC1I,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;QAC7B,GAAG,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC;QACrC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,kBAAkB,CAAC,EAAE,OAAO,EAAE,yBAAyB,IAAI,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;KACvK,CAAC,CAAC;IACH,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC"}
|
|
@@ -14,8 +14,12 @@ export const TOKEN_KEY = "token";
|
|
|
14
14
|
export const TOKEN_VOLUME = "alasio-bayma-token";
|
|
15
15
|
/** The token volume's files' mode: readable by the pod's group, which is how a non-root bayma reads it. */
|
|
16
16
|
export const TOKEN_MODE = 0o440;
|
|
17
|
+
/** The file bayma reads its token from, which a restored Sandbox's new token replaces. */
|
|
18
|
+
export const TOKEN_FILE = `${TOKEN_DIR}/${TOKEN_KEY}`;
|
|
17
19
|
/** The arguments bayma is given after its template's: where its token is. */
|
|
18
|
-
export const TOKEN_FILE_ARGS = ["--token-file",
|
|
20
|
+
export const TOKEN_FILE_ARGS = ["--token-file", TOKEN_FILE];
|
|
21
|
+
/** The arguments a session's bayma is given after those when it exports telemetry: the token it exports with, read from the same file for each export. */
|
|
22
|
+
export const TELEMETRY_TOKEN_FILE_ARGS = ["--telemetry-token-file", TOKEN_FILE];
|
|
19
23
|
/** The name of a Sandbox's token Secret. */
|
|
20
24
|
export function tokenSecretName(name) {
|
|
21
25
|
return `${name}-bayma-token`;
|
|
@@ -29,16 +33,58 @@ export const WORKLOAD_LABEL = "alasio.dev/workload";
|
|
|
29
33
|
export const NET_MODE_LABEL = "alasio.dev/net-mode";
|
|
30
34
|
/** The harness a folder's bayma serves, as a path segment. */
|
|
31
35
|
export const HARNESS_LABEL = "alasio.dev/harness";
|
|
32
|
-
/** The token's environment variable in a session's bayma container, which its OTLP headers expand. */
|
|
33
|
-
export const TOKEN_ENV = "ALASIO_SANDBOX_TOKEN";
|
|
34
36
|
/** The resolvers a session with internet uses unless its template names others. */
|
|
35
37
|
export const DEFAULT_FULL_MODE_NAMESERVERS = ["1.1.1.1", "8.8.8.8"];
|
|
36
38
|
/** The argument a folder's bayma is given its state directory by, under its template's state root. */
|
|
37
39
|
export const STATE_DIR_ARG = "--state-dir";
|
|
40
|
+
/**
|
|
41
|
+
* The argument a session's bayma is given how long it holds a stop by, for alasio to
|
|
42
|
+
* snapshot it first (bayma's mcp-http help): a bayma run without it holds none.
|
|
43
|
+
*/
|
|
44
|
+
export const STOP_WAIT_ARG = "--stop-wait-ms";
|
|
45
|
+
/** How long a session's bayma takes to stop once it holds its stop no more: it persists its sessions. */
|
|
46
|
+
export const BAYMA_STOP_SECONDS = 30;
|
|
38
47
|
/** A path segment from `value`: never empty, nor starting with a dot. */
|
|
39
48
|
export function sanitizePathToken(value) {
|
|
40
49
|
return String(value).replace(/[^A-Za-z0-9_.-]+/g, "-").replace(/^[-.]+|-+$/g, "") || "default";
|
|
41
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* What a session's pod template carries of its whole-sandbox snapshots
|
|
53
|
+
* (../sandbox/snapshots.ts): the hash of the template it was made from, which its
|
|
54
|
+
* snapshots record; the CPU features its sandbox is held to; and, of a pod restored from
|
|
55
|
+
* a snapshot, the image it is restored from, on its node under the snapshot cache, left
|
|
56
|
+
* paused until its node's agent resumes it, which its readiness gate waits for.
|
|
57
|
+
*/
|
|
58
|
+
export const SESSION_TEMPLATE_ANNOTATION = "alasio.dev/session-template";
|
|
59
|
+
/** gVisor's annotation that holds a sandbox to the CPU features it names, of those its node has. */
|
|
60
|
+
export const CPU_FEATURES_ANNOTATION = "dev.gvisor.internal.cpufeatures";
|
|
61
|
+
/** The annotation alasio's fork of gVisor restores a pod's sandbox from, naming the image on the node. */
|
|
62
|
+
export const RESTORE_ANNOTATION = "dev.gvisor.internal.restore.host-image-path";
|
|
63
|
+
/** The fork's annotation that leaves a restored sandbox paused, running nothing, until it is resumed. */
|
|
64
|
+
export const RESTORE_PAUSED_ANNOTATION = "dev.gvisor.internal.restore.paused";
|
|
65
|
+
/** The condition of a restored pod's readiness gate, which alasio sets once its sandbox is resumed. */
|
|
66
|
+
export const RESUMED_CONDITION = "alasio.dev/resumed";
|
|
67
|
+
/**
|
|
68
|
+
* The annotation of a suspended Sandbox naming the snapshot its pod was saved into, which
|
|
69
|
+
* alone it may be restored from: set as it is suspended, removed as it is next resumed,
|
|
70
|
+
* from that snapshot or not, so a snapshot outlives no resume of its Sandbox's.
|
|
71
|
+
*/
|
|
72
|
+
export const SNAPSHOT_ANNOTATION = "alasio.dev/snapshot";
|
|
73
|
+
/**
|
|
74
|
+
* The annotation naming the gVisor release that took the snapshot SNAPSHOT_ANNOTATION
|
|
75
|
+
* names, beside it, the only one that restores it: `alasio up` keeps every release one
|
|
76
|
+
* names (cli/src/kept-releases.ts).
|
|
77
|
+
*/
|
|
78
|
+
export const SNAPSHOT_RELEASE_ANNOTATION = "alasio.dev/snapshot-release";
|
|
79
|
+
/** Where a node agent keeps the snapshots it prepares, as `<environment>/<workspace>/<snapshot>` (../node-agent/cache.ts). */
|
|
80
|
+
export const SNAPSHOT_CACHE_DIR = "/var/lib/alasio/snapshots";
|
|
81
|
+
/**
|
|
82
|
+
* A snapshot's id, as a node agent names it: when it was taken, to the millisecond, so a
|
|
83
|
+
* workspace's ids sort as its snapshots were taken, then 32 random bits.
|
|
84
|
+
*/
|
|
85
|
+
export const SNAPSHOT_ID = "[0-9]{8}T[0-9]{9}Z-[0-9a-f]{8}";
|
|
86
|
+
/** A DNS label: an environment's name (its sessions' namespace) and a workspace's (its Sandbox's), as the snapshot cache's directories are named. */
|
|
87
|
+
export const NAME = /^[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?$/u;
|
|
42
88
|
/** The init container that holds a session's pod until its egress is confined: its name, and its resources. */
|
|
43
89
|
export const EGRESS_GATE = { name: "egress-gate", resources: { requests: { cpu: "10m", memory: "32Mi" }, limits: { memory: "64Mi" } } };
|
|
44
90
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-shape.js","sourceRoot":"","sources":["../../../../src/kube/sandbox-shape.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AAEvC,iGAAiG;AACjG,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAAC;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC;AACjD,2GAA2G;AAC3G,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"sandbox-shape.js","sourceRoot":"","sources":["../../../../src/kube/sandbox-shape.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH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ChC,kCAAkC;IAClC,uGAAuG;IACvG,wDAAwD;IACxD,qBAAqB;IACrB,8DAA8D;IAC9D,sFAAsF;IACtF,wCAAwC;IACxC,0IAA0I;IAC1I,gCAAgC;IAChC,gIAAgI;IAChI,OAAO;CACR,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a node keeps its gVisor releases, containerd's runtimes of them and its
|
|
3
|
+
* snapshots, where its node agent serves, and the memory the agent needs: as the agent
|
|
4
|
+
* reads them, the clusters alasio makes lay them out (cli/src/cluster/), and the
|
|
5
|
+
* installation's manifests give them to the agent (cli/src/manifests/node-agent.ts). Free
|
|
6
|
+
* of any import but sandbox-shape's, itself free of any, so the command line takes it
|
|
7
|
+
* without the agent.
|
|
8
|
+
*/
|
|
9
|
+
/** The port a node agent serves its API on, on its pod's address. */
|
|
10
|
+
export const NODE_AGENT_PORT = 8484;
|
|
11
|
+
/**
|
|
12
|
+
* The port a node agent serves the snapshots bucket on, to its node's restores, on its
|
|
13
|
+
* pod's address (../node-agent/store-proxy.ts): no network policy admits it, so the node
|
|
14
|
+
* alone reaches it, as a node reaches the pods it runs.
|
|
15
|
+
*/
|
|
16
|
+
export const STORE_PROXY_PORT = 8485;
|
|
17
|
+
/** The variable that gives a node agent its pod's address, which it serves the bucket to its node on. */
|
|
18
|
+
export const POD_IP_VARIABLE = "POD_IP";
|
|
19
|
+
/**
|
|
20
|
+
* Where a node keeps the gVisor releases alasio keeps, each in a directory of its own
|
|
21
|
+
* named after it, as its release archive has them: runsc, its shim, and gvisor-bin/, the
|
|
22
|
+
* binaries runsc runs beside it.
|
|
23
|
+
*/
|
|
24
|
+
export const GVISOR_RELEASES = "/usr/local/lib/alasio/gvisor";
|
|
25
|
+
/** The directory of gVisor's `release` on a node. */
|
|
26
|
+
export const gvisorDirectory = (release) => `${GVISOR_RELEASES}/${release}`;
|
|
27
|
+
/**
|
|
28
|
+
* Whether gVisor's `release` restores a sandbox straight from the bucket, its images read
|
|
29
|
+
* through the checkpoint gofer as the restore goes: one of the fork's at or past `since`,
|
|
30
|
+
* the first release that does, as cluster/node/pins.json says it (restoresFromBucketSince)
|
|
31
|
+
* and the installation gives the node agent it (RESTORES_FROM_BUCKET_SINCE_VARIABLE), by
|
|
32
|
+
* its base's date and patch, then its own number. One before it, as the fork's
|
|
33
|
+
* 20260921.0-eaucoin.6, which ends the sandbox as it tries (`urpc method
|
|
34
|
+
* "containerManager.Restore" failed: EOF`), is fetched into the node's cache first and
|
|
35
|
+
* restored from there; so is one that names no release of the fork's, and every release
|
|
36
|
+
* where `since` names none.
|
|
37
|
+
*/
|
|
38
|
+
export function restoresFromBucket(release, since) {
|
|
39
|
+
const parts = (named) => {
|
|
40
|
+
const matched = /^(\d{8})\.(\d+)-eaucoin\.(\d+)$/u.exec(named);
|
|
41
|
+
return matched ? matched.slice(1).map(Number) : null;
|
|
42
|
+
};
|
|
43
|
+
const [of, first] = [parts(release), parts(since)];
|
|
44
|
+
if (of === null || first === null)
|
|
45
|
+
return false;
|
|
46
|
+
const differs = of.findIndex((part, index) => part !== first[index]);
|
|
47
|
+
return differs === -1 || (of[differs] ?? 0) > (first[differs] ?? 0);
|
|
48
|
+
}
|
|
49
|
+
/** The variable that gives the node agent the first gVisor release that restores straight from the bucket (restoresFromBucket). */
|
|
50
|
+
export const RESTORES_FROM_BUCKET_SINCE_VARIABLE = "ALASIO_GVISOR_RESTORES_FROM_BUCKET_SINCE";
|
|
51
|
+
/** Where k3s's containerd reads its template, and runsc its options. */
|
|
52
|
+
export const CONTAINERD = "/var/lib/rancher/k3s/agent/etc/containerd";
|
|
53
|
+
/** gVisor's `release` as a DNS label, which containerd's runtimes and Kubernetes' RuntimeClasses are named with: its dots made dashes. */
|
|
54
|
+
export const gvisorLabel = (release) => release.replaceAll(".", "-");
|
|
55
|
+
/**
|
|
56
|
+
* The containerd runtime of gVisor's `release`, which a RuntimeClass names as its
|
|
57
|
+
* handler, and whose runsc options are `<CONTAINERD>/<runtime>.toml`.
|
|
58
|
+
*/
|
|
59
|
+
export const gvisorHandler = (release) => `runsc-${gvisorLabel(release)}`;
|
|
60
|
+
/** The RuntimeClass of gVisor's `release` alone, which a sandbox snapshotted under it is restored with. */
|
|
61
|
+
export const gvisorRuntimeClass = (release) => `gvisor-${gvisorLabel(release)}`;
|
|
62
|
+
/** The version runsc of gVisor's `release` reports, and saves its images with: its release's tag. */
|
|
63
|
+
export const runscVersion = (release) => `release-${release}`;
|
|
64
|
+
/** The root the gVisor shims run runsc with for Kubernetes' containers, under the node's /run. */
|
|
65
|
+
export const RUNSC_ROOT = "/run/containerd/runsc/k8s.io";
|
|
66
|
+
/** The node's snapshot cache, where its sandboxes are restored from, as the admission policy holds a restore to. */
|
|
67
|
+
export { SNAPSHOT_CACHE_DIR } from "../kube/sandbox-shape.js";
|
|
68
|
+
/**
|
|
69
|
+
* The node agent's container that says, as its pod starts, the CPU features its node has
|
|
70
|
+
* under the current gVisor release (./cpu-features.ts), as its termination message, which
|
|
71
|
+
* Kubernetes keeps up to 4 KiB of: a CpuFeaturesReport, as JSON.
|
|
72
|
+
*/
|
|
73
|
+
export const CPU_FEATURES_CONTAINER = "cpu-features";
|
|
74
|
+
/** A part of a snapshot file the node agent puts or gets (./s3.ts): 32 MiB, as large as S3's 10000 parts make an object of 312 GiB. */
|
|
75
|
+
export const SNAPSHOT_PART_BYTES = 32 * 1024 ** 2;
|
|
76
|
+
/** How many parts of a snapshot file the node agent puts or gets at a time, and how many gets, of every snapshot it gets. */
|
|
77
|
+
export const SNAPSHOT_PARTS_AT_ONCE = 4;
|
|
78
|
+
/** What a get of the node agent's writes to its file between syncs to the disk: 8 MiB. */
|
|
79
|
+
export const SNAPSHOT_SYNC_BYTES = 8 * 1024 ** 2;
|
|
80
|
+
/**
|
|
81
|
+
* The node agent's memory budget for what it gets: what it holds written and not yet on
|
|
82
|
+
* the disk, at most, of every get at a time together (./s3.ts). The kernel counts it in the
|
|
83
|
+
* agent's memory and cannot reclaim it before it is written, so the agent's memory limit
|
|
84
|
+
* leaves room for it beside the agent's own; what it reads through the page cache, the
|
|
85
|
+
* kernel reclaims.
|
|
86
|
+
*/
|
|
87
|
+
export const UNSYNCED_DOWNLOAD_BYTES = SNAPSHOT_PARTS_AT_ONCE * SNAPSHOT_SYNC_BYTES;
|
|
88
|
+
/**
|
|
89
|
+
* The node agent's own memory: what it was measured to hold restoring a 1 GiB session's
|
|
90
|
+
* snapshot from the bucket on a node of its own (test/e2e, 125 to 145 MiB anonymous),
|
|
91
|
+
* rounded up.
|
|
92
|
+
*/
|
|
93
|
+
export const NODE_AGENT_OWN_BYTES = 160 * 1024 ** 2;
|
|
94
|
+
/** The least memory limit a node agent runs under: its own, and a download's budget beside it. */
|
|
95
|
+
export const NODE_AGENT_MEMORY_FLOOR = NODE_AGENT_OWN_BYTES + UNSYNCED_DOWNLOAD_BYTES;
|
|
96
|
+
/** The variable holding the token alasio presents to a node agent. */
|
|
97
|
+
export const NODE_AGENT_TOKEN_VARIABLE = "ALASIO_NODE_AGENT_TOKEN";
|
|
98
|
+
/** The variable holding the most bytes the node's snapshot cache keeps. */
|
|
99
|
+
export const SNAPSHOT_CACHE_BYTES_VARIABLE = "ALASIO_SNAPSHOT_CACHE_BYTES";
|
|
100
|
+
/**
|
|
101
|
+
* How long a checkpoint, a prepare or a copy may take: a sandbox's memory, through the store,
|
|
102
|
+
* both ways, or within it. alasio waits for one so long, and an agent that stops lets the
|
|
103
|
+
* ones it runs end within it (./operations.ts), after its restores' reads (nodeAgentStopSeconds).
|
|
104
|
+
*/
|
|
105
|
+
export const OPERATION_LIMIT_SECONDS = 15 * 60;
|
|
106
|
+
/**
|
|
107
|
+
* How long a restore from the bucket may take from its prepare to its resume, which its token
|
|
108
|
+
* lasts unless resumed before (./store-proxy.ts): the longest it takes, alasio waiting 3
|
|
109
|
+
* minutes for its pod to run (POD_RUNNING_TIMEOUT in src/sandbox/snapshots.ts), then for the
|
|
110
|
+
* agent's resume, and a margin.
|
|
111
|
+
*/
|
|
112
|
+
export const RESTORE_PREPARED_FOR_SECONDS = 5 * 60;
|
|
113
|
+
/** The variable holding how long, in seconds, a resumed restore from the bucket may read it through the node agent (backgroundReadSeconds). */
|
|
114
|
+
export const BACKGROUND_READ_SECONDS_VARIABLE = "ALASIO_BACKGROUND_READ_SECONDS";
|
|
115
|
+
/**
|
|
116
|
+
* The slowest a resumed restore is taken to read the rest of its sandbox through the node
|
|
117
|
+
* agent, in the background: half of what gate 4 measured on a runner's bundled SeaweedFS,
|
|
118
|
+
* 8.7 MB/s through the agent's proxy from the restore's start to its last read
|
|
119
|
+
* (program/progress/live-lazy.md).
|
|
120
|
+
*/
|
|
121
|
+
export const BACKGROUND_READ_BYTES_PER_SECOND = 4 * 1024 ** 2;
|
|
122
|
+
/**
|
|
123
|
+
* How long a resumed restore of a sandbox of at most `memoryBytes` may read the rest of it
|
|
124
|
+
* through the node agent, at the slowest (BACKGROUND_READ_BYTES_PER_SECOND), in seconds: a
|
|
125
|
+
* minute at least.
|
|
126
|
+
*/
|
|
127
|
+
export function backgroundReadSeconds(memoryBytes) {
|
|
128
|
+
return Math.max(60, Math.ceil(memoryBytes / BACKGROUND_READ_BYTES_PER_SECOND));
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* How long a node agent that stops may take, its sandboxes of at most `memoryBytes`: the
|
|
132
|
+
* restores that read the bucket through it done first, the last within its token's time (one
|
|
133
|
+
* prepared just before the stop taking as long as a restore takes to its resume, then as long
|
|
134
|
+
* as it takes to read its sandbox whole), then the checkpoints, prepares and copies it runs
|
|
135
|
+
* (OPERATION_LIMIT_SECONDS).
|
|
136
|
+
*/
|
|
137
|
+
export function nodeAgentStopSeconds(memoryBytes) {
|
|
138
|
+
return RESTORE_PREPARED_FOR_SECONDS + backgroundReadSeconds(memoryBytes) + OPERATION_LIMIT_SECONDS;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=names.js.map
|
|
@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AAsB,GAAG,mBAAmB,CAAC;AAEpF;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,CAAC;AAEpD,kGAAkG;AAClG,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,GAAG,uBAAuB,CAAC;AAEtF,sEAAsE;AACtE,MAAM,CAAC,MAAM,yBAAyB,GAAG,yBAAyB,CAAC;AAEnE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,6BAA6B,GAAG,6BAA6B,CAAC;AAE3E;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,GAAG,EAAE,CAAC;AAEnD,+IAA+I;AAC/I,MAAM,CAAC,MAAM,gCAAgC,GAAG,gCAAgC,CAAC;AAEjF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;AAE9D;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,WAAmB;IACvD,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,gCAAgC,CAAC,CAAC,CAAC;AACjF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAAmB;IACtD,OAAO,4BAA4B,GAAG,qBAAqB,CAAC,WAAW,CAAC,GAAG,uBAAuB,CAAC;AACrG,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How Telegram's deliveries of a bot's updates to the webhook intake fare, as the bot's
|
|
3
|
+
* getWebhookInfo says, which is where alone Telegram says a delivery failed: alike for
|
|
4
|
+
* alasio, which watches its own bot's (./delivery-watch.ts), and for alasio status, which
|
|
5
|
+
* says each environment's. Free of anything but the language's own, so the command line
|
|
6
|
+
* takes it without the server.
|
|
7
|
+
*/
|
|
8
|
+
/** How long a failed delivery is a failure now, as Telegram keeps its last error after it delivers again. */
|
|
9
|
+
const LATELY_SECONDS = 600;
|
|
10
|
+
/**
|
|
11
|
+
* Telegram's errors that say it could not connect to the intake at all, as where the
|
|
12
|
+
* networks it delivers from are not among install.webhook.sources, which the intake's
|
|
13
|
+
* NetworkPolicy and a LoadBalancer admit alone: the connection is dropped, and times out,
|
|
14
|
+
* or refused.
|
|
15
|
+
*/
|
|
16
|
+
const UNREACHABLE = /^(Connection timed out|Connection refused|No route to host|Network is unreachable)\b/u;
|
|
17
|
+
/** Telegram's error that says the name it is told to deliver to resolves to no address. */
|
|
18
|
+
const UNRESOLVED = /^Failed to resolve host\b/u;
|
|
19
|
+
/** The fix Telegram's error `error` points to, null where it points to none. */
|
|
20
|
+
function fixOf(error) {
|
|
21
|
+
if (UNREACHABLE.test(error)) {
|
|
22
|
+
return "Telegram cannot connect to it, as where its networks have changed from those install.webhook.sources lists: list Telegram's (core.telegram.org/bots/webhooks) there, and alasio up admits them";
|
|
23
|
+
}
|
|
24
|
+
if (UNRESOLVED.test(error))
|
|
25
|
+
return "Telegram cannot resolve install.webhook.publicAddress: give the name an address, or set the address itself, and alasio up registers each bot with it";
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Whether `deliveries` fail at `now` (milliseconds): updates wait, and Telegram's last
|
|
30
|
+
* delivery failed lately; null where they do not, as where nothing waits, every update
|
|
31
|
+
* delivered since.
|
|
32
|
+
*/
|
|
33
|
+
export function failingDeliveries(deliveries, now) {
|
|
34
|
+
const { pending_update_count: pending, last_error_date: date, last_error_message: error = "no reason given" } = deliveries;
|
|
35
|
+
if (pending === 0 || date === undefined || now / 1000 - date >= LATELY_SECONDS)
|
|
36
|
+
return null;
|
|
37
|
+
const at = new Date(date * 1000).toISOString().replace(/\.\d{3}Z$/u, "Z");
|
|
38
|
+
return { description: `${pending} update${pending === 1 ? "" : "s"} waiting; Telegram's last delivery failed at ${at}: ${error}`, fix: fixOf(error) };
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=deliveries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deliveries.js","sourceRoot":"","sources":["../../../../src/telegram/deliveries.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,6GAA6G;AAC7G,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,WAAW,GAAG,uFAAuF,CAAC;AAE5G,2FAA2F;AAC3F,MAAM,UAAU,GAAG,4BAA4B,CAAC;AAEhD,gFAAgF;AAChF,SAAS,KAAK,CAAC,KAAa;IAC1B,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,gMAAgM,CAAC;IAC1M,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,sJAAsJ,CAAC;IAC1L,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAsB,EAAE,GAAW;IACnE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,GAAG,iBAAiB,EAAE,GAAG,UAAU,CAAC;IAC3H,IAAI,OAAO,KAAK,CAAC,IAAI,IAAI,KAAK,SAAS,IAAI,GAAG,GAAG,IAAI,GAAG,IAAI,IAAI,cAAc;QAAE,OAAO,IAAI,CAAC;IAC5F,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IAC1E,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,UAAU,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,gDAAgD,EAAE,KAAK,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;AACxJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alasio",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "alasio: coding agents you talk to from Telegram, installed and run with npx alasio",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"node": ">=24"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "rm -rf dist && tsc -p tsconfig.build.json
|
|
17
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
18
18
|
"start": "node ./src/main.ts"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{{ template "base" . }}
|
|
2
|
-
|
|
3
|
-
[plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.runsc]
|
|
4
|
-
runtime_type = "io.containerd.runsc.v1"
|
|
5
|
-
{{- if .SystemdCgroup }}
|
|
6
|
-
|
|
7
|
-
# Where systemd runs the machine, kubelet's cgroups are systemd's, and runsc places its
|
|
8
|
-
# sandboxes' through systemd too, as runsc.toml beside this file says.
|
|
9
|
-
[plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.runsc.options]
|
|
10
|
-
TypeUrl = "io.containerd.runsc.v1.options"
|
|
11
|
-
ConfigPath = "/var/lib/rancher/k3s/agent/etc/containerd/runsc.toml"
|
|
12
|
-
{{- end }}
|