Repository navigation
Commit 8115b1d
Add template debugging tooling and surface Jupyter logs (#288)
* Add template debugging tooling and surface Jupyter logs
Send Jupyter's stdout to the systemd journal instead of /dev/null so
startup errors (e.g. failed session creation) are visible via
`journalctl -u jupyter`.
Add a `make debug-template` workflow (build_debug.py + debug_logs.py)
that builds the template via the real systemd start path with a timeout
ready-gate, then spawns a sandbox and dumps the jupyter and
code-interpreter service journals — for diagnosing a server that fails
its readiness check. make_template() gains an optional `ready` override
to support this.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Fix wait_for_timeout units in build_debug (ms, not s)
wait_for_timeout takes milliseconds (min 1000ms), so 60 collapsed to a
1s ready-gate. Use 60_000 for the intended 60s.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Harden debug_logs against command/sandbox timeouts
Address Cursor Bugbot review on PR #288:
- Bump sandbox TTL 180s -> 600s so the full diagnostic sequence (sleep +
per-command 60s budgets) can't outlive the sandbox.
- Wrap each command in try/except so one slow or failing command no
longer aborts the loop and skips the remaining journals/probes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Drop redundant sleep in debug_logs
The start command runs at build time and the resulting state is
snapshotted, so a resumed sandbox already has the services running (and
their journals populated). No need to wait after create.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Type the make_template ready parameter
Annotate `ready` as `ReadyCmd | None` (the type returned by
wait_for_url/wait_for_timeout and accepted by set_start_cmd).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Add --max-time to debug_logs health probes
A port that accepts TCP but never sends an HTTP response (the half-broken
state this tool diagnoses) would otherwise hang curl until the 60s
command timeout. --max-time 3 makes each probe fail fast.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Route Jupyter stdout to journal only in debug builds
Keep production at StandardOutput=null. make_template(debug=True) now
applies a systemd drop-in (jupyter-debug.conf) that flips Jupyter's
stdout to the journal, and build_debug.py opts in. Production template
behavior is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Drop redundant systemctl daemon-reload from template build
systemd lazily loads the freshly-copied units (and their drop-ins) on
the first `systemctl start` at end of build, so the explicit
daemon-reload was a no-op. Verified the prod build still reaches a
healthy /health gate without it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Drop changeset; debug tooling needs no template release
The published template artifact is unchanged (jupyter.service matches
main, daemon-reload removal yields an identical image, the journal
drop-in only ships in debug builds). Remaining changes are the build
script, dev-only scripts, and docs — no version bump warranted.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent cf9e095 commit 8115b1d
6 files changed
Lines changed: 116 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
116 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| |||
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
139 | | - | |
140 | | - | |
141 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
0 commit comments