-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
82 additions
and
9 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Nobrainer in a container | ||
|
||
The Dockerfiles in this directory can be used to create Docker images to use _Nobrainer_ on CPU or GPU. | ||
|
||
## Build images | ||
|
||
```bash | ||
cd /code/nobrainer # Top-level nobrainer directory | ||
docker build -t neuronets/nobrainer:master-cpu -f docker/cpu.Dockerfile . | ||
docker build -t neuronets/nobrainer:master-gpu -f docker/gpu.Dockerfile . | ||
``` | ||
|
||
# Convert Docker images to Singularity containers | ||
|
||
Using Singularity version 3.x, Docker images can be converted to Singularity containers using the `singularity` command-line tool. | ||
|
||
## Pulling from DockerHub | ||
|
||
In most cases (e.g., working on a HPC cluster), the _Nobrainer_ singularity container can be created with: | ||
|
||
```bash | ||
singularity pull docker://neuronets/nobrainer:master-gpu | ||
``` | ||
|
||
## Building from local Docker cache | ||
|
||
If you built a _Nobrainer_ Docker images locally and would like to convert it to a Singularity container, you can do so with: | ||
|
||
```bash | ||
sudo singularity pull docker-daemon://neuronets/nobrainer:master-gpu | ||
``` | ||
|
||
Please note the use of `sudo` here. This is necessary for interacting with the Docker daemon. |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM tensorflow/tensorflow:2.14.0-jupyter | ||
RUN curl -sSL http://neuro.debian.net/lists/focal.us-nh.full | tee /etc/apt/sources.list.d/neurodebian.sources.list \ | ||
&& export GNUPGHOME="$(mktemp -d)" \ | ||
&& echo "disable-ipv6" >> ${GNUPGHOME}/dirmngr.conf \ | ||
&& (apt-key adv --homedir $GNUPGHOME --recv-keys --keyserver hkp://pgpkeys.eu 0xA5D32F012649A5A9 \ | ||
|| { curl -sSL http://neuro.debian.net/_static/neuro.debian.net.asc | apt-key add -; } ) \ | ||
&& apt-get update \ | ||
&& apt-get install -y git-annex-standalone git \ | ||
&& rm -rf /tmp/* | ||
COPY [".", "/opt/nobrainer"] | ||
RUN cd /opt/nobrainer \ | ||
&& sed -i 's/tensorflow >=/tensorflow-cpu >=/g' setup.cfg | ||
RUN python3 -m pip install --no-cache-dir /opt/nobrainer datalad datalad-osf | ||
RUN git config --global user.email "neuronets@example.com" \ | ||
&& git config --global user.name "Neuronets maintainers" | ||
RUN datalad clone https://github.com/neuronets/trained-models /models \ | ||
&& cd /models && git-annex enableremote osf-storage \ | ||
&& datalad get -s osf-storage . | ||
ENV LC_ALL=C.UTF-8 \ | ||
LANG=C.UTF-8 | ||
WORKDIR "/work" | ||
LABEL maintainer="Satrajit Ghosh <satrajit.ghosh@gmail.com>" | ||
ENTRYPOINT ["nobrainer"] |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM tensorflow/tensorflow:2.14.0-gpu-jupyter | ||
RUN curl -sSL http://neuro.debian.net/lists/focal.us-nh.full | tee /etc/apt/sources.list.d/neurodebian.sources.list \ | ||
&& export GNUPGHOME="$(mktemp -d)" \ | ||
&& echo "disable-ipv6" >> ${GNUPGHOME}/dirmngr.conf \ | ||
&& (apt-key adv --homedir $GNUPGHOME --recv-keys --keyserver hkp://pgpkeys.eu 0xA5D32F012649A5A9 \ | ||
|| { curl -sSL http://neuro.debian.net/_static/neuro.debian.net.asc | apt-key add -; } ) \ | ||
&& apt-get update \ | ||
&& apt-get install -y git-annex-standalone git \ | ||
&& rm -rf /tmp/* | ||
COPY [".", "/opt/nobrainer"] | ||
RUN cd /opt/nobrainer | ||
RUN python3 -m pip install --no-cache-dir /opt/nobrainer datalad datalad-osf | ||
RUN git config --global user.email "neuronets@example.com" \ | ||
&& git config --global user.name "Neuronets maintainers" | ||
RUN datalad clone https://github.com/neuronets/trained-models /models \ | ||
&& cd /models && git-annex enableremote osf-storage \ | ||
&& datalad get -s osf-storage . | ||
ENV LC_ALL=C.UTF-8 \ | ||
LANG=C.UTF-8 | ||
WORKDIR "/work" | ||
LABEL maintainer="Satrajit Ghosh <satrajit.ghosh@gmail.com>" | ||
ENTRYPOINT ["nobrainer"] |