feat: beta deploys all services with pipeline toggle defaulting to OFF
- pipelineEnabled: true in beta so all pods run (Kargo happy) - PIPELINE_DEFAULT_OFF=true in beta config — scheduler initializes the Redis toggle to OFF on first boot - Shared Ollama (10.1.1.12:2701) between beta and paper - Flip pipeline ON from the UI when testing, OFF when done - Optimistic UI update for the toggle button
This commit is contained in:
@@ -537,7 +537,13 @@ export function usePipelineToggle() {
|
||||
const qc = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: (enabled: boolean) => apiPost<{ pipeline_enabled: boolean }>('query', '/api/ops/pipeline/toggle', { enabled }),
|
||||
onSuccess: () => qc.invalidateQueries({ queryKey: ['pipeline-health'] }),
|
||||
onMutate: async (enabled) => {
|
||||
await qc.cancelQueries({ queryKey: ['pipeline-health'] });
|
||||
qc.setQueriesData<Record<string, unknown>>({ queryKey: ['pipeline-health'] }, (old) =>
|
||||
old ? { ...old, pipeline_enabled: enabled } : old,
|
||||
);
|
||||
},
|
||||
onSettled: () => qc.invalidateQueries({ queryKey: ['pipeline-health'] }),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
image:
|
||||
tag: latest
|
||||
|
||||
## Pipeline OFF by default — beta is for API testing only
|
||||
pipelineEnabled: false
|
||||
## Pipeline ON — all services deployed so Kargo sees them as healthy.
|
||||
## The Redis-based pipeline toggle defaults to OFF so the scheduler
|
||||
## won't enqueue jobs unless you flip it on from the UI.
|
||||
pipelineEnabled: true
|
||||
|
||||
## Single replica for API services
|
||||
## Single replica for all services in beta
|
||||
services:
|
||||
queryApi:
|
||||
replicas: 1
|
||||
@@ -34,6 +36,9 @@ config:
|
||||
MINIO_ENDPOINT: "minio.minio-service.svc.cluster.local:80"
|
||||
MINIO_SECURE: "false"
|
||||
BROKER_MODE: "paper"
|
||||
OLLAMA_BASE_URL: "http://10.1.1.12:2701"
|
||||
MARKET_DATA_BASE_URL: "https://api.polygon.io"
|
||||
PIPELINE_DEFAULT_OFF: "true"
|
||||
|
||||
## Blank out all secrets so beta never talks to external APIs
|
||||
secrets:
|
||||
|
||||
@@ -9,6 +9,7 @@ Requirements: 2.1, 2.2, 2.3, 2.4, 2.5
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from datetime import datetime, timezone
|
||||
from typing import Any, Optional
|
||||
|
||||
@@ -501,6 +502,14 @@ async def main() -> None:
|
||||
|
||||
logger.info("Scheduler started (tick=%ds)", SCHEDULER_TICK)
|
||||
pipeline_key = f"{PREFIX}:pipeline:enabled"
|
||||
|
||||
# If PIPELINE_DEFAULT_OFF is set, initialize the toggle to OFF on first boot
|
||||
# (only if the key doesn't already exist — preserves manual overrides)
|
||||
if os.getenv("PIPELINE_DEFAULT_OFF", "").lower() in ("1", "true", "yes"):
|
||||
created = await rds.set(pipeline_key, "0", nx=True)
|
||||
if created:
|
||||
logger.info("Pipeline toggle initialized to OFF (PIPELINE_DEFAULT_OFF=true)")
|
||||
|
||||
recovery_counter = 0
|
||||
retry_counter = 0
|
||||
cleanup_counter = 0
|
||||
|
||||
Reference in New Issue
Block a user