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>
36 lines
942 B
Go
36 lines
942 B
Go
package cli
|
|
|
|
import (
|
|
"slices"
|
|
"strings"
|
|
"testing"
|
|
|
|
"gitea.mynodes.xyz/ilker/llmgw/internal/settings"
|
|
)
|
|
|
|
func TestSlurmDocLists(t *testing.T) {
|
|
doc, err := settings.FromBytes("settings", []byte("slurm:\n enabled: true\n nodes: [cuda01, site2]\n"))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if got := docList(doc, []string{"slurm", "nodes"}); !slices.Equal(got, []string{"cuda01", "site2"}) {
|
|
t.Fatalf("nodes %v", got)
|
|
}
|
|
if got := docList(doc, []string{"slurm", "lent"}); got != nil {
|
|
t.Fatalf("lent %v", got)
|
|
}
|
|
if err := setList(doc, []string{"slurm", "lent"}, []string{"cuda01"}); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if got := docList(doc, []string{"slurm", "lent"}); !slices.Equal(got, []string{"cuda01"}) {
|
|
t.Fatalf("lent %v", got)
|
|
}
|
|
if err := setList(doc, []string{"slurm", "lent"}, nil); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
b, _ := doc.Bytes()
|
|
if strings.Contains(string(b), "lent") {
|
|
t.Fatalf("an empty list left:\n%s", b)
|
|
}
|
|
}
|