dockerfile updates

This commit is contained in:
doctorpangloss 2025-07-16 14:11:05 -07:00
parent f23fe2e2cf
commit e67684e669
4 changed files with 60 additions and 18 deletions

View File

@ -25,10 +25,23 @@ jobs:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6 - name: Build and push CUDA (NVIDIA) image
uses: docker/build-push-action@v6
with: with:
context: . context: .
file: ./Dockerfile
push: true push: true
tags: | tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-cuda
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-cuda
- name: Build and push ROCm (AMD) image
uses: docker/build-push-action@v6
with:
context: .
file: ./amd.Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-rocm
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-rocm

View File

@ -1,6 +1,6 @@
FROM nvcr.io/nvidia/pytorch:25.03-py3 FROM nvcr.io/nvidia/pytorch:25.03-py3
ARG TZ="America/Los_Angeles" ENV TZ="Etc/UTC"
ENV PYTORCH_CUDA_ALLOC_CONF="backend:cudaMallocAsync" ENV PYTORCH_CUDA_ALLOC_CONF="backend:cudaMallocAsync"
ENV UV_COMPILE_BYTECODE=1 ENV UV_COMPILE_BYTECODE=1
@ -9,23 +9,29 @@ ENV UV_SYSTEM_PYTHON=1
ENV UV_BREAK_SYSTEM_PACKAGES=1 ENV UV_BREAK_SYSTEM_PACKAGES=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1 ENV PIP_NO_CACHE_DIR=1
ENV DEBIAN_FRONTEND="noninteractive" ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
# mitigates # mitigates
# RuntimeError: Failed to import transformers.generation.utils because of the following error (look up to see its traceback): # RuntimeError: Failed to import transformers.generation.utils because of the following error (look up to see its traceback):
# numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject # numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
RUN echo "numpy<2" >> numpy-override.txt RUN echo "numpy<2" >> numpy-override.txt
# mitigates https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
# mitigates AttributeError: module 'cv2.dnn' has no attribute 'DictValue' \ # mitigates AttributeError: module 'cv2.dnn' has no attribute 'DictValue' \
# see https://github.com/facebookresearch/nougat/issues/40 # see https://github.com/facebookresearch/nougat/issues/40
RUN pip install uv && uv --version && \ RUN apt-get update && \
apt-get update && apt-get install --no-install-recommends ffmpeg libsm6 libxext6 -y && \ apt-get install --no-install-recommends -y tzdata ffmpeg libsm6 libxext6 && \
pip install uv && uv --version && \
apt-get purge -y --auto-remove tzdata && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
RUN uv pip uninstall --system $(pip list --format=freeze | grep opencv) && \ RUN uv pip uninstall --system $(pip list --format=freeze | grep opencv) && \
rm -rf /usr/local/lib/python3.12/dist-packages/cv2/ && \ rm -rf /usr/local/lib/python3.12/dist-packages/cv2/ && \
uv pip install --no-build-isolation opencv-python-headless uv pip install --no-build-isolation opencv-python-headless
RUN uv pip install --overrides=numpy-override.txt "comfyui[attention,comfyui_manager]@git+https://github.com/hiddenswitch/ComfyUI.git" && \
RUN uv pip install --overrides=numpy-override.txt "comfyui[attention,comfyui_manager]@git+https://github.com/hiddenswitch/ComfyUI.git"
WORKDIR /workspace WORKDIR /workspace
# addresses https://github.com/pytorch/pytorch/issues/104801 # addresses https://github.com/pytorch/pytorch/issues/104801

View File

@ -1,6 +1,35 @@
FROM rocm/pytorch:rocm6.0.2_ubuntu22.04_py3.10_pytorch_2.1.2 FROM rocm/pytorch:rocm6.4.1_ubuntu24.04_py3.12_pytorch_release_2.7.1
RUN pip install --no-cache --no-build-isolation git+https://github.com/hiddenswitch/ComfyUI.git
EXPOSE 8188 ENV TZ="Etc/UTC"
ENV UV_COMPILE_BYTECODE=1
ENV UV_NO_CACHE=1
ENV UV_SYSTEM_PYTHON=1
ENV UV_BREAK_SYSTEM_PACKAGES=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
# - ffmpeg and CV2 dependencies are for media handling.
# mitigates AttributeError: module 'cv2.dnn' has no attribute 'DictValue' \
# see https://github.com/facebookresearch/nougat/issues/40
RUN apt-get update && \
apt-get install --no-install-recommends -y ffmpeg libsm6 libxext6 && \
pip install uv && uv --version && \
apt-get purge -y --auto-remove tzdata && \
rm -rf /var/lib/apt/lists/*
RUN uv pip uninstall --system $(pip list --format=freeze | grep opencv) && \
rm -rf /usr/local/lib/python3.12/dist-packages/cv2/ && \
uv pip install --no-build-isolation opencv-python-headless
RUN uv pip install --overrides=numpy-override.txt "comfyui[attention,comfyui_manager]@git+https://github.com/hiddenswitch/ComfyUI.git"
WORKDIR /workspace WORKDIR /workspace
RUN comfyui --quick-test-for-ci --cpu --cwd /workspace RUN comfyui --quick-test-for-ci --cpu --cwd /workspace
CMD ["/usr/local/bin/comfyui", "--listen"]
EXPOSE 8188
CMD ["python", "-m", "comfy.cmd.main", "--listen"]

View File

@ -1,6 +0,0 @@
FROM intel/intel-optimized-pytorch:2.3.0-pip-base
RUN pip install --no-cache --no-build-isolation git+https://github.com/hiddenswitch/ComfyUI.git
EXPOSE 8188
WORKDIR /workspace
RUN comfyui --quick-test-for-ci --cpu --cwd /workspace
CMD ["/usr/local/bin/comfyui", "--listen"]