Skip to content

v0.1.0-rc.1

Pre-release
Pre-release

Choose a tag to compare

@juhovainio juhovainio released this 08 Jul 15:23
50b5e6d
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>