From 83857031b3ff3de7e496548db6391eb815e8b91f Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 15 Sep 2023 16:08:42 -0400 Subject: [PATCH 01/13] try circle ci --- .circleci/config.yml | 51 ++++++++++++++++++++++++++++++++++++++++ circleci/build_docker.sh | 27 +++++++++++++++++++++ circleci/push_docker.sh | 29 +++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 .circleci/config.yml create mode 100644 circleci/build_docker.sh create mode 100644 circleci/push_docker.sh diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..80f4b019 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,51 @@ +--- +version: 2.1 +jobs: + build: + machine: + # https://circleci.com/developer/machine/image/ubuntu-2204 + image: ubuntu-2204:2022.10.2 + steps: + - checkout + - run: + name: build docker image + command: | + cp ./circleci/build_docker.sh + bash build_docker.sh + - persist_to_workspace: + root: /home/circleci + paths: + - docker/image.tar + + deploy: + machine: + image: ubuntu-2204:2022.10.2 + steps: + - attach_workspace: + at: /tmp/workspace + - run: docker load -i /tmp/workspace/docker/image.tar + - run: + name: push to dockerhub + command: | + cp ./circleci/push_docker.sh + bash push_docker.sh + +workflows: + build_deploy: + jobs: + - build: + filters: + branches: + only: /.*/ + tags: + only: /.*/ + - deploy: + context: + - dockerhub + requires: + - build + filters: + branches: + only: /.*/ + tags: + only: /.*/ diff --git a/circleci/build_docker.sh b/circleci/build_docker.sh new file mode 100644 index 00000000..fc0cf006 --- /dev/null +++ b/circleci/build_docker.sh @@ -0,0 +1,27 @@ +#! /bin/bash + +set -eux -o pipefail + +# used to build the Docker image for a project in circle CI +# +# assumes that the docker has been cached in ${HOME}/docker/image.tar +# +# - save_cache: +# key: my_cache +# paths: +# - ~/docker +# - ~/data +# + +# make sure we have a lowercase repo +user_name="Inria-Empenn" +repo_name=$(echo "${CIRCLE_PROJECT_REPONAME}" | tr '[:upper:]' '[:lower:]') + +if [[ -e "${HOME}/docker/image.tar" ]]; then + docker load -i "${HOME}/docker/image.tar" +fi +git describe --tags --always > version +docker build -t "${user_name}/${repo_name}" . +mkdir -p "${HOME}/docker" +docker save "${user_name}/${repo_name}" > "${HOME}/docker/image.tar" +docker images diff --git a/circleci/push_docker.sh b/circleci/push_docker.sh new file mode 100644 index 00000000..895c5177 --- /dev/null +++ b/circleci/push_docker.sh @@ -0,0 +1,29 @@ +#! /bin/bash + +set -ex -o pipefail + +# used to push the Docker image for a project in circle CI + +if [[ -n "${DOCKER_TOKEN}" ]]; then + + # make sure we have a lowercase repo + user_name="Inria-Empenn" + repo_name=$(echo "${CIRCLE_PROJECT_REPONAME}" | tr '[:upper:]' '[:lower:]') + + echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_USER}" --password-stdin + + : "Pushing to DockerHub ${user_name}/${repo_name}:unstable" + docker tag "${user_name}/${repo_name}" "${user_name}/${repo_name}:unstable" + docker push "${user_name}/${repo_name}:unstable" + + if [[ -n "${CIRCLE_TAG}" ]]; then + : "Pushing to DockerHub ${user_name}/${repo_name}:${CIRCLE_TAG}" + docker push "${user_name}/${repo_name}:latest" + docker tag "${user_name}/${repo_name}" "${user_name}/${repo_name}:${CIRCLE_TAG}" + docker push "${user_name}/${repo_name}:${CIRCLE_TAG}" + fi + +else + : "No DOCKER_TOKEN, skipping push to DockerHub" + exit 1 +fi From f826c3a1cd3741e8c01c14c50989092deb9f3051 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 15 Sep 2023 16:12:52 -0400 Subject: [PATCH 02/13] fix cp --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 80f4b019..a14babc5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ jobs: - run: name: build docker image command: | - cp ./circleci/build_docker.sh + cp ./circleci/build_docker.sh build_docker.sh bash build_docker.sh - persist_to_workspace: root: /home/circleci @@ -27,7 +27,7 @@ jobs: - run: name: push to dockerhub command: | - cp ./circleci/push_docker.sh + cp ./circleci/push_docker.sh push_docker.sh bash push_docker.sh workflows: From 5058fe5cb6e732957adab6091462e95019006d81 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 15 Sep 2023 16:14:15 -0400 Subject: [PATCH 03/13] fix username --- circleci/build_docker.sh | 2 +- circleci/push_docker.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/circleci/build_docker.sh b/circleci/build_docker.sh index fc0cf006..2123338e 100644 --- a/circleci/build_docker.sh +++ b/circleci/build_docker.sh @@ -14,7 +14,7 @@ set -eux -o pipefail # # make sure we have a lowercase repo -user_name="Inria-Empenn" +user_name="remi-gau" repo_name=$(echo "${CIRCLE_PROJECT_REPONAME}" | tr '[:upper:]' '[:lower:]') if [[ -e "${HOME}/docker/image.tar" ]]; then diff --git a/circleci/push_docker.sh b/circleci/push_docker.sh index 895c5177..d3ff9ec2 100644 --- a/circleci/push_docker.sh +++ b/circleci/push_docker.sh @@ -7,7 +7,7 @@ set -ex -o pipefail if [[ -n "${DOCKER_TOKEN}" ]]; then # make sure we have a lowercase repo - user_name="Inria-Empenn" + user_name="remi-gau" repo_name=$(echo "${CIRCLE_PROJECT_REPONAME}" | tr '[:upper:]' '[:lower:]') echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_USER}" --password-stdin From 3546ba5404f7c95460aef52d42239f37f767578e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 16 Sep 2023 10:31:43 -0400 Subject: [PATCH 04/13] update docker recipe --- Dockerfile | 506 +++++++++++++++++++++++------------------------- INSTALL.md | 40 ++-- environment.yml | 4 +- makefile | 23 +++ 4 files changed, 284 insertions(+), 289 deletions(-) mode change 100755 => 100644 Dockerfile create mode 100644 makefile diff --git a/Dockerfile b/Dockerfile old mode 100755 new mode 100644 index 13b22194..c80935d7 --- a/Dockerfile +++ b/Dockerfile @@ -1,319 +1,291 @@ -# Generated by: Neurodocker version 0.7.0+0.gdc97516.dirty -# Latest release: Neurodocker version 0.7.0 -# Timestamp: 2021/11/09 11:04:47 UTC -# -# Thank you for using Neurodocker. If you discover any issues -# or ways to improve this software, please submit an issue or -# pull request on our GitHub repository: -# -# https://github.com/ReproNim/neurodocker +# Generated by Neurodocker and Reproenv. -FROM neurodebian:stretch-non-free - -USER root - -ARG DEBIAN_FRONTEND="noninteractive" - -ENV LANG="en_US.UTF-8" \ - LC_ALL="en_US.UTF-8" \ - ND_ENTRYPOINT="/neurodocker/startup.sh" -RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \ - && apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - apt-utils \ - bzip2 \ - ca-certificates \ +FROM centos:7 +RUN yum install -y -q \ + git \ + && yum clean all \ + && rm -rf /var/cache/yum/* +ENV ANTSPATH="/opt/ants-2.4.3/" \ + PATH="/opt/ants-2.4.3:$PATH" +RUN yum install -y -q \ curl \ - locales \ unzip \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ - && dpkg-reconfigure --frontend=noninteractive locales \ - && update-locale LANG="en_US.UTF-8" \ - && chmod 777 /opt && chmod a+s /opt \ - && mkdir -p /neurodocker \ - && if [ ! -f "$ND_ENTRYPOINT" ]; then \ - echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \ - && echo 'set -e' >> "$ND_ENTRYPOINT" \ - && echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" \ - && echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \ - fi \ - && chmod -R 777 /neurodocker && chmod a+s /neurodocker - -ENTRYPOINT ["/neurodocker/startup.sh"] - -RUN apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - git \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -ENV FSLDIR="/opt/fsl-6.0.3" \ - PATH="/opt/fsl-6.0.3/bin:$PATH" \ + && yum clean all \ + && rm -rf /var/cache/yum/* \ + && echo "Downloading ANTs ..." \ + && curl -fsSL -o ants.zip https://github.com/ANTsX/ANTs/releases/download/v2.4.3/ants-2.4.3-centos7-X64-gcc.zip \ + && unzip ants.zip -d /opt \ + && mv /opt/ants-2.4.3/bin/* /opt/ants-2.4.3 \ + && rm ants.zip +ENV FSLDIR="/opt/fsl-6.0.6.4" \ + PATH="/opt/fsl-6.0.6.4/bin:$PATH" \ FSLOUTPUTTYPE="NIFTI_GZ" \ FSLMULTIFILEQUIT="TRUE" \ - FSLTCLSH="/opt/fsl-6.0.3/bin/fsltclsh" \ - FSLWISH="/opt/fsl-6.0.3/bin/fslwish" \ + FSLTCLSH="/opt/fsl-6.0.6.4/bin/fsltclsh" \ + FSLWISH="/opt/fsl-6.0.6.4/bin/fslwish" \ FSLLOCKDIR="" \ FSLMACHINELIST="" \ FSLREMOTECALL="" \ FSLGECUDAQ="cuda.q" -RUN apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ +RUN yum install -y -q \ bc \ - dc \ + curl \ file \ - libfontconfig1 \ - libfreetype6 \ - libgl1-mesa-dev \ - libgl1-mesa-dri \ - libglu1-mesa-dev \ - libgomp1 \ - libice6 \ - libxcursor1 \ - libxft2 \ - libxinerama1 \ - libxrandr2 \ - libxrender1 \ - libxt6 \ + libGL \ + libGLU \ + libICE \ + libSM \ + libX11 \ + libXcursor \ + libXext \ + libXft \ + libXinerama \ + libXrandr \ + libXt \ + libgomp \ + libjpeg \ + libmng \ + libpng12 \ + nano \ + openblas-serial \ + python3 \ sudo \ wget \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && echo "Downloading FSL ..." \ - && mkdir -p /opt/fsl-6.0.3 \ - && curl -fsSL --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \ - | tar -xz -C /opt/fsl-6.0.3 --strip-components 1 \ - && sed -i '$iecho Some packages in this Docker container are non-free' $ND_ENTRYPOINT \ - && sed -i '$iecho If you are considering commercial use of this container, please consult the relevant license:' $ND_ENTRYPOINT \ - && sed -i '$iecho https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence' $ND_ENTRYPOINT \ - && sed -i '$isource $FSLDIR/etc/fslconf/fsl.sh' $ND_ENTRYPOINT \ - && echo "Installing FSL conda environment ..." \ - && bash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3 - -ENV PATH="/opt/afni-latest:$PATH" \ - AFNI_PLUGINPATH="/opt/afni-latest" -RUN apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - ed \ - gsl-bin \ - libglib2.0-0 \ - libglu1-mesa-dev \ - libglw1-mesa \ - libgomp1 \ - libjpeg62 \ - libnlopt-dev \ - libxm4 \ - netpbm \ - python \ - python3 \ - r-base \ - r-base-dev \ - tcsh \ - xfonts-base \ - xvfb \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && curl -sSL --retry 5 -o /tmp/toinstall.deb http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb \ - && dpkg -i /tmp/toinstall.deb \ - && rm /tmp/toinstall.deb \ - && curl -sSL --retry 5 -o /tmp/toinstall.deb http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb \ - && dpkg -i /tmp/toinstall.deb \ - && rm /tmp/toinstall.deb \ - && apt-get install -f \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && gsl2_path="$(find / -name 'libgsl.so.19' || printf '')" \ - && if [ -n "$gsl2_path" ]; then \ - ln -sfv "$gsl2_path" "$(dirname $gsl2_path)/libgsl.so.0"; \ - fi \ - && ldconfig \ - && echo "Downloading AFNI ..." \ - && mkdir -p /opt/afni-latest \ - && curl -fsSL --retry 5 https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz \ - | tar -xz -C /opt/afni-latest --strip-components 1 \ - && PATH=$PATH:/opt/afni-latest rPkgsInstall -pkgs ALL - + && yum clean all \ + && rm -rf /var/cache/yum/* \ + && echo "Installing FSL ..." \ + && curl -fsSL https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py | python3 - -d /opt/fsl-6.0.6.4 -V 6.0.6.4 ENV FORCE_SPMMCR="1" \ SPM_HTML_BROWSER="0" \ - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/opt/matlabmcr-2010a/v713/runtime/glnxa64:/opt/matlabmcr-2010a/v713/bin/glnxa64:/opt/matlabmcr-2010a/v713/sys/os/glnxa64:/opt/matlabmcr-2010a/v713/extern/bin/glnxa64" \ - MATLABCMD="/opt/matlabmcr-2010a/v713/toolbox/matlab" + SPMMCRCMD="/opt/spm12-r7771/run_spm12.sh /opt/matlab-compiler-runtime-2010a/v713 script" \ + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/opt/matlab-compiler-runtime-2010a/v713/runtime/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/bin/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/sys/os/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/extern/bin/glnxa64" \ + MATLABCMD="/opt/matlab-compiler-runtime-2010a/v713/toolbox/matlab" RUN export TMPDIR="$(mktemp -d)" \ - && apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ + && yum install -y -q \ bc \ - libncurses5 \ - libxext6 \ - libxmu6 \ - libxpm-dev \ - libxt6 \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ + curl \ + libXext \ + libXmu \ + libXpm \ + libXt \ + unzip \ + && yum clean all \ + && rm -rf /var/cache/yum/* \ && echo "Downloading MATLAB Compiler Runtime ..." \ - && curl -sSL --retry 5 -o /tmp/toinstall.deb http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb \ - && dpkg -i /tmp/toinstall.deb \ - && rm /tmp/toinstall.deb \ - && apt-get install -f \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && curl -fsSL --retry 5 -o "$TMPDIR/MCRInstaller.bin" https://dl.dropbox.com/s/zz6me0c3v4yq5fd/MCR_R2010a_glnxa64_installer.bin \ + && curl -fL -o "$TMPDIR/MCRInstaller.bin" https://dl.dropbox.com/s/zz6me0c3v4yq5fd/MCR_R2010a_glnxa64_installer.bin \ && chmod +x "$TMPDIR/MCRInstaller.bin" \ - && "$TMPDIR/MCRInstaller.bin" -silent -P installLocation="/opt/matlabmcr-2010a" \ + && "$TMPDIR/MCRInstaller.bin" -silent -P installLocation="/opt/matlab-compiler-runtime-2010a" \ && rm -rf "$TMPDIR" \ && unset TMPDIR \ - && echo "Downloading standalone SPM ..." \ - && curl -fsSL --retry 5 -o /tmp/spm12.zip https://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/previous/spm12_r7771_R2010a.zip \ + # Install spm12 + && echo "Downloading standalone SPM12 ..." \ + && curl -fL -o /tmp/spm12.zip https://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/previous/spm12_r7771_R2010a.zip \ && unzip -q /tmp/spm12.zip -d /tmp \ && mkdir -p /opt/spm12-r7771 \ && mv /tmp/spm12/* /opt/spm12-r7771/ \ && chmod -R 777 /opt/spm12-r7771 \ && rm -rf /tmp/spm* \ - && /opt/spm12-r7771/run_spm12.sh /opt/matlabmcr-2010a/v713 quit \ - && sed -i '$iexport SPMMCRCMD=\"/opt/spm12-r7771/run_spm12.sh /opt/matlabmcr-2010a/v713 script\"' $ND_ENTRYPOINT - -RUN test "$(getent passwd neuro)" || useradd --no-user-group --create-home --shell /bin/bash neuro + # Test + && /opt/spm12-r7771/run_spm12.sh /opt/matlab-compiler-runtime-2010a/v713 quit +RUN test "$(getent passwd neuro)" \ + || useradd --no-user-group --create-home --shell /bin/bash neuro USER neuro - WORKDIR /home - ENV CONDA_DIR="/opt/miniconda-latest" \ PATH="/opt/miniconda-latest/bin:$PATH" -RUN export PATH="/opt/miniconda-latest/bin:$PATH" \ +RUN yum install -y -q \ + bzip2 \ + curl \ + && yum clean all \ + && rm -rf /var/cache/yum/* \ + # Install dependencies. + && export PATH="/opt/miniconda-latest/bin:$PATH" \ && echo "Downloading Miniconda installer ..." \ && conda_installer="/tmp/miniconda.sh" \ - && curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ + && curl -fsSL -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ && bash "$conda_installer" -b -p /opt/miniconda-latest \ && rm -f "$conda_installer" \ && conda update -yq -nbase conda \ + # Prefer packages in conda-forge && conda config --system --prepend channels conda-forge \ + # Packages in lower-priority channels not considered if a package with the same + # name exists in a higher priority channel. Can dramatically speed up installations. + # Conda recommends this as a default + # https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html + && conda config --set channel_priority strict \ && conda config --system --set auto_update_conda false \ && conda config --system --set show_channel_urls true \ - && sync && conda clean -y --all && sync \ - && conda create -y -q --name neuro \ - && conda install -y -q --name neuro \ - "python=3.8" \ + # Enable `conda activate` + && conda init bash \ + && conda install -y --name neuro \ + "python=3.11" \ "traits" \ "jupyter" \ "nilearn" \ "graphviz" \ - "nipype" \ + "nipype==1.8.6" \ "scikit-image" \ - && sync && conda clean -y --all && sync \ && bash -c "source activate neuro \ - && pip install --no-cache-dir \ + && python -m pip install --no-cache-dir \ "matplotlib"" \ - && rm -rf ~/.cache/pip/* \ - && sync \ - && sed -i '$isource activate neuro' $ND_ENTRYPOINT - -ENV LD_LIBRARY_PATH="/opt/miniconda-latest/envs/neuro:" - + # Clean up + && sync && conda clean --all --yes && sync \ + && rm -rf ~/.cache/pip/* +ENV LD_LIBRARY_PATH="/opt/miniconda-latest/envs/neuro:D_LIBRARY_PATH" RUN bash -c 'source activate neuro' - USER root - RUN chmod 777 -Rf /home - RUN chown -R neuro /home - USER neuro - RUN mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py -RUN echo '{ \ - \n "pkg_manager": "apt", \ - \n "instructions": [ \ - \n [ \ - \n "base", \ - \n "neurodebian:stretch-non-free" \ - \n ], \ - \n [ \ - \n "install", \ - \n [ \ - \n "git" \ - \n ] \ - \n ], \ - \n [ \ - \n "fsl", \ - \n { \ - \n "version": "6.0.3" \ - \n } \ - \n ], \ - \n [ \ - \n "afni", \ - \n { \ - \n "version": "latest", \ - \n "method": "binaries", \ - \n "install_r": "true", \ - \n "install_r_pkgs": "true", \ - \n "install_python2": "true", \ - \n "install_python3": "true" \ - \n } \ - \n ], \ - \n [ \ - \n "spm12", \ - \n { \ - \n "version": "r7771", \ - \n "method": "binaries" \ - \n } \ - \n ], \ - \n [ \ - \n "user", \ - \n "neuro" \ - \n ], \ - \n [ \ - \n "workdir", \ - \n "/home" \ - \n ], \ - \n [ \ - \n "miniconda", \ - \n { \ - \n "create_env": "neuro", \ - \n "conda_install": [ \ - \n "python=3.8", \ - \n "traits", \ - \n "jupyter", \ - \n "nilearn", \ - \n "graphviz", \ - \n "nipype", \ - \n "scikit-image" \ - \n ], \ - \n "pip_install": [ \ - \n "matplotlib" \ - \n ], \ - \n "activate": true \ - \n } \ - \n ], \ - \n [ \ - \n "env", \ - \n { \ - \n "LD_LIBRARY_PATH": "/opt/miniconda-latest/envs/neuro:" \ - \n } \ - \n ], \ - \n [ \ - \n "run_bash", \ - \n "source activate neuro" \ - \n ], \ - \n [ \ - \n "user", \ - \n "root" \ - \n ], \ - \n [ \ - \n "run", \ - \n "chmod 777 -Rf /home" \ - \n ], \ - \n [ \ - \n "run", \ - \n "chown -R neuro /home" \ - \n ], \ - \n [ \ - \n "user", \ - \n "neuro" \ - \n ], \ - \n [ \ - \n "run", \ - \n "mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \\\"0.0.0.0\\\" > ~/.jupyter/jupyter_notebook_config.py" \ - \n ] \ - \n ] \ - \n}' > /neurodocker/neurodocker_specs.json +# Save specification to JSON. +USER root +RUN printf '{ \ + "pkg_manager": "yum", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "centos:7" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "git" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "yum install -y -q \\\\\\n git \\\\\\n && yum clean all \\\\\\n && rm -rf /var/cache/yum/*" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "ANTSPATH": "/opt/ants-2.4.3/", \ + "PATH": "/opt/ants-2.4.3:$PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "yum install -y -q \\\\\\n curl \\\\\\n unzip\\nyum clean all\\nrm -rf /var/cache/yum/*\\necho \\"Downloading ANTs ...\\"\\ncurl -fsSL -o ants.zip https://github.com/ANTsX/ANTs/releases/download/v2.4.3/ants-2.4.3-centos7-X64-gcc.zip\\nunzip ants.zip -d /opt\\nmv /opt/ants-2.4.3/bin/* /opt/ants-2.4.3\\nrm ants.zip" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "FSLDIR": "/opt/fsl-6.0.6.4", \ + "PATH": "/opt/fsl-6.0.6.4/bin:$PATH", \ + "FSLOUTPUTTYPE": "NIFTI_GZ", \ + "FSLMULTIFILEQUIT": "TRUE", \ + "FSLTCLSH": "/opt/fsl-6.0.6.4/bin/fsltclsh", \ + "FSLWISH": "/opt/fsl-6.0.6.4/bin/fslwish", \ + "FSLLOCKDIR": "", \ + "FSLMACHINELIST": "", \ + "FSLREMOTECALL": "", \ + "FSLGECUDAQ": "cuda.q" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "yum install -y -q \\\\\\n bc \\\\\\n curl \\\\\\n file \\\\\\n libGL \\\\\\n libGLU \\\\\\n libICE \\\\\\n libSM \\\\\\n libX11 \\\\\\n libXcursor \\\\\\n libXext \\\\\\n libXft \\\\\\n libXinerama \\\\\\n libXrandr \\\\\\n libXt \\\\\\n libgomp \\\\\\n libjpeg \\\\\\n libmng \\\\\\n libpng12 \\\\\\n nano \\\\\\n openblas-serial \\\\\\n python3 \\\\\\n sudo \\\\\\n wget\\nyum clean all\\nrm -rf /var/cache/yum/*\\n\\necho \\"Installing FSL ...\\"\\ncurl -fsSL https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py | python3 - -d /opt/fsl-6.0.6.4 -V 6.0.6.4" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "FORCE_SPMMCR": "1", \ + "SPM_HTML_BROWSER": "0", \ + "SPMMCRCMD": "/opt/spm12-r7771/run_spm12.sh /opt/matlab-compiler-runtime-2010a/v713 script", \ + "LD_LIBRARY_PATH": "$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/opt/matlab-compiler-runtime-2010a/v713/runtime/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/bin/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/sys/os/glnxa64:/opt/matlab-compiler-runtime-2010a/v713/extern/bin/glnxa64", \ + "MATLABCMD": "/opt/matlab-compiler-runtime-2010a/v713/toolbox/matlab" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "export TMPDIR=\\"$\(mktemp -d\)\\"\\nyum install -y -q \\\\\\n bc \\\\\\n curl \\\\\\n libXext \\\\\\n libXmu \\\\\\n libXpm \\\\\\n libXt \\\\\\n unzip\\nyum clean all\\nrm -rf /var/cache/yum/*\\necho \\"Downloading MATLAB Compiler Runtime ...\\"\\ncurl -fL -o \\"$TMPDIR/MCRInstaller.bin\\" https://dl.dropbox.com/s/zz6me0c3v4yq5fd/MCR_R2010a_glnxa64_installer.bin\\nchmod +x \\"$TMPDIR/MCRInstaller.bin\\"\\n\\"$TMPDIR/MCRInstaller.bin\\" -silent -P installLocation=\\"/opt/matlab-compiler-runtime-2010a\\"\\nrm -rf \\"$TMPDIR\\"\\nunset TMPDIR\\n# Install spm12\\necho \\"Downloading standalone SPM12 ...\\"\\ncurl -fL -o /tmp/spm12.zip https://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/previous/spm12_r7771_R2010a.zip\\nunzip -q /tmp/spm12.zip -d /tmp\\nmkdir -p /opt/spm12-r7771\\nmv /tmp/spm12/* /opt/spm12-r7771/\\nchmod -R 777 /opt/spm12-r7771\\nrm -rf /tmp/spm*\\n# Test\\n/opt/spm12-r7771/run_spm12.sh /opt/matlab-compiler-runtime-2010a/v713 quit" \ + } \ + }, \ + { \ + "name": "user", \ + "kwds": { \ + "user": "neuro" \ + } \ + }, \ + { \ + "name": "workdir", \ + "kwds": { \ + "path": "/home" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "CONDA_DIR": "/opt/miniconda-latest", \ + "PATH": "/opt/miniconda-latest/bin:$PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name neuro \\\\\\n \\"python=3.11\\" \\\\\\n \\"traits\\" \\\\\\n \\"jupyter\\" \\\\\\n \\"nilearn\\" \\\\\\n \\"graphviz\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image\\"\\nbash -c \\"source activate neuro\\n python -m pip install --no-cache-dir \\\\\\n \\"matplotlib\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "LD_LIBRARY_PATH": "/opt/miniconda-latest/envs/neuro:D_LIBRARY_PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'source activate neuro'"'"'" \ + } \ + }, \ + { \ + "name": "user", \ + "kwds": { \ + "user": "root" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "chmod 777 -Rf /home" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "chown -R neuro /home" \ + } \ + }, \ + { \ + "name": "user", \ + "kwds": { \ + "user": "neuro" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \\\\\\"0.0.0.0\\\\\\" > ~/.jupyter/jupyter_notebook_config.py" \ + } \ + } \ + ] \ +}' > /.reproenv.json +USER neuro +# End saving to specification to JSON. diff --git a/INSTALL.md b/INSTALL.md index f1589893..f12b0ca4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -52,26 +52,26 @@ docker images The Dockerfile used to create the image stored on DockerHub is available at the root of the repository ([Dockerfile](Dockerfile)). But you might want to personalize this Dockerfile. To do so, change the command below that will generate a new Dockerfile: ```bash -docker run --rm repronim/neurodocker:0.7.0 generate docker \ - --base neurodebian:stretch-non-free --pkg-manager apt \ - --install git \ - --fsl version=6.0.3 \ - --afni version=latest method=binaries install_r=true install_r_pkgs=true install_python2=true install_python3=true \ - --spm12 version=r7771 method=binaries \ - --user=neuro \ - --workdir /home \ - --miniconda create_env=neuro \ - conda_install="python=3.8 traits jupyter nilearn graphviz nipype scikit-image" \ - pip_install="matplotlib" \ - activate=True \ - --env LD_LIBRARY_PATH="/opt/miniconda-latest/envs/neuro:$LD_LIBRARY_PATH" \ - --run-bash "source activate neuro" \ - --user=root \ - --run 'chmod 777 -Rf /home' \ - --run 'chown -R neuro /home' \ - --user=neuro \ - --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile -``` + docker run --rm repronim/neurodocker:0.9.5 generate docker \ + --base-image centos:7 --pkg-manager yum \ + --yes \ + --install git \ + --ants method=binaries version=2.4.3 \ + --fsl version=6.0.6.4 \ + --spm12 version=r7771 method=binaries \ + --user=neuro \ + --workdir /home \ + --miniconda method=binaries env_name=neuro \ + version=latest \ + conda_install="python=3.11 traits jupyter nilearn graphviz nipype==1.8.6 scikit-image" \ + pip_install="matplotlib" \ + --env LD_LIBRARY_PATH="/opt/miniconda-latest/envs/neuro:$LD_LIBRARY_PATH" \ + --run-bash "source activate neuro" \ + --user=root \ + --run 'chmod 777 -Rf /home' \ + --run 'chown -R neuro /home' \ + --user=neuro \ + --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile``` When you are satisfied with your Dockerfile, just build the image: diff --git a/environment.yml b/environment.yml index e2fa4b95..90ff35f3 100644 --- a/environment.yml +++ b/environment.yml @@ -3,13 +3,13 @@ channels: - conda-forge - defaults dependencies: - - python=3.8.0 + - python=3.11.0 - pip - traits - jupyter - nilearn - graphviz - - nipype + - nipype==1.8.6 - scikit-image - pip: - matplotlib diff --git a/makefile b/makefile new file mode 100644 index 00000000..159c53ca --- /dev/null +++ b/makefile @@ -0,0 +1,23 @@ +.PHONY: Dockerfile + +Dockerfile: + docker run --rm repronim/neurodocker:0.9.5 generate docker \ + --base-image centos:7 --pkg-manager yum \ + --yes \ + --install git \ + --ants method=binaries version=2.4.3 \ + --fsl version=6.0.6.4 \ + --spm12 version=r7771 method=binaries \ + --user=neuro \ + --workdir /home \ + --miniconda method=binaries env_name=neuro \ + version=latest \ + conda_install="python=3.11 traits jupyter nilearn graphviz nipype==1.8.6 scikit-image" \ + pip_install="matplotlib" \ + --env LD_LIBRARY_PATH="/opt/miniconda-latest/envs/neuro:$LD_LIBRARY_PATH" \ + --run-bash "source activate neuro" \ + --user=root \ + --run 'chmod 777 -Rf /home' \ + --run 'chown -R neuro /home' \ + --user=neuro \ + --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile \ No newline at end of file From 77dca7c88e181245ceb9f8aef18a81ffc7a95321 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 16 Sep 2023 10:46:47 -0400 Subject: [PATCH 05/13] remove user in dockerfile --- Dockerfile | 60 ------------------------------------------------------ INSTALL.md | 11 ++-------- makefile | 8 -------- 3 files changed, 2 insertions(+), 77 deletions(-) diff --git a/Dockerfile b/Dockerfile index c80935d7..f0448d91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,10 +87,6 @@ RUN export TMPDIR="$(mktemp -d)" \ && rm -rf /tmp/spm* \ # Test && /opt/spm12-r7771/run_spm12.sh /opt/matlab-compiler-runtime-2010a/v713 quit -RUN test "$(getent passwd neuro)" \ - || useradd --no-user-group --create-home --shell /bin/bash neuro -USER neuro -WORKDIR /home ENV CONDA_DIR="/opt/miniconda-latest" \ PATH="/opt/miniconda-latest/bin:$PATH" RUN yum install -y -q \ @@ -131,16 +127,9 @@ RUN yum install -y -q \ # Clean up && sync && conda clean --all --yes && sync \ && rm -rf ~/.cache/pip/* -ENV LD_LIBRARY_PATH="/opt/miniconda-latest/envs/neuro:D_LIBRARY_PATH" -RUN bash -c 'source activate neuro' -USER root -RUN chmod 777 -Rf /home -RUN chown -R neuro /home -USER neuro RUN mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py # Save specification to JSON. -USER root RUN printf '{ \ "pkg_manager": "yum", \ "existing_users": [ \ @@ -218,18 +207,6 @@ RUN printf '{ \ "command": "export TMPDIR=\\"$\(mktemp -d\)\\"\\nyum install -y -q \\\\\\n bc \\\\\\n curl \\\\\\n libXext \\\\\\n libXmu \\\\\\n libXpm \\\\\\n libXt \\\\\\n unzip\\nyum clean all\\nrm -rf /var/cache/yum/*\\necho \\"Downloading MATLAB Compiler Runtime ...\\"\\ncurl -fL -o \\"$TMPDIR/MCRInstaller.bin\\" https://dl.dropbox.com/s/zz6me0c3v4yq5fd/MCR_R2010a_glnxa64_installer.bin\\nchmod +x \\"$TMPDIR/MCRInstaller.bin\\"\\n\\"$TMPDIR/MCRInstaller.bin\\" -silent -P installLocation=\\"/opt/matlab-compiler-runtime-2010a\\"\\nrm -rf \\"$TMPDIR\\"\\nunset TMPDIR\\n# Install spm12\\necho \\"Downloading standalone SPM12 ...\\"\\ncurl -fL -o /tmp/spm12.zip https://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/previous/spm12_r7771_R2010a.zip\\nunzip -q /tmp/spm12.zip -d /tmp\\nmkdir -p /opt/spm12-r7771\\nmv /tmp/spm12/* /opt/spm12-r7771/\\nchmod -R 777 /opt/spm12-r7771\\nrm -rf /tmp/spm*\\n# Test\\n/opt/spm12-r7771/run_spm12.sh /opt/matlab-compiler-runtime-2010a/v713 quit" \ } \ }, \ - { \ - "name": "user", \ - "kwds": { \ - "user": "neuro" \ - } \ - }, \ - { \ - "name": "workdir", \ - "kwds": { \ - "path": "/home" \ - } \ - }, \ { \ "name": "env", \ "kwds": { \ @@ -243,42 +220,6 @@ RUN printf '{ \ "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name neuro \\\\\\n \\"python=3.11\\" \\\\\\n \\"traits\\" \\\\\\n \\"jupyter\\" \\\\\\n \\"nilearn\\" \\\\\\n \\"graphviz\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image\\"\\nbash -c \\"source activate neuro\\n python -m pip install --no-cache-dir \\\\\\n \\"matplotlib\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ - { \ - "name": "env", \ - "kwds": { \ - "LD_LIBRARY_PATH": "/opt/miniconda-latest/envs/neuro:D_LIBRARY_PATH" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "bash -c '"'"'source activate neuro'"'"'" \ - } \ - }, \ - { \ - "name": "user", \ - "kwds": { \ - "user": "root" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "chmod 777 -Rf /home" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "chown -R neuro /home" \ - } \ - }, \ - { \ - "name": "user", \ - "kwds": { \ - "user": "neuro" \ - } \ - }, \ { \ "name": "run", \ "kwds": { \ @@ -287,5 +228,4 @@ RUN printf '{ \ } \ ] \ }' > /.reproenv.json -USER neuro # End saving to specification to JSON. diff --git a/INSTALL.md b/INSTALL.md index f12b0ca4..7cbabd3e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -59,19 +59,12 @@ The Dockerfile used to create the image stored on DockerHub is available at the --ants method=binaries version=2.4.3 \ --fsl version=6.0.6.4 \ --spm12 version=r7771 method=binaries \ - --user=neuro \ - --workdir /home \ --miniconda method=binaries env_name=neuro \ version=latest \ conda_install="python=3.11 traits jupyter nilearn graphviz nipype==1.8.6 scikit-image" \ pip_install="matplotlib" \ - --env LD_LIBRARY_PATH="/opt/miniconda-latest/envs/neuro:$LD_LIBRARY_PATH" \ - --run-bash "source activate neuro" \ - --user=root \ - --run 'chmod 777 -Rf /home' \ - --run 'chown -R neuro /home' \ - --user=neuro \ - --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile``` + --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile +``` When you are satisfied with your Dockerfile, just build the image: diff --git a/makefile b/makefile index 159c53ca..029f6df1 100644 --- a/makefile +++ b/makefile @@ -8,16 +8,8 @@ Dockerfile: --ants method=binaries version=2.4.3 \ --fsl version=6.0.6.4 \ --spm12 version=r7771 method=binaries \ - --user=neuro \ - --workdir /home \ --miniconda method=binaries env_name=neuro \ version=latest \ conda_install="python=3.11 traits jupyter nilearn graphviz nipype==1.8.6 scikit-image" \ pip_install="matplotlib" \ - --env LD_LIBRARY_PATH="/opt/miniconda-latest/envs/neuro:$LD_LIBRARY_PATH" \ - --run-bash "source activate neuro" \ - --user=root \ - --run 'chmod 777 -Rf /home' \ - --run 'chown -R neuro /home' \ - --user=neuro \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile \ No newline at end of file From 355495cb374bc6eaacd564dc62790e4f1cc23ab2 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 16 Sep 2023 10:59:24 -0400 Subject: [PATCH 06/13] rm env name --- Dockerfile | 6 +++--- makefile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f0448d91..8ac4fa5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -113,7 +113,7 @@ RUN yum install -y -q \ && conda config --system --set show_channel_urls true \ # Enable `conda activate` && conda init bash \ - && conda install -y --name neuro \ + && conda install -y --name base \ "python=3.11" \ "traits" \ "jupyter" \ @@ -121,7 +121,7 @@ RUN yum install -y -q \ "graphviz" \ "nipype==1.8.6" \ "scikit-image" \ - && bash -c "source activate neuro \ + && bash -c "source activate base \ && python -m pip install --no-cache-dir \ "matplotlib"" \ # Clean up @@ -217,7 +217,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name neuro \\\\\\n \\"python=3.11\\" \\\\\\n \\"traits\\" \\\\\\n \\"jupyter\\" \\\\\\n \\"nilearn\\" \\\\\\n \\"graphviz\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image\\"\\nbash -c \\"source activate neuro\\n python -m pip install --no-cache-dir \\\\\\n \\"matplotlib\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.11\\" \\\\\\n \\"traits\\" \\\\\\n \\"jupyter\\" \\\\\\n \\"nilearn\\" \\\\\\n \\"graphviz\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"matplotlib\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ diff --git a/makefile b/makefile index 029f6df1..8b1f53d2 100644 --- a/makefile +++ b/makefile @@ -8,7 +8,7 @@ Dockerfile: --ants method=binaries version=2.4.3 \ --fsl version=6.0.6.4 \ --spm12 version=r7771 method=binaries \ - --miniconda method=binaries env_name=neuro \ + --miniconda method=binaries \ version=latest \ conda_install="python=3.11 traits jupyter nilearn graphviz nipype==1.8.6 scikit-image" \ pip_install="matplotlib" \ From 456ac77020b0c7df16f7708a9f8c5b1cc34dd2ce Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 16 Sep 2023 11:51:42 -0400 Subject: [PATCH 07/13] use pip for install --- Dockerfile | 16 ++++++++-------- INSTALL.md | 6 +++--- makefile | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8ac4fa5e..5161ec09 100644 --- a/Dockerfile +++ b/Dockerfile @@ -115,15 +115,15 @@ RUN yum install -y -q \ && conda init bash \ && conda install -y --name base \ "python=3.11" \ - "traits" \ - "jupyter" \ - "nilearn" \ - "graphviz" \ - "nipype==1.8.6" \ - "scikit-image" \ && bash -c "source activate base \ && python -m pip install --no-cache-dir \ - "matplotlib"" \ + "matplotlib" \ + "traits" \ + "jupyter" \ + "nilearn" \ + "graphviz" \ + "nipype==1.8.6" \ + "scikit-image"" \ # Clean up && sync && conda clean --all --yes && sync \ && rm -rf ~/.cache/pip/* @@ -217,7 +217,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.11\\" \\\\\\n \\"traits\\" \\\\\\n \\"jupyter\\" \\\\\\n \\"nilearn\\" \\\\\\n \\"graphviz\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"matplotlib\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.11\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"matplotlib\\" \\\\\\n \\"traits\\" \\\\\\n \\"jupyter\\" \\\\\\n \\"nilearn\\" \\\\\\n \\"graphviz\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ diff --git a/INSTALL.md b/INSTALL.md index 7cbabd3e..8727c2b1 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -59,10 +59,10 @@ The Dockerfile used to create the image stored on DockerHub is available at the --ants method=binaries version=2.4.3 \ --fsl version=6.0.6.4 \ --spm12 version=r7771 method=binaries \ - --miniconda method=binaries env_name=neuro \ + --miniconda method=binaries \ version=latest \ - conda_install="python=3.11 traits jupyter nilearn graphviz nipype==1.8.6 scikit-image" \ - pip_install="matplotlib" \ + conda_install="python=3.11" \ + pip_install="matplotlib traits jupyter nilearn graphviz nipype==1.8.6 scikit-image" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile ``` diff --git a/makefile b/makefile index 8b1f53d2..324bf4f6 100644 --- a/makefile +++ b/makefile @@ -10,6 +10,6 @@ Dockerfile: --spm12 version=r7771 method=binaries \ --miniconda method=binaries \ version=latest \ - conda_install="python=3.11 traits jupyter nilearn graphviz nipype==1.8.6 scikit-image" \ - pip_install="matplotlib" \ + conda_install="python=3.11" \ + pip_install="matplotlib traits jupyter nilearn graphviz nipype==1.8.6 scikit-image" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile \ No newline at end of file From 42d08f72542f6b462dfb3f2ec3ecb16d46f23fd9 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 16 Sep 2023 13:25:45 -0400 Subject: [PATCH 08/13] improve conda env install --- Dockerfile | 15 ++++++++------- INSTALL.md | 4 ++-- environment.yml | 18 +++++++++--------- makefile | 4 ++-- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5161ec09..ae1c8085 100644 --- a/Dockerfile +++ b/Dockerfile @@ -115,15 +115,16 @@ RUN yum install -y -q \ && conda init bash \ && conda install -y --name base \ "python=3.11" \ + "pip=23.2.1" \ && bash -c "source activate base \ && python -m pip install --no-cache-dir \ - "matplotlib" \ - "traits" \ - "jupyter" \ - "nilearn" \ - "graphviz" \ + "traits==6.3.0" \ + "jupyterlab-4.0.6" \ + "graphviz-0.20.1" \ "nipype==1.8.6" \ - "scikit-image"" \ + "scikit-image==0.21.0" \ + "matplotlib==3.8.0" \ + "nilearn==0.10.1"" \ # Clean up && sync && conda clean --all --yes && sync \ && rm -rf ~/.cache/pip/* @@ -217,7 +218,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.11\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"matplotlib\\" \\\\\\n \\"traits\\" \\\\\\n \\"jupyter\\" \\\\\\n \\"nilearn\\" \\\\\\n \\"graphviz\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.11\\" \\\\\\n \\"pip=23.2.1\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"traits==6.3.0\\" \\\\\\n \\"jupyterlab-4.0.6\\" \\\\\\n \\"graphviz-0.20.1\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image==0.21.0\\" \\\\\\n \\"matplotlib==3.8.0\\" \\\\\\n \\"nilearn==0.10.1\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ diff --git a/INSTALL.md b/INSTALL.md index 8727c2b1..957aebee 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -61,8 +61,8 @@ The Dockerfile used to create the image stored on DockerHub is available at the --spm12 version=r7771 method=binaries \ --miniconda method=binaries \ version=latest \ - conda_install="python=3.11" \ - pip_install="matplotlib traits jupyter nilearn graphviz nipype==1.8.6 scikit-image" \ + conda_install="python=3.11 pip=23.2.1" \ + pip_install="traits==6.3.0 jupyterlab-4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile ``` diff --git a/environment.yml b/environment.yml index 90ff35f3..d7f83495 100644 --- a/environment.yml +++ b/environment.yml @@ -3,13 +3,13 @@ channels: - conda-forge - defaults dependencies: - - python=3.11.0 - - pip - - traits - - jupyter - - nilearn - - graphviz - - nipype==1.8.6 - - scikit-image + - python=3.10 + - pip=23.2.1 - pip: - - matplotlib + - traits==6.3.0 + - jupyter + - graphviz + - nipype==1.8.6 + - scikit-image==0.21.0 + - matplotlib==3.8.0 + - nilearn==0.10.1 diff --git a/makefile b/makefile index 324bf4f6..142f9262 100644 --- a/makefile +++ b/makefile @@ -10,6 +10,6 @@ Dockerfile: --spm12 version=r7771 method=binaries \ --miniconda method=binaries \ version=latest \ - conda_install="python=3.11" \ - pip_install="matplotlib traits jupyter nilearn graphviz nipype==1.8.6 scikit-image" \ + conda_install="python=3.11 pip=23.2.1" \ + pip_install="traits==6.3.0 jupyterlab-4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile \ No newline at end of file From eff6247e5795cbdd7743aa6dc93b232f7d5a5a75 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 16 Sep 2023 14:27:12 -0400 Subject: [PATCH 09/13] use python 3.10 --- Dockerfile | 4 ++-- INSTALL.md | 2 +- makefile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ae1c8085..0a715ca2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -114,7 +114,7 @@ RUN yum install -y -q \ # Enable `conda activate` && conda init bash \ && conda install -y --name base \ - "python=3.11" \ + "python=3.10" \ "pip=23.2.1" \ && bash -c "source activate base \ && python -m pip install --no-cache-dir \ @@ -218,7 +218,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.11\\" \\\\\\n \\"pip=23.2.1\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"traits==6.3.0\\" \\\\\\n \\"jupyterlab-4.0.6\\" \\\\\\n \\"graphviz-0.20.1\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image==0.21.0\\" \\\\\\n \\"matplotlib==3.8.0\\" \\\\\\n \\"nilearn==0.10.1\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.10\\" \\\\\\n \\"pip=23.2.1\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"traits==6.3.0\\" \\\\\\n \\"jupyterlab-4.0.6\\" \\\\\\n \\"graphviz-0.20.1\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image==0.21.0\\" \\\\\\n \\"matplotlib==3.8.0\\" \\\\\\n \\"nilearn==0.10.1\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ diff --git a/INSTALL.md b/INSTALL.md index 957aebee..daa056cf 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -61,7 +61,7 @@ The Dockerfile used to create the image stored on DockerHub is available at the --spm12 version=r7771 method=binaries \ --miniconda method=binaries \ version=latest \ - conda_install="python=3.11 pip=23.2.1" \ + conda_install="python=3.10 pip=23.2.1" \ pip_install="traits==6.3.0 jupyterlab-4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile ``` diff --git a/makefile b/makefile index 142f9262..81e2c1cb 100644 --- a/makefile +++ b/makefile @@ -10,6 +10,6 @@ Dockerfile: --spm12 version=r7771 method=binaries \ --miniconda method=binaries \ version=latest \ - conda_install="python=3.11 pip=23.2.1" \ + conda_install="python=3.10 pip=23.2.1" \ pip_install="traits==6.3.0 jupyterlab-4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile \ No newline at end of file From 58c8c660ba13a6117f914fd4cbfbbefb1a47624b Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 16 Sep 2023 15:39:25 -0400 Subject: [PATCH 10/13] use mamba --- Dockerfile | 4 +++- makefile | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0a715ca2..ecb64729 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,6 +102,8 @@ RUN yum install -y -q \ && bash "$conda_installer" -b -p /opt/miniconda-latest \ && rm -f "$conda_installer" \ && conda update -yq -nbase conda \ + && conda install -yq -nbase conda-libmamba-solver \ + && conda config --set solver libmamba \ # Prefer packages in conda-forge && conda config --system --prepend channels conda-forge \ # Packages in lower-priority channels not considered if a package with the same @@ -218,7 +220,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.10\\" \\\\\\n \\"pip=23.2.1\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"traits==6.3.0\\" \\\\\\n \\"jupyterlab-4.0.6\\" \\\\\\n \\"graphviz-0.20.1\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image==0.21.0\\" \\\\\\n \\"matplotlib==3.8.0\\" \\\\\\n \\"nilearn==0.10.1\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\nconda install -yq -nbase conda-libmamba-solver\\nconda config --set solver libmamba\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.10\\" \\\\\\n \\"pip=23.2.1\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"traits==6.3.0\\" \\\\\\n \\"jupyterlab-4.0.6\\" \\\\\\n \\"graphviz-0.20.1\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image==0.21.0\\" \\\\\\n \\"matplotlib==3.8.0\\" \\\\\\n \\"nilearn==0.10.1\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ diff --git a/makefile b/makefile index 81e2c1cb..9750b4d7 100644 --- a/makefile +++ b/makefile @@ -2,6 +2,20 @@ Dockerfile: docker run --rm repronim/neurodocker:0.9.5 generate docker \ + --base-image centos:7 --pkg-manager yum \ + --yes \ + --install git \ + --ants method=binaries version=2.4.3 \ + --fsl version=6.0.6.4 \ + --spm12 version=r7771 method=binaries \ + --miniconda method=binaries \ + version=latest + conda_install="python=3.10 pip=23.2.1" \ + pip_install="traits==6.3.0 jupyterlab-4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ + --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile + +Dockerfile_mamba: + neurodocker generate docker \ --base-image centos:7 --pkg-manager yum \ --yes \ --install git \ @@ -10,6 +24,7 @@ Dockerfile: --spm12 version=r7771 method=binaries \ --miniconda method=binaries \ version=latest \ + mamba=true \ conda_install="python=3.10 pip=23.2.1" \ pip_install="traits==6.3.0 jupyterlab-4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile \ No newline at end of file From 5ecd9f6751823b97656a013584ae6b5bba005676 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 16 Sep 2023 15:59:20 -0400 Subject: [PATCH 11/13] fix typo --- Dockerfile | 4 ++-- makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ecb64729..88b3ad7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -121,7 +121,7 @@ RUN yum install -y -q \ && bash -c "source activate base \ && python -m pip install --no-cache-dir \ "traits==6.3.0" \ - "jupyterlab-4.0.6" \ + "jupyterlab==4.0.6" \ "graphviz-0.20.1" \ "nipype==1.8.6" \ "scikit-image==0.21.0" \ @@ -220,7 +220,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\nconda install -yq -nbase conda-libmamba-solver\\nconda config --set solver libmamba\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.10\\" \\\\\\n \\"pip=23.2.1\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"traits==6.3.0\\" \\\\\\n \\"jupyterlab-4.0.6\\" \\\\\\n \\"graphviz-0.20.1\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image==0.21.0\\" \\\\\\n \\"matplotlib==3.8.0\\" \\\\\\n \\"nilearn==0.10.1\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\nconda install -yq -nbase conda-libmamba-solver\\nconda config --set solver libmamba\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.10\\" \\\\\\n \\"pip=23.2.1\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"traits==6.3.0\\" \\\\\\n \\"jupyterlab==4.0.6\\" \\\\\\n \\"graphviz-0.20.1\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image==0.21.0\\" \\\\\\n \\"matplotlib==3.8.0\\" \\\\\\n \\"nilearn==0.10.1\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ diff --git a/makefile b/makefile index 9750b4d7..a39e92bf 100644 --- a/makefile +++ b/makefile @@ -11,7 +11,7 @@ Dockerfile: --miniconda method=binaries \ version=latest conda_install="python=3.10 pip=23.2.1" \ - pip_install="traits==6.3.0 jupyterlab-4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ + pip_install="traits==6.3.0 jupyterlab==4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile Dockerfile_mamba: @@ -26,5 +26,5 @@ Dockerfile_mamba: version=latest \ mamba=true \ conda_install="python=3.10 pip=23.2.1" \ - pip_install="traits==6.3.0 jupyterlab-4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ + pip_install="traits==6.3.0 jupyterlab==4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile \ No newline at end of file From e97eb32c8a0a5f42e8d210cd3a65cee33c31a416 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 16 Sep 2023 16:12:43 -0400 Subject: [PATCH 12/13] ignore files --- Dockerfile | 4 ++-- makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 88b3ad7d..22606830 100644 --- a/Dockerfile +++ b/Dockerfile @@ -122,7 +122,7 @@ RUN yum install -y -q \ && python -m pip install --no-cache-dir \ "traits==6.3.0" \ "jupyterlab==4.0.6" \ - "graphviz-0.20.1" \ + "graphviz==0.20.1" \ "nipype==1.8.6" \ "scikit-image==0.21.0" \ "matplotlib==3.8.0" \ @@ -220,7 +220,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\nconda install -yq -nbase conda-libmamba-solver\\nconda config --set solver libmamba\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.10\\" \\\\\\n \\"pip=23.2.1\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"traits==6.3.0\\" \\\\\\n \\"jupyterlab==4.0.6\\" \\\\\\n \\"graphviz-0.20.1\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image==0.21.0\\" \\\\\\n \\"matplotlib==3.8.0\\" \\\\\\n \\"nilearn==0.10.1\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "yum install -y -q \\\\\\n bzip2 \\\\\\n curl\\nyum clean all\\nrm -rf /var/cache/yum/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\nconda install -yq -nbase conda-libmamba-solver\\nconda config --set solver libmamba\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.10\\" \\\\\\n \\"pip=23.2.1\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"traits==6.3.0\\" \\\\\\n \\"jupyterlab==4.0.6\\" \\\\\\n \\"graphviz==0.20.1\\" \\\\\\n \\"nipype==1.8.6\\" \\\\\\n \\"scikit-image==0.21.0\\" \\\\\\n \\"matplotlib==3.8.0\\" \\\\\\n \\"nilearn==0.10.1\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ diff --git a/makefile b/makefile index a39e92bf..26347dd9 100644 --- a/makefile +++ b/makefile @@ -11,7 +11,7 @@ Dockerfile: --miniconda method=binaries \ version=latest conda_install="python=3.10 pip=23.2.1" \ - pip_install="traits==6.3.0 jupyterlab==4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ + pip_install="traits==6.3.0 jupyterlab==4.0.6 graphviz==0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile Dockerfile_mamba: @@ -26,5 +26,5 @@ Dockerfile_mamba: version=latest \ mamba=true \ conda_install="python=3.10 pip=23.2.1" \ - pip_install="traits==6.3.0 jupyterlab==4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ + pip_install="traits==6.3.0 jupyterlab==4.0.6 graphviz==0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile \ No newline at end of file From b9e02d4d9327fa306787774b594da9ceb94f962a Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 16 Sep 2023 16:44:20 -0400 Subject: [PATCH 13/13] checkout repo --- .circleci/config.yml | 1 + INSTALL.md | 5 +++-- makefile | 18 ++++-------------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a14babc5..4b1819d6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,6 +23,7 @@ jobs: steps: - attach_workspace: at: /tmp/workspace + - checkout - run: docker load -i /tmp/workspace/docker/image.tar - run: name: push to dockerhub diff --git a/INSTALL.md b/INSTALL.md index daa056cf..a0b7dbd3 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -52,7 +52,7 @@ docker images The Dockerfile used to create the image stored on DockerHub is available at the root of the repository ([Dockerfile](Dockerfile)). But you might want to personalize this Dockerfile. To do so, change the command below that will generate a new Dockerfile: ```bash - docker run --rm repronim/neurodocker:0.9.5 generate docker \ + neurodocker generate docker \ --base-image centos:7 --pkg-manager yum \ --yes \ --install git \ @@ -61,8 +61,9 @@ The Dockerfile used to create the image stored on DockerHub is available at the --spm12 version=r7771 method=binaries \ --miniconda method=binaries \ version=latest \ + mamba=true \ conda_install="python=3.10 pip=23.2.1" \ - pip_install="traits==6.3.0 jupyterlab-4.0.6 graphviz-0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ + pip_install="traits==6.3.0 jupyterlab==4.0.6 graphviz==0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile ``` diff --git a/makefile b/makefile index 26347dd9..c73c7ac7 100644 --- a/makefile +++ b/makefile @@ -1,20 +1,10 @@ .PHONY: Dockerfile -Dockerfile: - docker run --rm repronim/neurodocker:0.9.5 generate docker \ - --base-image centos:7 --pkg-manager yum \ - --yes \ - --install git \ - --ants method=binaries version=2.4.3 \ - --fsl version=6.0.6.4 \ - --spm12 version=r7771 method=binaries \ - --miniconda method=binaries \ - version=latest - conda_install="python=3.10 pip=23.2.1" \ - pip_install="traits==6.3.0 jupyterlab==4.0.6 graphviz==0.20.1 nipype==1.8.6 scikit-image==0.21.0 matplotlib==3.8.0 nilearn==0.10.1" \ - --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' > Dockerfile +# docker run --rm repronim/neurodocker:0.9.5 generate docker -Dockerfile_mamba: +# using the mamba option requires to use the version of neurodocker +# installed from the main branch of the the neurodocker github repo +Dockerfile: neurodocker generate docker \ --base-image centos:7 --pkg-manager yum \ --yes \