Commit 50b5e6d
authored
feat(serve): detach from an attached serve session with Ctrl-D (#85)
* feat(serve): detach from an attached serve session with Ctrl-D
`rocm serve --verbose`/`--foreground` ran the engine in-process, so the
only way out was Ctrl-C, which killed the model. The attached path now
spawns the same detached managed child the background path uses and tails
its log, so the server outlives the session: Ctrl-D detaches and leaves it
running (manage it later with `rocm services`), while Ctrl-C stops it.
Split the engine spawn out of start_managed_service so the attached path
streams startup logs live instead of blocking on the readiness wait.
Signed-off-by: Eugene Volen <Eugene.Volen@amd.com>
* fix(serve): supervise and harden the attached detach path
Address review on the attached serve path:
- Ensure the supervisor daemon is running after spawning the attached
child, so a Ctrl-D-detached server gets the same health-check,
auto-recovery, record reconciliation, and dashboard metrics a
background-managed server gets.
- Enter raw mode before spawning the key reader thread, closing a window
where a terminal Ctrl-C would kill the CLI with no detach/stop message.
- Discover AppPaths once and thread it into spawn_managed_engine_child
instead of rediscovering it per call.
Signed-off-by: Eugene Volen <Eugene.Volen@amd.com>
---------
Signed-off-by: Eugene Volen <Eugene.Volen@amd.com>1 parent 800785e commit 50b5e6d
3 files changed
Lines changed: 374 additions & 67 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | | - | |
196 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
197 | 200 | | |
198 | 201 | | |
199 | 202 | | |
| |||
0 commit comments