@gresearch/marimohub-compute-armada 0.3.0 → 0.4.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/CHANGELOG.md +166 -0
- package/README.md +24 -251
- package/dist/agent/SHA256SUMS +2 -2
- package/dist/agent/linux-amd64/agent +0 -0
- package/dist/agent/linux-arm64/agent +0 -0
- package/dist/index.js +7421 -14
- package/dist/index.js.map +78 -5
- package/docs/CONFIGURATION.md +582 -0
- package/examples/kernel-pod.yaml +79 -0
- package/package.json +7 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this
|
|
6
|
+
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). A new version
|
|
7
|
+
heading merged to main is released: see
|
|
8
|
+
[docs/CONTRIBUTING.md](https://github.com/G-Research/marimohub-compute-armada/blob/main/docs/CONTRIBUTING.md#releasing).
|
|
9
|
+
|
|
10
|
+
## [Unreleased]
|
|
11
|
+
|
|
12
|
+
## [0.4.0] - 2026-11-19
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `ARMADA_POD_TEMPLATE_FILE` adds a partial Pod manifest to every kernel pod: volumes of
|
|
17
|
+
any source (CSI, Secret, ConfigMap), the kernel container's `env`, `envFrom` and
|
|
18
|
+
`volumeMounts` (with `subPath`, `readOnly` and `mountPropagation`), and
|
|
19
|
+
`serviceAccountName`, `automountServiceAccountToken` and `enableServiceLinks`. Kernels can
|
|
20
|
+
now mount network shares with a credential from a Secret in the job namespace, and run
|
|
21
|
+
without the namespace's service-account token, or under a service account of their own.
|
|
22
|
+
The file uses the format of marimohub's `MARIMOHUB_COMPUTE_KUBERNETES_POD_TEMPLATE_FILE`,
|
|
23
|
+
where the kernel container is named `marimo`: that name is accepted for the container
|
|
24
|
+
and in a `resourceFieldRef.containerName`, which is submitted as `kernel`.
|
|
25
|
+
Startup fails, naming the field, when the template touches a part of the pod the adapter
|
|
26
|
+
owns, a field another variable sets, or a field it does not support. Without the setting,
|
|
27
|
+
the pod spec is unchanged. The template is part of the submission and so public in
|
|
28
|
+
Lookout, like the rest of the pod spec: it must name Secrets, never hold credentials.
|
|
29
|
+
([#30](https://github.com/G-Research/marimohub-compute-armada/pull/30))
|
|
30
|
+
- The npm package ships the configuration reference, `docs/CONFIGURATION.md`: every
|
|
31
|
+
variable the adapter reads with its default and checks, setups to start from, and what
|
|
32
|
+
a job submission shows everyone in Lookout. It also ships `CHANGELOG.md` and
|
|
33
|
+
`examples/kernel-pod.yaml`, a pod template for network shares with a Kerberos credential
|
|
34
|
+
cache. The README links to it in place of its own configuration section.
|
|
35
|
+
([#30](https://github.com/G-Research/marimohub-compute-armada/pull/30))
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- `ARMADA_KERNEL_MAX_LIFETIME_SECONDS` now applies under marimohub. Before, marimohub's
|
|
40
|
+
session lifetime always took its place. Check any value you set: below
|
|
41
|
+
`MARIMOHUB_SESSION_MAX_LIFETIME_SECONDS` it now stops startup, and above it, it now sets
|
|
42
|
+
the pod deadline. Unset, the deadline is twice the session lifetime.
|
|
43
|
+
([#30](https://github.com/G-Research/marimohub-compute-armada/pull/30))
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
|
|
47
|
+
- Kubernetes killed a kernel pod at marimohub's session lifetime (4 hours by default) even
|
|
48
|
+
when marimohub had extended the session because editors were still connected, and could
|
|
49
|
+
kill an idle session before marimohub saved it. The pod's `activeDeadlineSeconds` is now a
|
|
50
|
+
backstop at twice the session lifetime, as on marimohub's own CoreWeave, E2B and W&B
|
|
51
|
+
backends. `ARMADA_KERNEL_MAX_LIFETIME_SECONDS` sets it instead, and now applies under
|
|
52
|
+
marimohub too: before, marimohub's session lifetime always took its place. A value below
|
|
53
|
+
the session lifetime stops startup. The variable is now documented.
|
|
54
|
+
([#30](https://github.com/G-Research/marimohub-compute-armada/pull/30))
|
|
55
|
+
- `ARMADA_COMMAND_MAX_SECONDS` set but empty turned the exec backstop off, as if it were
|
|
56
|
+
`0`. An empty or blank value of any seconds setting now stops startup, as other empty
|
|
57
|
+
settings already did.
|
|
58
|
+
([#30](https://github.com/G-Research/marimohub-compute-armada/pull/30))
|
|
59
|
+
- `ARMADA_NAMESPACE` or `ARMADA_PRIORITY_CLASS` set but empty was submitted as is, and every
|
|
60
|
+
session failed. Either one set but empty now stops startup.
|
|
61
|
+
([#30](https://github.com/G-Research/marimohub-compute-armada/pull/30))
|
|
62
|
+
- A malformed `ARMADA_POD_ANNOTATIONS`, `ARMADA_POD_LABELS`, `ARMADA_INGRESS_ANNOTATIONS`,
|
|
63
|
+
`ARMADA_QUEUE_BY_*` or `ARMADA_GPU_NODE_SELECTORS` was repeated in full in the startup
|
|
64
|
+
error, where a credential pasted into it would reach marimohub's logs. The error now names
|
|
65
|
+
the variable only.
|
|
66
|
+
([#30](https://github.com/G-Research/marimohub-compute-armada/pull/30))
|
|
67
|
+
|
|
68
|
+
## [0.3.0] - 2026-11-18
|
|
69
|
+
|
|
70
|
+
### Added
|
|
71
|
+
|
|
72
|
+
- `ARMADA_START_TIMEOUT_SECONDS` sets how long a session start waits for its Armada job to
|
|
73
|
+
run (default 300, as before). The wait was a fixed 5 minutes, and raising marimohub's
|
|
74
|
+
`MARIMOHUB_SANDBOX_STARTUP_TIMEOUT_SECONDS` did not extend it: marimohub's clock starts
|
|
75
|
+
only once the sandbox is reachable, after the queue wait. A start that runs out now says
|
|
76
|
+
where the job got stuck (still queued, or a pod that will not start) instead of failing
|
|
77
|
+
with a bare `TimeoutError`.
|
|
78
|
+
([#29](https://github.com/G-Research/marimohub-compute-armada/pull/29))
|
|
79
|
+
|
|
80
|
+
### Changed
|
|
81
|
+
|
|
82
|
+
- Needs marimohub 0.7.1 or later, and refuses to load on an older one. Built and tested
|
|
83
|
+
against 0.7.1, which is also the base of the `Dockerfile` image now. From 0.7.1, marimohub
|
|
84
|
+
gives library adapters its own not-found error, and the adapter reports a sandbox whose
|
|
85
|
+
Armada job has finished with it. Before, a notebook whose pod was preempted, cancelled or
|
|
86
|
+
lost stayed locked until an admin reclaimed its session. Because marimohub drops the
|
|
87
|
+
unsaved edits of a sandbox reported gone, the adapter reports it only when Armada confirms
|
|
88
|
+
it: a job Lookout does not list yet is looked for in the job set's events, and a lookup
|
|
89
|
+
Armada cannot answer fails as an ordinary error, which marimohub retries.
|
|
90
|
+
([#29](https://github.com/G-Research/marimohub-compute-armada/pull/29))
|
|
91
|
+
|
|
92
|
+
### Fixed
|
|
93
|
+
|
|
94
|
+
- A session start behind a proxy with a read timeout (nginx's default is 60s) failed once
|
|
95
|
+
its job had waited that long in the queue: the proxy cut the watch for the job to start,
|
|
96
|
+
and a cut watch ended the wait. The wait now opens the stream again after the last event
|
|
97
|
+
it read, through dropped connections and through the 502, 503 or 504 a proxy answers
|
|
98
|
+
meanwhile, until its deadline.
|
|
99
|
+
([#29](https://github.com/G-Research/marimohub-compute-armada/pull/29))
|
|
100
|
+
|
|
101
|
+
## [0.2.1] - 2026-11-17
|
|
102
|
+
|
|
103
|
+
### Fixed
|
|
104
|
+
|
|
105
|
+
- A sandbox whose Armada job had finished without marimohub asking (preempted, cancelled,
|
|
106
|
+
failed, node lost) still looked alive. Every call to it waited the 30s agent timeout
|
|
107
|
+
against a pod that no longer existed, and each lifecycle sweep took about 90s, which
|
|
108
|
+
delayed snapshots for every session on the hub. The sandbox is now reported gone at once,
|
|
109
|
+
and its calls throw instead of returning `BACKEND_ERROR`.
|
|
110
|
+
([#28](https://github.com/G-Research/marimohub-compute-armada/pull/28))
|
|
111
|
+
|
|
112
|
+
## [0.2.0] - 2026-10-13
|
|
113
|
+
|
|
114
|
+
### Added
|
|
115
|
+
|
|
116
|
+
- Strict attachment (`connectExisting`), which marimohub uses to save an expired editor
|
|
117
|
+
session's edits before it reclaims the sandbox. It reaches the sandbox's existing job and
|
|
118
|
+
never submits one. Without it, such a session kept its pod and editor claim until its
|
|
119
|
+
authorization ran out or an admin discarded it, and its edits were lost.
|
|
120
|
+
([#22](https://github.com/G-Research/marimohub-compute-armada/pull/22))
|
|
121
|
+
|
|
122
|
+
### Changed
|
|
123
|
+
|
|
124
|
+
- Built and tested against marimohub 0.5.0, which is also the base of the `Dockerfile`
|
|
125
|
+
image now. ([#22](https://github.com/G-Research/marimohub-compute-armada/pull/22))
|
|
126
|
+
|
|
127
|
+
## [0.1.2] - 2026-10-13
|
|
128
|
+
|
|
129
|
+
### Fixed
|
|
130
|
+
|
|
131
|
+
- Startup now also checks the GPU types in `MARIMOHUB_COMPUTE_APP_PROFILES`, the separate
|
|
132
|
+
app profile list from marimohub 0.5.0. An app profile with a GPU type that
|
|
133
|
+
`ARMADA_GPU_NODE_SELECTORS` does not map passed startup and then failed every app
|
|
134
|
+
session that used it. ([#21](https://github.com/G-Research/marimohub-compute-armada/pull/21))
|
|
135
|
+
|
|
136
|
+
## [0.1.1] - 2026-10-12
|
|
137
|
+
|
|
138
|
+
### Fixed
|
|
139
|
+
|
|
140
|
+
- The kernel agent had no way to report its version. `agent --version` now prints the
|
|
141
|
+
release it was built for, and the agent logs it at startup. A build from
|
|
142
|
+
`agent/Dockerfile` reports `dev` unless it is given `--build-arg VERSION=...`.
|
|
143
|
+
|
|
144
|
+
## [0.1.0] - 2026-10-12
|
|
145
|
+
|
|
146
|
+
First release, built and tested against marimohub 0.4.14 and Armada v0.22.7.
|
|
147
|
+
|
|
148
|
+
### Added
|
|
149
|
+
|
|
150
|
+
- A marimohub compute adapter that runs notebook kernels as Armada jobs, loaded through
|
|
151
|
+
marimohub's external adapter library mode.
|
|
152
|
+
- A kernel agent that runs as PID 1 in the kernel pod and runs the commands marimohub
|
|
153
|
+
sends it, so the adapter needs no Kubernetes credentials. Each pod gets its own token,
|
|
154
|
+
derived from `ARMADA_AGENT_TOKEN_SECRET`.
|
|
155
|
+
- The kernel agent as static Linux binaries for amd64 and arm64, with a Dockerfile that
|
|
156
|
+
builds the agent image from them, in the npm package.
|
|
157
|
+
- Kernel ports reached through a NodePort or an Ingress (`ARMADA_EXPOSE`).
|
|
158
|
+
- `listActive` reconciliation against Lookout (`ARMADA_LOOKOUT_URL`).
|
|
159
|
+
- marimohub compute profiles, with GPU types mapped to node selectors
|
|
160
|
+
(`ARMADA_GPU_NODE_SELECTORS`).
|
|
161
|
+
- Queues chosen per user or per project (`ARMADA_QUEUE_BY_USER`, `ARMADA_QUEUE_BY_PROJECT`).
|
|
162
|
+
- Image pull secrets and a pod security context for private registries and restricted
|
|
163
|
+
clusters.
|
|
164
|
+
- Fixed labels and annotations on every kernel pod (`ARMADA_POD_LABELS`,
|
|
165
|
+
`ARMADA_POD_ANNOTATIONS`).
|
|
166
|
+
- Basic or bearer token auth to Armada, with the token re-read from a file on every request.
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ release with the same files and build attestations; [CHANGELOG.md](CHANGELOG.md)
|
|
|
18
18
|
changed.
|
|
19
19
|
|
|
20
20
|
To build from source instead, see [Deployment](#deployment);
|
|
21
|
-
[docs/CONTRIBUTING.md](docs/CONTRIBUTING.md) walks through a full run against a local kind
|
|
21
|
+
[docs/CONTRIBUTING.md](https://github.com/G-Research/marimohub-compute-armada/blob/main/docs/CONTRIBUTING.md) walks through a full run against a local kind
|
|
22
22
|
cluster.
|
|
23
23
|
|
|
24
24
|
## How it works
|
|
@@ -38,259 +38,30 @@ Kubernetes credential of any kind.
|
|
|
38
38
|
The adapter is two halves: **placement** (`src/armada.ts`) submits the job and follows
|
|
39
39
|
its events, and the **control channel** (`src/channel.ts`) talks to the agent.
|
|
40
40
|
Everything above that is ordinary shell commands. The full picture, with diagrams, is
|
|
41
|
-
in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
|
|
41
|
+
in [docs/ARCHITECTURE.md](https://github.com/G-Research/marimohub-compute-armada/blob/main/docs/ARCHITECTURE.md).
|
|
42
42
|
|
|
43
43
|
## Configuration
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
| `MARIMOHUB_COMPUTE_IMAGE` | no | Kernel image, first of the list (default marimo's) |
|
|
52
|
-
| `ARMADA_NAMESPACE` | no | Pod namespace (default `default`) |
|
|
53
|
-
| `ARMADA_LOOKOUT_URL` | no | Lookout base URL; enables `listActive` reconciliation |
|
|
54
|
-
| `ARMADA_PRIORITY_CLASS` | no | Use a non-preemptible class for interactive sessions |
|
|
55
|
-
| `ARMADA_KERNEL_PORT` | no | Port marimo serves on (default `2718`) |
|
|
56
|
-
| `ARMADA_AGENT_PORT` | no | Port the agent listens on (default `8718`) |
|
|
57
|
-
| `ARMADA_IMAGE_PULL_SECRETS` | no | Comma-separated secret names for private registries |
|
|
58
|
-
| `ARMADA_RUN_AS_USER` | no | Pod `securityContext.runAsUser`, a uid |
|
|
59
|
-
| `ARMADA_RUN_AS_GROUP` | no | Pod `securityContext.runAsGroup`, a gid |
|
|
60
|
-
| `ARMADA_FS_GROUP` | no | Pod `securityContext.fsGroup`; owns the agent volume |
|
|
61
|
-
| `ARMADA_COMMAND_MAX_SECONDS` | no | Backstop for one exec (default `21600`, `0` off) |
|
|
62
|
-
| `ARMADA_START_TIMEOUT_SECONDS` | no | Wait for a job to start running (default `300`) |
|
|
63
|
-
| `ARMADA_EXPOSE` | no | `nodeport` (default) or `ingress`, for both ports |
|
|
64
|
-
| `ARMADA_INGRESS_TLS` | no | `true` (default) or `false`; ingress only |
|
|
65
|
-
| `ARMADA_INGRESS_CERT_NAME` | no | TLS secret name prefix (default `<namespace>-`) |
|
|
66
|
-
| `ARMADA_INGRESS_ANNOTATIONS` | no | JSON object put on every job's Ingress |
|
|
67
|
-
| `ARMADA_POD_LABELS` | no | JSON object of labels put on every kernel pod |
|
|
68
|
-
| `ARMADA_POD_ANNOTATIONS` | no | JSON object of annotations put on every kernel pod |
|
|
69
|
-
| `ARMADA_QUEUE_BY_USER` | no | JSON object, marimohub user id to queue |
|
|
70
|
-
| `ARMADA_QUEUE_BY_PROJECT` | no | JSON object, marimohub project id to queue |
|
|
71
|
-
| `ARMADA_GPU_NODE_SELECTORS` | no | JSON object, GPU type to node selector; enables GPUs |
|
|
72
|
-
| `MARIMOHUB_COMPUTE_SANDBOX_HOSTNAME` | no | Public kernel hostname |
|
|
73
|
-
| `ARMADA_AUTH_USERNAME` | no | Basic auth, set with the password |
|
|
74
|
-
| `ARMADA_AUTH_PASSWORD` | no | Basic auth, set with the username |
|
|
75
|
-
| `ARMADA_AUTH_TOKEN` | no | Bearer token, for example from OIDC |
|
|
76
|
-
| `ARMADA_AUTH_TOKEN_FILE` | no | Bearer token file, re-read on every request |
|
|
77
|
-
|
|
78
|
-
Configuration is validated at startup, so a missing variable stops marimohub from
|
|
79
|
-
booting rather than failing at the first session.
|
|
80
|
-
|
|
81
|
-
`MARIMOHUB_COMPUTE_IMAGE` defaults to `ghcr.io/marimo-team/marimo-sandbox:latest`, marimo's
|
|
82
|
-
own kernel image, as marimohub's kubernetes adapter defaults its own. It is public and amd64.
|
|
83
|
-
`ARMADA_AGENT_IMAGE` has no default because the image is not published: build it from the
|
|
84
|
-
npm package's `dist/agent` or from `agent/`, and push it where the worker nodes pull from
|
|
85
|
-
(see Deployment). The agent port is exposed the same way as the kernel port, so whatever
|
|
86
|
-
reaches one reaches the other.
|
|
87
|
-
|
|
88
|
-
`ARMADA_AGENT_TOKEN_SECRET` is the key each sandbox's agent token is derived from, with
|
|
89
|
-
the sandbox id. Generate it once (`openssl rand -hex 32`) and give every marimohub process
|
|
90
|
-
running the adapter the same value: marimohub stops and snapshots a session through
|
|
91
|
-
whichever process gets there, and a process with a different secret is refused by the
|
|
92
|
-
pod. Changing it cuts every running session off from its agent, so their edits can no
|
|
93
|
-
longer be saved; rotate it when no sessions are running. The same holds once for the
|
|
94
|
-
upgrade that introduced it: pods started by an earlier version carry a random token no
|
|
95
|
-
process can derive, so upgrade with no sessions running, or expect those sessions' last
|
|
96
|
-
edits to be lost when they end.
|
|
97
|
-
|
|
98
|
-
Both images are pulled by the worker cluster, never by marimohub, so a private registry
|
|
99
|
-
needs a credential the cluster holds: `ARMADA_IMAGE_PULL_SECRETS` names one or more
|
|
100
|
-
secrets in `ARMADA_NAMESPACE`, and every pod lists them as `imagePullSecrets`. A secret's
|
|
101
|
-
registry host must match the image reference's host exactly (`ghcr.io` is not
|
|
102
|
-
`https://ghcr.io/v2/`); a mismatch does not fail at startup, it surfaces later as
|
|
103
|
-
`ImagePullBackOff` on the pod.
|
|
104
|
-
|
|
105
|
-
A cluster may run an admission policy that rejects a pod which does not say who it runs
|
|
106
|
-
as (the failure is literally `runAsUser not specified`). `ARMADA_RUN_AS_USER`,
|
|
107
|
-
`ARMADA_RUN_AS_GROUP` and `ARMADA_FS_GROUP` fill the pod-level `securityContext`, so the
|
|
108
|
-
init container that copies the agent runs with the same ids as the kernel. None has a
|
|
109
|
-
default: a guessed uid is wrong on every cluster that does not need one, and which uid a
|
|
110
|
-
kernel image tolerates is a property of that image. `ARMADA_FS_GROUP` matters as much as
|
|
111
|
-
`ARMADA_RUN_AS_USER`: the agent's volume is an `emptyDir`, mounted root-owned, so a
|
|
112
|
-
non-root user cannot have the agent written into it unless the volume is group-owned by
|
|
113
|
-
a group the pod runs with. Without `fsGroup`, the init container's `agent install` fails
|
|
114
|
-
with a permission error before the kernel ever starts.
|
|
115
|
-
|
|
116
|
-
`ARMADA_EXPOSE` decides how those two ports are reached. `nodeport` asks Armada for a
|
|
117
|
-
NodePort service: plaintext HTTP on the cluster's own network, which is what a local
|
|
118
|
-
cluster offers with nothing installed and is enough when marimohub runs beside it in
|
|
119
|
-
`proxy` exposure. `ingress` asks for an Ingress instead: one hostname per port, named by
|
|
120
|
-
the executor's `podDefaults.ingress.hostnameSuffix`, served over HTTPS by the cluster's
|
|
121
|
-
ingress controller. Armada's Ingress names no class, so the cluster needs a default
|
|
122
|
-
IngressClass or an annotation naming one; the executor's suffix must be a wildcard DNS
|
|
123
|
-
record for the controller; and the TLS secret, `<namespace>-` (or
|
|
124
|
-
`ARMADA_INGRESS_CERT_NAME`) plus the executor's `certNameSuffix`, must hold a wildcard
|
|
125
|
-
certificate for `*.<namespace>.<suffix>` that marimohub trusts (`NODE_EXTRA_CA_CERTS` for
|
|
126
|
-
a private CA). `ARMADA_INGRESS_ANNOTATIONS` lands on every job's Ingress: a source
|
|
127
|
-
allowlist for the agent's hostname, or a longer websocket read timeout, go there. It is
|
|
128
|
-
part of the submission, so everyone with Lookout access reads it (see
|
|
129
|
-
[What Armada shows everyone](#what-armada-shows-everyone)).
|
|
130
|
-
|
|
131
|
-
`ARMADA_POD_LABELS` and `ARMADA_POD_ANNOTATIONS` tag every kernel pod with fixed values,
|
|
132
|
-
for cost allocation, admission policies or `kubectl -l`. Armada copies them from the job
|
|
133
|
-
onto the pod, and Lookout shows the annotations. Armada does not check them at submit, so
|
|
134
|
-
the adapter applies Kubernetes' rules at startup: a key or a label value the cluster would
|
|
135
|
-
refuse stops marimohub rather than failing every session. Keys starting with `armada_` or
|
|
136
|
-
`armadaproject.io/`, and `marimohub/sandbox`, are reserved. The pod's Service and Ingress
|
|
137
|
-
do not get these labels. Both are public to everyone with Lookout access, so neither may
|
|
138
|
-
hold a credential (see [What Armada shows everyone](#what-armada-shows-everyone)).
|
|
45
|
+
The adapter is configured through environment variables, all of them checked when
|
|
46
|
+
marimohub starts. **[docs/CONFIGURATION.md](docs/CONFIGURATION.md)** is the reference:
|
|
47
|
+
every variable, its default and its checks, setups to start from, and what Armada shows
|
|
48
|
+
everyone with Lookout access. It ships in the npm package, at
|
|
49
|
+
`node_modules/@gresearch/marimohub-compute-armada/docs/CONFIGURATION.md`, with an example
|
|
50
|
+
pod template in `examples/`.
|
|
139
51
|
|
|
140
|
-
|
|
141
|
-
ARMADA_POD_LABELS='{"team": "quant", "example.com/cost-center": "cc-1234"}'
|
|
142
|
-
ARMADA_POD_ANNOTATIONS='{"example.com/contact": "quant@example.com"}'
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
`ARMADA_QUEUE` takes every sandbox unless its owner maps elsewhere. Armada computes fair
|
|
146
|
-
share and priority per queue, so a queue per team or per user is how tenants are told
|
|
147
|
-
apart. `ARMADA_QUEUE_BY_USER` and `ARMADA_QUEUE_BY_PROJECT` map marimohub ids to queue
|
|
148
|
-
names, the user's entry winning; every queue named must already exist, with permissions
|
|
149
|
-
for the configured credential. marimohub names the owner on the calls where it holds a
|
|
150
|
-
session record (marimohub#301, released in 0.4.0), and the owner places a sandbox that does
|
|
151
|
-
not exist yet. For one that does, the queue it is in is the answer whatever the map says
|
|
152
|
-
today: the adapter remembers it, takes it from Lookout during `listActive`, and asks
|
|
153
|
-
Lookout by job set for a sandbox it has never seen, since marimohub addresses sandboxes by
|
|
154
|
-
id alone on several paths. A queue map therefore requires `ARMADA_LOOKOUT_URL`, and a
|
|
155
|
-
call Lookout cannot answer fails rather than guesses; marimohub retries it.
|
|
156
|
-
|
|
157
|
-
Two clocks bound a session start. `ARMADA_START_TIMEOUT_SECONDS` (default 300) is the
|
|
158
|
-
adapter's: how long it waits for the job to start running, which covers the time in the
|
|
159
|
-
Armada queue, scheduling, the image pull and the agent's init container. marimohub's
|
|
160
|
-
`MARIMOHUB_SANDBOX_STARTUP_TIMEOUT_SECONDS` (default 120) starts only once the pod
|
|
161
|
-
answers, and covers installing the notebook's dependencies and starting marimo. On a busy
|
|
162
|
-
cluster, raise `ARMADA_START_TIMEOUT_SECONDS` to allow more time for server-side placement.
|
|
163
|
-
A start that runs out of it fails with the last event the job reported, which tells a job
|
|
164
|
-
still in its queue from one whose pod will not start.
|
|
165
|
-
|
|
166
|
-
marimohub adds three limits of its own. The browser tab that initiated the start can still
|
|
167
|
-
time out after 150 seconds while the server continues waiting: marimohub 0.7.1 fixes that
|
|
168
|
-
limit in the browser, it covers marimohub's own startup as well as the queue wait, and no
|
|
169
|
-
setting changes it. A browser tab that picks
|
|
170
|
-
up a session that is already starting (a reload, a second tab) gives up after
|
|
171
|
-
`MARIMOHUB_SANDBOX_STARTUP_TIMEOUT_SECONDS` plus 30 seconds from when it began watching,
|
|
172
|
-
so keep that at least as long as a typical queue wait. And marimohub marks a session that
|
|
173
|
-
is still starting after 15 minutes as failed, so keep `ARMADA_START_TIMEOUT_SECONDS` plus
|
|
174
|
-
`MARIMOHUB_SANDBOX_STARTUP_TIMEOUT_SECONDS` and about 90 seconds of adapter waits (the
|
|
175
|
-
ingress address and the agent's first answer) below that.
|
|
176
|
-
|
|
177
|
-
Compute profiles (`MARIMOHUB_COMPUTE_PROFILES`) let editors
|
|
178
|
-
pick hardware per notebook: when creating it, later through "Change compute profile", or
|
|
179
|
-
for one edit session. The adapter tells marimohub it applies them, and a profile's CPU
|
|
180
|
-
and memory become the kernel container's requests and limits, which Armada requires to
|
|
181
|
-
be equal. So a kernel that outgrows its profile's memory is OOM-killed, and every session
|
|
182
|
-
is charged its full profile against the queue's fair share, idle or not. Offer a short
|
|
183
|
-
list of sizes rather than one large default. Users can only pick when
|
|
184
|
-
`MARIMOHUB_COMPUTE_PROFILE_OVERRIDE=editors`.
|
|
185
|
-
`MARIMOHUB_COMPUTE_APP_PROFILES` gives apps their own list, in the same syntax; without
|
|
186
|
-
it, apps use the editing list.
|
|
52
|
+
Four variables are required:
|
|
187
53
|
|
|
188
54
|
```bash
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
55
|
+
ARMADA_URL=https://armada.example.com
|
|
56
|
+
ARMADA_QUEUE=marimohub
|
|
57
|
+
ARMADA_AGENT_IMAGE=registry.example.com/marimohub-kernel-agent:<version>
|
|
58
|
+
ARMADA_AGENT_TOKEN_SECRET=<output of openssl rand -hex 32, the same for every hub process>
|
|
192
59
|
```
|
|
193
60
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
the cluster's (`kubectl get nodes -L nvidia.com/gpu.product`), and every label used must
|
|
199
|
-
be in each executor's `kubernetes.trackedNodeLabels`: the scheduler only sees tracked
|
|
200
|
-
labels, so a selector on any other stays queued for good.
|
|
201
|
-
|
|
202
|
-
Session surfaces (VS Code or OpenCode inside the sandbox, `MARIMOHUB_SURFACES`) need a
|
|
203
|
-
port each next to the kernel's. The adapter reads marimohub's own `MARIMOHUB_SURFACES`
|
|
204
|
-
and `MARIMOHUB_SURFACE_<ID>_PORT` settings, declares those ports on every pod so Armada
|
|
205
|
-
exposes them like the kernel's, and advertises `multiPort` exactly then. A surface port
|
|
206
|
-
may not be the agent's. The kernel image must ship the surface's binary.
|
|
207
|
-
|
|
208
|
-
`ARMADA_LOOKOUT_URL` gates a capability: set it and the adapter advertises
|
|
209
|
-
`listActive`, which marimohub's reconciler uses to enumerate live sandboxes after a
|
|
210
|
-
restart. Leave it unset and reconciliation is a clean no-op.
|
|
211
|
-
|
|
212
|
-
Configure at most one auth mechanism. With none, no `Authorization` header is sent,
|
|
213
|
-
which is what a server running `anonymousAuth: true` expects. Prefer
|
|
214
|
-
`ARMADA_AUTH_TOKEN_FILE` for anything that rotates: it is read per request.
|
|
215
|
-
|
|
216
|
-
## What Armada shows everyone
|
|
217
|
-
|
|
218
|
-
Armada keeps every job submission and serves it back whole: its API returns the pod spec,
|
|
219
|
-
and Lookout shows the submission to everyone who can open the job. Once submitted, nothing
|
|
220
|
-
takes it back. Treat every value below as readable by everyone with Lookout access, for
|
|
221
|
-
good, and never put a credential in one. The two tables are the whole submission
|
|
222
|
-
(`src/armada.ts` builds it, `src/podspec.ts` the pod spec in it).
|
|
223
|
-
|
|
224
|
-
What configuration decides:
|
|
225
|
-
|
|
226
|
-
| In the submission | Comes from |
|
|
227
|
-
| ----------------------- | -------------------------------------------------------------------------------- |
|
|
228
|
-
| Queue and namespace | `ARMADA_QUEUE` (or the owner's entry in `ARMADA_QUEUE_BY_*`), `ARMADA_NAMESPACE` |
|
|
229
|
-
| Kernel and agent images | `MARIMOHUB_COMPUTE_IMAGE` (the one marimohub asks for), `ARMADA_AGENT_IMAGE` |
|
|
230
|
-
| Pod labels | `ARMADA_POD_LABELS` |
|
|
231
|
-
| Pod annotations | `ARMADA_POD_ANNOTATIONS` |
|
|
232
|
-
| Exposure | `ARMADA_EXPOSE`: a NodePort service or an Ingress |
|
|
233
|
-
| Ingress settings | `ARMADA_INGRESS_TLS`, `ARMADA_INGRESS_CERT_NAME`, `ARMADA_INGRESS_ANNOTATIONS` |
|
|
234
|
-
| Ports | `ARMADA_KERNEL_PORT`, `ARMADA_AGENT_PORT`, `MARIMOHUB_SURFACE_<ID>_PORT` |
|
|
235
|
-
| Surfaces | `MARIMOHUB_SURFACES`, which picks the surfaces whose ports are declared |
|
|
236
|
-
| Resources | The compute profile's CPU, memory and GPU count, else 1 CPU and `2Gi` |
|
|
237
|
-
| Node selector | `ARMADA_GPU_NODE_SELECTORS`, the entry for the profile's GPU type |
|
|
238
|
-
| Priority class | `ARMADA_PRIORITY_CLASS` |
|
|
239
|
-
| Pull secrets | `ARMADA_IMAGE_PULL_SECRETS`, the secret names only |
|
|
240
|
-
| Pod security context | `ARMADA_RUN_AS_USER`, `ARMADA_RUN_AS_GROUP`, `ARMADA_FS_GROUP` |
|
|
241
|
-
| Deadline | marimohub's session lifetime, else `ARMADA_KERNEL_MAX_LIFETIME_SECONDS` |
|
|
242
|
-
|
|
243
|
-
What the adapter fixes:
|
|
244
|
-
|
|
245
|
-
| In the submission | Value |
|
|
246
|
-
| --------------------------------------- | ------------------------------------------------------------------------- |
|
|
247
|
-
| Job set id, client id, external job URI | The sandbox id |
|
|
248
|
-
| Annotations | `armadaproject.io/failFast: "true"`, `marimohub/sandbox` set to the queue |
|
|
249
|
-
| One pod environment variable | `MH_AGENT_TOKEN_SHA256`, the SHA-256 of the agent token, never the token |
|
|
250
|
-
| Pod lifecycle | Restart policy `Never`, a 30s grace period |
|
|
251
|
-
| Agent install | The `mh-agent` volume and the init container that copies the agent in |
|
|
252
|
-
| Init container resources | `100m` CPU and `64Mi` memory |
|
|
253
|
-
| Container commands | `/agent install …` and `/mh-agent/agent --port <ARMADA_AGENT_PORT>` |
|
|
254
|
-
| Ingress service | `useClusterIP: true` |
|
|
255
|
-
|
|
256
|
-
Every configured value is copied in as written. The adapter checks each one's shape,
|
|
257
|
-
such as a valid label key or a nonblank name, and nothing more: it cannot tell a
|
|
258
|
-
credential from any other string. The free-form maps are where one is most likely to be
|
|
259
|
-
pasted: `ARMADA_POD_ANNOTATIONS`, `ARMADA_INGRESS_ANNOTATIONS`, and `ARMADA_POD_LABELS`
|
|
260
|
-
within the label character set. Some ingress annotations invite a credential: an
|
|
261
|
-
ingress-nginx `configuration-snippet` that sets an `Authorization` header, or an `auth-url`
|
|
262
|
-
with a key in its query string. Name a Kubernetes Secret instead
|
|
263
|
-
(`nginx.ingress.kubernetes.io/auth-secret`), the way `ARMADA_IMAGE_PULL_SECRETS` does for
|
|
264
|
-
registries.
|
|
265
|
-
|
|
266
|
-
No variable sets an environment variable on the pod, by design: a value set that way is
|
|
267
|
-
in the spec. `ARMADA_AGENT_TOKEN_SECRET`, the agent tokens and the `ARMADA_AUTH_*`
|
|
268
|
-
credentials never enter a submission; the auth credentials only ever travel as an
|
|
269
|
-
`Authorization` header to Armada and Lookout.
|
|
270
|
-
|
|
271
|
-
Notebook users cannot put anything in a submission: they pick a compute profile and an
|
|
272
|
-
image from lists the operator wrote. The credentials they give marimohub for an
|
|
273
|
-
integration, such as a database password or a cloud key, become the session's environment,
|
|
274
|
-
which the adapter hands to the pod through the agent, as `export` statements in front of
|
|
275
|
-
each command. So those credentials:
|
|
276
|
-
|
|
277
|
-
- stay out of the submission and out of Lookout;
|
|
278
|
-
- cross the cluster network as plain HTTP, readable by anyone who can watch it. The agent
|
|
279
|
-
speaks only HTTP, so under `ARMADA_EXPOSE=nodeport` the whole way is plaintext, and
|
|
280
|
-
under `ingress` with TLS only the hop from marimohub to the ingress controller is
|
|
281
|
-
encrypted: the controller forwards to the pod in plaintext;
|
|
282
|
-
- are visible to every process in the kernel container, as on any marimohub backend;
|
|
283
|
-
- never appear in the adapter's own error messages. Those name the command marimohub
|
|
284
|
-
asked for at most, never the `export` statements put in front of it, so a credential
|
|
285
|
-
written into the command itself would still show.
|
|
286
|
-
|
|
287
|
-
What a notebook prints stays out of Lookout as well. The kernel's output goes to a log file
|
|
288
|
-
inside the pod and command output goes back over the agent, so the container log, which is
|
|
289
|
-
what Lookout's log view shows, holds only the agent's own lines.
|
|
290
|
-
|
|
291
|
-
Before a deployment goes live, walk whoever sets these variables through this section. The
|
|
292
|
-
adapter keeps the credentials it handles out of the submission; it cannot stop a person
|
|
293
|
-
typing one into a variable that is public by design.
|
|
61
|
+
Everything in a job submission, the pod spec included, is readable by everyone with
|
|
62
|
+
Lookout access, for good. No setting may hold a credential: name a Kubernetes Secret
|
|
63
|
+
instead. See
|
|
64
|
+
[What Armada shows everyone](docs/CONFIGURATION.md#what-armada-shows-everyone).
|
|
294
65
|
|
|
295
66
|
## Deployment
|
|
296
67
|
|
|
@@ -322,7 +93,7 @@ The kernel port is not guarded by the agent token. marimo checks a token of its
|
|
|
322
93
|
which marimohub mints per session, and only when `MARIMOHUB_SANDBOX_AUTH=on`. Its default
|
|
323
94
|
is `off`, which starts marimo with `--no-token`: anyone who can reach a kernel's address
|
|
324
95
|
then has a live editor in that pod. Set `MARIMOHUB_SANDBOX_AUTH=on`, as both scripts in
|
|
325
|
-
`dev/` do. [ARCHITECTURE.md](docs/ARCHITECTURE.md#two-tokens) explains which code sends and
|
|
96
|
+
`dev/` do. [ARCHITECTURE.md](https://github.com/G-Research/marimohub-compute-armada/blob/main/docs/ARCHITECTURE.md#two-tokens) explains which code sends and
|
|
326
97
|
checks each token.
|
|
327
98
|
|
|
328
99
|
The surface ports (`MARIMOHUB_SURFACES`) have no token under either setting: marimohub starts
|
|
@@ -417,7 +188,7 @@ export ARMADA_AGENT_IMAGE=marimohub-kernel-agent:local
|
|
|
417
188
|
```
|
|
418
189
|
|
|
419
190
|
`dev/run-native.sh` scripts the local arrangement end to end, including the load; see
|
|
420
|
-
[docs/CONTRIBUTING.md](docs/CONTRIBUTING.md), which also covers the case where
|
|
191
|
+
[docs/CONTRIBUTING.md](https://github.com/G-Research/marimohub-compute-armada/blob/main/docs/CONTRIBUTING.md), which also covers the case where
|
|
421
192
|
`kind load` trips over a multi-platform image.
|
|
422
193
|
|
|
423
194
|
Needs marimohub 0.7.1 or later, and is built and tested against the release in the
|
|
@@ -426,11 +197,13 @@ adapter reports a lost pod with, so the adapter refuses to load there.
|
|
|
426
197
|
|
|
427
198
|
## Documentation
|
|
428
199
|
|
|
429
|
-
- [docs/
|
|
200
|
+
- [docs/CONFIGURATION.md](docs/CONFIGURATION.md): every setting, with examples, and what a
|
|
201
|
+
job submission shows everyone.
|
|
202
|
+
- [docs/ARCHITECTURE.md](https://github.com/G-Research/marimohub-compute-armada/blob/main/docs/ARCHITECTURE.md): the three systems, the agent, and
|
|
430
203
|
how one session flows through them.
|
|
431
|
-
- [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md): toolchain, checks, running the whole
|
|
204
|
+
- [docs/CONTRIBUTING.md](https://github.com/G-Research/marimohub-compute-armada/blob/main/docs/CONTRIBUTING.md): toolchain, checks, running the whole
|
|
432
205
|
thing locally, and what to update when you change something.
|
|
433
|
-
- [docs/DECISIONS.md](docs/DECISIONS.md): why the adapter is shaped the way it is, with
|
|
206
|
+
- [docs/DECISIONS.md](https://github.com/G-Research/marimohub-compute-armada/blob/main/docs/DECISIONS.md): why the adapter is shaped the way it is, with
|
|
434
207
|
the evidence cited against the pinned Armada release, and what is left to a deployment.
|
|
435
208
|
|
|
436
209
|
## License
|
package/dist/agent/SHA256SUMS
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
42b9248eca206bffcb240ad05136fdc88ebdd2a4217957ec0dad7531bb3fe602 linux-amd64/agent
|
|
2
|
+
28b053523537e524390af27d0a232dee2702d03f94926bfec99ded44eff03c81 linux-arm64/agent
|
|
Binary file
|
|
Binary file
|