From 1e2e3f52717b4df3ceeb3c19d8642cc148f5a14c Mon Sep 17 00:00:00 2001 From: snw35 Date: Mon, 16 Feb 2026 17:10:08 +0000 Subject: [PATCH] Link sageattention wheel filename to python version --- neo/Dockerfile | 22 +++++++++++++--------- neo/get_python_version.py | 15 +++++++++++++-- neo/new_ver.json | 16 ++++++++-------- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/neo/Dockerfile b/neo/Dockerfile index 40f6c59..3a120bc 100644 --- a/neo/Dockerfile +++ b/neo/Dockerfile @@ -19,10 +19,10 @@ ENV UV_CACHE_DIR=${REFORGE_PATH}/venv/uvcache ENV DEBIAN_FRONTEND="noninteractive" # Version variables controlled by https://github.com/snw35/dfupdate -ENV UV_VERSION=0.10.0 +ENV UV_VERSION=0.10.3 ENV UV_URL=https://github.com/astral-sh/uv/releases/download/${UV_VERSION} ENV UV_FILENAME=uv-x86_64-unknown-linux-gnu.tar.gz -ENV UV_SHA256=230e328948c92dd1ebad83949c4d56e83813dfe9c6362a4c519e6a227973f1ae +ENV UV_SHA256=c60b9956a0e6727f0ddd881c303a706c6408b2047f3a8fa4d1454a826338ccdc # Install UV RUN curl -L -O ${UV_URL}/${UV_FILENAME} \ @@ -33,10 +33,10 @@ RUN curl -L -O ${UV_URL}/${UV_FILENAME} \ && rm -rf ./uv-x86_64-unknown-linux-gnu ./${UV_FILENAME} # Version variables controlled by https://github.com/snw35/dfupdate -ENV REFORGE_VERSION=2.11 +ENV REFORGE_VERSION=2.13 ENV REFORGE_URL=https://github.com/Haoming02/sd-webui-forge-classic/archive/refs/tags/ ENV REFORGE_FILENAME=${REFORGE_VERSION}.tar.gz -ENV REFORGE_SHA256=29bb8acb84c67bacb392723265734c76733b3720c3cd7558c5790530872da8b9 +ENV REFORGE_SHA256=0eb8eebc09d76c1749919e636623939d45c2a273a00ad53430636a03dc9b8dc6 # Install ReForge RUN curl -L -O $REFORGE_URL/$REFORGE_FILENAME \ @@ -65,15 +65,19 @@ USER ubuntu ENV PATH="$PATH:${REFORGE_PATH}:/home/ubuntu/.local/bin" # Version variables controlled by https://github.com/snw35/dfupdate +# Stop sage from automatically updating due to python version being unknown at build time ENV SAGE_VERSION=2.2.0 ENV SAGE_URL=https://github.com/snw35/sageattention-wheel/releases/download/cu12-${SAGE_VERSION}-cu13-${SAGE_VERSION}/ -ENV SAGE_FILENAME=sageattention-${SAGE_VERSION}+cu13-cp311-cp311-linux_x86_64.whl -ENV SAGE_SHA256=32c92fe1032238f855f3b1498544b2a9fc25bd55dd4e6c310c2ba39410c5961a -# +ENV SAGE_SHA256=599bede74bb0be04157b24939f02ea0e741d2e9a4e20abc6ae7c98a00c31f4ce +ENV SAGE_UPGRADE=false + # # Construct full venv -RUN curl -L -O ${SAGE_URL}/${SAGE_FILENAME} \ +RUN export PYTHON_VERSION=$(python3 ${REFORGE_PATH}/get_python_version.py) \ + && export SAGE_CP=$(python3 ${REFORGE_PATH}/get_python_version.py -strip) \ + && export SAGE_FILENAME=sageattention-${SAGE_VERSION}+cu13-cp${SAGE_CP}-cp${SAGE_CP}-linux_x86_64.whl \ + && curl -L -O ${SAGE_URL}/${SAGE_FILENAME} \ && echo "$SAGE_SHA256 ./${SAGE_FILENAME}" | sha256sum -c - \ - && uv python install $(python3 ${REFORGE_PATH}/get_python_version.py) --default \ + && uv python install $PYTHON_VERSION --default \ && uv venv ${REFORGE_PATH}/venv --clear --seed --allow-existing \ && . ${REFORGE_PATH}/venv/bin/activate \ && uv pip install insightface \ diff --git a/neo/get_python_version.py b/neo/get_python_version.py index 0018ec7..ea8278c 100644 --- a/neo/get_python_version.py +++ b/neo/get_python_version.py @@ -9,9 +9,11 @@ Input: - Environment variable: REFORGE_PATH (repo root) +- Optional CLI argument: -strip (or --strip) to remove period from output Output: -- Prints major.minor (e.g. 3.13) to stdout +- Prints major.minor (e.g. 3.13) to stdout by default +- With -strip/--strip, prints without period (e.g. 313) - Exits non-zero on failure """ @@ -119,6 +121,15 @@ def _from_launch_utils(root: Path) -> str | None: def main() -> int: + strip_output = False + for arg in sys.argv[1:]: + if arg in ("-strip", "--strip"): + strip_output = True + else: + print(f"ERROR: Unknown argument: {arg}", file=sys.stderr) + print("Usage: get_python_version.py [-strip]", file=sys.stderr) + return 2 + root_env = os.environ.get("REFORGE_PATH", "").strip() if not root_env: print("ERROR: REFORGE_PATH is not set", file=sys.stderr) @@ -132,7 +143,7 @@ def main() -> int: for detector in (_from_pyproject, _from_python_version_file, _from_launch_utils): ver = detector(root) if ver: - print(ver) + print(ver.replace(".", "") if strip_output else ver) return 0 print( diff --git a/neo/new_ver.json b/neo/new_ver.json index cecfab4..d2e4881 100644 --- a/neo/new_ver.json +++ b/neo/new_ver.json @@ -8,10 +8,10 @@ "version": "13.1.1-base-ubuntu24.04" }, "REFORGE": { - "version": "2.11", - "gitref": "refs/tags/2.11", - "revision": "686471e322316bc5cab8cd0c79e74df359e962b2", - "url": "https://github.com/Haoming02/sd-webui-forge-classic/releases/tag/2.11" + "version": "2.13", + "gitref": "refs/tags/2.13", + "revision": "7465c0e9c2c2c1a093673ed8be3fc53049dd35a4", + "url": "https://github.com/Haoming02/sd-webui-forge-classic/releases/tag/2.13" }, "SAGE": { "version": "2.2.0", @@ -20,10 +20,10 @@ "url": "https://github.com/snw35/sageattention-wheel/releases/tag/2.2.0" }, "UV": { - "version": "0.10.0", - "gitref": "refs/tags/0.10.0", - "revision": "0ba432459aa4e84d793fd8cfc98d13cf619316bb", - "url": "https://github.com/astral-sh/uv/releases/tag/0.10.0" + "version": "0.10.3", + "gitref": "refs/tags/0.10.3", + "revision": "c75a0c625cbed187d64bbb6c406afd94f3d5da49", + "url": "https://github.com/astral-sh/uv/releases/tag/0.10.3" } } }