diff --git a/.gitignore b/.gitignore index 325e5fd264..c6fdf69070 100644 --- a/.gitignore +++ b/.gitignore @@ -141,3 +141,4 @@ dmypy.json # Pyre type checker .pyre/ +*.tar diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..55958d1044 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# Use NVIDIA CUDA base image with Python 3.10 +FROM hale0007/cuda11.8-conda-ubuntu22.04 AS base + +FROM base AS controlnet-env +# We inherit from conda-install which has both system deps and conda +COPY environment.yaml . +RUN mamba env create -f environment.yaml + +# Set default environment variables +ENV PATH /opt/conda/envs/diffinf/bin:$PATH +ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:$LD_LIBRARY_PATH +ENV CUDA_VISIBLE_DEVICES=0 + +WORKDIR /app + diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000000..2591922718 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,34 @@ +version: '3' + +services: + controlnet: + image: controlnet:latest + user: root + ports: + - "6006:6006" # Add this line + volumes: + - /usr/local/share/ca-certificates/verdi.crt:/usr/local/share/ca-certificates/verdi.crt + - ./entrypoint.sh:/entrypoint.sh + - ../ControlNet:/app/ControlNet + environment: + - HTTP_PROXY=https://10.253.254.250:3130/ + - HTTPS_PROXY=https://10.253.254.250:3130/ + - http_proxy=https://10.253.254.250:3130/ + - https_proxy=https://10.253.254.250:3130/ + - REQUESTS_CA_BUNDLE=/usr/local/share/ca-certificates/verdi.crt + - CUDA_VISIBLE_DEVICES=0,1,2,3 + entrypoint: ["/bin/bash", "/entrypoint.sh"] + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: all + capabilities: [gpu] + # Add these important networking configs + network_mode: "host" # This is crucial for NCCL communication + ipc: host # Required for proper shared memory access + ulimits: # Add proper system limits + memlock: -1 + stack: 67108864 + shm_size: '64gb' # Adjust based on your needs \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000000..685a19e858 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash +chmod 644 /usr/local/share/ca-certificates/verdi.crt +update-ca-certificates + +tail -f /dev/null