Merge C18 offline bundles and the Helm chart

Conflicts: server.go imports (both kept); agent.pb.go regenerated with buf
from the merged proto.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-05 00:15:47 +02:00
commit 6f85c17fc5
51 files changed
+4177 -63

No files matched your search

@@ -55,6 +55,23 @@ func TestEachNodeIsToldTheEnginesDecidedForIt(t *testing.T) {
}
}
func TestAnOfflineClusterTellsNodesWhereOnTheMirrorAndWhatEachFileMustBe(t *testing.T) {
s := &Service{}
s.SetEngines(map[string]string{"llamacpp": "b1"})
if w := s.provisionFor(inventory.Node{ID: "n"}, []string{"llamacpp"}).GetEngines()[0]; w.GetOfflineBase() != "" {
t.Fatalf("an online cluster sent a mirror: %v", w)
}
s.SetOffline(func(engine, version string) (string, map[string]string) {
return "http://mirror:8081/_llmgw/engines/" + engine + "/" + version,
map[string]string{"llama-" + version + "-bin-ubuntu-x64.tar.gz": "abc"}
})
w := s.provisionFor(inventory.Node{ID: "n"}, []string{"llamacpp"}).GetEngines()[0]
if w.GetOfflineBase() != "http://mirror:8081/_llmgw/engines/llamacpp/b1" ||
w.GetOfflineSha256()["llama-b1-bin-ubuntu-x64.tar.gz"] != "abc" {
t.Errorf("the node was told %v", w)
}
}
func TestABuildChosenForANodeIsWhatItIsTold(t *testing.T) {
s := &Service{}
s.SetEngines(map[string]string{"llamacpp": "b1", "vllm": "0.30.0"})
+17 -1
View File
@@ -66,6 +66,9 @@ type Service struct {
// each connected node said it can install, for telling it again.
choices func(nodeID string) map[string]string
installableBy map[string][]string
// offline, when set, is where engines come from on a cluster with no
// way to the internet; see SetOffline.
offline func(engine, version string) (string, map[string]string)
// controlPlanes lists what agents may dial; see SetControlPlanes.
controlPlanes func(context.Context) ([]string, error)
@@ -989,11 +992,24 @@ func (s *Service) provisionFor(node inventory.Node, can []string) *llmgwv1.Provi
if !slices.Contains(can, e) || chosen[e] == "none" {
continue
}
p.Engines = append(p.Engines, &llmgwv1.EngineWant{Engine: e, Version: wants[e], Variant: chosen[e]})
w := &llmgwv1.EngineWant{Engine: e, Version: wants[e], Variant: chosen[e]}
if s.offline != nil {
w.OfflineBase, w.OfflineSha256 = s.offline(e, wants[e])
}
p.Engines = append(p.Engines, w)
}
return p
}
// SetOffline makes nodes install engines from the cluster's mirror rather
// than from their publishers: f gives where an engine version's files are
// there, and each file's checksum from the bundle the control plane trusts.
// A version no bundle carried has no checksums, and the node says which
// bundle to import rather than reaching for the internet.
func (s *Service) SetOffline(f func(engine, version string) (base string, sha256 map[string]string)) {
s.offline = f
}
// installable are the engines a node can be asked to install. An agent older
// than the list said nothing, and could install llama.cpp alone: asked for
// vLLM too, it reported it unsupported, and a cluster half way through an