engine_overrides give nodes picked by GPU class, id or labels their own engine versions; node add --disable-engine keeps one off a node; what vLLM cannot do on a node is a warning rather than a refused node; the CUDA requirement follows the version; a hand-named binary is no longer replaced by an installed one. Refs #2 (items 4 and 7). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
33 lines
1.3 KiB
Go
33 lines
1.3 KiB
Go
package agent
|
|
|
|
import (
|
|
"testing"
|
|
|
|
llmgwv1 "gitea.mynodes.xyz/ilker/llmgw/api/gen/llmgw/v1"
|
|
"gitea.mynodes.xyz/ilker/llmgw/internal/agent/engines"
|
|
)
|
|
|
|
func TestAnEngineDisabledOnTheNodeIsNeitherInstalledNorAdvertised(t *testing.T) {
|
|
a := &Agent{}
|
|
a.cfg.Engines.Disabled = []string{"vllm"}
|
|
a.setProvision(&llmgwv1.Provision{Engines: []*llmgwv1.EngineWant{
|
|
{Engine: "llamacpp", Version: "b1"}, {Engine: "vllm", Version: "0.30.0"},
|
|
}})
|
|
if len(a.provWants) != 1 || a.provWants[0].Engine != "llamacpp" {
|
|
t.Errorf("wants %+v: vLLM is disabled here and must not be installed", a.provWants)
|
|
}
|
|
a.configuredVers = map[string]string{"vllm": "0.25.0"}
|
|
a.installedVers = map[string]string{"llamacpp": "b1"}
|
|
if got := a.engineReportLocked(); got["vllm"] != "" || got["llamacpp"] != "b1" {
|
|
t.Errorf("advertised %v: a disabled engine found on disk is still not offered", got)
|
|
}
|
|
}
|
|
|
|
func TestAnEngineNamedByHandIsNotInstalledOverIt(t *testing.T) {
|
|
a := &Agent{reg: engines.NewRegistry(engines.Config{LlamaCpp: engines.LlamaCppConfig{Bin: "/opt/own/llama-server"}})}
|
|
a.setProvision(&llmgwv1.Provision{Engines: []*llmgwv1.EngineWant{{Engine: "llamacpp", Version: "b1"}}})
|
|
if len(a.provWants) != 0 {
|
|
t.Errorf("wants %+v: an installed build would be used over the operator's own", a.provWants)
|
|
}
|
|
}
|