Add a backend-agnostic command to restart the orchestrator #391

Open
opened 2026-07-16 22:09:04 -04:00 by didericis-claude · 0 comments
Collaborator

Problem

There's no first-class way to restart the per-host orchestrator / control plane. Today it's a manual, backend-specific dance:

  • firecracker: python3 -c "from bot_bottle.backend.firecracker import infra_vm; infra_vm.stop()" then relaunch a bottle (or supervise) to boot a fresh infra VM. Needed whenever orchestrator-side code changes, since the VM loads its control-plane code at boot and won't reload.
  • docker: the orchestrator container auto-recreates on a source-hash change via OrchestratorService.ensure_running(), but there's no explicit "restart it now" command.

This bit us repeatedly while iterating on the supervise HTTP bridge — every orchestrator-side change required remembering the right incantation for the current backend.

Proposal

Add a backend-agnostic CLI command, e.g. ./cli.py orchestrator restart (or under the existing backend group). It should:

  1. Stop the selected backend's orchestrator/gateway (firecracker: infra_vm.stop(); docker: OrchestratorService().stop()).
  2. Bring it back up via the new backend-agnostic BottleBackend.ensure_orchestrator() (added in b1df380-adjacent work — commit 2641ab7), printing the healthy control-plane URL.

A status / stop pair under the same group would round it out. The bring-up half already exists (ensure_orchestrator); this issue is mostly the stop half + CLI wiring + a stop() on the backend base to mirror ensure_orchestrator().

Context

Follows the supervise single-DB / HTTP-bridge work on firecracker-consolidated-launch.

## Problem There's no first-class way to restart the per-host orchestrator / control plane. Today it's a manual, backend-specific dance: - **firecracker**: `python3 -c "from bot_bottle.backend.firecracker import infra_vm; infra_vm.stop()"` then relaunch a bottle (or `supervise`) to boot a fresh infra VM. Needed whenever orchestrator-side code changes, since the VM loads its control-plane code at boot and won't reload. - **docker**: the orchestrator container auto-recreates on a source-hash change via `OrchestratorService.ensure_running()`, but there's no explicit "restart it now" command. This bit us repeatedly while iterating on the supervise HTTP bridge — every orchestrator-side change required remembering the right incantation for the current backend. ## Proposal Add a backend-agnostic CLI command, e.g. `./cli.py orchestrator restart` (or under the existing `backend` group). It should: 1. Stop the selected backend's orchestrator/gateway (firecracker: `infra_vm.stop()`; docker: `OrchestratorService().stop()`). 2. Bring it back up via the new backend-agnostic `BottleBackend.ensure_orchestrator()` (added in b1df380-adjacent work — commit 2641ab7), printing the healthy control-plane URL. A `status` / `stop` pair under the same group would round it out. The bring-up half already exists (`ensure_orchestrator`); this issue is mostly the stop half + CLI wiring + a `stop()` on the backend base to mirror `ensure_orchestrator()`. ## Context Follows the supervise single-DB / HTTP-bridge work on `firecracker-consolidated-launch`.
didericis added the Kind/Feature
Priority
Low
4
labels 2026-07-16 22:17:55 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didericis/bot-bottle#391