-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multi-stage build for 'comfy3d-pt25' [skip-ci]
- Loading branch information
Showing
5 changed files
with
311 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Publish 'base-cu124-pt25' to Docker Hub | ||
|
||
on: | ||
workflow_dispatch: # Can be manually triggered | ||
push: | ||
branches: [ main ] | ||
paths-ignore: | ||
- '**' | ||
- '!base-cu124-pt25/Dockerfile' | ||
- '!.github/workflows/build-base-cu124-pt25.yml' | ||
|
||
|
||
jobs: | ||
|
||
build-publish-base-cu124-pt25: | ||
environment: Publish to Docker Hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Maximize build disk space | ||
uses: easimon/maximize-build-space@master | ||
with: | ||
overprovision-lvm: 'true' | ||
remove-android: 'true' | ||
- | ||
name: Git checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }} | ||
- | ||
name: Build and push 'base-cu124-pt25' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./base-cu124-pt25 | ||
file: ./base-cu124-pt25/Dockerfile | ||
tags: | | ||
yanwk/comfyui-boot:base-cu124-pt25 | ||
push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Publish 'base-cu124' to Docker Hub | ||
|
||
on: | ||
workflow_dispatch: # Can be manually triggered | ||
push: | ||
branches: [ main ] | ||
paths-ignore: | ||
- '**' | ||
- '!base-cu124/Dockerfile' | ||
- '!.github/workflows/build-base-cu124.yml' | ||
|
||
|
||
jobs: | ||
|
||
build-publish-base-cu124: | ||
environment: Publish to Docker Hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Maximize build disk space | ||
uses: easimon/maximize-build-space@master | ||
with: | ||
overprovision-lvm: 'true' | ||
remove-android: 'true' | ||
- | ||
name: Git checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }} | ||
- | ||
name: Build and push 'base-cu124' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./base-cu124 | ||
file: ./base-cu124/Dockerfile | ||
tags: | | ||
yanwk/comfyui-boot:base-cu124 | ||
push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
################################################################################ | ||
# Dockerfile that builds 'yanwk/comfyui-boot:base-cu124-pt25' | ||
# An environment for PyTorch 2.5, CUDA 12.4, Python 3.12 | ||
################################################################################ | ||
|
||
FROM yanwk/comfyui-boot:base-cu124 | ||
|
||
LABEL maintainer="YAN Wenkun <[email protected]>" | ||
|
||
RUN set -eu | ||
|
||
RUN --mount=type=cache,target=/var/cache/zypp \ | ||
zypper --gpg-auto-import-keys \ | ||
dist-upgrade --no-confirm --no-recommends --auto-agree-with-licenses | ||
|
||
################################################################################ | ||
# PyTorch Packages | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip list \ | ||
&& pip install \ | ||
--upgrade pip wheel setuptools | ||
|
||
ARG PIP_INDEX_URL="https://download.pytorch.org/whl/cu124" | ||
ARG PIP_EXTRA_INDEX_URL="https://pypi.org/simple" | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install \ | ||
--dry-run xformers==0.0.28.post3 torch==2.5.1 torchvision torchaudio | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install \ | ||
--no-deps torch==2.5.1 | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install \ | ||
--no-deps xformers==0.0.28.post3 torch==2.5.1 | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install \ | ||
xformers==0.0.28.post3 torch==2.5.1 torchvision torchaudio | ||
|
||
ARG PIP_INDEX_URL= | ||
ARG PIP_EXTRA_INDEX_URL= | ||
|
||
# Bind libs (.so files) | ||
# Even we have CUDA installed by Zypper, we still need to install CUDA libs for Python in order to run PyTorch. | ||
# What's more, NVIDIA's openSUSE15 repo didn't provide CuDNN & NCCL, we have to use Python packages anyway. | ||
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}\ | ||
:/usr/local/lib64/python3.12/site-packages/torch/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/cuda_cupti/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/cuda_runtime/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/cudnn/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/cufft/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/cublas/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/cuda_nvrtc/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/curand/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/cusolver/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/cusparse/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/nccl/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/nvjitlink/lib\ | ||
:/usr/local/lib/python3.12/site-packages/nvidia/nvtx/lib" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
################################################################################ | ||
# Dockerfile that builds 'yanwk/comfyui-boot:base-cu124' | ||
# An environment for CUDA 12.4, Python 3.12 | ||
################################################################################ | ||
|
||
FROM docker.io/opensuse/tumbleweed:latest | ||
|
||
LABEL maintainer="YAN Wenkun <[email protected]>" | ||
|
||
RUN set -eu | ||
|
||
################################################################################ | ||
# NVIDIA CUDA devel | ||
# Ref: https://gitlab.com/nvidia/container-images/cuda/ | ||
# Break down the steps, so we have more but smaller image layers. | ||
|
||
RUN --mount=type=cache,target=/var/cache/zypp \ | ||
printf "\ | ||
[cuda-opensuse15-x86_64]\n\ | ||
name=cuda-opensuse15-x86_64\n\ | ||
baseurl=https://developer.download.nvidia.com/compute/cuda/repos/opensuse15/x86_64\n\ | ||
enabled=1\n\ | ||
gpgcheck=1\n\ | ||
gpgkey=https://developer.download.nvidia.com/compute/cuda/repos/opensuse15/x86_64/D42D0685.pub\n" \ | ||
> /etc/zypp/repos.d/cuda-opensuse15.repo \ | ||
&& zypper --gpg-auto-import-keys \ | ||
install --no-confirm --no-recommends --auto-agree-with-licenses \ | ||
cuda-cccl-12-4 \ | ||
cuda-command-line-tools-12-4 \ | ||
cuda-compat-12-4 \ | ||
cuda-cudart-12-4 \ | ||
cuda-minimal-build-12-4 \ | ||
cuda-nvcc-12-4 \ | ||
cuda-nvprof-12-4 \ | ||
cuda-nvtx-12-4 \ | ||
libcublas-12-4 \ | ||
libnpp-12-4 | ||
|
||
RUN --mount=type=cache,target=/var/cache/zypp \ | ||
zypper --gpg-auto-import-keys \ | ||
install --no-confirm --no-recommends --auto-agree-with-licenses \ | ||
cuda-cudart-devel-12-4 \ | ||
cuda-nvml-devel-12-4 \ | ||
cuda-nvrtc-devel-12-4 \ | ||
libcublas-devel-12-4 \ | ||
libnpp-devel-12-4 | ||
|
||
RUN --mount=type=cache,target=/var/cache/zypp \ | ||
zypper --gpg-auto-import-keys \ | ||
install --no-confirm --no-recommends --auto-agree-with-licenses \ | ||
cuda-libraries-12-4 | ||
|
||
RUN --mount=type=cache,target=/var/cache/zypp \ | ||
zypper --gpg-auto-import-keys \ | ||
install --no-confirm --no-recommends --auto-agree-with-licenses \ | ||
cuda-libraries-devel-12-4 | ||
|
||
ENV PATH="${PATH}:/usr/local/cuda-12.4/bin" \ | ||
Check warning on line 58 in base-cu124/Dockerfile GitHub Actions / build-publish-base-cu124Variables should be defined before their use
Check warning on line 58 in base-cu124/Dockerfile GitHub Actions / build-publish-base-cu124Variables should be defined before their use
Check warning on line 58 in base-cu124/Dockerfile GitHub Actions / build-publish-base-cu124Variables should be defined before their use
Check warning on line 58 in base-cu124/Dockerfile GitHub Actions / build-publish-base-cu124Variables should be defined before their use
|
||
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/cuda-12.4/lib64" \ | ||
LIBRARY_PATH="${LIBRARY_PATH}:/usr/local/cuda-12.4/lib64/stubs" \ | ||
CUDA_HOME="/usr/local/cuda-12.4" | ||
|
||
################################################################################ | ||
# Python and tools | ||
# Since this image is so big, we use openSUSE-verified PIP packages for compatibility. | ||
|
||
RUN --mount=type=cache,target=/var/cache/zypp \ | ||
zypper addrepo --check --refresh --priority 90 \ | ||
'https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/Essentials/' packman-essentials \ | ||
&& zypper --gpg-auto-import-keys \ | ||
install --no-confirm --auto-agree-with-licenses \ | ||
python312-devel \ | ||
python312-pip \ | ||
python312-wheel \ | ||
python312-setuptools \ | ||
python312-Cython \ | ||
python312-py-build-cmake \ | ||
python312-aiohttp \ | ||
python312-dbm \ | ||
python312-ffmpeg-python \ | ||
python312-GitPython \ | ||
python312-httpx \ | ||
python312-joblib \ | ||
python312-lark \ | ||
python312-matplotlib \ | ||
python312-mpmath \ | ||
python312-numba-devel \ | ||
python312-numpy1 \ | ||
python312-onnx \ | ||
python312-opencv \ | ||
python312-pandas \ | ||
python312-qrcode \ | ||
python312-rich \ | ||
python312-scikit-build \ | ||
python312-scikit-build-core-pyproject \ | ||
python312-scikit-image \ | ||
python312-scikit-learn \ | ||
python312-scipy \ | ||
python312-svglib \ | ||
python312-tqdm \ | ||
&& rm /usr/lib64/python3.12/EXTERNALLY-MANAGED \ | ||
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 100 | ||
|
||
RUN --mount=type=cache,target=/var/cache/zypp \ | ||
zypper --gpg-auto-import-keys \ | ||
install --no-confirm --auto-agree-with-licenses \ | ||
Mesa-libGL1 \ | ||
Mesa-libEGL-devel \ | ||
libgthread-2_0-0 \ | ||
make \ | ||
ninja \ | ||
git \ | ||
aria2 \ | ||
fish \ | ||
fd \ | ||
which \ | ||
vim \ | ||
opencv \ | ||
opencv-devel \ | ||
ffmpeg \ | ||
x264 \ | ||
x265 \ | ||
google-noto-sans-fonts \ | ||
google-noto-sans-cjk-fonts \ | ||
google-noto-coloremoji-fonts \ | ||
unzip 7zip | ||
|
||
################################################################################ | ||
# GCC 13 | ||
# Required for compiling CUDA 12.4-related code. | ||
|
||
RUN --mount=type=cache,target=/var/cache/zypp \ | ||
zypper --gpg-auto-import-keys \ | ||
install --no-confirm --auto-agree-with-licenses \ | ||
gcc13 \ | ||
gcc13-c++ \ | ||
cpp13 \ | ||
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-13 90 \ | ||
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-13 90 \ | ||
&& update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-13 90 \ | ||
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 90 \ | ||
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 90 \ | ||
&& update-alternatives --install /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-13 90 \ | ||
&& update-alternatives --install /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-13 90 \ | ||
&& update-alternatives --install /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-13 90 \ | ||
&& update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-13 90 \ | ||
&& update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-13 90 \ | ||
&& update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-13 90 |
Oops, something went wrong.