@atolis-hq/wake 0.3.93 → 0.3.94
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.
|
@@ -366,7 +366,13 @@ ENV WAKE_MAIN_JS=/app/dist/src/main.js
|
|
|
366
366
|
# for \`docker exec\` (i.e. \`wake sandbox setup\`/\`wake sandbox exec\`) even
|
|
367
367
|
# when WAKE_START_ENABLED's supervised \`wake start\` child keeps crashing —
|
|
368
368
|
# e.g. on first boot, before sandbox auth has been configured.
|
|
369
|
-
|
|
369
|
+
#
|
|
370
|
+
# /wake/.wake is bind-mounted from the host and self-update actively creates
|
|
371
|
+
# and deletes its own lock files there while this container is starting, so
|
|
372
|
+
# a recursive chown can race a file disappearing mid-walk. That single ENOENT
|
|
373
|
+
# must not be fatal under set -eu — it would otherwise crash the container
|
|
374
|
+
# before wake start ever runs.
|
|
375
|
+
ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake; chown -R wake:wake /wake/.wake || true; if [ -n \\"$WAKE_HOME_INIT_DIRS\\" ]; then printf '%s\\n' \\"$WAKE_HOME_INIT_DIRS\\" | while IFS= read -r directory; do case \\"$directory\\" in \\"$WAKE_HOME_INIT_ROOT\\"/*) mkdir -p \\"$directory\\"; chown wake:wake \\"$directory\\" ;; *) exit 1 ;; esac; done; fi; exec su wake -s /bin/sh -c 'HOME=/home/wake exec node \\"$WAKE_MAIN_JS\\" sandbox-entrypoint --wake-root /wake'"]
|
|
370
376
|
`;
|
|
371
377
|
const packagedDockerfile = `# syntax=docker/dockerfile:1
|
|
372
378
|
FROM node:24-bookworm-slim
|
|
@@ -418,7 +424,13 @@ EXPOSE 4317
|
|
|
418
424
|
# sandbox-entrypoint-command.ts) that the CLI should be invoked via the bare
|
|
419
425
|
# \`wake\` binary that \`npm install -g\` puts on PATH, rather than a hardcoded
|
|
420
426
|
# npm global lib path that varies by npm/OS setup.
|
|
421
|
-
|
|
427
|
+
#
|
|
428
|
+
# /wake/.wake is bind-mounted from the host and self-update actively creates
|
|
429
|
+
# and deletes its own lock files there while this container is starting, so
|
|
430
|
+
# a recursive chown can race a file disappearing mid-walk. That single ENOENT
|
|
431
|
+
# must not be fatal under set -eu — it would otherwise crash the container
|
|
432
|
+
# before wake start ever runs.
|
|
433
|
+
ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake; chown -R wake:wake /wake/.wake || true; if [ -n \\"$WAKE_HOME_INIT_DIRS\\" ]; then printf '%s\\n' \\"$WAKE_HOME_INIT_DIRS\\" | while IFS= read -r directory; do case \\"$directory\\" in \\"$WAKE_HOME_INIT_ROOT\\"/*) mkdir -p \\"$directory\\"; chown wake:wake \\"$directory\\" ;; *) exit 1 ;; esac; done; fi; exec su wake -s /bin/sh -c 'HOME=/home/wake exec wake sandbox-entrypoint'"]
|
|
422
434
|
`;
|
|
423
435
|
/** Creates an immediately-valid, human-readable target Wake root. */
|
|
424
436
|
export async function initialiseWakeRoot(wakeRoot) {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { DockerProcessError, } from './docker-invocation.js';
|
|
2
2
|
/** Verifies the replacement sandbox has started its resident Wake process. */
|
|
3
3
|
export async function verifyResidentStart(docker, containerName, expectedCmdlineFragment, options) {
|
|
4
|
-
|
|
4
|
+
// A mature Wake home's bind-mounted .wake can hold weeks of accumulated
|
|
5
|
+
// event, projection, and transcript files; the entrypoint's recursive
|
|
6
|
+
// chown over all of it — especially through Docker Desktop's virtualized
|
|
7
|
+
// filesystem on Windows — can alone take longer than a short, test-sized
|
|
8
|
+
// budget before the resident process ever gets to write its PID file.
|
|
9
|
+
const attempts = options?.attempts ?? 90;
|
|
5
10
|
const intervalMs = options?.intervalMs ?? 1000;
|
|
6
11
|
const check = [
|
|
7
12
|
'pid="$(cat /wake/.wake/logs/start.pid)"',
|
package/docker/Dockerfile
CHANGED
|
@@ -64,4 +64,9 @@ EXPOSE 4317
|
|
|
64
64
|
# that's fine since it's the very first thing that runs.
|
|
65
65
|
ENV WAKE_MAIN_JS=/app/dist/src/main.js
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
# /wake/.wake is bind-mounted from the host and self-update actively creates
|
|
68
|
+
# and deletes its own lock files there while this container is starting, so
|
|
69
|
+
# a recursive chown can race a file disappearing mid-walk. That single ENOENT
|
|
70
|
+
# must not be fatal under set -eu — it would otherwise crash the container
|
|
71
|
+
# before wake start ever runs.
|
|
72
|
+
ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake; chown -R wake:wake /wake/.wake || true; exec su wake -s /bin/sh -c 'if [ \"$WAKE_START_ENABLED\" = \"true\" ]; then exec node /app/dist/src/main.js start --wake-root /wake --no-sandbox; else exec sleep infinity; fi'"]
|
|
@@ -50,4 +50,10 @@ EXPOSE 4317
|
|
|
50
50
|
# sandbox-entrypoint-command.ts) that the CLI should be invoked via the bare
|
|
51
51
|
# `wake` binary that `npm install -g` puts on PATH, rather than a hardcoded
|
|
52
52
|
# npm global lib path that varies by npm/OS setup.
|
|
53
|
-
|
|
53
|
+
#
|
|
54
|
+
# /wake/.wake is bind-mounted from the host and self-update actively creates
|
|
55
|
+
# and deletes its own lock files there while this container is starting, so
|
|
56
|
+
# a recursive chown can race a file disappearing mid-walk. That single ENOENT
|
|
57
|
+
# must not be fatal under set -eu — it would otherwise crash the container
|
|
58
|
+
# before wake start ever runs.
|
|
59
|
+
ENTRYPOINT ["sh", "-c", "set -eu; mkdir -p /wake/.wake; chown -R wake:wake /wake/.wake || true; exec su wake -s /bin/sh -c 'exec wake sandbox-entrypoint'"]
|