Skip to content

Commit

Permalink
Add 'dev' for testing purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
YanWenKun committed Mar 17, 2024
1 parent 8b999c4 commit 446ebed
Show file tree
Hide file tree
Showing 2 changed files with 145 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish "dev" to Docker Hub

on:
workflow_dispatch: # Can be manually triggered

jobs:

build-publish-dev:
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 'dev'
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile-dev
tags: yanwk/comfyui-boot:dev
push: true

105 changes: 105 additions & 0 deletions docs/Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
################################################################################
# Dockerfile that builds 'yanwk/comfyui-boot:dev'
################################################################################

FROM opensuse/tumbleweed:latest

LABEL maintainer="code@yanwk.fun"

# Note: GCC for InsightFace, FFmpeg for video
RUN --mount=type=cache,target=/var/cache/zypp \
set -eu \
&& zypper install --no-confirm \
python311 python311-pip python311-wheel python311-setuptools \
python311-devel python311-Cython gcc-c++ cmake \
python311-av python311-ffmpeg-python python311-numpy ffmpeg \
google-noto-sans-fonts google-noto-sans-cjk-fonts google-noto-coloremoji-fonts \
shadow git aria2 \
Mesa-libGL1 libgthread-2_0-0 \
&& rm /usr/lib64/python3.11/EXTERNALLY-MANAGED

RUN --mount=type=cache,target=/root/.cache/pip \
pip install --break-system-packages \
--upgrade pip wheel setuptools Cython numpy

# Install xFormers (stable version, will specify PyTorch version),
# and Torchvision + Torchaudio (will downgrade to match xFormers' PyTorch version).
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --break-system-packages \
xformers torchvision torchaudio \
--index-url https://download.pytorch.org/whl/cu121 \
--extra-index-url https://pypi.org/simple \

# Upgrade xFormers to dev version, while keeping most deps at stable version.
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --break-system-packages \
--pre --upgrade xformers \
--index-url https://download.pytorch.org/whl/cu121 \
--extra-index-url https://pypi.org/simple

# Install ONNX Runtime(ORT) for CUDA 12.x
# ORT is used by DWPose by controlnet_aux. But current ORT release on PyPI only supports CUDA 11.8.
# This fix should be removed once ORT done upgrade.
# Ref: https://onnxruntime.ai/docs/install/
# Ref: https://github.com/Fannovel16/comfyui_controlnet_aux/issues/75
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --break-system-packages \
onnxruntime onnxruntime-gpu \
--index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ \
--extra-index-url https://pypi.org/simple

# Dependencies for: ComfyUI,
# InstantID, ControlNet Auxiliary Preprocessors, Frame Interpolation,
# ComfyUI-Manager, Inspire-Pack, Impact-Pack, "Essentials", Face Analysis,
# Efficiency Nodes, Crystools, FizzNodes, smZNodes(compel, lark)
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --break-system-packages \
-r https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/requirements.txt \
-r https://raw.githubusercontent.com/ZHO-ZHO-ZHO/ComfyUI-InstantID/main/requirements.txt \
-r https://raw.githubusercontent.com/Fannovel16/comfyui_controlnet_aux/main/requirements.txt \
-r https://raw.githubusercontent.com/Fannovel16/ComfyUI-Frame-Interpolation/main/requirements-with-cupy.txt \
-r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/requirements.txt \
-r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Inspire-Pack/main/requirements.txt \
-r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Impact-Pack/Main/requirements.txt \
-r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Impact-Subpack/main/requirements.txt \
-r https://raw.githubusercontent.com/cubiq/ComfyUI_essentials/main/requirements.txt \
-r https://raw.githubusercontent.com/cubiq/ComfyUI_FaceAnalysis/main/requirements.txt \
-r https://raw.githubusercontent.com/jags111/efficiency-nodes-comfyui/main/requirements.txt \
-r https://raw.githubusercontent.com/crystian/ComfyUI-Crystools/main/requirements.txt \
-r https://raw.githubusercontent.com/FizzleDorf/ComfyUI_FizzNodes/main/requirements.txt \
compel lark

# Fix for libs (.so files)
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}\
:/usr/lib64/python3.11/site-packages/torch/lib\
:/usr/lib/python3.11/site-packages/nvidia/cuda_cupti/lib\
:/usr/lib/python3.11/site-packages/nvidia/cuda_runtime/lib\
:/usr/lib/python3.11/site-packages/nvidia/cudnn/lib\
:/usr/lib/python3.11/site-packages/nvidia/cufft/lib"

# More libs (not necessary, just in case)
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}\
:/usr/lib/python3.11/site-packages/nvidia/cublas/lib\
:/usr/lib/python3.11/site-packages/nvidia/cuda_nvrtc/lib\
:/usr/lib/python3.11/site-packages/nvidia/curand/lib\
:/usr/lib/python3.11/site-packages/nvidia/cusolver/lib\
:/usr/lib/python3.11/site-packages/nvidia/cusparse/lib\
:/usr/lib/python3.11/site-packages/nvidia/nccl/lib\
:/usr/lib/python3.11/site-packages/nvidia/nvjitlink/lib\
:/usr/lib/python3.11/site-packages/nvidia/nvtx/lib"

# Create a low-privilege user
RUN printf 'CREATE_MAIL_SPOOL=no' >> /etc/default/useradd \
&& mkdir -p /home/runner /home/scripts \
&& groupadd runner \
&& useradd runner -g runner -d /home/runner \
&& chown runner:runner /home/runner /home/scripts

COPY --chown=runner:runner scripts/. /home/scripts/

USER runner:runner
VOLUME /home/runner
WORKDIR /home/runner
EXPOSE 8188
ENV CLI_ARGS=""
CMD ["bash","/home/scripts/entrypoint.sh"]

0 comments on commit 446ebed

Please sign in to comment.