Delete Dockerfile
Browse files- Dockerfile +0 -118
Dockerfile
DELETED
|
@@ -1,118 +0,0 @@
|
|
| 1 |
-
FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-devel
|
| 2 |
-
|
| 3 |
-
# Arguments to build Docker Image using CUDA
|
| 4 |
-
ARG USE_CUDA=1
|
| 5 |
-
ARG TORCH_ARCH=
|
| 6 |
-
|
| 7 |
-
ENV AM_I_DOCKER=True
|
| 8 |
-
ENV BUILD_WITH_CUDA=True
|
| 9 |
-
ENV CUDA_HOME=/usr/local/cuda-11.6/
|
| 10 |
-
ENV TORCH_CUDA_ARCH_LIST="3.5;5.0;6.0;6.1;7.0;7.5;8.0;8.6+PTX"
|
| 11 |
-
|
| 12 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
| 13 |
-
|
| 14 |
-
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
|
| 15 |
-
curl \
|
| 16 |
-
git \
|
| 17 |
-
wget \
|
| 18 |
-
vim \
|
| 19 |
-
sudo \
|
| 20 |
-
tar \
|
| 21 |
-
unzip \
|
| 22 |
-
openssh-server \
|
| 23 |
-
python3-pip \
|
| 24 |
-
build-essential \
|
| 25 |
-
ninja-build \
|
| 26 |
-
cmake \
|
| 27 |
-
swig \
|
| 28 |
-
libopenblas-dev \
|
| 29 |
-
ffmpeg \
|
| 30 |
-
libsm6 \
|
| 31 |
-
libxext6 \
|
| 32 |
-
libssl-dev \
|
| 33 |
-
zlib1g-dev \
|
| 34 |
-
libbz2-dev \
|
| 35 |
-
libreadline-dev \
|
| 36 |
-
libsqlite3-dev \
|
| 37 |
-
libncursesw5-dev \
|
| 38 |
-
xz-utils \
|
| 39 |
-
tk-dev \
|
| 40 |
-
libxml2-dev \
|
| 41 |
-
libxmlsec1-dev \
|
| 42 |
-
libffi-dev \
|
| 43 |
-
liblzma-dev \
|
| 44 |
-
python3-venv \
|
| 45 |
-
git-lfs \
|
| 46 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 47 |
-
|
| 48 |
-
# symlink for python3
|
| 49 |
-
RUN ln -s /usr/bin/python3 /usr/bin/python
|
| 50 |
-
|
| 51 |
-
# add user and his password
|
| 52 |
-
ENV USER=garage_docker
|
| 53 |
-
ARG UID=1000
|
| 54 |
-
ARG GID=1000
|
| 55 |
-
# default password
|
| 56 |
-
ARG PW=user
|
| 57 |
-
|
| 58 |
-
RUN useradd -m ${USER} --uid=${UID} && echo "${USER}:${PW}" | chpasswd && adduser ${USER} sudo
|
| 59 |
-
WORKDIR /home/${USER}
|
| 60 |
-
|
| 61 |
-
# create some directories for mounting volumes
|
| 62 |
-
RUN mkdir Garage && chown -R ${UID}:${GID} /home/${USER}
|
| 63 |
-
COPY . /home/${USER}/Garage
|
| 64 |
-
|
| 65 |
-
USER root
|
| 66 |
-
|
| 67 |
-
# Ensure proper permissions for the Garage directory
|
| 68 |
-
RUN chown -R ${UID}:${GID} /home/${USER}/Garage
|
| 69 |
-
RUN chmod -R u+w /home/${USER}/Garage
|
| 70 |
-
|
| 71 |
-
USER ${UID}:${GID}
|
| 72 |
-
|
| 73 |
-
ENV PATH="/home/${USER}/.local/bin:$PATH"
|
| 74 |
-
|
| 75 |
-
# Configure Git to trust the repository's directory
|
| 76 |
-
RUN git config --global --add safe.directory /home/${USER}/Garage
|
| 77 |
-
|
| 78 |
-
# create venv
|
| 79 |
-
ENV VIRTUAL_ENV="/home/${USER}/.venv"
|
| 80 |
-
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
| 81 |
-
RUN python -m venv $VIRTUAL_ENV
|
| 82 |
-
|
| 83 |
-
COPY requirements.txt /tmp/requirements.txt
|
| 84 |
-
RUN python3 -m pip install -r /tmp/requirements.txt
|
| 85 |
-
|
| 86 |
-
# Install PyTorch with the correct CUDA version
|
| 87 |
-
RUN pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 -f https://download.pytorch.org/whl/torch_stable.html
|
| 88 |
-
|
| 89 |
-
# install models for segmentation
|
| 90 |
-
RUN python -m pip install --no-cache-dir -e /home/${USER}/Garage/Garage/models/GroundedSegmentAnything/segment_anything
|
| 91 |
-
# When using build isolation, PyTorch with newer CUDA is installed and can't compile GroundingDINO
|
| 92 |
-
RUN python -m pip install --no-cache-dir wheel
|
| 93 |
-
WORKDIR /home/${USER}/Garage/Garage/models/GroundedSegmentAnything/GroundingDINO
|
| 94 |
-
RUN python /home/${USER}/Garage/Garage/models/GroundedSegmentAnything/GroundingDINO/setup.py build
|
| 95 |
-
RUN python /home/${USER}/Garage/Garage/models/GroundedSegmentAnything/GroundingDINO/setup.py install
|
| 96 |
-
|
| 97 |
-
# download weights
|
| 98 |
-
WORKDIR /home/${USER}/Garage/Garage/models
|
| 99 |
-
RUN mkdir checkpoints && chown -R ${UID}:${GID} /home/${USER}
|
| 100 |
-
WORKDIR /home/${USER}/Garage/Garage/models/checkpoints
|
| 101 |
-
RUN mkdir GroundedSegmentAnything && chown -R ${UID}:${GID} /home/${USER}
|
| 102 |
-
WORKDIR /home/${USER}/Garage
|
| 103 |
-
|
| 104 |
-
RUN git lfs clone https://huggingface.co/JunhaoZhuang/PowerPaint-v2-1/ /home/${USER}/Garage/Garage/models/checkpoints/ppt-v2-1
|
| 105 |
-
RUN git lfs clone https://huggingface.co/llava-hf/llava-1.5-7b-hf /home/${USER}/Garage/Garage/models/checkpoints/llava-1.5-7b-hf
|
| 106 |
-
RUN git lfs clone https://huggingface.co/danulkin/llama /home/${USER}/Garage/Garage/models/checkpoints/llama-3-8b-Instruct
|
| 107 |
-
RUN wget -O /home/${USER}/Garage/Garage/models/checkpoints/GroundedSegmentAnything/sam_vit_h_4b8939.pth https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
|
| 108 |
-
RUN wget -O /home/${USER}/Garage/Garage/models/checkpoints/GroundedSegmentAnything/groundingdino_swint_ogc.pth https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth
|
| 109 |
-
|
| 110 |
-
# upgrade pip
|
| 111 |
-
ARG PIP_VERSION=23.3.1
|
| 112 |
-
ARG SETUPTOOLS_VERSION=68.2.2
|
| 113 |
-
RUN pip install pip==${PIP_VERSION} setuptools==${SETUPTOOLS_VERSION}
|
| 114 |
-
|
| 115 |
-
EXPOSE 7860
|
| 116 |
-
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 117 |
-
|
| 118 |
-
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|