-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #387 from asogaard/update-docker
Update Docker image
- Loading branch information
Showing
2 changed files
with
62 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,42 @@ | ||
FROM icecube/icetray:combo-stable | ||
# Reference image (large), for missing components. | ||
FROM icecube/icetray:combo-stable as combo | ||
|
||
ARG TORCH=1.9.1 | ||
ARG PYG=2.0.1 | ||
ARG CUDA=cpu | ||
# Base image. | ||
FROM icecube/icetray:combo-stable-slim as main | ||
|
||
# Argument(s). | ||
ARG HARDWARE=cpu | ||
|
||
# Copy over missing libraries in slim. | ||
COPY --from=combo /usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.71.0 /usr/lib/x86_64-linux-gnu/ | ||
COPY --from=combo /usr/lib/x86_64-linux-gnu/libboost_atomic.so.1.71.0 /usr/lib/x86_64-linux-gnu/ | ||
|
||
# Install pip. | ||
RUN wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py && rm get-pip.py | ||
|
||
# Updating python packages. Specific to `icecube/icetray:combo*`. | ||
RUN pip install --upgrade pip && \ | ||
pip install wheel setuptools==59.5.0 && \ | ||
pip install --upgrade astropy && \ | ||
pip install --ignore-installed PyYAML && \ | ||
pip install torch==${TORCH}+${CUDA} -f https://download.pytorch.org/whl/${CUDA}/torch_stable.html && \ | ||
pip install torch-cluster==1.5.9 -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html && \ | ||
pip install torch-scatter==2.0.9 -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html && \ | ||
pip install torch-sparse==0.6.12 -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html && \ | ||
pip install torch-spline-conv==1.2.1 -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html && \ | ||
pip install torch-geometric==${PYG} -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html | ||
pip install --ignore-installed PyYAML | ||
|
||
# Copy checked out package code to appropriate destination in image. | ||
WORKDIR /root/graphnet | ||
ADD . /root/graphnet/ | ||
|
||
# Install GraphNeT and required dependencies. | ||
RUN pip install -r requirements/torch_${HARDWARE}.txt | ||
RUN pip install -e .[develop,torch] | ||
|
||
# Create missing alias(es) in slim. | ||
RUN echo 'alias python="python3"' >> ~/.bashrc | ||
|
||
RUN pip install git+https://github.com/icecube/graphnet.git#egg=graphnet[develop,torch] | ||
# Stylise command line prompt | ||
RUN echo 'PS1="🐳 \[\033[38;2;86;138;242m\]graphnet@\h \[\033[0m\]❯ \[\033[0;34m\]\w \[\033[0m\]\$ "' >> ~/.bashrc | ||
RUN echo 'PS2="\[\033[38;5;236m\]❯\[\033[38;5;239m\]❯\[\033[0m\]❯ "' >> ~/.bashrc | ||
|
||
WORKDIR /root | ||
# Enable colours in terminal. | ||
#ENV TERM xterm-256color | ||
|
||
# Default command for executing container. | ||
CMD [ "/bin/bash" ] |