Build of https://github.com/MIC-DKFZ/nnUNet for HPC
2.9K
# Pull base image.
FROM nvidia/cuda:10.2-devel-ubuntu16.04
MAINTAINER Nathaniel Butterworth USYD SIH
#Create some directories to work with on Artmeis
RUN mkdir /project && mkdir /scratch
Install ubuntu libraires and packages
RUN apt-get update -y && \
apt-get install git curl -y && \
rm -rf /var/lib/apt/lists/*
#Set some environemnt variables we will need
ENV PATH="/build/miniconda3/bin:${PATH}"
ARG PATH="/build/miniconda3/bin:${PATH}"
WORKDIR /build
#Install Python3 we can use
RUN curl -O https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.3-Linux-x86_64.sh &&\
mkdir /build/.conda && \
bash Miniconda3-py38_4.8.3-Linux-x86_64.sh -b -p /build/miniconda3 &&\
rm -rf /Miniconda3-py38_4.8.3-Linux-x86_64.sh
WORKDIR /build
#Install packages
RUN conda install pip
RUN pip install --upgrade pip
RUN pip install nnunet
Build a Sinularity image with:
sudo singularity build nnunet.img docker://nbutter/nnunet
Oryou can probably get away with actually just building this on Artemis (without using sudo).
How the Dockerfile was built and uploaded here
#To build the new repo
docker build . -t nnunet
#The push it here
docker push nbutter/nnunet:tagname
I originally tried to build this image by modifying an existing container, by doing the following...
#Pull the image and build it as a "sandbox" containter so you can make changes to it
ubuntu@sing:~$ sudo singularity build --sandbox pyslowfast.img docker://nbutter/pyfastslow
#Run the image interactively, with write permission, so you can install additional packages
ubuntu@sing:~$ sudo singularity shell --writable pyslowfast.img
#Inside the container make any required changes, i.e:
Singularity> pip install nnunet
Singularity> exit
#OPTIONAL: After exiting the container, now rebuild as non-writeable image
ubuntu@sing:~$ sudo singularity build nnunet.img pyslowfast.img
Surprisingly, this worked fine on my local machine when running this did not work on Artemis, but it did work locally.
Running uunet in the container on Artemis gave an error of Python not being able to transcode some of the header text.
UnicodeEncodeError: 'ascii' codec can't encode character '\xe4'...
My thoughts are that it was uunet was using some part of the system Python, so that is why it worked locally, but fails on Artemis?? Maybe.
Singularity commmand run local/on Artemis.
singularity exec nnunet.simg /bin/bash -c "export nnUNet_raw_data_base='/project/Training/PROJECTS/singularity_pytorch_maryam/nnUNet_raw' && export nnUNet_preprocessed='/project/Training/PROJECTS/singularity_pytorch_maryam/nnUNet_preprocessed' && export RESULTS_FOLDER='/project/Training/PROJECTS/singularity_pytorch_maryam/nnUNet_trained_models' && nnUNet_convert_decathlon_task -i Task05_Prostate/"
Content type
Image
Digest
Size
3.5 GB
Last updated
about 6 years ago
docker pull nbutter/nnunet