diff --git a/coordinator/internal/agent/config.go b/coordinator/internal/agent/config.go index a01a3a4..20890f7 100644 --- a/coordinator/internal/agent/config.go +++ b/coordinator/internal/agent/config.go @@ -8,6 +8,8 @@ import ( "strconv" "strings" "time" + + "github.com/emil28092005/SciMesh/coordinator/internal/workloads" ) // Config is read only from the environment, mirroring the former Python @@ -99,7 +101,7 @@ func LoadConfig() (*Config, error) { return nil, err } if len(capabilities) == 0 { - capabilities = []string{"similarity-search", "similarity_search"} + capabilities = defaultCapabilities() } runner, err := envList("TASK_RUNNER") if err != nil { @@ -157,3 +159,19 @@ func durationEnv(name string, fallback time.Duration) (time.Duration, error) { } return parsed, nil } + +// defaultCapabilities derives the worker's advertised capabilities from the +// embedded workload catalog, so an agent is workload-agnostic out of the box: +// it claims whatever enabled workloads the coordinator library declares. +// Explicit CAPABILITIES still overrides this for operators who want a subset. +func defaultCapabilities() []string { + catalog, err := workloads.Load() + if err != nil { + return []string{"similarity-search"} + } + names := make([]string, 0, len(catalog.Enabled())) + for _, workload := range catalog.Enabled() { + names = append(names, workload.Name) + } + return names +} diff --git a/coordinator/scripts/demo-ui.sh b/coordinator/scripts/demo-ui.sh index cc03910..05d48a3 100755 --- a/coordinator/scripts/demo-ui.sh +++ b/coordinator/scripts/demo-ui.sh @@ -201,7 +201,7 @@ SciMesh manual demo is ready. Sign in with the admin above, or register a new account from the login page. The admin sees every job; a plain user sees only their own. Upload a small -ChEMBL TSV through “New similarity search”, then watch the job page update. +ChEMBL TSV through the "New computation" form, then watch the job page update. Worker logs are in $logs_dir. Stop everything with: make demo-down