@namzu/sandbox 13.0.0 → 15.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/CHANGELOG.md +1147 -0
- package/README.md +447 -0
- package/dist/backends/aci-standby-pool/index.d.ts.map +1 -1
- package/dist/backends/aci-standby-pool/index.js +13 -1
- package/dist/backends/aci-standby-pool/index.js.map +1 -1
- package/dist/backends/docker/index.d.ts.map +1 -1
- package/dist/backends/docker/index.js +19 -1
- package/dist/backends/docker/index.js.map +1 -1
- package/dist/backends/firecracker/index.d.ts.map +1 -1
- package/dist/backends/firecracker/index.js +12 -2
- package/dist/backends/firecracker/index.js.map +1 -1
- package/dist/backends/firecracker/protocol.d.ts +481 -8
- package/dist/backends/firecracker/protocol.d.ts.map +1 -1
- package/dist/backends/firecracker/protocol.js +136 -0
- package/dist/backends/firecracker/protocol.js.map +1 -1
- package/dist/backends/firecracker/transport.d.ts +642 -14
- package/dist/backends/firecracker/transport.d.ts.map +1 -1
- package/dist/backends/firecracker/transport.js +1307 -34
- package/dist/backends/firecracker/transport.js.map +1 -1
- package/dist/backends/kubernetes/egress-policy.d.ts +1296 -0
- package/dist/backends/kubernetes/egress-policy.d.ts.map +1 -0
- package/dist/backends/kubernetes/egress-policy.js +2458 -0
- package/dist/backends/kubernetes/egress-policy.js.map +1 -0
- package/dist/backends/kubernetes/identity.d.ts +193 -0
- package/dist/backends/kubernetes/identity.d.ts.map +1 -0
- package/dist/backends/kubernetes/identity.js +147 -0
- package/dist/backends/kubernetes/identity.js.map +1 -0
- package/dist/backends/kubernetes/index.d.ts +1019 -0
- package/dist/backends/kubernetes/index.d.ts.map +1 -0
- package/dist/backends/kubernetes/index.js +1756 -0
- package/dist/backends/kubernetes/index.js.map +1 -0
- package/dist/backends/kubernetes/ingress-policy.d.ts +375 -0
- package/dist/backends/kubernetes/ingress-policy.d.ts.map +1 -0
- package/dist/backends/kubernetes/ingress-policy.js +1050 -0
- package/dist/backends/kubernetes/ingress-policy.js.map +1 -0
- package/dist/backends/kubernetes/k8s-client.d.ts +334 -0
- package/dist/backends/kubernetes/k8s-client.d.ts.map +1 -0
- package/dist/backends/kubernetes/k8s-client.js +553 -0
- package/dist/backends/kubernetes/k8s-client.js.map +1 -0
- package/dist/backends/kubernetes/lease.d.ts +145 -0
- package/dist/backends/kubernetes/lease.d.ts.map +1 -0
- package/dist/backends/kubernetes/lease.js +201 -0
- package/dist/backends/kubernetes/lease.js.map +1 -0
- package/dist/backends/kubernetes/objects.d.ts +702 -0
- package/dist/backends/kubernetes/objects.d.ts.map +1 -0
- package/dist/backends/kubernetes/objects.js +518 -0
- package/dist/backends/kubernetes/objects.js.map +1 -0
- package/dist/backends/kubernetes/per-sandbox-policy.d.ts +219 -0
- package/dist/backends/kubernetes/per-sandbox-policy.d.ts.map +1 -0
- package/dist/backends/kubernetes/per-sandbox-policy.js +407 -0
- package/dist/backends/kubernetes/per-sandbox-policy.js.map +1 -0
- package/dist/backends/kubernetes/privilege-probe.d.ts +136 -0
- package/dist/backends/kubernetes/privilege-probe.d.ts.map +1 -0
- package/dist/backends/kubernetes/privilege-probe.js +185 -0
- package/dist/backends/kubernetes/privilege-probe.js.map +1 -0
- package/dist/backends/kubernetes/rbac.d.ts +153 -0
- package/dist/backends/kubernetes/rbac.d.ts.map +1 -0
- package/dist/backends/kubernetes/rbac.js +177 -0
- package/dist/backends/kubernetes/rbac.js.map +1 -0
- package/dist/backends/kubernetes/sandbox.d.ts +190 -0
- package/dist/backends/kubernetes/sandbox.d.ts.map +1 -0
- package/dist/backends/kubernetes/sandbox.js +433 -0
- package/dist/backends/kubernetes/sandbox.js.map +1 -0
- package/dist/backends/kubernetes/transport.d.ts +1048 -0
- package/dist/backends/kubernetes/transport.d.ts.map +1 -0
- package/dist/backends/kubernetes/transport.js +2093 -0
- package/dist/backends/kubernetes/transport.js.map +1 -0
- package/dist/backends/kubernetes/workspace.d.ts +1512 -0
- package/dist/backends/kubernetes/workspace.d.ts.map +1 -0
- package/dist/backends/kubernetes/workspace.js +3703 -0
- package/dist/backends/kubernetes/workspace.js.map +1 -0
- package/dist/backends/remote-execution-controller.d.ts +14 -0
- package/dist/backends/remote-execution-controller.d.ts.map +1 -1
- package/dist/backends/remote-execution-controller.js.map +1 -1
- package/dist/index.d.ts +350 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +344 -34
- package/dist/index.js.map +1 -1
- package/dist/testing/sandbox-conformance.d.ts +227 -0
- package/dist/testing/sandbox-conformance.d.ts.map +1 -0
- package/dist/testing/sandbox-conformance.js +896 -0
- package/dist/testing/sandbox-conformance.js.map +1 -0
- package/package.json +5 -4
- package/src/backends/aci-standby-pool/index.ts +16 -1
- package/src/backends/docker/index.ts +22 -1
- package/src/backends/firecracker/index.ts +14 -2
- package/src/backends/firecracker/protocol.ts +541 -6
- package/src/backends/firecracker/transport.ts +1687 -64
- package/src/backends/kubernetes/egress-policy.ts +3448 -0
- package/src/backends/kubernetes/identity.ts +261 -0
- package/src/backends/kubernetes/index.ts +2670 -0
- package/src/backends/kubernetes/ingress-policy.ts +1344 -0
- package/src/backends/kubernetes/k8s-client.ts +742 -0
- package/src/backends/kubernetes/lease.ts +254 -0
- package/src/backends/kubernetes/objects.ts +983 -0
- package/src/backends/kubernetes/per-sandbox-policy.ts +542 -0
- package/src/backends/kubernetes/privilege-probe.ts +261 -0
- package/src/backends/kubernetes/rbac.ts +192 -0
- package/src/backends/kubernetes/sandbox.ts +593 -0
- package/src/backends/kubernetes/transport.ts +2895 -0
- package/src/backends/kubernetes/workspace.ts +5640 -0
- package/src/backends/remote-execution-controller.ts +14 -0
- package/src/index.ts +838 -35
- package/src/testing/sandbox-conformance.ts +1202 -0
package/README.md
CHANGED
|
@@ -76,6 +76,22 @@ microVM; a confirmed stop with an incomplete terminal stream is reported
|
|
|
76
76
|
separately so callers do not mistake partial output for an unknown process
|
|
77
77
|
outcome.
|
|
78
78
|
|
|
79
|
+
**One exception, and it is the only object here that is not disposable.** A
|
|
80
|
+
persistent Kubernetes workspace is not retired on an unconfirmed stop: the
|
|
81
|
+
retirement there is the `operatingMode: Suspended` patch, which makes the
|
|
82
|
+
controller delete the pod, and a workspace is held by more than one process by
|
|
83
|
+
design. Nothing is written, the handle goes on serving, the rejection carries
|
|
84
|
+
`retirement: { accepted: false, reason: 'workspace-kept' }`, and a bounded
|
|
85
|
+
health probe reports through `onCancellationUnconfirmed` whether the guest
|
|
86
|
+
agent is serving, has fenced itself, or could not be reached — so the host
|
|
87
|
+
decides when the live sessions in that pod go down. Because such a workspace
|
|
88
|
+
is held by more than one process, the writes that DO still go to it — suspend,
|
|
89
|
+
resume, adopt, delete — take an optional monotonic holder epoch, stored on the
|
|
90
|
+
object and tested in the same request that writes, so a superseded process's
|
|
91
|
+
late suspend or late delete is refused by the cluster rather than applied.
|
|
92
|
+
A call that passes no epoch sends exactly the requests it always sent. See
|
|
93
|
+
`docs/sdk/kubernetes-sandbox.md`.
|
|
94
|
+
|
|
79
95
|
Remote peers retain terminal ids briefly for idempotent cancellation, but evict
|
|
80
96
|
the oldest terminal history before refusing new work. If a command leader exits
|
|
81
97
|
while descendants remain, the peer fences itself and retires the whole sandbox
|
|
@@ -84,6 +100,132 @@ Concurrent destroy and automatic-retirement calls share one checked teardown;
|
|
|
84
100
|
Docker removal is never reported as accepted after a non-zero or aborted
|
|
85
101
|
`docker rm -f`.
|
|
86
102
|
|
|
103
|
+
**The SIGTERM → SIGKILL grace window.** Both peers implement the same
|
|
104
|
+
mechanism, deliberately kept textually parallel so a future reader sees they
|
|
105
|
+
are one design, not two: `SIGTERM` the owned process group, wait for it to go
|
|
106
|
+
quiet, and escalate to `SIGKILL` only if it is still alive at the end of a
|
|
107
|
+
grace window — with nothing checking that a quiet group went quiet BECAUSE of
|
|
108
|
+
the signal rather than by finishing on its own. A command that ignores
|
|
109
|
+
`SIGTERM` but happens to complete within the window therefore runs to
|
|
110
|
+
completion untouched and reports back as a clean, unaborted-looking success.
|
|
111
|
+
The container worker's `NAMZU_SANDBOX_CANCEL_GRACE_MS` and the Firecracker/
|
|
112
|
+
kubernetes guest agent's `NAMZU_AGENT_CANCEL_GRACE_MS` both default to `250`
|
|
113
|
+
(previously `2000` on both — issue #469's kind conformance run caught this on
|
|
114
|
+
the agent transport first; the identical worker-side race was fixed in the
|
|
115
|
+
same change once found). 250ms is comfortably under the shared conformance
|
|
116
|
+
suite's adversarial fixture (a command that finishes on its own in ~400ms)
|
|
117
|
+
while still enough for a fast, well-behaved `SIGTERM` handler's own cleanup;
|
|
118
|
+
a deployment that genuinely needs a longer cooperative-shutdown window sets
|
|
119
|
+
either variable explicitly.
|
|
120
|
+
|
|
121
|
+
**Retained output, and a command that outlives its connection.** On the
|
|
122
|
+
kubernetes workspace tier a command can be started with a caller-chosen
|
|
123
|
+
`executionId` and `retainOutput`, and then followed — or picked up by a
|
|
124
|
+
different host process — through the additive `attach-execution` op. There is
|
|
125
|
+
ONE retained-output primitive in the guest and every consumer reads it: an
|
|
126
|
+
ordered, size-bounded log of stdout and stderr in a single monotonically
|
|
127
|
+
increasing byte-offset space, so a reader resumes with one number and sees the
|
|
128
|
+
interleaving the command produced. Its bound is bytes, not chunks — a chunk
|
|
129
|
+
larger than the whole budget has its head sliced off rather than being kept
|
|
130
|
+
whole — and eviction advances the log's start offset, so a read from before it
|
|
131
|
+
is answered with a `droppedBytes` count. A gap is reported; output is never
|
|
132
|
+
silently skipped, and offsets are absolute so a stale cursor is always
|
|
133
|
+
answerable. Every delta frame of a retained command carries the byte range it
|
|
134
|
+
occupies — on the `execute` stream as well as on an attach — because a host
|
|
135
|
+
must never derive an offset from what it received: output crosses the wire as
|
|
136
|
+
decoded text, and a chunk that ends inside a multi-byte character does not
|
|
137
|
+
decode to its own byte length. `attach-execution` replays from the requested
|
|
138
|
+
offset, follows the live command, and ends with one terminal frame; it never
|
|
139
|
+
signals the process, and closing an attach connection is a no-op. Ending a
|
|
140
|
+
command stays `cancel-execution`'s job alone. Reserving an id the guest still
|
|
141
|
+
holds reports what it holds rather than minting a second reservation, so a
|
|
142
|
+
retried start runs the command once — a guarantee that ends where the record
|
|
143
|
+
does, at the retention window (`NAMZU_AGENT_EXECUTION_RETAINED_TTL_MS`,
|
|
144
|
+
10 min) and at pod replacement. The cost is bounded twice over, per execution
|
|
145
|
+
(`NAMZU_AGENT_EXECUTION_LOG_BYTES`, 1 MiB) and by how many executions may
|
|
146
|
+
retain at once (`NAMZU_AGENT_MAX_RETAINED_OUTPUT_LOGS`, 32), and only a
|
|
147
|
+
command that asked for retention is kept at all. The guest advertises
|
|
148
|
+
`execution-attach` in `healthz` and a host that asks for a detachable command
|
|
149
|
+
against an image without it is refused before the command is admitted.
|
|
150
|
+
|
|
151
|
+
**Sessions: a terminal or a program that outlives the host process.** On the
|
|
152
|
+
kubernetes workspace tier a terminal can be opened with a caller-chosen
|
|
153
|
+
`sessionId` and `persistent: true`, and a program can be started with no
|
|
154
|
+
terminal at all through the additive `start-detached` op. Both then belong to
|
|
155
|
+
the guest's session registry rather than to the connection that started them:
|
|
156
|
+
closing the connection DETACHES and sends no signal, `attach-session` replays
|
|
157
|
+
from a byte offset and then follows live, `list-sessions` names what is
|
|
158
|
+
running, and `kill-session` ends one. The registry holds the SAME retained-output
|
|
159
|
+
primitive described above — one ring per session, one monotonic offset space,
|
|
160
|
+
eviction reported as `droppedBytes` — rather than a second one, and output is
|
|
161
|
+
read into it whether or not anybody is attached, so a program with no reader
|
|
162
|
+
never blocks on a full PTY. At most one attachment exists per session: a second
|
|
163
|
+
attach ends the first with a named `detached` frame, so two host processes
|
|
164
|
+
cannot interleave keystrokes into one shell. The registry is in memory only,
|
|
165
|
+
so a replaced pod comes back with none. **A teardown now reaches the whole
|
|
166
|
+
session.** The agent's own comment claimed a process-group kill reached "the
|
|
167
|
+
shell and every descendant"; it did not, because util-linux `script` starts the
|
|
168
|
+
shell in a new session, so a job backgrounded with `&` survived every terminal
|
|
169
|
+
teardown and ran until the pod stopped. Both `kill-session` and a
|
|
170
|
+
non-persistent terminal's teardown now signal every process still in that
|
|
171
|
+
kernel session, found through `/proc`. The cost is bounded per session
|
|
172
|
+
(`NAMZU_AGENT_SESSION_LOG_BYTES`, 1 MiB) and by how many may exist
|
|
173
|
+
(`NAMZU_AGENT_MAX_SESSIONS`, 16), with an exited session's record kept for
|
|
174
|
+
`NAMZU_AGENT_SESSION_TERMINAL_TTL_MS` (10 min). The guest advertises `sessions`
|
|
175
|
+
in `healthz` and a host asking for any of it against an image without the
|
|
176
|
+
string is refused rather than served a connection-bound terminal.
|
|
177
|
+
|
|
178
|
+
**Quiesce: stop everything the guest is running, and keep serving.** A
|
|
179
|
+
workspace host that takes a final capture of the disk could not make it exact.
|
|
180
|
+
`suspend()` reaches the terminals THAT handle returned and an execution
|
|
181
|
+
somebody cancelled by id; a terminal another host process opened, a command
|
|
182
|
+
already in flight, and above all a program that moved into a session of its own
|
|
183
|
+
with `setsid` and was then reparented away from the agent all kept running, and
|
|
184
|
+
kept writing, until the pod stopped — and once the pod has stopped there is no
|
|
185
|
+
agent left to read the disk through. The additive `quiesce` op is where a host
|
|
186
|
+
stands instead: it marks every running execution BEFORE it signals anything
|
|
187
|
+
(without that mark, a group leader dying before the rest of its group makes an
|
|
188
|
+
execution's close handler fence the agent, and a fenced agent refuses the
|
|
189
|
+
capture the quiesce was performed for), scans `/proc` rather than its own
|
|
190
|
+
children, skips PID 1, itself and its own kernel session, then signals in
|
|
191
|
+
rounds — `SIGTERM`, `graceMs`, `SIGKILL` on what is left — until a pass finds
|
|
192
|
+
nothing. A process still present after `SIGKILL` FAILS the call and names its
|
|
193
|
+
pid; it never resolves optimistically. Afterwards `execute`, `read-file` and
|
|
194
|
+
`write-file` all still work, which is the whole point. While it runs, every op
|
|
195
|
+
that would start a process answers `quiesce_in_progress`; the reads do not. The
|
|
196
|
+
general scan covers the guest's PID namespace, which in a pod is the container
|
|
197
|
+
and nothing else, and the agent performs it only when it is the init of that
|
|
198
|
+
namespace or was started by it (`k8s/entrypoint.sh` makes `tini` PID 1 and the
|
|
199
|
+
agent its child); anywhere else it narrows itself to the kernel sessions its own
|
|
200
|
+
registries own and reports `scope: "owned-sessions"` rather than being silently
|
|
201
|
+
weaker. The guest advertises `quiesce` in `healthz` and a host asking an image
|
|
202
|
+
without it is refused by name.
|
|
203
|
+
|
|
204
|
+
**A workspace's writes reach its disk on purpose.** Nothing in the agent ever
|
|
205
|
+
called `sync`, `syncfs` or `fsync`: a `write-file` answered `ok` as soon as the
|
|
206
|
+
bytes were in the page cache, and a `suspend()` took the pod away as soon as it
|
|
207
|
+
had stopped — which says nothing is writing any more, not that what was written
|
|
208
|
+
arrived. Both halves are closed. A `write-file` now goes through a temp
|
|
209
|
+
sibling, an `fsync`, a rename and a directory `fsync` before it answers, so the
|
|
210
|
+
reply means the bytes are on the device and a write that fails leaves the
|
|
211
|
+
previous contents rather than a truncated file; one `fsync` per part sequence,
|
|
212
|
+
on the last part, covers the whole file. And the additive `flush` op runs
|
|
213
|
+
`syncfs(2)` over the workspace mount, which is the only thing that can reach
|
|
214
|
+
what a COMMAND wrote — the Kubernetes backend sends it and waits for the reply
|
|
215
|
+
before it patches a workspace to `Suspended`, and the agent runs it itself on
|
|
216
|
+
`SIGTERM`, after stopping every process it owns through the same routine
|
|
217
|
+
`quiesce` uses and before exiting 0. The guest advertises `flush` in `healthz`
|
|
218
|
+
**only if it can run one** — the flush runs `sync -f`, and an image that
|
|
219
|
+
strips coreutils has this code and no `sync` — so a host that does not see the
|
|
220
|
+
string is told the image cannot flush rather than being left to read an
|
|
221
|
+
`unknown_op`, or a refusal it can never get past, as a flush that happened.
|
|
222
|
+
|
|
223
|
+
**The command timeout ceiling is configurable.** The guest agent reads its
|
|
224
|
+
maximum `timeoutMs` from `NAMZU_SANDBOX_MAX_TIMEOUT_MS` — the same variable
|
|
225
|
+
the container worker has always read for the same limit — defaulting to the
|
|
226
|
+
unchanged 30 minutes, and names the variable when it refuses. A request above
|
|
227
|
+
the ceiling is refused, not silently shortened.
|
|
228
|
+
|
|
87
229
|
Every worker and microVM guest publishes its wire-protocol version in the
|
|
88
230
|
readiness response. The host admits only the exact version implemented by its
|
|
89
231
|
release; missing, older, and newer versions fail before a sandbox handle or
|
|
@@ -101,6 +243,285 @@ previous host and golden-image pair available together for rollback. Rolling
|
|
|
101
243
|
back only one side is intentionally rejected at readiness, so a mismatched
|
|
102
244
|
guest never accepts work under an unverified wire contract.
|
|
103
245
|
|
|
246
|
+
## Guest agent transports and the per-instance token
|
|
247
|
+
|
|
248
|
+
The microVM guest agent picks its listen socket from the environment, in a
|
|
249
|
+
fixed order: `NAMZU_AGENT_UNIX_PATH` for a unix-domain socket, then an
|
|
250
|
+
inherited descriptor for the vsock bridge named by `NAMZU_AGENT_VSOCK_PORT`,
|
|
251
|
+
then `NAMZU_AGENT_TCP_PORT` for a TCP listener on `0.0.0.0`. The third mode is
|
|
252
|
+
for a deployment that reaches the guest over a routed network — one sandbox per
|
|
253
|
+
pod on a container orchestrator — instead of over a host-local socket. Framing,
|
|
254
|
+
ops, execution leases, terminals, loopback TCP and file IO are identical on all
|
|
255
|
+
three; only the listen address differs. A guest whose environment configures
|
|
256
|
+
none of them still refuses to start, naming all three. `NAMZU_AGENT_TCP_PORT=0`
|
|
257
|
+
binds an ephemeral port, which is what the suites use; a deployment names a
|
|
258
|
+
fixed port, because nothing in front of the guest can be configured to reach a
|
|
259
|
+
port that is only chosen at startup.
|
|
260
|
+
|
|
261
|
+
A routed listener is reachable by whatever the network admits, so that
|
|
262
|
+
deployment also gives the agent a per-instance credential. With
|
|
263
|
+
`NAMZU_AGENT_BIND_TOKEN` set, every op except `healthz` must present exactly
|
|
264
|
+
that token in its request envelope, from the first frame of the connection; a
|
|
265
|
+
missing, empty or different token is answered `unauthorized` and the connection
|
|
266
|
+
is closed before any handler runs. The token is compared in constant time
|
|
267
|
+
against a fixed-width digest, so neither its value nor its length is learnable
|
|
268
|
+
by probing. `NAMZU_AGENT_REQUIRE_TOKEN` is the fallback for a deployment that
|
|
269
|
+
cannot inject a token: the agent binds to the first token it is shown and
|
|
270
|
+
refuses every other one for the life of the process. With neither variable set
|
|
271
|
+
the agent authenticates nothing, which is what the host-local vsock and unix
|
|
272
|
+
transports have always done and what they keep doing. `healthz` never requires
|
|
273
|
+
a token and never echoes one, so readiness probing needs no secret and leaks
|
|
274
|
+
nothing beyond liveness and the protocol version.
|
|
275
|
+
|
|
276
|
+
The TCP mode fails closed. `NAMZU_AGENT_TCP_PORT` set with neither
|
|
277
|
+
`NAMZU_AGENT_BIND_TOKEN` nor `NAMZU_AGENT_REQUIRE_TOKEN` is refused at startup,
|
|
278
|
+
naming both, rather than binding an unauthenticated listener on `0.0.0.0`; the
|
|
279
|
+
unix and inherited-descriptor modes keep requiring no token, because their
|
|
280
|
+
control channel is host↔guest only. `NAMZU_AGENT_BIND_TOKEN` set to the empty
|
|
281
|
+
string is refused at startup in **every** mode: that is the shape a
|
|
282
|
+
downward-API injection takes when it resolved to nothing, and honouring it
|
|
283
|
+
would open precisely the hole the variable was set to close.
|
|
284
|
+
|
|
285
|
+
Neither the framed wire nor its version changes when the agent grows a
|
|
286
|
+
capability. `healthz` carries a `features` list instead, and a host uses an op
|
|
287
|
+
or a field only when it sees the string there: `write-file-parts` for a body
|
|
288
|
+
written to a temporary sibling in parts and finished with an atomic rename,
|
|
289
|
+
`flush` for the `syncfs` over the workspace mount, `stream-heartbeat` for the
|
|
290
|
+
per-stream liveness frame, and `guest-boot-id` for the agent process's own
|
|
291
|
+
identity.
|
|
292
|
+
|
|
293
|
+
`guest-boot-id` is a field rather than an op. The agent mints one opaque id at
|
|
294
|
+
startup and stamps it on every reply a caller has already authenticated —
|
|
295
|
+
`reserve-execution`, `cancel-execution` including its `unknown_execution`
|
|
296
|
+
refusal, `read-file`, `write-file`, and the `ready` frame that opens a terminal,
|
|
297
|
+
a session attachment or a `tcp-connect` stream. `healthz`, which is
|
|
298
|
+
unauthenticated, carries only the feature string and no id. It exists because a
|
|
299
|
+
per-instance token cannot answer "is this the same agent": on a container
|
|
300
|
+
orchestrator the token is the pod's uid, and a container restarted in place
|
|
301
|
+
keeps its pod — so the token still works, every call still succeeds, and every
|
|
302
|
+
process the caller started is gone with nothing on the wire saying so. An agent
|
|
303
|
+
that predates the field sends none and a host must read that as "this guest
|
|
304
|
+
cannot tell me", never as a change. A heartbeat is negotiated
|
|
305
|
+
per stream and in both directions — the `terminal` or `tcp-connect` open body
|
|
306
|
+
carries the interval, the agent echoes the interval it will use in its `ready`
|
|
307
|
+
event and only then starts sending, and the host only starts once that echo
|
|
308
|
+
arrived. An agent that predates the field ignores it and echoes nothing, so its
|
|
309
|
+
host behaves exactly as it did; a host that predates it never asks, so it is
|
|
310
|
+
never sent a frame type it would treat as a protocol error. Once negotiated,
|
|
311
|
+
three consecutive intervals with nothing at all arriving end the stream on both
|
|
312
|
+
sides — the same cleanup a closed socket already runs. Both sides count bytes
|
|
313
|
+
rather than whole frames, so a large frame still on its way is proof of life
|
|
314
|
+
like any other; silence while a side has paused reading for backpressure does
|
|
315
|
+
not count; and the echoed interval is honoured only between 100 ms and four
|
|
316
|
+
times what was asked, since each side does its own watchdog arithmetic with
|
|
317
|
+
a number the other sent.
|
|
318
|
+
|
|
319
|
+
Because the credential rides inside the request envelope, the gate cannot run
|
|
320
|
+
until a whole frame has been parsed — so what an unauthenticated peer may spend
|
|
321
|
+
in that window is bounded rather than trusted, and in the token modes only:
|
|
322
|
+
|
|
323
|
+
| Variable | Default | What it bounds |
|
|
324
|
+
|---|---|---|
|
|
325
|
+
| `NAMZU_AGENT_MAX_FRAME_BYTES` | 256 MiB | The largest length any frame header may announce, on every listen mode. The 8-hex prefix otherwise permits 4 GiB, which the reader used to honour. Sized for the largest frame the host legitimately writes: a `write-file` carries the whole base64 body in one envelope when it fits. |
|
|
326
|
+
| `NAMZU_AGENT_MAX_PREAUTH_FRAME_BYTES` | 8 MiB | The same ceiling for a connection that has not yet presented the token, clamped to the one above. Token modes only. It is the ceiling on one `write-file` FRAME on a token path, no longer on a file — see below. |
|
|
327
|
+
| `NAMZU_AGENT_MAX_PREAUTH_CONNECTIONS` | 64 | How many connections may be unauthenticated at once. Token modes only. Every bound above is per connection, so without this one they could be paid again on the next connection. A full pool evicts its **oldest** unauthenticated member and serves the arrival — see below for why that direction. |
|
|
328
|
+
| `NAMZU_AGENT_MAX_PREAUTH_BUFFER_BYTES` | 32 MiB | What all unauthenticated connections may buffer **between them**, never less than one pre-auth frame. Token modes only. The count above bounds sockets; this bounds the heap behind them, and the heap is what runs out first. |
|
|
329
|
+
| `NAMZU_AGENT_PREAUTH_IDLE_TIMEOUT_MS` | 10000 | How long a connection may stay unauthenticated while **quiet**. Every byte received resets it, so it retires the connection that says nothing, not the one that says too little. Token modes only, cleared the moment a connection authenticates. |
|
|
330
|
+
| `NAMZU_AGENT_PREAUTH_DEADLINE_MS` | 10000 | How long a connection may stay unauthenticated **at all**, measured from accept and reset by nothing. Token modes only, cleared the moment a connection authenticates, so no long-lived terminal, `tcp-connect` or streaming `execute` is ever measured against it. |
|
|
331
|
+
| `NAMZU_AGENT_REFUSAL_FLUSH_GRACE_MS` | 1000 | How long a refusal frame may take to reach the wire before the socket is destroyed anyway. Every listen mode. A backstop against a peer that has stopped reading, not a budget anything normally spends. |
|
|
332
|
+
|
|
333
|
+
The `quiesce` op has four bounds and one scope of its own, on every listen mode:
|
|
334
|
+
|
|
335
|
+
| Variable | Default | What it bounds |
|
|
336
|
+
|---|---|---|
|
|
337
|
+
| `NAMZU_AGENT_QUIESCE_GRACE_MS` | 1000 | How long one round waits after `SIGTERM` before escalating to `SIGKILL`. Clamped below `NAMZU_AGENT_CANCEL_CONFIRM_TIMEOUT_MS`, and a caller-supplied `graceMs` at or above that bound is refused: a marked execution's close handler stops waiting there, so a later escalation would fence the agent mid-quiesce. Not the pod's `terminationGracePeriodSeconds`. |
|
|
338
|
+
| `NAMZU_AGENT_QUIESCE_DEADLINE_MS` | 20000 | The whole op, across every round. Kept well under the host transport's 60s read-idle timeout, because nothing is written on the wire while a quiesce runs — so raise it only up to that timeout (itself configurable on the host), never past it: beyond it the host tears down a quiesce that is working and cannot learn that it did. |
|
|
339
|
+
| `NAMZU_AGENT_QUIESCE_MAX_ROUNDS` | 8 | Scan-and-signal passes before the call reports failure. Rounds exist because a process can be forked while a pass is in flight; a workload forking faster than it can be killed is a failure to report, not a loop to run out the deadline. |
|
|
340
|
+
| `NAMZU_AGENT_QUIESCE_SETTLE_MS` | 1000 | How long the op waits, after everything is gone, for a killed child's `close` event to move its session to `exited` and settle its execution. Bookkeeping only — the processes are already gone, so running out of it does not fail the call. |
|
|
341
|
+
| `NAMZU_AGENT_QUIESCE_SCOPE` | derived | `owned-sessions` narrows the scan to the kernel sessions the agent's own registries own. The only accepted value: the general PID-namespace scan is derived from whether this agent is the init of its own PID namespace or was started by it, and there is deliberately no way to force it on. |
|
|
342
|
+
|
|
343
|
+
Termination and the flush have two more, on every listen mode:
|
|
344
|
+
|
|
345
|
+
| Variable | Default | What it bounds |
|
|
346
|
+
|---|---|---|
|
|
347
|
+
| `NAMZU_AGENT_FLUSH_TIMEOUT_MS` | 10000 | One `sync -f` over the workspace mount, whether a host asked for it or the `SIGTERM` handler is running it. Reported unconfirmed rather than abandoned quietly when it expires, because a caller that asked for a flush is usually about to take the pod away. |
|
|
348
|
+
| `NAMZU_AGENT_SHUTDOWN_DEADLINE_MS` | 15000 | The WHOLE `SIGTERM` handler: stop accepting connections, stop every process the guest is running, flush, exit. The agent exits when it expires whatever is still in flight — a process in uninterruptible IO outlives a `SIGKILL` and a `syncfs` takes as long as the device takes, and a handler with no bound would hold the pod open until the kubelet's own `SIGKILL`. Keep it well below the pod's `terminationGracePeriodSeconds`. It is the only bound: a repeat `SIGTERM` is logged and ignored, because in a stopping pod the second one is the kubelet's own (sent as soon as the `preStop` hook returns) rather than anybody asking for a shorter wait. The hook's wait is derived from this number so it outlives it. |
|
|
349
|
+
|
|
350
|
+
So the most an unauthenticated peer can make the agent hold is
|
|
351
|
+
`NAMZU_AGENT_MAX_PREAUTH_BUFFER_BYTES`, spread over at most
|
|
352
|
+
`NAMZU_AGENT_MAX_PREAUTH_CONNECTIONS` sockets, and both are tunable against the
|
|
353
|
+
pod's memory limit. Resident memory settles somewhat above that while the
|
|
354
|
+
allocator catches up; what it does not do is keep climbing. Note what a shared
|
|
355
|
+
budget means when it is exhausted: the connection refused is whichever one asks
|
|
356
|
+
next, which may be a legitimate caller rather than the peer holding the budget.
|
|
357
|
+
That is the trade a global bound makes — a refused request is recoverable, an
|
|
358
|
+
exhausted pod is not.
|
|
359
|
+
|
|
360
|
+
A header above either ceiling is answered `frame_too_large`, naming the
|
|
361
|
+
announced length, the limit, and the variable that governs it, because a caller
|
|
362
|
+
told only a number cannot tell which of the two ceilings it hit. A fourth bound
|
|
363
|
+
needs no variable: a frame header is exactly nine bytes, eight hex digits and a
|
|
364
|
+
newline, so a peer streaming bytes that contain no newline at all is refused on
|
|
365
|
+
the ninth of them rather than buffered against a newline that is never coming.
|
|
366
|
+
A refused connection — for any of these, or for `unauthorized` — is
|
|
367
|
+
**destroyed**, not `end()`ed: ending a socket closes only its writable half, so
|
|
368
|
+
a refused peer used to be able to keep streaming into the agent's frame buffer
|
|
369
|
+
for as long as it liked.
|
|
370
|
+
|
|
371
|
+
Two of those bounds exist because the others do not answer a slow loris, and in
|
|
372
|
+
one earlier shape made each other worse. An idle timeout is reset by every
|
|
373
|
+
byte, so a peer that trickles one byte every few seconds stays unauthenticated
|
|
374
|
+
for as long as it cares to; `NAMZU_AGENT_PREAUTH_DEADLINE_MS` is what bounds
|
|
375
|
+
it, because it runs from accept and nothing resets it. And a full pool that
|
|
376
|
+
refused the **newest** connection handed exactly those peers the power to
|
|
377
|
+
decide who else got served: enough of them locked out every later caller,
|
|
378
|
+
including the credential-exempt `healthz` probe that a readiness check cannot
|
|
379
|
+
do without. So a full pool evicts its oldest unauthenticated member instead,
|
|
380
|
+
answers it `too_many_unauthenticated_connections`, and serves the arrival — the
|
|
381
|
+
oldest unauthenticated connection being, by construction, the one that has had
|
|
382
|
+
the longest to present a token and has not.
|
|
383
|
+
|
|
384
|
+
What none of this does is stop a peer that can reach the port from causing
|
|
385
|
+
churn. It can still open connections, hold slots until the deadline, and make
|
|
386
|
+
the agent evict and re-accept; what it cannot do is hold a slot indefinitely or
|
|
387
|
+
starve a probe. That residual is deliberate, and it is the division of labour
|
|
388
|
+
this design rests on: the NetworkPolicy ingress rule in front of the agent port
|
|
389
|
+
is the boundary that decides who may reach it at all, and the token and these
|
|
390
|
+
bounds are defence in depth behind it, for a peer already inside that rule.
|
|
391
|
+
|
|
392
|
+
One consequence used to be worth naming as a limit, because it is the price of
|
|
393
|
+
putting the credential in the envelope rather than in a handshake: a
|
|
394
|
+
`write-file` body travels in the same first frame as the token, so in a token
|
|
395
|
+
mode the pre-auth cap bounds that body — about 6 MiB of file content at the
|
|
396
|
+
default, since the body travels base64-encoded. It is still the bound on one
|
|
397
|
+
frame. It is no longer the bound on a **file**.
|
|
398
|
+
|
|
399
|
+
`write-file` takes an optional `part` object, and a body too large for one
|
|
400
|
+
frame arrives as a sequence of them:
|
|
401
|
+
|
|
402
|
+
```jsonc
|
|
403
|
+
// Every part is an ordinary write-file. `path` names a TEMPORARY sibling of
|
|
404
|
+
// the target for the whole sequence, never the target itself.
|
|
405
|
+
{ "op": "write-file", "token": "…", "body": {
|
|
406
|
+
"path": "seed/.namzu-write-<uuid>-repo.tar.part",
|
|
407
|
+
"content": "<base64 of this slice>", "encoding": "base64",
|
|
408
|
+
"part": { "offset": 0, "final": false } } }
|
|
409
|
+
|
|
410
|
+
// …and the last one renames onto the target.
|
|
411
|
+
{ "op": "write-file", "token": "…", "body": {
|
|
412
|
+
"path": "seed/.namzu-write-<uuid>-repo.tar.part",
|
|
413
|
+
"content": "<base64 of the tail>", "encoding": "base64",
|
|
414
|
+
"part": { "offset": 12582912, "final": true, "renameTo": "seed/repo.tar" } } }
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
`offset` must equal the temp file's CURRENT size (`0` creates or truncates
|
|
418
|
+
it), so a part that went missing, arrived twice or arrived out of order is
|
|
419
|
+
refused — `write_part_offset_mismatch` — rather than written in the wrong
|
|
420
|
+
place; a per-temp-path lock refuses an overlapping writer outright
|
|
421
|
+
(`write_part_in_flight`). A part whose bytes did not all reach the disk is
|
|
422
|
+
refused too (`write_part_short_write`): one `pwrite` answers a write that
|
|
423
|
+
crosses the volume's free space or an `RLIMIT_FSIZE` with a short count and
|
|
424
|
+
no error, so the agent checks the count it got and the temp file's size
|
|
425
|
+
against what the part claimed before it renames anything. The temp path and
|
|
426
|
+
`renameTo` go through the same workspace jail every other write does, and the
|
|
427
|
+
target changes exactly once, in the final `rename`: a reader never sees a
|
|
428
|
+
half-written file, and a sequence that dies partway leaves the target exactly
|
|
429
|
+
as it was. A host that abandons a sequence removes what it left behind with
|
|
430
|
+
`part: { "discard": true }`, which is idempotent — a path that is not there,
|
|
431
|
+
in a directory that was never created, answers `discarded` and creates
|
|
432
|
+
nothing on the way — and refuses (`write_part_not_a_temp_file`) any path
|
|
433
|
+
whose name, or whose RESOLVED name, is not one of these part files:
|
|
434
|
+
`write-file` removes an abandoned part, never an arbitrary file. A `part`
|
|
435
|
+
that is present but is not an object is refused outright
|
|
436
|
+
(`write_part_invalid_shape`) rather than served as the plain whole-file write
|
|
437
|
+
it resembles.
|
|
438
|
+
|
|
439
|
+
The guest opts in. `healthz` answers with `features` alongside `ok` and
|
|
440
|
+
`protocolVersion` — `write-file-parts` among them — and a host sends a part
|
|
441
|
+
only to a guest that advertised it: an agent that predates the field would
|
|
442
|
+
ignore `part` and write that slice as a whole file. A deployment that would
|
|
443
|
+
rather send one big frame than several small ones can still raise
|
|
444
|
+
`NAMZU_AGENT_MAX_PREAUTH_FRAME_BYTES`, trading pre-auth buffer budget for
|
|
445
|
+
frame size. Nothing on the Firecracker path is affected either way: no token
|
|
446
|
+
mode is active there, so no pre-auth cap applies and a `write-file` frame of
|
|
447
|
+
any size up to `NAMZU_AGENT_MAX_FRAME_BYTES` is accepted exactly as before.
|
|
448
|
+
|
|
449
|
+
`read-file` has the mirror-image arrangement, for a problem that was never a
|
|
450
|
+
refusal — it just cost more the bigger the file got, until it stopped working.
|
|
451
|
+
The whole-file reply held the file buffer, its base64 string, the JSON string
|
|
452
|
+
and two frame buffers at once, about 7.7x the file: measured against this
|
|
453
|
+
agent over loopback TCP, a 64 MiB read grew it by 405 MiB, and a file of about
|
|
454
|
+
384 MiB or more could not be answered at all because its base64 string is
|
|
455
|
+
longer than V8 permits a string to be. So `read-file` now takes optional
|
|
456
|
+
`offset` and `length` and `pread`s one bounded slice, answering with the WHOLE
|
|
457
|
+
file's `sizeBytes` beside it and with the bytes that exist when the range runs
|
|
458
|
+
past the end; and a new `read-file-stream` op opens the fd once and sends
|
|
459
|
+
`meta`, then base64 `data` frames, then `end`, then the zero-length
|
|
460
|
+
terminator, reusing one read buffer and waiting for the socket to drain
|
|
461
|
+
between chunks. A 1 GiB read grows the agent by about 12 MiB on the same
|
|
462
|
+
measurement.
|
|
463
|
+
|
|
464
|
+
```jsonc
|
|
465
|
+
// One slice, one reply frame. Capped by NAMZU_AGENT_READ_FILE_RANGE_BYTES
|
|
466
|
+
// (1 MiB): a larger range is REFUSED, not shortened.
|
|
467
|
+
{ "op": "read-file", "token": "…", "body": {
|
|
468
|
+
"path": "out/report.bin", "encoding": "base64",
|
|
469
|
+
"offset": 1048576, "length": 262144 } }
|
|
470
|
+
|
|
471
|
+
// The whole file, as an ordered multi-frame reply.
|
|
472
|
+
{ "op": "read-file-stream", "token": "…", "body": { "path": "out/report.bin" } }
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
The guest opts into both together: `healthz`'s `features` list carries both
|
|
476
|
+
strings, `write-file-parts` and `read-file-stream` — one entry for the two
|
|
477
|
+
read shapes, because they ship in the same file and no guest can have one
|
|
478
|
+
without the other. A host that does not see it keeps to the single whole-file
|
|
479
|
+
reply and sends neither — an agent that predates them would ignore
|
|
480
|
+
`offset`/`length` and answer with the whole file, which the caller would read
|
|
481
|
+
as its slice, so the
|
|
482
|
+
host throws `AgentReadFileStreamUnsupportedError` instead. Both new shapes go
|
|
483
|
+
through the same workspace jail the old op used.
|
|
484
|
+
|
|
485
|
+
Two rules a host writing to this wire has to know. A range must ask for
|
|
486
|
+
`base64`: a `utf8` slice taken at an arbitrary offset can begin or end inside
|
|
487
|
+
a multi-byte character, so the guest refuses one with
|
|
488
|
+
`read_file_range_requires_base64`, while a whole-file read still serves `utf8`
|
|
489
|
+
because its boundaries are the file's own. And `read-file-stream` serves
|
|
490
|
+
regular files only, refusing a directory, a fifo or a device node with
|
|
491
|
+
`read_file_stream_not_a_regular_file` — a regular file that `stat` reports as
|
|
492
|
+
zero bytes and that still has content, the procfs shape, is read to EOF by
|
|
493
|
+
both new shapes rather than answered as empty.
|
|
494
|
+
|
|
495
|
+
None of this is a wire change. `token`, `part`, `offset` and `length` are
|
|
496
|
+
optional envelope and body fields, `read-file-stream` is a new op nobody is
|
|
497
|
+
obliged to call, and `features` is an additive `healthz` field, so the guest
|
|
498
|
+
protocol version is deliberately unchanged and no host and no golden image
|
|
499
|
+
has to roll together with this release.
|
|
500
|
+
|
|
501
|
+
What the token is not: a boundary against the sandbox's own workload. Once the
|
|
502
|
+
image entrypoint deprivileges, the agent and the workload share a uid, so a
|
|
503
|
+
workload process can read the agent's own `/proc/<pid>/environ`. It is
|
|
504
|
+
per-instance for exactly that reason — a workload that steals its own
|
|
505
|
+
instance's token gains nothing it does not already have inside that instance,
|
|
506
|
+
and there is no shared pool secret whose theft would reach the other instances.
|
|
507
|
+
The boundary that keeps other tenants out is the network rule in front of the
|
|
508
|
+
agent port; the token is defence in depth behind it. What the guest does
|
|
509
|
+
guarantee is narrower and exact: every process it starts to serve a request —
|
|
510
|
+
an `execute` command, a `terminal` shell, the resize helper behind that
|
|
511
|
+
terminal — is handed an environment stripped of every `NAMZU_AGENT_*` and
|
|
512
|
+
`NAMZU_SANDBOX_*` variable, so the token and the agent's own configuration
|
|
513
|
+
never enter the workload's environment through the environment it is given.
|
|
514
|
+
Reading them out of `/proc` is the exposure above, and it is why the token is
|
|
515
|
+
per-instance.
|
|
516
|
+
|
|
517
|
+
That scrub is a **behaviour change** for the `terminal` op, not only a new
|
|
518
|
+
guarantee. A terminal shell used to be handed the agent's whole `process.env`;
|
|
519
|
+
it now gets the scrubbed environment an `execute` child has always had, and so
|
|
520
|
+
does the `stty` resize helper behind it. A terminal session therefore no longer
|
|
521
|
+
sees the agent's own settings — `NAMZU_SANDBOX_WORKSPACE` among them. A
|
|
522
|
+
workload that needs a value in its terminal passes it in `env` on the
|
|
523
|
+
`openTerminal` call, which still wins over everything else, `TERM` included.
|
|
524
|
+
|
|
104
525
|
## Firecracker workspace channels
|
|
105
526
|
|
|
106
527
|
The Firecracker backend exposes two optional same-sandbox channels. Call
|
|
@@ -131,6 +552,32 @@ that can change egress after admission. A backend must throw when it cannot
|
|
|
131
552
|
enforce a requested live policy; accepting without applying it would erase the
|
|
132
553
|
security boundary the host relied on.
|
|
133
554
|
|
|
555
|
+
## Kubernetes per-sandbox egress
|
|
556
|
+
|
|
557
|
+
The kubernetes backend serves that contract when — and only when —
|
|
558
|
+
`egress.perSandbox` is configured: the method is PRESENT on a task handle
|
|
559
|
+
then and absent otherwise, which is the same omit-rather-than-ignore rule read
|
|
560
|
+
from the other side. A `KubernetesWorkspace` handle never carries it, and
|
|
561
|
+
`createKubernetesWorkspace` refuses a config that sets the option (with
|
|
562
|
+
`KubernetesWorkspacePerSandboxEgressConfigError`, before the first request)
|
|
563
|
+
rather than omitting a method the config asked for. Configured, each
|
|
564
|
+
`setNetworkPolicy` call writes one
|
|
565
|
+
`CiliumNetworkPolicy` for that sandbox alone, named after the claim's uid,
|
|
566
|
+
selecting one per-sandbox pod label, owned by the claim so the cluster
|
|
567
|
+
collects it on `destroy()`, and resolving only once a read-back deep-equals
|
|
568
|
+
what was sent. An empty list deletes that object and leaves the configured
|
|
569
|
+
baseline in force — which is a narrowing only when that baseline denies,
|
|
570
|
+
because cluster policies union.
|
|
571
|
+
|
|
572
|
+
It has two operator prerequisites, and a host that enables the option without
|
|
573
|
+
them is refused by design rather than by accident: an applied
|
|
574
|
+
`ValidatingAdmissionPolicy` and its binding, which the backend proves before
|
|
575
|
+
its first write and which bound what the host may write, and a separate RBAC
|
|
576
|
+
file granting the policy-write verbs the default Role deliberately withholds.
|
|
577
|
+
Whether such a policy is ENFORCED is a property of the cluster's CNI and is
|
|
578
|
+
not measured anywhere in this repository. See
|
|
579
|
+
`docs/sdk/kubernetes-sandbox.md`.
|
|
580
|
+
|
|
134
581
|
## Documentation
|
|
135
582
|
|
|
136
583
|
- [Namzu docs](https://github.com/cogitave/namzu/tree/main/docs)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/backends/aci-standby-pool/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAEX,8BAA8B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/backends/aci-standby-pool/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAEX,8BAA8B,EAU9B,MAAM,YAAY,CAAA;AAGnB,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAc3E;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;AAEpD,MAAM,WAAW,mCAAmC;IACnD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB;;;;OAIG;IACH,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAA;IACtC;;;OAGG;IACH,QAAQ,CAAC,+BAA+B,EAAE,MAAM,CAAA;IAChD;;;OAGG;IACH,QAAQ,CAAC,6BAA6B,CAAC,EAAE,MAAM,CAAA;IAC/C;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,8BAA8B,CAAA;IAC/C;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAA;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IACrC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IACrC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;IAChC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;CACrC;AASD;;;;GAIG;AACH,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,mCAAmC,GACzC,cAAc,CAiBhB;AAoMD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CActE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC5B,GAAG,IAAI,CAOP"}
|
|
@@ -411,12 +411,24 @@ async function spawnAciSandbox(config, options, readiness) {
|
|
|
411
411
|
throw new Error(`write-file failed: HTTP ${res.status} ${await res.text()}`);
|
|
412
412
|
}
|
|
413
413
|
},
|
|
414
|
-
|
|
414
|
+
/**
|
|
415
|
+
* Refused rather than answered whole when a range is asked for —
|
|
416
|
+
* the worker has no range op, and {@link Sandbox.readFile} says a
|
|
417
|
+
* backend that takes `offset`/`length` and hands back everything
|
|
418
|
+
* has given a wrong answer, not a degraded one. `options.signal`
|
|
419
|
+
* is honoured — one HTTP request is the whole read, so the signal
|
|
420
|
+
* goes to `fetch`.
|
|
421
|
+
*/
|
|
422
|
+
async readFile(path, options) {
|
|
415
423
|
assertActive();
|
|
424
|
+
if (options?.offset !== undefined || options?.length !== undefined) {
|
|
425
|
+
throw new Error('readFile: the standby-pool worker serves whole files only, so offset/length cannot be honoured. Read the file whole, or use a backend that streams.');
|
|
426
|
+
}
|
|
416
427
|
const res = await fetch(`${baseUrl}/read-file`, {
|
|
417
428
|
method: 'POST',
|
|
418
429
|
headers: { 'content-type': 'application/json' },
|
|
419
430
|
body: JSON.stringify({ path, encoding: 'base64' }),
|
|
431
|
+
signal: options?.signal,
|
|
420
432
|
});
|
|
421
433
|
if (!res.ok) {
|
|
422
434
|
throw new Error(`read-file failed: HTTP ${res.status} ${await res.text()}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/backends/aci-standby-pool/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAcH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAGhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EACN,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,GACjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,8BAA8B,EAC9B,mBAAmB,GACnB,MAAM,mCAAmC,CAAA;AA+E1C,MAAM,qBAAqB,GAAG,GAAG,CAAA;AACjC,MAAM,wBAAwB,GAAG,MAAM,CAAA;AACvC,MAAM,mBAAmB,GAAG,IAAI,CAAA;AAChC,MAAM,uBAAuB,GAAG,oBAAoB,CAAA;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MAAM,EAAE,8BAA8B,GAAG,MAAM,CAUvF;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,8BAA8B,GAAG,MAAM,CAKxF"}
|
|
@@ -528,12 +528,30 @@ async function spawnDockerSandbox(config, options, readiness) {
|
|
|
528
528
|
throw new Error(`write-file failed: HTTP ${res.status} ${await res.text()}`);
|
|
529
529
|
}
|
|
530
530
|
},
|
|
531
|
-
|
|
531
|
+
/**
|
|
532
|
+
* The worker's `/read-file` has no range, so a caller asking for one
|
|
533
|
+
* is REFUSED rather than handed the whole file.
|
|
534
|
+
*
|
|
535
|
+
* {@link Sandbox.readFile} draws that line: a backend that takes
|
|
536
|
+
* `offset`/`length` and answers with everything has given a wrong
|
|
537
|
+
* answer, not a degraded one, and the caller stops looking. Declaring
|
|
538
|
+
* the one-parameter form would not close it — through the `Sandbox`
|
|
539
|
+
* type a caller can still pass options — so the refusal is explicit.
|
|
540
|
+
*
|
|
541
|
+
* `options.signal` IS honoured: the contract says it aborts the read,
|
|
542
|
+
* and one HTTP request is the whole read here, so it is handed to
|
|
543
|
+
* `fetch`.
|
|
544
|
+
*/
|
|
545
|
+
async readFile(path, options) {
|
|
532
546
|
assertActive();
|
|
547
|
+
if (options?.offset !== undefined || options?.length !== undefined) {
|
|
548
|
+
throw new Error('readFile: the docker worker serves whole files only, so offset/length cannot be honoured. Read the file whole, or use a backend that streams.');
|
|
549
|
+
}
|
|
533
550
|
const res = await fetch(`${baseUrl}/read-file`, {
|
|
534
551
|
method: 'POST',
|
|
535
552
|
headers: { 'content-type': 'application/json' },
|
|
536
553
|
body: JSON.stringify({ path, encoding: 'base64' }),
|
|
554
|
+
signal: options?.signal,
|
|
537
555
|
});
|
|
538
556
|
if (!res.ok) {
|
|
539
557
|
throw new Error(`read-file failed: HTTP ${res.status} ${await res.text()}`);
|