The control plane uses whichever mirror answers
mirror.peers names the mirrors kept in step with mirror.api. The mirror's management calls go to the first that can be reached, and each mirror is asked every fifteen seconds whether it answers: a shard is sent its model's and adapters' address on one that does while the mirror the catalog names is down. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
5bc71b3d0a
commit
8a76a53afb
11 files changed
+276
-21
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package agentsvc
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.mynodes.xyz/ilker/llmgw/internal/agent/engines"
|
||||
@@ -18,3 +19,20 @@ func TestAdaptersTravelToTheAgentInOrder(t *testing.T) {
|
||||
t.Errorf("adapters %+v", got)
|
||||
}
|
||||
}
|
||||
|
||||
// While its mirror is down, a shard is sent its model and adapters on the
|
||||
// mirror the rewrite names, and the command it was made from is left as it is.
|
||||
func TestAShardIsSentItsModelOnAMirrorThatAnswers(t *testing.T) {
|
||||
SetSourceRewrite(func(s string) string { return strings.Replace(s, "http://mirror-a", "http://mirror-b", 1) })
|
||||
t.Cleanup(func() { SetSourceRewrite(func(s string) string { return s }) })
|
||||
ads := []engines.Adapter{{Name: "sql", Path: "http://mirror-a/sql.gguf"}}
|
||||
cmd := reconciler.ShardCommand{ReplicaID: "r", ShardID: "s", Spec: engines.ShardSpec{
|
||||
Profile: engines.Profile{Name: "cpu", Engine: "llamacpp", ModelPath: "http://mirror-a/qwen/v1/", Adapters: ads}}}
|
||||
spec, _ := ShardSpecFromStart(StartShardFromCommand(cmd))
|
||||
if spec.Profile.ModelPath != "http://mirror-b/qwen/v1/" || spec.Profile.Adapters[0].Path != "http://mirror-b/sql.gguf" {
|
||||
t.Errorf("sent %+v", spec.Profile)
|
||||
}
|
||||
if ads[0].Path != "http://mirror-a/sql.gguf" {
|
||||
t.Error("the catalog's adapter was changed in place")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user