From ec88293c956881ea3fae49a7660e5b99e5724129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Tue, 24 Jan 2023 14:34:55 +0100 Subject: [PATCH 1/2] Update main dockerfile --- docker/dockerfile | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/docker/dockerfile b/docker/dockerfile index 07493388e..e54109b5f 100644 --- a/docker/dockerfile +++ b/docker/dockerfile @@ -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" ] \ No newline at end of file From 922c82e09e38f5eb309fefda898d5029a951864b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Tue, 24 Jan 2023 14:47:20 +0100 Subject: [PATCH 2/2] Update README --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 67a001931..a77ac4769 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,34 @@ depending on your setup to your `.bashrc` script or similar to make sure that th +
+Running in Docker +
+ +If you want to run GraphNeT (with IceTray), and don't intend to contribute to the package, consider using the provided [Docker image](https://hub.docker.com/repository/docker/asogaard/graphnet). With Docker, you can then run GraphNeT as: +```bash +$ docker run --rm -it asogaard/graphnet:latest +🐳 graphnet@dc423315742c ❯ ~/graphnet $ python examples/01_icetray/01_convert_i3_files.py sqlite icecube-upgrade +graphnet: INFO 2023-01-24 13:41:27 - get_logger - Writing log to logs/graphnet_20230124-134127.log +(...) +graphnet: INFO 2023-01-24 13:41:46 - SQLiteDataConverter.info - Saving results to /root/graphnet/data/examples/outputs/convert_i3_files/ic86 +graphnet: INFO 2023-01-24 13:41:46 - SQLiteDataConverter.info - Processing 1 I3 file(s) in main thread (not multiprocessing) + 0%| | 0/1 [00:00 +
+ ## :ringed_planet: Use cases @@ -170,4 +198,4 @@ GraphNeT has an Apache 2.0 license, as found in the [LICENSE](LICENSE) file. This project has received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie SkΕ‚odowska-Curie grant agreement No. 890778, and the PUNCH4NFDI consortium via DFG fund β€œNFDI39/1”. -[^1]: Examples of this are shown in the [examples/convert_i3_files.py](examples/convert_i3_files.py) script +[^1]: Examples of this are shown in the [examples/01_icetray/01_convert_i3_files.py](./examples/01_icetray/01_convert_i3_files.py) script