feat: wire configured harness execution
This commit is contained in:
@@ -8,7 +8,9 @@ import (
|
||||
"net/http"
|
||||
"orchestra/internal/authz"
|
||||
"orchestra/internal/domain"
|
||||
"orchestra/internal/herdr"
|
||||
"orchestra/internal/operations"
|
||||
"orchestra/internal/orchestrator"
|
||||
"orchestra/internal/provider"
|
||||
"orchestra/internal/registry"
|
||||
"orchestra/internal/router"
|
||||
@@ -36,6 +38,18 @@ func main() {
|
||||
log.Fatalf("load orchestra config: %v", err)
|
||||
}
|
||||
rt = &router.Router{Store: s, Registry: rr, Reachability: registry.TCPReachability{}, Timeout: time.Second, Retry: router.RetryPolicy{MaxAttempts: 3, Backoff: time.Minute}}
|
||||
if repo, root := os.Getenv("ORCHESTRA_REPO"), os.Getenv("ORCHESTRA_WORKTREE_ROOT"); repo != "" && root != "" {
|
||||
adapters := map[string]herdr.Adapter{}
|
||||
for _, h := range rr.Herdrs() {
|
||||
if h.Address == "" {
|
||||
continue
|
||||
}
|
||||
client := herdr.New(h.Address)
|
||||
adapters[h.ID] = herdr.Codex(client, 200000)
|
||||
}
|
||||
coordinator := &orchestrator.Coordinator{Store: s, Worktrees: orchestrator.GitWorktrees{Root: root, Repo: repo}, Adapters: orchestrator.AdapterFactory{Herdrs: adapters}}
|
||||
rt.OnLease = func(e domain.Event) error { return coordinator.Start(context.Background(), e) }
|
||||
}
|
||||
}
|
||||
mux := http.NewServeMux()
|
||||
surface := func(r *http.Request) authz.Surface {
|
||||
|
||||
Reference in New Issue
Block a user