From d91eca366f6d7594908a0e28910e54fd31268c24 Mon Sep 17 00:00:00 2001 From: malvm Date: Wed, 5 Aug 2026 09:36:35 +0400 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=20mlflow?= =?UTF-8?q?=20=D0=B8=D0=B7=20docker=20compose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 +-- docker-compose.yml | 31 ++----------------------------- tests/test_deployment.py | 8 ++------ 3 files changed, 5 insertions(+), 37 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad416cf..3c5c340 100755 --- a/Dockerfile +++ b/Dockerfile @@ -23,9 +23,8 @@ RUN --mount=type=cache,target=/root/.cache/uv \ COPY src ./src RUN uv pip install --system --no-deps --no-build-isolation . -# Expose Web UI port and MLflow port +# Expose Web UI port EXPOSE 8000 -EXPOSE 5000 # Start Web UI using the system entry point CMD ["yolo-train-webui", "--host", "0.0.0.0", "--port", "8000"] diff --git a/docker-compose.yml b/docker-compose.yml index 29efa05..5dcb2f1 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,10 +12,8 @@ services: - ./models:/workspace/models - ./models/.config:/root/.config/Ultralytics environment: - # Use the Compose MLflow service so metadata and artifacts survive container recreation. - YOLO_WEBUI_MLFLOW_TRACKING_URI: http://mlflow:5000 - depends_on: - - mlflow + # Optional: tracking URI for external MLflow server (e.g. http://host.docker.internal:5000 or http://your-mlflow-host:5000) + YOLO_WEBUI_MLFLOW_TRACKING_URI: http://host.docker.internal:5000 # Uncomment the block below on Linux with NVIDIA GPU to pass the graphics card into the container: # deploy: # resources: @@ -26,28 +24,3 @@ services: # capabilities: [gpu] ipc: host restart: unless-stopped - - mlflow: - build: - context: . - image: yolo-train-webui:latest - command: - - mlflow - - server - - --backend-store-uri - - sqlite:////mlflow/mlflow.db - - --artifacts-destination - - /mlflow/artifacts - - --host - - 0.0.0.0 - - --port - - "5000" - - --workers - - "1" - - --allowed-hosts - - localhost:5000,127.0.0.1:5000,mlflow:5000 - ports: - - "127.0.0.1:5000:5000" - volumes: - - ./mlflow:/mlflow - restart: unless-stopped diff --git a/tests/test_deployment.py b/tests/test_deployment.py index 93623e6..f29bc69 100644 --- a/tests/test_deployment.py +++ b/tests/test_deployment.py @@ -12,16 +12,12 @@ def test_compose_is_local_and_does_not_require_nvidia() -> None: compose = yaml.safe_load( (PROJECT_ROOT / "docker-compose.yml").read_text(encoding="utf-8") ) + assert set(compose["services"].keys()) == {"webui"} webui = compose["services"]["webui"] assert webui["ports"] == ["127.0.0.1:8000:8000"] assert "deploy" not in webui - - mlflow = compose["services"]["mlflow"] - assert mlflow["ports"] == ["127.0.0.1:5000:5000"] - assert mlflow["volumes"] == ["./mlflow:/mlflow"] - assert "server" in mlflow["command"] - assert webui["environment"]["YOLO_WEBUI_MLFLOW_TRACKING_URI"] == "http://mlflow:5000" + assert "YOLO_WEBUI_MLFLOW_TRACKING_URI" in webui["environment"] def test_docker_dependencies_are_exported_from_lock_file() -> None: