alasio 7.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 +65 -29
- package/dist/cli/src/branches.js.map +1 -1
- package/dist/cli/src/cluster/k3s.js +8 -1
- package/dist/cli/src/cluster/k3s.js.map +1 -1
- package/dist/cli/src/cluster/node.js +8 -1
- package/dist/cli/src/cluster/node.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 +40 -8
- package/dist/cli/src/commands/restore-filer-store.js.map +1 -1
- package/dist/cli/src/commands/status.js +156 -12
- package/dist/cli/src/commands/status.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/install.js +69 -15
- package/dist/cli/src/install.js.map +1 -1
- package/dist/cli/src/kept-releases.js.map +1 -1
- 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 +58 -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 +43 -4
- package/dist/cli/src/manifests/admission.js.map +1 -1
- package/dist/cli/src/manifests/alasio.js +68 -15
- package/dist/cli/src/manifests/alasio.js.map +1 -1
- package/dist/cli/src/manifests/collector.js +227 -128
- package/dist/cli/src/manifests/collector.js.map +1 -1
- package/dist/cli/src/manifests/config.js +196 -15
- package/dist/cli/src/manifests/config.js.map +1 -1
- package/dist/cli/src/manifests/index.js +8 -4
- 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 +336 -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 +125 -46
- package/dist/cli/src/manifests/neon.js.map +1 -1
- package/dist/cli/src/manifests/network-policies.js +130 -33
- package/dist/cli/src/manifests/network-policies.js.map +1 -1
- package/dist/cli/src/manifests/node-agent.js +14 -5
- package/dist/cli/src/manifests/node-agent.js.map +1 -1
- package/dist/cli/src/manifests/scalers.js.map +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 +5 -0
- package/dist/neon/control/branches.js +120 -15
- package/dist/neon/control/branches.js.map +1 -1
- package/dist/neon/control/endpoints.js +9 -0
- package/dist/neon/control/endpoints.js.map +1 -1
- package/dist/neon/control/jwt.js +16 -3
- package/dist/neon/control/jwt.js.map +1 -1
- package/dist/neon/control/secrets.js +39 -6
- package/dist/neon/control/secrets.js.map +1 -1
- package/dist/src/kube/config.js +3 -1
- package/dist/src/kube/config.js.map +1 -1
- package/dist/src/kube/sandbox-shape.js +12 -2
- package/dist/src/kube/sandbox-shape.js.map +1 -1
- package/dist/src/node-agent/names.js +67 -1
- package/dist/src/node-agent/names.js.map +1 -1
- package/dist/src/telegram/deliveries.js +40 -0
- package/dist/src/telegram/deliveries.js.map +1 -0
- package/package.json +1 -1
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
*/
|
|
9
9
|
/** The port a node agent serves its API on, on its pod's address. */
|
|
10
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";
|
|
11
19
|
/**
|
|
12
20
|
* Where a node keeps the gVisor releases alasio keeps, each in a directory of its own
|
|
13
21
|
* named after it, as its release archive has them: runsc, its shim, and gvisor-bin/, the
|
|
@@ -16,6 +24,30 @@ export const NODE_AGENT_PORT = 8484;
|
|
|
16
24
|
export const GVISOR_RELEASES = "/usr/local/lib/alasio/gvisor";
|
|
17
25
|
/** The directory of gVisor's `release` on a node. */
|
|
18
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";
|
|
19
51
|
/** Where k3s's containerd reads its template, and runsc its options. */
|
|
20
52
|
export const CONTAINERD = "/var/lib/rancher/k3s/agent/etc/containerd";
|
|
21
53
|
/** gVisor's `release` as a DNS label, which containerd's runtimes and Kubernetes' RuntimeClasses are named with: its dots made dashes. */
|
|
@@ -68,7 +100,41 @@ export const SNAPSHOT_CACHE_BYTES_VARIABLE = "ALASIO_SNAPSHOT_CACHE_BYTES";
|
|
|
68
100
|
/**
|
|
69
101
|
* How long a checkpoint, a prepare or a copy may take: a sandbox's memory, through the store,
|
|
70
102
|
* both ways, or within it. alasio waits for one so long, and an agent that stops lets the
|
|
71
|
-
* ones it runs end within it (./operations.ts).
|
|
103
|
+
* ones it runs end within it (./operations.ts), after its restores' reads (nodeAgentStopSeconds).
|
|
72
104
|
*/
|
|
73
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
|
+
}
|
|
74
140
|
//# sourceMappingURL=names.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"names.js","sourceRoot":"","sources":["../../../../src/node-agent/names.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qEAAqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,8BAA8B,CAAC;AAE9D,qDAAqD;AACrD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,GAAG,eAAe,IAAI,OAAO,EAAE,CAAC;AAE5F,wEAAwE;AACxE,MAAM,CAAC,MAAM,UAAU,GAAG,2CAA2C,CAAC;AAEtE,0IAA0I;AAC1I,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAErF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,SAAS,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;AAE1F,2GAA2G;AAC3G,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,UAAU,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;AAEhG,qGAAqG;AACrG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,WAAW,OAAO,EAAE,CAAC;AAE9E,kGAAkG;AAClG,MAAM,CAAC,MAAM,UAAU,GAAG,8BAA8B,CAAC;AAEzD,oHAAoH;AACpH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAQrD,uIAAuI;AACvI,MAAM,CAAC,MAA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C;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,C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