From b9a028a1db5595f239743d32aed34cf6ca8bbb51 Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Thu, 6 Aug 2026 10:03:58 +0800 Subject: [PATCH] update: multi python version --- {runtime => extras}/requirements-py310 | 0 {runtime => extras}/requirements-py312 | 0 {runtime => extras}/requirements-py38 | 0 runtime/Dockerfile | 7 ++++--- schedule/Dockerfile | 12 ++++++++++++ 5 files changed, 16 insertions(+), 3 deletions(-) rename {runtime => extras}/requirements-py310 (100%) rename {runtime => extras}/requirements-py312 (100%) rename {runtime => extras}/requirements-py38 (100%) diff --git a/runtime/requirements-py310 b/extras/requirements-py310 similarity index 100% rename from runtime/requirements-py310 rename to extras/requirements-py310 diff --git a/runtime/requirements-py312 b/extras/requirements-py312 similarity index 100% rename from runtime/requirements-py312 rename to extras/requirements-py312 diff --git a/runtime/requirements-py38 b/extras/requirements-py38 similarity index 100% rename from runtime/requirements-py38 rename to extras/requirements-py38 diff --git a/runtime/Dockerfile b/runtime/Dockerfile index ed5c333..874b312 100644 --- a/runtime/Dockerfile +++ b/runtime/Dockerfile @@ -6,6 +6,7 @@ COPY --from=rclone/rclone:latest /usr/local/bin/rclone /usr/local/bin/rclone COPY pyproject.toml uv.lock ./ COPY common ./common COPY runtime ./runtime +COPY extras ./extras RUN UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv sync --frozen --no-dev --no-editable --package runtime RUN mkdir -p /root/.jupyter/custom /app/.venv/share/jupyter/custom && \ @@ -13,14 +14,14 @@ RUN mkdir -p /root/.jupyter/custom /app/.venv/share/jupyter/custom && \ cp /root/.jupyter/custom/custom.css /app/.venv/share/jupyter/custom/custom.css RUN uv venv --python 3.12 /opt/venv/python3.12 && \ - UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.12/bin/python -r runtime/requirements-py312 + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.12/bin/python -r extras/requirements-py312 RUN uv venv --python 3.8 /opt/venv/python3.8 && \ - UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.8/bin/python -r runtime/requirements-py38 && \ + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.8/bin/python -r extras/requirements-py38 && \ /opt/venv/python3.8/bin/python -m ipykernel install --prefix=/opt/venv/python3.12 --name=python38 --display-name="python3.8" RUN uv venv --python 3.10 /opt/venv/python3.10 && \ - UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.10/bin/python -r runtime/requirements-py310 && \ + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.10/bin/python -r extras/requirements-py310 && \ /opt/venv/python3.10/bin/python -m ipykernel install --prefix=/opt/venv/python3.12 --name=python310 --display-name="python3.10" EXPOSE 8000 diff --git a/schedule/Dockerfile b/schedule/Dockerfile index 6886e8a..cfeae40 100644 --- a/schedule/Dockerfile +++ b/schedule/Dockerfile @@ -3,7 +3,19 @@ FROM python-base:3.12 COPY pyproject.toml uv.lock ./ COPY common ./common COPY schedule ./schedule +COPY extras ./extras RUN UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv sync --frozen --no-dev --no-editable --package schedule +RUN uv venv --python 3.12 /opt/venv/python3.12 && \ + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.12/bin/python -r extras/requirements-py312 + +RUN uv venv --python 3.8 /opt/venv/python3.8 && \ + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.8/bin/python -r extras/requirements-py38 && \ + /opt/venv/python3.8/bin/python -m ipykernel install --prefix=/opt/venv/python3.12 --name=python38 --display-name="python3.8" + +RUN uv venv --python 3.10 /opt/venv/python3.10 && \ + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.10/bin/python -r extras/requirements-py310 && \ + /opt/venv/python3.10/bin/python -m ipykernel install --prefix=/opt/venv/python3.12 --name=python310 --display-name="python3.10" + EXPOSE 8000 CMD ["uv", "run", "--frozen", "--package", "schedule", "gunicorn", "--config", "schedule/gunicorn.conf.py", "schedule.main:app"]