CI / test (push) Successful in 9m40s
internal/control/slurmsvc tells each node what it is, writes slurm.conf and gres.conf from the nodes' reports and the inventory, and moves each node of slurm.nodes between llmgw and Slurm: lent, drained of replicas first, then resumed in Slurm; taken back, drained in Slurm and cordoned in llmgw until its last job step ends. Kept every tick from the settings and the agents' reports, so a new leader carries on. A broken Slurm never keeps a node from llmgw. GET /api/v1/slurm; ctl slurm status, setup, lend, reclaim, off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
585 B
Go
26 lines
585 B
Go
package agentsvc
|
|
|
|
import (
|
|
llmgwv1 "gitea.mynodes.xyz/ilker/llmgw/api/gen/llmgw/v1"
|
|
)
|
|
|
|
// SlurmHandler is told of the nodes' part in Slurm (BACKLOG P).
|
|
type SlurmHandler interface {
|
|
OnSlurmStatus(node string, st *llmgwv1.SlurmStatus)
|
|
// OnRegister is a node's new stream, which is told again what it is.
|
|
OnRegister(node string)
|
|
}
|
|
|
|
// SetSlurm gives the service what Slurm's messages go to.
|
|
func (s *Service) SetSlurm(h SlurmHandler) {
|
|
s.mu.Lock()
|
|
s.slurm = h
|
|
s.mu.Unlock()
|
|
}
|
|
|
|
func (s *Service) slurmHandler() SlurmHandler {
|
|
s.mu.RLock()
|
|
defer s.mu.RUnlock()
|
|
return s.slurm
|
|
}
|