From 5c9aaedf4634aa884adfdbfcb86f5cd208761054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Wilczy=C5=84ski?= Date: Fri, 28 Feb 2025 15:22:04 +0100 Subject: [PATCH] uvicorn to bind to all the interfaces; upgrade to 0.34.0 --- runner/Dockerfile | 2 +- runner/app/runit/uvicorn/run | 2 +- runner/dev/Dockerfile.debug | 4 ++-- runner/docker/Dockerfile.audio_to_text | 2 +- runner/docker/Dockerfile.live-app-noop | 4 ++-- runner/docker/Dockerfile.live-app__PIPELINE__ | 2 +- runner/docker/Dockerfile.llm | 2 +- runner/docker/Dockerfile.segment_anything_2 | 2 +- runner/docker/Dockerfile.text_to_speech | 2 +- runner/requirements.live-ai.txt | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/runner/Dockerfile b/runner/Dockerfile index 256588458..017b70409 100644 --- a/runner/Dockerfile +++ b/runner/Dockerfile @@ -55,4 +55,4 @@ COPY images/ /app/images COPY bench.py /app/bench.py COPY example_data/ /app/example_data -CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "", "--port", "8000"] diff --git a/runner/app/runit/uvicorn/run b/runner/app/runit/uvicorn/run index ed0ec412f..2529a1106 100755 --- a/runner/app/runit/uvicorn/run +++ b/runner/app/runit/uvicorn/run @@ -1,4 +1,4 @@ #!/bin/sh cd /app -exec uvicorn app.main:app --log-config app/cfg/uvicorn_logging_config.json --host 0.0.0.0 --port 8000 +exec uvicorn app.main:app --log-config app/cfg/uvicorn_logging_config.json --host "" --port 8000 diff --git a/runner/dev/Dockerfile.debug b/runner/dev/Dockerfile.debug index b05927d4f..07754a6c1 100644 --- a/runner/dev/Dockerfile.debug +++ b/runner/dev/Dockerfile.debug @@ -5,7 +5,7 @@ FROM livepeer/ai-runner:base RUN pip install debugpy # Expose the debugpy port and start the app as usual. -CMD ["python", "-m", "debugpy", "--listen", "0.0.0.0:5678", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] +CMD ["python", "-m", "debugpy", "--listen", "0.0.0.0:5678", "-m", "uvicorn", "app.main:app", "--host", "", "--port", "8000"] # If you want to wait for the debugger to attach before starting the app, use the --wait-for-client option. -# CMD ["python", "-m", "debugpy", "--listen", "0.0.0.0:5678", "--wait-for-client", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] +# CMD ["python", "-m", "debugpy", "--listen", "0.0.0.0:5678", "--wait-for-client", "-m", "uvicorn", "app.main:app", "--host", "", "--port", "8000"] diff --git a/runner/docker/Dockerfile.audio_to_text b/runner/docker/Dockerfile.audio_to_text index d1e74b24c..c3426adfc 100755 --- a/runner/docker/Dockerfile.audio_to_text +++ b/runner/docker/Dockerfile.audio_to_text @@ -22,4 +22,4 @@ WORKDIR /app # Copy app directory to avoid rebuilding the base image during development. COPY app/ /app/app -CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "", "--port", "8000"] diff --git a/runner/docker/Dockerfile.live-app-noop b/runner/docker/Dockerfile.live-app-noop index e9ad77de1..93311886e 100644 --- a/runner/docker/Dockerfile.live-app-noop +++ b/runner/docker/Dockerfile.live-app-noop @@ -23,7 +23,7 @@ RUN ls /usr/local/lib && ls /usr/local/lib/pkgconfig && ls -lha /usr/local/bin & # Install any additional Python packages RUN pip install --no-cache-dir \ - uvicorn==0.30.0 \ + uvicorn==0.34.0 \ fastapi==0.111.0 \ numpy==1.26.4 \ torch==2.5.1 \ @@ -51,4 +51,4 @@ COPY bench.py /app/bench.py WORKDIR /app -CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "", "--port", "8000"] diff --git a/runner/docker/Dockerfile.live-app__PIPELINE__ b/runner/docker/Dockerfile.live-app__PIPELINE__ index 0242cdd61..f6a65472b 100644 --- a/runner/docker/Dockerfile.live-app__PIPELINE__ +++ b/runner/docker/Dockerfile.live-app__PIPELINE__ @@ -39,4 +39,4 @@ RUN rm -r /ComfyUI/custom_nodes/ComfyUI-Manager ARG GIT_SHA ENV GIT_SHA=$GIT_SHA -CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "", "--port", "8000"] diff --git a/runner/docker/Dockerfile.llm b/runner/docker/Dockerfile.llm index 5ab4b9675..5516b6cca 100644 --- a/runner/docker/Dockerfile.llm +++ b/runner/docker/Dockerfile.llm @@ -71,4 +71,4 @@ COPY images/ /app/images COPY bench.py /app/bench.py COPY example_data/ /app/example_data -CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "", "--port", "8000"] diff --git a/runner/docker/Dockerfile.segment_anything_2 b/runner/docker/Dockerfile.segment_anything_2 index faec26664..35db39c51 100644 --- a/runner/docker/Dockerfile.segment_anything_2 +++ b/runner/docker/Dockerfile.segment_anything_2 @@ -9,4 +9,4 @@ WORKDIR /app # Copy app directory to avoid rebuilding the base image during development. COPY app/ /app/app -CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "", "--port", "8000"] diff --git a/runner/docker/Dockerfile.text_to_speech b/runner/docker/Dockerfile.text_to_speech index 12a99ee8c..ad7458bcf 100644 --- a/runner/docker/Dockerfile.text_to_speech +++ b/runner/docker/Dockerfile.text_to_speech @@ -24,4 +24,4 @@ WORKDIR /app # Copy app directory to avoid rebuilding the base image during development. COPY app/ /app/app -CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "app.main:app", "--log-config", "app/cfg/uvicorn_logging_config.json", "--host", "", "--port", "8000"] diff --git a/runner/requirements.live-ai.txt b/runner/requirements.live-ai.txt index fd56cf32e..01f7fe806 100644 --- a/runner/requirements.live-ai.txt +++ b/runner/requirements.live-ai.txt @@ -4,7 +4,7 @@ fastapi==0.111.0 pydantic==2.7.2 Pillow==10.3.0 python-multipart==0.0.9 -uvicorn==0.30.0 +uvicorn==0.34.0 huggingface_hub==0.23.2 triton>=2.1.0 peft==0.11.1