From 187243bfdb9dd45502e03f583d04f68edea141b3 Mon Sep 17 00:00:00 2001 From: Marko Djordjevic Date: Sat, 21 Feb 2026 09:34:16 +0100 Subject: [PATCH] Fix MLflow localhost references to use Docker service name Replace hardcoded localhost:5000 with mlflow:5000 in pipeline.yaml and main.py health check fallback so containers can reach MLflow over Docker's internal network. Co-Authored-By: Claude Sonnet 4.6 --- services/ml/app/main.py | 2 +- services/ml/config/pipeline.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/ml/app/main.py b/services/ml/app/main.py index 6293671..aa1647e 100644 --- a/services/ml/app/main.py +++ b/services/ml/app/main.py @@ -536,7 +536,7 @@ async def health_check(response: Response): # Check MLflow connection via HTTP GET to its health endpoint mlflow_status = "unhealthy" try: - mlflow_tracking_uri = os.getenv("MLFLOW_TRACKING_URI", "http://localhost:5000") + mlflow_tracking_uri = os.getenv("MLFLOW_TRACKING_URI", "http://mlflow:5000") mlflow_health_url = f"{mlflow_tracking_uri.rstrip('/')}/health" resp = http_requests.get(mlflow_health_url, timeout=3) if resp.status_code == 200: diff --git a/services/ml/config/pipeline.yaml b/services/ml/config/pipeline.yaml index c97fab0..918d7b8 100644 --- a/services/ml/config/pipeline.yaml +++ b/services/ml/config/pipeline.yaml @@ -127,7 +127,7 @@ stages: # MLflow settings mlflow: - tracking_uri: "http://localhost:5000" + tracking_uri: "http://mlflow:5000" experiment_name: "candlestick_patterns" log_artifacts: true register_model: false # Set to true to register in model registry