Issue #3 asked for commands to stop and start the system, and 05aa21c gave
only one machine's services. Now:
- llmgw stop sets serving.stopped in the cluster's settings, live: the
reconciler wants every model at no replicas, freeing every GPU, and the
gateway answers every POST under /v1/ with 503 system_stopped. The control
planes, agents and mirror keep running, and no model's definition changes.
- llmgw start clears it; every model is placed again as it asks.
- llmgw restart has every agent restart over its stream (RestartAgent), then
the other control planes over ssh, standbys before a leader, then this
one; engines keep serving.
- llmgw status is the cluster's summary, saying when it is stopped.
One machine's services moved to llmgw service status|start|stop|restart.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
23 lines
663 B
Go
23 lines
663 B
Go
package adminapi
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// AgentRestartView names the nodes whose agents were told to restart.
|
|
type AgentRestartView struct {
|
|
Nodes []string `json:"nodes"`
|
|
}
|
|
|
|
// SetAgentRestarter enables POST /api/v1/agents/restart.
|
|
func (a *API) SetAgentRestarter(f func(reason string) []string) { a.restartAgents = f }
|
|
|
|
func (a *API) restartAgentsHandler(w http.ResponseWriter, r *http.Request) {
|
|
if a.restartAgents == nil {
|
|
writeError(w, http.StatusNotImplemented, "this control plane has no agents to restart")
|
|
return
|
|
}
|
|
nodes := a.restartAgents("llmgw restart, by " + actorOf(r))
|
|
writeJSON(w, http.StatusAccepted, AgentRestartView{Nodes: nodes})
|
|
}
|