This commit is contained in:
@@ -117,7 +117,8 @@ func main() {
|
|||||||
mux.Handle("/healthz", health.Handler{Runtime: "cognitive-worker", SemanticGeneration: 1, ArchitectureGeneration: 1})
|
mux.Handle("/healthz", health.Handler{Runtime: "cognitive-worker", SemanticGeneration: 1, ArchitectureGeneration: 1})
|
||||||
readinessClient := &http.Client{Timeout: 2 * time.Second}
|
readinessClient := &http.Client{Timeout: 2 * time.Second}
|
||||||
cpuReadinessClient := &http.Client{Timeout: 10 * time.Second}
|
cpuReadinessClient := &http.Client{Timeout: 10 * time.Second}
|
||||||
mediumReadinessClient := &http.Client{Timeout: 10 * time.Second}
|
mediumReadinessTimeout := 60 * time.Second
|
||||||
|
mediumReadinessClient := &http.Client{Timeout: mediumReadinessTimeout}
|
||||||
lifeboatURL := strings.TrimSuffix(strings.TrimRight(envOr("LOCAL_LIFEBOAT_PROVIDER_URL", "http://cognitive-lifeboat:8086/v1"), "/"), "/v1") + "/health"
|
lifeboatURL := strings.TrimSuffix(strings.TrimRight(envOr("LOCAL_LIFEBOAT_PROVIDER_URL", "http://cognitive-lifeboat:8086/v1"), "/"), "/v1") + "/health"
|
||||||
fleetClient := &http.Client{Timeout: 2 * time.Second}
|
fleetClient := &http.Client{Timeout: 2 * time.Second}
|
||||||
preferredFleet := capability.FleetTier(envOr("COGNITIVE_PREFERRED_FLEET_TIER", string(capability.FleetTierFast)))
|
preferredFleet := capability.FleetTier(envOr("COGNITIVE_PREFERRED_FLEET_TIER", string(capability.FleetTierFast)))
|
||||||
@@ -138,11 +139,11 @@ func main() {
|
|||||||
if mediumAPIKey != "" {
|
if mediumAPIKey != "" {
|
||||||
mediumHeaders["Authorization"] = "Bearer " + mediumAPIKey
|
mediumHeaders["Authorization"] = "Bearer " + mediumAPIKey
|
||||||
}
|
}
|
||||||
mediumHealthProbe = health.OptionalHTTPProbeWithHeaders(&http.Client{Timeout: 15 * time.Second}, mediumEndpoint, mediumHeaders)
|
mediumHealthProbe = health.OptionalHTTPProbeWithHeaders(mediumReadinessClient, mediumEndpoint, mediumHeaders)
|
||||||
// The local gateway may need several seconds to enumerate a loaded model.
|
// The local gateway may need several seconds to enumerate a loaded model.
|
||||||
// Keep this bounded, but do not classify a healthy MEDIUM provider as
|
// Keep this bounded, but do not classify a healthy MEDIUM provider as
|
||||||
// unavailable before its authenticated discovery response can arrive.
|
// unavailable before its authenticated discovery response can arrive.
|
||||||
mediumHealthProbe.Timeout = 15 * time.Second
|
mediumHealthProbe.Timeout = mediumReadinessTimeout
|
||||||
}
|
}
|
||||||
readinessProbes := []health.Probe{
|
readinessProbes := []health.Probe{
|
||||||
health.HTTPProbe(readinessClient, strings.TrimRight(envOr("CORE_RUNTIME_URL", "http://core-runtime:8080"), "/")+"/healthz"),
|
health.HTTPProbe(readinessClient, strings.TrimRight(envOr("CORE_RUNTIME_URL", "http://core-runtime:8080"), "/")+"/healthz"),
|
||||||
@@ -161,7 +162,7 @@ func main() {
|
|||||||
|
|
||||||
fleetEndpoints := []fleetEndpoint{
|
fleetEndpoints := []fleetEndpoint{
|
||||||
{ProviderID: "local-cpu-primary", ModelID: "local-cpu-model", Tier: capability.FleetTierFast, URL: cpuEndpoint, Headers: cpuFleetHeaders, Client: &http.Client{Timeout: 10 * time.Second}, Timeout: 2 * time.Second},
|
{ProviderID: "local-cpu-primary", ModelID: "local-cpu-model", Tier: capability.FleetTierFast, URL: cpuEndpoint, Headers: cpuFleetHeaders, Client: &http.Client{Timeout: 10 * time.Second}, Timeout: 2 * time.Second},
|
||||||
{ProviderID: "local-medium-primary", ModelID: "local-medium-model", Tier: capability.FleetTierMedium, URL: mediumEndpoint, Headers: mediumHeaders, Client: mediumReadinessClient, Timeout: 15 * time.Second},
|
{ProviderID: "local-medium-primary", ModelID: "local-medium-model", Tier: capability.FleetTierMedium, URL: mediumEndpoint, Headers: mediumHeaders, Client: mediumReadinessClient, Timeout: mediumReadinessTimeout},
|
||||||
{ProviderID: "cognitive-lifeboat", ModelID: "qwen3-8b-lifeboat", Tier: capability.FleetTierLifeboat, URL: lifeboatURL},
|
{ProviderID: "cognitive-lifeboat", ModelID: "qwen3-8b-lifeboat", Tier: capability.FleetTierLifeboat, URL: lifeboatURL},
|
||||||
}
|
}
|
||||||
if gpuConfigured {
|
if gpuConfigured {
|
||||||
@@ -222,7 +223,7 @@ func refreshProviderDiscoveries(resolver bindingResolver, service discoveryServi
|
|||||||
for name := range service.providers {
|
for name := range service.providers {
|
||||||
// Keep startup discovery bounded while allowing the authenticated local
|
// Keep startup discovery bounded while allowing the authenticated local
|
||||||
// gateway enough time to enumerate a loaded MEDIUM model.
|
// gateway enough time to enumerate a loaded MEDIUM model.
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
|
||||||
registration, ok := service.providers[name]
|
registration, ok := service.providers[name]
|
||||||
if !ok || registration.Discovery == nil {
|
if !ok || registration.Discovery == nil {
|
||||||
cancel()
|
cancel()
|
||||||
|
|||||||
@@ -154,10 +154,10 @@ func main() {
|
|||||||
}
|
}
|
||||||
mux.Handle("/healthz", health.Handler{Runtime: "core-runtime", SemanticGeneration: 1, ArchitectureGeneration: 1})
|
mux.Handle("/healthz", health.Handler{Runtime: "core-runtime", SemanticGeneration: 1, ArchitectureGeneration: 1})
|
||||||
readinessClient := &http.Client{Timeout: 2 * time.Second}
|
readinessClient := &http.Client{Timeout: 2 * time.Second}
|
||||||
cognitiveReadinessClient := &http.Client{Timeout: 20 * time.Second}
|
cognitiveReadinessClient := &http.Client{Timeout: 70 * time.Second}
|
||||||
cognitiveReadinessProbe := health.HTTPProbe(cognitiveReadinessClient, strings.TrimRight(envOr("COGNITIVE_RUNTIME_URL", "http://cognitive-worker:8083"), "/")+"/readyz")
|
cognitiveReadinessProbe := health.HTTPProbe(cognitiveReadinessClient, strings.TrimRight(envOr("COGNITIVE_RUNTIME_URL", "http://cognitive-worker:8083"), "/")+"/readyz")
|
||||||
cognitiveReadinessProbe.Timeout = 20 * time.Second
|
cognitiveReadinessProbe.Timeout = 70 * time.Second
|
||||||
mux.Handle("/readyz", health.ReadinessHandler{Runtime: "core-runtime", Probes: []health.Probe{
|
mux.Handle("/readyz", health.ReadinessHandler{Runtime: "core-runtime", Timeout: 75 * time.Second, Probes: []health.Probe{
|
||||||
health.TCPProbe("postgres", envOr("POSTGRES_HOST", "postgres"), envOr("POSTGRES_PORT", "5432")),
|
health.TCPProbe("postgres", envOr("POSTGRES_HOST", "postgres"), envOr("POSTGRES_PORT", "5432")),
|
||||||
health.HTTPProbe(readinessClient, strings.TrimRight(envOr("CONTINUITY_RUNTIME_URL", "http://continuity-runtime:8081"), "/")+"/healthz"),
|
health.HTTPProbe(readinessClient, strings.TrimRight(envOr("CONTINUITY_RUNTIME_URL", "http://continuity-runtime:8081"), "/")+"/healthz"),
|
||||||
// A running worker is not necessarily ready to serve cognitive traffic.
|
// A running worker is not necessarily ready to serve cognitive traffic.
|
||||||
|
|||||||
Reference in New Issue
Block a user