-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
90 lines (67 loc) · 2.83 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# FROM nvidia/cuda:11.6.2-base-ubuntu20.04
FROM nvidia/cuda:12.3.1-devel-ubuntu22.04
# Add some dependencies
ENV DEBIAN_FRONTEND=noninteractive
# Change the UID of the apt user to work in rootless container.
RUN sed -i 's/_apt:x:100:65534/_apt:x:100:100/g' /etc/passwd
# Explicitly pull the 55 version of the cuda-drivers, to work
# with the L4 GPUs in the hosting machine. Otherwise ubuntu
# pulls the wrong version automatically (535) with the toolkit.
RUN apt-get update && apt-get install -y --no-install-recommends \
git cuda-drivers-555 pkg-config libopenblas-dev
# Install any needed packages specified in requirements.txt
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
ca-certificates \
vim \
less \
make \
git \
jq \
nodejs \
npm
# Note: npm installation is insanesly slow!
RUN apt-get install -y --no-install-recommends cpio
RUN rm -rf /var/lib/apt/lists/*
# Define the version of Miniconda to install
ENV MINICONDA_VERSION=py310_24.7.1-0
ENV PYTHON_VERSION=3.10
# Define the Miniconda installer filename
ENV INSTALLER=Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh
# Define the installation directory
ENV INSTALL_DIR=/opt/miniconda3
# Download the Miniconda installer
RUN wget --no-check-certificate "https://repo.anaconda.com/miniconda/$INSTALLER" -O /tmp/miniconda.sh
# Install Miniconda
RUN /bin/bash /tmp/miniconda.sh -b -p $INSTALL_DIR \
&& rm /tmp/miniconda.sh
# Add Miniconda to PATH
ENV PATH=$INSTALL_DIR/bin:$PATH
# Initialize Miniconda
RUN conda init --all
# Set channel_priority to flexible
RUN conda config --set channel_priority flexible
# Clone the repository ([email protected]:epigen/cellwhisperer.git --recurse-submodules) (or copy it in this case)
# RUN git clone [email protected]:epigen/cellwhisperer.git --recurse-submodules /opt/cellwhisperer
COPY --chmod=0755 . /opt/cellwhisperer
# Change the working directory
WORKDIR /opt/cellwhisperer
# Ignore SSL issues arising from proxy-ing (also for wget)
RUN npm config set strict-ssl false
# Install the dependencies
RUN conda env create -f envs/main.yaml
RUN conda env create -f envs/llava.yaml
RUN conda env create -f envs/llama_cpp.yaml
# Activate the environment
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
# Build the web app
RUN git config --global --add safe.directory /opt/cellwhisperer/modules/cellxgene
RUN git config --global --add safe.directory /opt/cellwhisperer
RUN cd modules/cellxgene && CONDA_ENV=cellwhisperer /entrypoint.sh make build-for-server-dev
# [Optional] Install scgpt
# RUN CONDA_ENV=cellwhisperer /entrypoint.sh bash envs/install_scgpt_after_env_creation.sh
# Initialize an empty git repo (the original one is ignored by .dockerignore), such that all the `git rev-parse` commands works
RUN git init
# Set the default command to run when creating a new container
CMD [ "/bin/bash" ]