From 75e5a7650d279094b2ddf132b2ccf62411bcef55 Mon Sep 17 00:00:00 2001 From: shotgunosine Date: Fri, 10 Jul 2020 09:56:56 -0400 Subject: [PATCH 01/33] make freesurfer 7 docker file --- Dockerfile_fs7 | 302 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 Dockerfile_fs7 diff --git a/Dockerfile_fs7 b/Dockerfile_fs7 new file mode 100644 index 0000000..ce27b3a --- /dev/null +++ b/Dockerfile_fs7 @@ -0,0 +1,302 @@ +# Generated by: Neurodocker version 0.7.0+12.g913b321 +# Latest release: Neurodocker version 0.7.0 +# Timestamp: 2020/07/09 17:08:57 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 + +FROM ubuntu:xenial + +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 \ + 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 \ + tcsh \ + bc \ + tar \ + libgomp1 \ + perl-modules \ + wget \ + curl \ + libsm-dev \ + libx11-dev \ + libxt-dev \ + libxext-dev \ + libglu1-mesa \ + libpython2.7-stdlib \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +ENV FREESURFER_HOME="/opt/freesurfer" \ + PATH="/opt/freesurfer/bin:$PATH" +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + bc \ + libgomp1 \ + libxmu6 \ + libxt6 \ + perl \ + tcsh \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && echo "Downloading FreeSurfer ..." \ + && mkdir -p /opt/freesurfer \ + && curl -fsSL --retry 5 https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.1.0/freesurfer-linux-centos6_x86_64-7.1.0.tar.gz \ + | tar -xz -C /opt/freesurfer --strip-components 1 \ + --exclude='freesurfer/average/mult-comp-cor' \ + --exclude='freesurfer/lib/cuda' \ + --exclude='freesurfer/lib/qt' \ + --exclude='freesurfer/subjects/V1_average' \ + --exclude='freesurfer/subjects/bert' \ + --exclude='freesurfer/subjects/cvs_avg35' \ + --exclude='freesurfer/subjects/cvs_avg35_inMNI152' \ + --exclude='freesurfer/subjects/fsaverage3' \ + --exclude='freesurfer/subjects/fsaverage4' \ + --exclude='freesurfer/subjects/fsaverage5' \ + --exclude='freesurfer/subjects/fsaverage6' \ + --exclude='freesurfer/subjects/fsaverage_sym' \ + --exclude='freesurfer/trctrain' \ + && sed -i '$isource "/opt/freesurfer/SetUpFreeSurfer.sh"' "$ND_ENTRYPOINT" + +ENV CONDA_DIR="/opt/miniconda-latest" \ + PATH="/opt/miniconda-latest/bin:$PATH" +RUN 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 \ + && bash "$conda_installer" -b -p /opt/miniconda-latest \ + && rm -f "$conda_installer" \ + && conda update -yq -nbase conda \ + && conda config --system --prepend channels conda-forge \ + && conda config --system --set auto_update_conda false \ + && conda config --system --set show_channel_urls true \ + && sync && conda clean -y --all && sync \ + && conda install -y -q --name base \ + "python=3" \ + "pip" \ + "pandas" \ + "setuptools" \ + "pandas=0.21.0" \ + && sync && conda clean -y --all && sync \ + && bash -c "source activate base \ + && pip install --no-cache-dir \ + "nibabel"" \ + && rm -rf ~/.cache/pip/* \ + && sync + +RUN bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' + +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + nodejs \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN bash -c 'npm install -g bids-validator@0.19.8' + +ENV FSLDIR="/usr/share/fsl/5.0" \ + FSLOUTPUTTYPE="NIFTI_GZ" \ + FSLMULTIFILEQUIT="TRUE" \ + POSSUMDIR="/usr/share/fsl/5.0" \ + LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" \ + FSLTCLSH="/usr/bin/tclsh" \ + FSLWISH="/usr/bin/wish" + +ENV OS="Linux" \ + FS_OVERRIDE="0" \ + FIX_VERTEX_AREA="" \ + SUBJECTS_DIR="/opt/freesurfer/subjects" \ + FSF_OUTPUT_FORMAT="nii.gz" \ + MNI_DIR="/opt/freesurfer/mni" \ + LOCAL_DIR="/opt/freesurfer/local" \ + FREESURFER_HOME="/opt/freesurfer" \ + FSFAST_HOME="/opt/freesurfer/fsfast" \ + MINC_BIN_DIR="/opt/freesurfer/mni/bin" \ + MINC_LIB_DIR="/opt/freesurfer/mni/lib" \ + MNI_DATAPATH="/opt/freesurfer/mni/data" \ + FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \ + PERL5LIB="/opt/freesurfer/mni/share/perl5" \ + MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \ + PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ + PYTHONPATH="" + +RUN mkdir root/matlab && touch root/matlab/startup.m + +RUN mkdir /scratch + +RUN mkdir /local-scratch + +COPY ["run.py", "/run.py"] + +RUN chmod +x /run.py + +COPY ["version", "/version"] + +ENTRYPOINT ["/neurodocker/startup.sh", "/run.py"] + +RUN echo '{ \ + \n "pkg_manager": "apt", \ + \n "instructions": [ \ + \n [ \ + \n "base", \ + \n "ubuntu:xenial" \ + \n ], \ + \n [ \ + \n "install", \ + \n [ \ + \n "tcsh", \ + \n "bc", \ + \n "tar", \ + \n "libgomp1", \ + \n "perl-modules", \ + \n "wget", \ + \n "curl", \ + \n "libsm-dev", \ + \n "libx11-dev", \ + \n "libxt-dev", \ + \n "libxext-dev", \ + \n "libglu1-mesa", \ + \n "libpython2.7-stdlib" \ + \n ] \ + \n ], \ + \n [ \ + \n "freesurfer", \ + \n { \ + \n "version": "7.1.0", \ + \n "install_path": "/opt/freesurfer" \ + \n } \ + \n ], \ + \n [ \ + \n "miniconda", \ + \n { \ + \n "use_env": "base", \ + \n "conda_install": [ \ + \n "python=3", \ + \n "pip", \ + \n "pandas", \ + \n "setuptools", \ + \n "pandas=0.21.0" \ + \n ], \ + \n "pip_install": [ \ + \n "nibabel" \ + \n ] \ + \n } \ + \n ], \ + \n [ \ + \n "run_bash", \ + \n "curl -sL https://deb.nodesource.com/setup_6.x | bash -" \ + \n ], \ + \n [ \ + \n "install", \ + \n [ \ + \n "nodejs" \ + \n ] \ + \n ], \ + \n [ \ + \n "run_bash", \ + \n "npm install -g bids-validator@0.19.8" \ + \n ], \ + \n [ \ + \n "env", \ + \n { \ + \n "FSLDIR": "/usr/share/fsl/5.0", \ + \n "FSLOUTPUTTYPE": "NIFTI_GZ", \ + \n "FSLMULTIFILEQUIT": "TRUE", \ + \n "POSSUMDIR": "/usr/share/fsl/5.0", \ + \n "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \ + \n "FSLTCLSH": "/usr/bin/tclsh", \ + \n "FSLWISH": "/usr/bin/wish" \ + \n } \ + \n ], \ + \n [ \ + \n "env", \ + \n { \ + \n "OS": "Linux", \ + \n "FS_OVERRIDE": "0", \ + \n "FIX_VERTEX_AREA": "", \ + \n "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + \n "FSF_OUTPUT_FORMAT": "nii.gz", \ + \n "MNI_DIR": "/opt/freesurfer/mni", \ + \n "LOCAL_DIR": "/opt/freesurfer/local", \ + \n "FREESURFER_HOME": "/opt/freesurfer", \ + \n "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + \n "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + \n "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + \n "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + \n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + \n "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + \n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \ + \n "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \ + \n "PYTHONPATH": "" \ + \n } \ + \n ], \ + \n [ \ + \n "run", \ + \n "mkdir root/matlab && touch root/matlab/startup.m" \ + \n ], \ + \n [ \ + \n "run", \ + \n "mkdir /scratch" \ + \n ], \ + \n [ \ + \n "run", \ + \n "mkdir /local-scratch" \ + \n ], \ + \n [ \ + \n "copy", \ + \n [ \ + \n "run.py", \ + \n "/run.py" \ + \n ] \ + \n ], \ + \n [ \ + \n "run", \ + \n "chmod +x /run.py" \ + \n ], \ + \n [ \ + \n "copy", \ + \n [ \ + \n "version", \ + \n "/version" \ + \n ] \ + \n ], \ + \n [ \ + \n "entrypoint", \ + \n "/neurodocker/startup.sh /run.py" \ + \n ] \ + \n ] \ + \n}' > /neurodocker/neurodocker_specs.json From 5de01cfae50fbd7eb513f1a97eef502b3ad13e98 Mon Sep 17 00:00:00 2001 From: Andy Worth Date: Tue, 27 Oct 2020 11:18:25 -0400 Subject: [PATCH 02/33] bump to FS 7.1.1 --- Dockerfile_fs7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile_fs7 b/Dockerfile_fs7 index ce27b3a..d541d4e 100644 --- a/Dockerfile_fs7 +++ b/Dockerfile_fs7 @@ -75,7 +75,7 @@ RUN apt-get update -qq \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FreeSurfer ..." \ && mkdir -p /opt/freesurfer \ - && curl -fsSL --retry 5 https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.1.0/freesurfer-linux-centos6_x86_64-7.1.0.tar.gz \ + && curl -fsSL --retry 5 https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.1.1/freesurfer-linux-centos6_x86_64-7.1.1.tar.gz \ | tar -xz -C /opt/freesurfer --strip-components 1 \ --exclude='freesurfer/average/mult-comp-cor' \ --exclude='freesurfer/lib/cuda' \ From 16197f1fb1993f5efdadd50e8d8f73c34bf0d9ff Mon Sep 17 00:00:00 2001 From: shotgunosine Date: Tue, 3 Nov 2020 09:27:52 -0500 Subject: [PATCH 03/33] add 7.1.1 --- .circleci/config.yml | 116 +++++++++++++ Dockerfile | 35 ++-- Dockerfile_fs7 | 7 +- Singularity | 39 +++-- Singularity_fs7 | 314 ++++++++++++++++++++++++++++++++++ generate_freesurfer_images.sh | 63 ++++++- 6 files changed, 540 insertions(+), 34 deletions(-) create mode 100644 Singularity_fs7 diff --git a/.circleci/config.yml b/.circleci/config.yml index 92238e3..381cf01 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,6 +92,99 @@ jobs: if [[ -n "$DOCKER_PASS" ]]; then docker login -u $DOCKER_USER -p $DOCKER_PASS && docker tag bids/${CIRCLE_PROJECT_REPONAME} bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG && docker push bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG; fi no_output_timeout: 6h + + build_fs7: + machine: + image: circleci/classic:latest + steps: + - checkout + - restore_cache: + keys: + - v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }} + - run: + name: load and build + command: | + if [[ -e ~/docker/image_fs7.tar ]]; then docker load -i ~/docker/image_fs7.tar; fi + git describe --tags > version + docker build -t bids/${CIRCLE_PROJECT_REPONAME}_fs7 -f Dockerfile_fs7 . + mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}" > ~/docker/image.tar + mkdir -p ~/license; echo "cHJpbnRmICJEeWxhbi5OaWVsc29uQGdtYWlsLmNvbVxuMzcwNjNcbiAqQ1lrZWhQYUNvRDlNXG4gRlM2N1BTWmRFV2lqb1xuIiA+IH4vbGljZW5zZS9saWNlbnNlLnR4dA==" | base64 -d | sh + no_output_timeout: 6h + - save_cache: + key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }}-{{ epoch }} + paths: + - ~/docker + - ~/license + test_fs7: + machine: + image: circleci/classic:latest + steps: + - checkout + - restore_cache: + key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }} + - restore_cache: + key: v_0-test_data + - run: + name: get data + command: | + if [[ ! -d ~/data/ds114_test1 ]]; then wget -c -O ${HOME}/ds114_test1.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e54a326c613b01d7d3ed90" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1.tar -C ${HOME}/data; fi + if [[ ! -d ~/data/ds114_test2 ]]; then wget -c -O ${HOME}/ds114_test2.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2.tar -C ${HOME}/data; fi + if [[ ! -d ~/data/ds114_test1_freesurfer_precomp_v6.0.0 ]]; then wget -c --no-check-certificate -O ${HOME}/ds114_test1_freesurfer_precomp_v6.0.0.tar "https://osf.io/j6zk2/?action=download&version=1" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1_freesurfer_precomp_v6.0.0.tar -C ${HOME}/data; fi + if [[ ! -d ~/data/ds114_test2_freesurfer_precomp_v6.0.0 ]]; then wget -c --no-check-certificate -O ${HOME}/ds114_test2_freesurfer_precomp_v6.0.0.tar "https://osf.io/yhzzj/?action=download&version=1" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2_freesurfer_precomp_v6.0.0.tar -C ${HOME}/data; fi + - save_cache: + key: v_0-test_data + paths: + - ~/data + - run: + name: load image + command: docker load -i ~/docker/image.tar + - run: + name: print version + command: | + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v $PWD/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME} --version + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME} -h + - run: + name: test 1 + command: | + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME} /bids_dataset /outputs participant --participant_label 01 --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs1/sub-01/scripts/recon-all.done + no_output_timeout: 6h + - run: + name: test 2 + command: | + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME} /bids_dataset /outputs participant --participant_label 01 --steps cross-sectional --session_label test --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done + no_output_timeout: 6h + - run: + name: group2 test 1 + command: | + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME} /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs1/ && sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ && cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv + no_output_timeout: 6h + - run: + name: group2 test 2 + command: | + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME} /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs2/ && sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ && cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv + no_output_timeout: 6h + - store_artifacts: + path: ~/outputs1 + - store_artifacts: + path: ~/outputs2 + + + deploy_fs7: + machine: + image: circleci/classic:latest + steps: + - checkout + - restore_cache: + key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }} + - run: + name: load image + command: docker load -i ~/docker/image.tar + - deploy: + command: | + if [[ -n "$DOCKER_PASS" ]]; then docker login -u $DOCKER_USER -p $DOCKER_PASS && docker push bids/${CIRCLE_PROJECT_REPONAME}_fs7:latest; fi + if [[ -n "$DOCKER_PASS" ]]; then docker login -u $DOCKER_USER -p $DOCKER_PASS && docker tag bids/${CIRCLE_PROJECT_REPONAME}_fs7 bids/${CIRCLE_PROJECT_REPONAME}_fs7:$CIRCLE_TAG && docker push bids/${CIRCLE_PROJECT_REPONAME}_fs7:$CIRCLE_TAG; fi + no_output_timeout: 6h + workflows: version: 2.1 build_test_deploy: @@ -114,6 +207,29 @@ workflows: requires: - build - test + filters: + branches: + ignore: /.*/ + tags: + only: /.*/ + - build_fs7: + filters: + tags: + only: /.*/ + branches: + only: /.*/ + - test_fs7: + requires: + - build_fs7 + filters: + tags: + only: /.*/ + branches: + only: /.*/ + - deploy_fs7: + requires: + - build_fs7 + - test_fs7 filters: branches: ignore: /.*/ diff --git a/Dockerfile b/Dockerfile index f739c80..14c6294 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,18 @@ -# Generated by Neurodocker version 0.4.2-3-gf7055a1 -# Timestamp: 2020-06-29 18:20:44 UTC +# Generated by: Neurodocker version 0.7.0+15.ga4940e3.dirty +# Latest release: Neurodocker version 0.7.0 # # 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/kaczmarj/neurodocker +# https://github.com/ReproNim/neurodocker +# +# Timestamp: 2020/11/02 20:18:23 UTC FROM ubuntu:xenial +USER root + ARG DEBIAN_FRONTEND="noninteractive" ENV LANG="en_US.UTF-8" \ @@ -24,7 +28,7 @@ RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \ locales \ unzip \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && 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" \ @@ -33,6 +37,7 @@ RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \ && 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 @@ -55,7 +60,7 @@ RUN apt-get update -qq \ libglu1-mesa \ libpython2.7-stdlib \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + && rm -rf /var/lib/apt/lists/* ENV FREESURFER_HOME="/opt/freesurfer" \ PATH="/opt/freesurfer/bin:$PATH" @@ -68,7 +73,7 @@ RUN apt-get update -qq \ perl \ tcsh \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FreeSurfer ..." \ && mkdir -p /opt/freesurfer \ && curl -fsSL --retry 5 ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \ @@ -100,17 +105,17 @@ RUN export PATH="/opt/miniconda-latest/bin:$PATH" \ && conda config --system --prepend channels conda-forge \ && conda config --system --set auto_update_conda false \ && conda config --system --set show_channel_urls true \ - && sync && conda clean -tipsy && sync \ + && sync && conda clean -y --all && sync \ && conda install -y -q --name base \ - 'python=3' \ - 'pip' \ - 'pandas' \ - 'setuptools' \ - 'pandas=0.21.0' \ - && sync && conda clean -tipsy && sync \ + "python=3" \ + "pip" \ + "pandas" \ + "setuptools" \ + "pandas=0.21.0" \ + && sync && conda clean -y --all && sync \ && bash -c "source activate base \ && pip install --no-cache-dir \ - 'nibabel'" \ + "nibabel"" \ && rm -rf ~/.cache/pip/* \ && sync @@ -120,7 +125,7 @@ RUN apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ nodejs \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + && rm -rf /var/lib/apt/lists/* RUN bash -c 'npm install -g bids-validator@0.19.8' diff --git a/Dockerfile_fs7 b/Dockerfile_fs7 index d541d4e..c2e1172 100644 --- a/Dockerfile_fs7 +++ b/Dockerfile_fs7 @@ -1,12 +1,13 @@ -# Generated by: Neurodocker version 0.7.0+12.g913b321 +# Generated by: Neurodocker version 0.7.0+15.ga4940e3.dirty # Latest release: Neurodocker version 0.7.0 -# Timestamp: 2020/07/09 17:08:57 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 +# +# Timestamp: 2020/11/02 20:18:25 UTC FROM ubuntu:xenial @@ -196,7 +197,7 @@ RUN echo '{ \ \n [ \ \n "freesurfer", \ \n { \ - \n "version": "7.1.0", \ + \n "version": "7.1.1", \ \n "install_path": "/opt/freesurfer" \ \n } \ \n ], \ diff --git a/Singularity b/Singularity index 2251296..51d1c0f 100644 --- a/Singularity +++ b/Singularity @@ -1,16 +1,20 @@ -# Generated by Neurodocker version 0.4.2-3-gf7055a1 -# Timestamp: 2020-06-29 18:20:45 UTC +# Generated by: Neurodocker version 0.7.0+15.ga4940e3.dirty +# Latest release: Neurodocker version 0.7.0 # # 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/kaczmarj/neurodocker +# https://github.com/ReproNim/neurodocker +# +# Timestamp: 2020/11/02 20:18:27 UTC Bootstrap: docker From: ubuntu:xenial %post +su - root + export ND_ENTRYPOINT="/neurodocker/startup.sh" apt-get update -qq apt-get install -y -q --no-install-recommends \ @@ -21,7 +25,7 @@ apt-get install -y -q --no-install-recommends \ locales \ unzip apt-get clean -rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +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" @@ -30,6 +34,7 @@ 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 @@ -50,7 +55,7 @@ apt-get install -y -q --no-install-recommends \ libglu1-mesa \ libpython2.7-stdlib apt-get clean -rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +rm -rf /var/lib/apt/lists/* apt-get update -qq apt-get install -y -q --no-install-recommends \ @@ -61,7 +66,7 @@ apt-get install -y -q --no-install-recommends \ perl \ tcsh apt-get clean -rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +rm -rf /var/lib/apt/lists/* echo "Downloading FreeSurfer ..." mkdir -p /opt/freesurfer curl -fsSL --retry 5 ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \ @@ -91,17 +96,17 @@ conda update -yq -nbase conda conda config --system --prepend channels conda-forge conda config --system --set auto_update_conda false conda config --system --set show_channel_urls true -sync && conda clean -tipsy && sync +sync && conda clean -y --all && sync conda install -y -q --name base \ - 'python=3' \ - 'pip' \ - 'pandas' \ - 'setuptools' \ - 'pandas=0.21.0' -sync && conda clean -tipsy && sync + "python=3" \ + "pip" \ + "pandas" \ + "setuptools" \ + "pandas=0.21.0" +sync && conda clean -y --all && sync bash -c "source activate base pip install --no-cache-dir \ - 'nibabel'" + "nibabel"" rm -rf ~/.cache/pip/* sync @@ -112,7 +117,7 @@ apt-get update -qq apt-get install -y -q --no-install-recommends \ nodejs apt-get clean -rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +rm -rf /var/lib/apt/lists/* bash -c 'npm install -g bids-validator@0.19.8' @@ -132,6 +137,10 @@ echo '{ \n "ubuntu:xenial" \n ], \n [ +\n "user", +\n "root" +\n ], +\n [ \n "_header", \n { \n "version": "generic", diff --git a/Singularity_fs7 b/Singularity_fs7 new file mode 100644 index 0000000..8f95b88 --- /dev/null +++ b/Singularity_fs7 @@ -0,0 +1,314 @@ +# Generated by: Neurodocker version 0.7.0+15.ga4940e3.dirty +# Latest release: Neurodocker version 0.7.0 +# +# 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 +# +# Timestamp: 2020/11/02 20:18:28 UTC + +Bootstrap: docker +From: ubuntu:xenial + +%post +su - root + +export ND_ENTRYPOINT="/neurodocker/startup.sh" +apt-get update -qq +apt-get install -y -q --no-install-recommends \ + apt-utils \ + bzip2 \ + ca-certificates \ + 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 + +apt-get update -qq +apt-get install -y -q --no-install-recommends \ + tcsh \ + bc \ + tar \ + libgomp1 \ + perl-modules \ + wget \ + curl \ + libsm-dev \ + libx11-dev \ + libxt-dev \ + libxext-dev \ + libglu1-mesa \ + libpython2.7-stdlib +apt-get clean +rm -rf /var/lib/apt/lists/* + +apt-get update -qq +apt-get install -y -q --no-install-recommends \ + bc \ + libgomp1 \ + libxmu6 \ + libxt6 \ + perl \ + tcsh +apt-get clean +rm -rf /var/lib/apt/lists/* +echo "Downloading FreeSurfer ..." +mkdir -p /opt/freesurfer +curl -fsSL --retry 5 https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.1.1/freesurfer-linux-centos6_x86_64-7.1.1.tar.gz \ +| tar -xz -C /opt/freesurfer --strip-components 1 \ + --exclude='freesurfer/average/mult-comp-cor' \ + --exclude='freesurfer/lib/cuda' \ + --exclude='freesurfer/lib/qt' \ + --exclude='freesurfer/subjects/V1_average' \ + --exclude='freesurfer/subjects/bert' \ + --exclude='freesurfer/subjects/cvs_avg35' \ + --exclude='freesurfer/subjects/cvs_avg35_inMNI152' \ + --exclude='freesurfer/subjects/fsaverage3' \ + --exclude='freesurfer/subjects/fsaverage4' \ + --exclude='freesurfer/subjects/fsaverage5' \ + --exclude='freesurfer/subjects/fsaverage6' \ + --exclude='freesurfer/subjects/fsaverage_sym' \ + --exclude='freesurfer/trctrain' +sed -i '$isource "/opt/freesurfer/SetUpFreeSurfer.sh"' "$ND_ENTRYPOINT" + +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 +bash "$conda_installer" -b -p /opt/miniconda-latest +rm -f "$conda_installer" +conda update -yq -nbase conda +conda config --system --prepend channels conda-forge +conda config --system --set auto_update_conda false +conda config --system --set show_channel_urls true +sync && conda clean -y --all && sync +conda install -y -q --name base \ + "python=3" \ + "pip" \ + "pandas" \ + "setuptools" \ + "pandas=0.21.0" +sync && conda clean -y --all && sync +bash -c "source activate base + pip install --no-cache-dir \ + "nibabel"" +rm -rf ~/.cache/pip/* +sync + + +bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' + +apt-get update -qq +apt-get install -y -q --no-install-recommends \ + nodejs +apt-get clean +rm -rf /var/lib/apt/lists/* + +bash -c 'npm install -g bids-validator@0.19.8' + +mkdir root/matlab && touch root/matlab/startup.m + +mkdir /scratch + +mkdir /local-scratch + +chmod +x /run.py + +echo '{ +\n "pkg_manager": "apt", +\n "instructions": [ +\n [ +\n "base", +\n "ubuntu:xenial" +\n ], +\n [ +\n "user", +\n "root" +\n ], +\n [ +\n "_header", +\n { +\n "version": "generic", +\n "method": "custom" +\n } +\n ], +\n [ +\n "install", +\n [ +\n "tcsh", +\n "bc", +\n "tar", +\n "libgomp1", +\n "perl-modules", +\n "wget", +\n "curl", +\n "libsm-dev", +\n "libx11-dev", +\n "libxt-dev", +\n "libxext-dev", +\n "libglu1-mesa", +\n "libpython2.7-stdlib" +\n ] +\n ], +\n [ +\n "freesurfer", +\n { +\n "version": "7.1.1", +\n "install_path": "/opt/freesurfer" +\n } +\n ], +\n [ +\n "miniconda", +\n { +\n "use_env": "base", +\n "conda_install": [ +\n "python=3", +\n "pip", +\n "pandas", +\n "setuptools", +\n "pandas=0.21.0" +\n ], +\n "pip_install": [ +\n "nibabel" +\n ] +\n } +\n ], +\n [ +\n "run_bash", +\n "curl -sL https://deb.nodesource.com/setup_6.x | bash -" +\n ], +\n [ +\n "install", +\n [ +\n "nodejs" +\n ] +\n ], +\n [ +\n "run_bash", +\n "npm install -g bids-validator@0.19.8" +\n ], +\n [ +\n "env", +\n { +\n "FSLDIR": "/usr/share/fsl/5.0", +\n "FSLOUTPUTTYPE": "NIFTI_GZ", +\n "FSLMULTIFILEQUIT": "TRUE", +\n "POSSUMDIR": "/usr/share/fsl/5.0", +\n "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", +\n "FSLTCLSH": "/usr/bin/tclsh", +\n "FSLWISH": "/usr/bin/wish" +\n } +\n ], +\n [ +\n "env", +\n { +\n "OS": "Linux", +\n "FS_OVERRIDE": "0", +\n "FIX_VERTEX_AREA": "", +\n "SUBJECTS_DIR": "/opt/freesurfer/subjects", +\n "FSF_OUTPUT_FORMAT": "nii.gz", +\n "MNI_DIR": "/opt/freesurfer/mni", +\n "LOCAL_DIR": "/opt/freesurfer/local", +\n "FREESURFER_HOME": "/opt/freesurfer", +\n "FSFAST_HOME": "/opt/freesurfer/fsfast", +\n "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", +\n "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", +\n "MNI_DATAPATH": "/opt/freesurfer/mni/data", +\n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", +\n "PERL5LIB": "/opt/freesurfer/mni/share/perl5", +\n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", +\n "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", +\n "PYTHONPATH": "" +\n } +\n ], +\n [ +\n "run", +\n "mkdir root/matlab && touch root/matlab/startup.m" +\n ], +\n [ +\n "run", +\n "mkdir /scratch" +\n ], +\n [ +\n "run", +\n "mkdir /local-scratch" +\n ], +\n [ +\n "copy", +\n [ +\n "run.py", +\n "/run.py" +\n ] +\n ], +\n [ +\n "run", +\n "chmod +x /run.py" +\n ], +\n [ +\n "copy", +\n [ +\n "version", +\n "/version" +\n ] +\n ], +\n [ +\n "entrypoint", +\n "/neurodocker/startup.sh /run.py" +\n ] +\n ] +\n}' > /neurodocker/neurodocker_specs.json + +%environment +export LANG="en_US.UTF-8" +export LC_ALL="en_US.UTF-8" +export ND_ENTRYPOINT="/neurodocker/startup.sh" +export FREESURFER_HOME="/opt/freesurfer" +export PATH="/opt/freesurfer/bin:$PATH" +export CONDA_DIR="/opt/miniconda-latest" +export PATH="/opt/miniconda-latest/bin:$PATH" +export FSLDIR="/usr/share/fsl/5.0" +export FSLOUTPUTTYPE="NIFTI_GZ" +export FSLMULTIFILEQUIT="TRUE" +export POSSUMDIR="/usr/share/fsl/5.0" +export LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" +export FSLTCLSH="/usr/bin/tclsh" +export FSLWISH="/usr/bin/wish" +export OS="Linux" +export FS_OVERRIDE="0" +export FIX_VERTEX_AREA="" +export SUBJECTS_DIR="/opt/freesurfer/subjects" +export FSF_OUTPUT_FORMAT="nii.gz" +export MNI_DIR="/opt/freesurfer/mni" +export LOCAL_DIR="/opt/freesurfer/local" +export FREESURFER_HOME="/opt/freesurfer" +export FSFAST_HOME="/opt/freesurfer/fsfast" +export MINC_BIN_DIR="/opt/freesurfer/mni/bin" +export MINC_LIB_DIR="/opt/freesurfer/mni/lib" +export MNI_DATAPATH="/opt/freesurfer/mni/data" +export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" +export PERL5LIB="/opt/freesurfer/mni/share/perl5" +export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" +export PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +export PYTHONPATH="" + +%files +run.py /run.py +version /version + +%runscript +/neurodocker/startup.sh /run.py diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index 0c6e234..b1f4bd2 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -39,7 +39,7 @@ # ############################################################################### -image="kaczmarj/neurodocker:master@sha256:936401fe8f677e0d294f688f352cbb643c9693f8de371475de1d593650e42a66" +image="repronim/neurodocker@sha256:291c40c8efce92260822b6ef40f88c300d77d09f08d577f55c46ef7c4b43d2e5" # Generate a dockerfile for building BIDS-Apps Freesurfer container docker run --rm ${image} generate docker \ @@ -72,6 +72,36 @@ docker run --rm ${image} generate docker \ --entrypoint '/neurodocker/startup.sh /run.py' \ > Dockerfile +docker run --rm ${image} generate docker \ + --base ubuntu:xenial \ + --pkg-manager apt \ + --install tcsh bc tar libgomp1 perl-modules wget curl \ + libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ + --freesurfer version=7.1.1 install_path=/opt/freesurfer \ + --miniconda use_env=base conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ + --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ + --install nodejs \ + --run-bash 'npm install -g bids-validator@0.19.8' \ + --env FSLDIR=/usr/share/fsl/5.0 FSLOUTPUTTYPE=NIFTI_GZ \ + FSLMULTIFILEQUIT=TRUE POSSUMDIR=/usr/share/fsl/5.0 LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \ + FSLTCLSH=/usr/bin/tclsh FSLWISH=/usr/bin/wish FSLOUTPUTTYPE=NIFTI_GZ \ + --env OS=Linux FS_OVERRIDE=0 FIX_VERTEX_AREA= SUBJECTS_DIR=/opt/freesurfer/subjects \ + FSF_OUTPUT_FORMAT=nii.gz MNI_DIR=/opt/freesurfer/mni LOCAL_DIR=/opt/freesurfer/local \ + FREESURFER_HOME=/opt/freesurfer FSFAST_HOME=/opt/freesurfer/fsfast MINC_BIN_DIR=/opt/freesurfer/mni/bin \ + MINC_LIB_DIR=/opt/freesurfer/mni/lib MNI_DATAPATH=/opt/freesurfer/mni/data \ + FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast PERL5LIB=/opt/freesurfer/mni/share/perl5 \ + MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \ + PATH=/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + PYTHONPATH="" \ + --run 'mkdir root/matlab && touch root/matlab/startup.m' \ + --run 'mkdir /scratch' \ + --run 'mkdir /local-scratch' \ + --copy run.py '/run.py' \ + --run 'chmod +x /run.py' \ + --copy version '/version' \ + --entrypoint '/neurodocker/startup.sh /run.py' \ +> Dockerfile_fs7 + # Generate a singularity recipe for building BIDS-Apps Freesurfer container docker run --rm ${image} generate singularity \ @@ -103,3 +133,34 @@ docker run --rm ${image} generate singularity \ --copy version '/version' \ --entrypoint '/neurodocker/startup.sh /run.py' \ > Singularity + + +docker run --rm ${image} generate singularity \ + --base ubuntu:xenial \ + --pkg-manager apt \ + --install tcsh bc tar libgomp1 perl-modules wget curl \ + libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ + --freesurfer version=7.1.1 install_path=/opt/freesurfer \ + --miniconda use_env=base conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ + --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ + --install nodejs \ + --run-bash 'npm install -g bids-validator@0.19.8' \ + --env FSLDIR=/usr/share/fsl/5.0 FSLOUTPUTTYPE=NIFTI_GZ \ + FSLMULTIFILEQUIT=TRUE POSSUMDIR=/usr/share/fsl/5.0 LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \ + FSLTCLSH=/usr/bin/tclsh FSLWISH=/usr/bin/wish FSLOUTPUTTYPE=NIFTI_GZ \ + --env OS=Linux FS_OVERRIDE=0 FIX_VERTEX_AREA= SUBJECTS_DIR=/opt/freesurfer/subjects \ + FSF_OUTPUT_FORMAT=nii.gz MNI_DIR=/opt/freesurfer/mni LOCAL_DIR=/opt/freesurfer/local \ + FREESURFER_HOME=/opt/freesurfer FSFAST_HOME=/opt/freesurfer/fsfast MINC_BIN_DIR=/opt/freesurfer/mni/bin \ + MINC_LIB_DIR=/opt/freesurfer/mni/lib MNI_DATAPATH=/opt/freesurfer/mni/data \ + FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast PERL5LIB=/opt/freesurfer/mni/share/perl5 \ + MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \ + PATH=/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + PYTHONPATH="" \ + --run 'mkdir root/matlab && touch root/matlab/startup.m' \ + --run 'mkdir /scratch' \ + --run 'mkdir /local-scratch' \ + --copy run.py '/run.py' \ + --run 'chmod +x /run.py' \ + --copy version '/version' \ + --entrypoint '/neurodocker/startup.sh /run.py' \ +> Singularity_fs7 \ No newline at end of file From 196b712ca3370ec1248df5aed0c45952830a7bc2 Mon Sep 17 00:00:00 2001 From: shotgunosine Date: Tue, 3 Nov 2020 11:08:17 -0500 Subject: [PATCH 04/33] fix circleci config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 381cf01..5c73b60 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -107,7 +107,7 @@ jobs: if [[ -e ~/docker/image_fs7.tar ]]; then docker load -i ~/docker/image_fs7.tar; fi git describe --tags > version docker build -t bids/${CIRCLE_PROJECT_REPONAME}_fs7 -f Dockerfile_fs7 . - mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}" > ~/docker/image.tar + mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}_fs7" > ~/docker/image.tar mkdir -p ~/license; echo "cHJpbnRmICJEeWxhbi5OaWVsc29uQGdtYWlsLmNvbVxuMzcwNjNcbiAqQ1lrZWhQYUNvRDlNXG4gRlM2N1BTWmRFV2lqb1xuIiA+IH4vbGljZW5zZS9saWNlbnNlLnR4dA==" | base64 -d | sh no_output_timeout: 6h - save_cache: From b65ce3505f55888939d95f075223f16e85976931 Mon Sep 17 00:00:00 2001 From: shotgunosine Date: Tue, 3 Nov 2020 11:46:12 -0500 Subject: [PATCH 05/33] have fs_7 tests use fs_7 image --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c73b60..760eac0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -141,27 +141,27 @@ jobs: - run: name: print version command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v $PWD/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME} --version - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME} -h + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v $PWD/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME}_fs7 --version + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME}_fs7 -h - run: name: test 1 command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME} /bids_dataset /outputs participant --participant_label 01 --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs1/sub-01/scripts/recon-all.done + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs participant --participant_label 01 --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs1/sub-01/scripts/recon-all.done no_output_timeout: 6h - run: name: test 2 command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME} /bids_dataset /outputs participant --participant_label 01 --steps cross-sectional --session_label test --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs participant --participant_label 01 --steps cross-sectional --session_label test --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done no_output_timeout: 6h - run: name: group2 test 1 command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME} /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs1/ && sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ && cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs1/ && sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ && cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv no_output_timeout: 6h - run: name: group2 test 2 command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME} /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs2/ && sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ && cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs2/ && sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ && cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv no_output_timeout: 6h - store_artifacts: path: ~/outputs1 From d261690ee9239a3aff36775939cc4f91690f7889 Mon Sep 17 00:00:00 2001 From: shotgunosine Date: Tue, 3 Nov 2020 16:42:22 -0500 Subject: [PATCH 06/33] fix don't use python2 prefix to group commands if we're running freesurfer 7 --- run.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/run.py b/run.py index f951b66..1c95596 100755 --- a/run.py +++ b/run.py @@ -517,6 +517,15 @@ def run(command, env={}, ignore_errors=False): raise Exception("No freesurfer subject found for %s in %s" % (s, output_dir)) subjects_str = " ".join(subjects) + # The call to python2 is only required if we're running Freesurfer 6, we'll need to check version + # and modify the calls accordingly. + with open(os.path.join(os.environ['FREESURFER_HOME'], 'build-stamp.txt'), 'r') as h: + bs = h.read() + if '-7.' in bs: + cmd_start = '' + else: + cmd_start = 'python2 ' + if len(subjects) > 0: # create cortical stats for p in args.parcellations: @@ -526,7 +535,7 @@ def run(command, env={}, ignore_errors=False): if os.path.isfile(table_file): warn("Replace old file %s" % table_file) os.remove(table_file) - cmd = "python2 `which aparcstats2table` --hemi {h} --subjects {subjects} --parc {p} --meas {m} " \ + cmd = cmd_start + "`which aparcstats2table` --hemi {h} --subjects {subjects} --parc {p} --meas {m} " \ "--tablefile {table_file}".format(h=h, subjects=subjects_str, p=p, m=m, table_file=table_file) print("Creating cortical stats table for {h} {p} {m}".format(h=h, p=p, m=m)) @@ -537,7 +546,7 @@ def run(command, env={}, ignore_errors=False): if os.path.isfile(table_file): warn("Replace old file %s" % table_file) os.remove(table_file) - cmd = "python2 `which asegstats2table` --subjects {subjects} --meas volume --tablefile {" \ + cmd = cmd_start + "`which asegstats2table` --subjects {subjects} --meas volume --tablefile {" \ "table_file}".format(subjects=subjects_str, table_file=table_file) print("Creating subcortical stats table.") run(cmd, env={"SUBJECTS_DIR": output_dir, 'FS_LICENSE': args.license_file}) From 97c3a9f597eb12c4f12a008339d5cd1ab63da1f6 Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Fri, 25 Aug 2023 15:30:00 -0400 Subject: [PATCH 07/33] bump neurodocker to master and freesurfer to 7.4.1 --- Dockerfile | 518 +++++++++++++++++--------------- Dockerfile_fs7 | 518 +++++++++++++++++--------------- Singularity | 541 ++++++++++++++++++---------------- Singularity_fs7 | 541 ++++++++++++++++++---------------- generate_freesurfer_images.sh | 22 +- 5 files changed, 1153 insertions(+), 987 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14c6294..520042a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,134 +1,113 @@ -# Generated by: Neurodocker version 0.7.0+15.ga4940e3.dirty -# Latest release: Neurodocker version 0.7.0 -# -# 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 -# -# Timestamp: 2020/11/02 20:18:23 UTC +# Generated by Neurodocker and Reproenv. FROM ubuntu:xenial - -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 \ - 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 \ - tcsh \ - bc \ - tar \ - libgomp1 \ - perl-modules \ - wget \ - curl \ - libsm-dev \ - libx11-dev \ - libxt-dev \ - libxext-dev \ - libglu1-mesa \ - libpython2.7-stdlib \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -ENV FREESURFER_HOME="/opt/freesurfer" \ - PATH="/opt/freesurfer/bin:$PATH" + && apt-get install -y -q --no-install-recommends \ + bc \ + curl \ + libglu1-mesa \ + libgomp1 \ + libpython2.7-stdlib \ + libsm-dev \ + libx11-dev \ + libxext-dev \ + libxt-dev \ + perl-modules \ + tar \ + tcsh \ + wget \ + && rm -rf /var/lib/apt/lists/* +ENV OS="Linux" \ + PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH" \ + FREESURFER_HOME="/opt/freesurfer" \ + FREESURFER="/opt/freesurfer" \ + SUBJECTS_DIR="/opt/freesurfer/subjects" \ + LOCAL_DIR="/opt/freesurfer/local" \ + FSFAST_HOME="/opt/freesurfer/fsfast" \ + FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \ + FUNCTIONALS_DIR="/opt/freesurfer/sessions" \ + FS_OVERRIDE="0" \ + FIX_VERTEX_AREA="" \ + FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" \ + MINC_BIN_DIR="/opt/freesurfer/mni/bin" \ + MINC_LIB_DIR="/opt/freesurfer/mni/lib" \ + MNI_DIR="/opt/freesurfer/mni" \ + MNI_DATAPATH="/opt/freesurfer/mni/data" \ + MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5" \ + PERL5LIB="/opt/freesurfer/mni/share/perl5" RUN apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ bc \ + ca-certificates \ + curl \ libgomp1 \ libxmu6 \ libxt6 \ perl \ tcsh \ - && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FreeSurfer ..." \ && mkdir -p /opt/freesurfer \ - && curl -fsSL --retry 5 ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \ - | tar -xz -C /opt/freesurfer --strip-components 1 \ - --exclude='freesurfer/average/mult-comp-cor' \ - --exclude='freesurfer/lib/cuda' \ - --exclude='freesurfer/lib/qt' \ - --exclude='freesurfer/subjects/V1_average' \ - --exclude='freesurfer/subjects/bert' \ - --exclude='freesurfer/subjects/cvs_avg35' \ - --exclude='freesurfer/subjects/cvs_avg35_inMNI152' \ - --exclude='freesurfer/subjects/fsaverage3' \ - --exclude='freesurfer/subjects/fsaverage4' \ - --exclude='freesurfer/subjects/fsaverage5' \ - --exclude='freesurfer/subjects/fsaverage6' \ - --exclude='freesurfer/subjects/fsaverage_sym' \ - --exclude='freesurfer/trctrain' \ - && sed -i '$isource "/opt/freesurfer/SetUpFreeSurfer.sh"' "$ND_ENTRYPOINT" - + && curl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \ + | tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \ + --exclude='average/mult-comp-cor' \ + --exclude='lib/cuda' \ + --exclude='lib/qt' \ + --exclude='subjects/V1_average' \ + --exclude='subjects/bert' \ + --exclude='subjects/cvs_avg35' \ + --exclude='subjects/cvs_avg35_inMNI152' \ + --exclude='subjects/fsaverage3' \ + --exclude='subjects/fsaverage4' \ + --exclude='subjects/fsaverage5' \ + --exclude='subjects/fsaverage6' \ + --exclude='subjects/fsaverage_sym' \ + --exclude='trctrain' ENV CONDA_DIR="/opt/miniconda-latest" \ PATH="/opt/miniconda-latest/bin:$PATH" -RUN export PATH="/opt/miniconda-latest/bin:$PATH" \ +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + bzip2 \ + ca-certificates \ + curl \ + && rm -rf /var/lib/apt/lists/* \ + # 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 install -y -q --name base \ + # Enable `conda activate` + && conda init bash \ + && conda install -y --name base \ "python=3" \ "pip" \ "pandas" \ "setuptools" \ "pandas=0.21.0" \ - && sync && conda clean -y --all && sync \ && bash -c "source activate base \ - && pip install --no-cache-dir \ + && python -m pip install --no-cache-dir \ "nibabel"" \ - && rm -rf ~/.cache/pip/* \ - && sync - + # Clean up + && sync && conda clean --all --yes && sync \ + && rm -rf ~/.cache/pip/* RUN bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' - RUN apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - nodejs \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - + && apt-get install -y -q --no-install-recommends \ + nodejs \ + && rm -rf /var/lib/apt/lists/* RUN bash -c 'npm install -g bids-validator@0.19.8' - ENV FSLDIR="/usr/share/fsl/5.0" \ FSLOUTPUTTYPE="NIFTI_GZ" \ FSLMULTIFILEQUIT="TRUE" \ @@ -136,7 +115,6 @@ ENV FSLDIR="/usr/share/fsl/5.0" \ LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" \ FSLTCLSH="/usr/bin/tclsh" \ FSLWISH="/usr/bin/wish" - ENV OS="Linux" \ FS_OVERRIDE="0" \ FIX_VERTEX_AREA="" \ @@ -154,150 +132,212 @@ ENV OS="Linux" \ MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \ PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ PYTHONPATH="" - RUN mkdir root/matlab && touch root/matlab/startup.m - RUN mkdir /scratch - RUN mkdir /local-scratch - -COPY ["run.py", "/run.py"] - +COPY ["run.py", \ + "/run.py"] RUN chmod +x /run.py - -COPY ["version", "/version"] - +COPY ["version", \ + "/version"] ENTRYPOINT ["/neurodocker/startup.sh", "/run.py"] -RUN echo '{ \ - \n "pkg_manager": "apt", \ - \n "instructions": [ \ - \n [ \ - \n "base", \ - \n "ubuntu:xenial" \ - \n ], \ - \n [ \ - \n "install", \ - \n [ \ - \n "tcsh", \ - \n "bc", \ - \n "tar", \ - \n "libgomp1", \ - \n "perl-modules", \ - \n "wget", \ - \n "curl", \ - \n "libsm-dev", \ - \n "libx11-dev", \ - \n "libxt-dev", \ - \n "libxext-dev", \ - \n "libglu1-mesa", \ - \n "libpython2.7-stdlib" \ - \n ] \ - \n ], \ - \n [ \ - \n "freesurfer", \ - \n { \ - \n "version": "6.0.1", \ - \n "install_path": "/opt/freesurfer" \ - \n } \ - \n ], \ - \n [ \ - \n "miniconda", \ - \n { \ - \n "use_env": "base", \ - \n "conda_install": [ \ - \n "python=3", \ - \n "pip", \ - \n "pandas", \ - \n "setuptools", \ - \n "pandas=0.21.0" \ - \n ], \ - \n "pip_install": [ \ - \n "nibabel" \ - \n ] \ - \n } \ - \n ], \ - \n [ \ - \n "run_bash", \ - \n "curl -sL https://deb.nodesource.com/setup_6.x | bash -" \ - \n ], \ - \n [ \ - \n "install", \ - \n [ \ - \n "nodejs" \ - \n ] \ - \n ], \ - \n [ \ - \n "run_bash", \ - \n "npm install -g bids-validator@0.19.8" \ - \n ], \ - \n [ \ - \n "env", \ - \n { \ - \n "FSLDIR": "/usr/share/fsl/5.0", \ - \n "FSLOUTPUTTYPE": "NIFTI_GZ", \ - \n "FSLMULTIFILEQUIT": "TRUE", \ - \n "POSSUMDIR": "/usr/share/fsl/5.0", \ - \n "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \ - \n "FSLTCLSH": "/usr/bin/tclsh", \ - \n "FSLWISH": "/usr/bin/wish" \ - \n } \ - \n ], \ - \n [ \ - \n "env", \ - \n { \ - \n "OS": "Linux", \ - \n "FS_OVERRIDE": "0", \ - \n "FIX_VERTEX_AREA": "", \ - \n "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ - \n "FSF_OUTPUT_FORMAT": "nii.gz", \ - \n "MNI_DIR": "/opt/freesurfer/mni", \ - \n "LOCAL_DIR": "/opt/freesurfer/local", \ - \n "FREESURFER_HOME": "/opt/freesurfer", \ - \n "FSFAST_HOME": "/opt/freesurfer/fsfast", \ - \n "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ - \n "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ - \n "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ - \n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ - \n "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ - \n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \ - \n "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \ - \n "PYTHONPATH": "" \ - \n } \ - \n ], \ - \n [ \ - \n "run", \ - \n "mkdir root/matlab && touch root/matlab/startup.m" \ - \n ], \ - \n [ \ - \n "run", \ - \n "mkdir /scratch" \ - \n ], \ - \n [ \ - \n "run", \ - \n "mkdir /local-scratch" \ - \n ], \ - \n [ \ - \n "copy", \ - \n [ \ - \n "run.py", \ - \n "/run.py" \ - \n ] \ - \n ], \ - \n [ \ - \n "run", \ - \n "chmod +x /run.py" \ - \n ], \ - \n [ \ - \n "copy", \ - \n [ \ - \n "version", \ - \n "/version" \ - \n ] \ - \n ], \ - \n [ \ - \n "entrypoint", \ - \n "/neurodocker/startup.sh /run.py" \ - \n ] \ - \n ] \ - \n}' > /neurodocker/neurodocker_specs.json +# Save specification to JSON. +RUN printf '{ \ + "pkg_manager": "apt", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "ubuntu:xenial" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "tcsh", \ + "bc", \ + "tar", \ + "libgomp1", \ + "perl-modules", \ + "wget", \ + "curl", \ + "libsm-dev", \ + "libx11-dev", \ + "libxt-dev", \ + "libxext-dev", \ + "libglu1-mesa", \ + "libpython2.7-stdlib" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget \\\\\\n && rm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FREESURFER": "/opt/freesurfer", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/freesurfer\\ncurl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "CONDA_DIR": "/opt/miniconda-latest", \ + "PATH": "/opt/miniconda-latest/bin:$PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "nodejs" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n nodejs \\\\\\n && rm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "FSLDIR": "/usr/share/fsl/5.0", \ + "FSLOUTPUTTYPE": "NIFTI_GZ", \ + "FSLMULTIFILEQUIT": "TRUE", \ + "POSSUMDIR": "/usr/share/fsl/5.0", \ + "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \ + "FSLTCLSH": "/usr/bin/tclsh", \ + "FSLWISH": "/usr/bin/wish" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "FSF_OUTPUT_FORMAT": "nii.gz", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \ + "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \ + "PYTHONPATH": "" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir root/matlab && touch root/matlab/startup.m" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /scratch" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /local-scratch" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "run.py", \ + "/run.py" \ + ], \ + "destination": "/run.py" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "chmod +x /run.py" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "version", \ + "/version" \ + ], \ + "destination": "/version" \ + } \ + }, \ + { \ + "name": "entrypoint", \ + "kwds": { \ + "args": [ \ + "/neurodocker/startup.sh", \ + "/run.py" \ + ] \ + } \ + } \ + ] \ +}' > /.reproenv.json +# End saving to specification to JSON. diff --git a/Dockerfile_fs7 b/Dockerfile_fs7 index c2e1172..84ea1dd 100644 --- a/Dockerfile_fs7 +++ b/Dockerfile_fs7 @@ -1,134 +1,113 @@ -# Generated by: Neurodocker version 0.7.0+15.ga4940e3.dirty -# Latest release: Neurodocker version 0.7.0 -# -# 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 -# -# Timestamp: 2020/11/02 20:18:25 UTC +# Generated by Neurodocker and Reproenv. FROM ubuntu:xenial - -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 \ - 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 \ - tcsh \ - bc \ - tar \ - libgomp1 \ - perl-modules \ - wget \ - curl \ - libsm-dev \ - libx11-dev \ - libxt-dev \ - libxext-dev \ - libglu1-mesa \ - libpython2.7-stdlib \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -ENV FREESURFER_HOME="/opt/freesurfer" \ - PATH="/opt/freesurfer/bin:$PATH" + && apt-get install -y -q --no-install-recommends \ + bc \ + curl \ + libglu1-mesa \ + libgomp1 \ + libpython2.7-stdlib \ + libsm-dev \ + libx11-dev \ + libxext-dev \ + libxt-dev \ + perl-modules \ + tar \ + tcsh \ + wget \ + && rm -rf /var/lib/apt/lists/* +ENV OS="Linux" \ + PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH" \ + FREESURFER_HOME="/opt/freesurfer" \ + FREESURFER="/opt/freesurfer" \ + SUBJECTS_DIR="/opt/freesurfer/subjects" \ + LOCAL_DIR="/opt/freesurfer/local" \ + FSFAST_HOME="/opt/freesurfer/fsfast" \ + FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \ + FUNCTIONALS_DIR="/opt/freesurfer/sessions" \ + FS_OVERRIDE="0" \ + FIX_VERTEX_AREA="" \ + FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" \ + MINC_BIN_DIR="/opt/freesurfer/mni/bin" \ + MINC_LIB_DIR="/opt/freesurfer/mni/lib" \ + MNI_DIR="/opt/freesurfer/mni" \ + MNI_DATAPATH="/opt/freesurfer/mni/data" \ + MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5" \ + PERL5LIB="/opt/freesurfer/mni/share/perl5" RUN apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ bc \ + ca-certificates \ + curl \ libgomp1 \ libxmu6 \ libxt6 \ perl \ tcsh \ - && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FreeSurfer ..." \ && mkdir -p /opt/freesurfer \ - && curl -fsSL --retry 5 https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.1.1/freesurfer-linux-centos6_x86_64-7.1.1.tar.gz \ - | tar -xz -C /opt/freesurfer --strip-components 1 \ - --exclude='freesurfer/average/mult-comp-cor' \ - --exclude='freesurfer/lib/cuda' \ - --exclude='freesurfer/lib/qt' \ - --exclude='freesurfer/subjects/V1_average' \ - --exclude='freesurfer/subjects/bert' \ - --exclude='freesurfer/subjects/cvs_avg35' \ - --exclude='freesurfer/subjects/cvs_avg35_inMNI152' \ - --exclude='freesurfer/subjects/fsaverage3' \ - --exclude='freesurfer/subjects/fsaverage4' \ - --exclude='freesurfer/subjects/fsaverage5' \ - --exclude='freesurfer/subjects/fsaverage6' \ - --exclude='freesurfer/subjects/fsaverage_sym' \ - --exclude='freesurfer/trctrain' \ - && sed -i '$isource "/opt/freesurfer/SetUpFreeSurfer.sh"' "$ND_ENTRYPOINT" - + && curl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \ + | tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \ + --exclude='average/mult-comp-cor' \ + --exclude='lib/cuda' \ + --exclude='lib/qt' \ + --exclude='subjects/V1_average' \ + --exclude='subjects/bert' \ + --exclude='subjects/cvs_avg35' \ + --exclude='subjects/cvs_avg35_inMNI152' \ + --exclude='subjects/fsaverage3' \ + --exclude='subjects/fsaverage4' \ + --exclude='subjects/fsaverage5' \ + --exclude='subjects/fsaverage6' \ + --exclude='subjects/fsaverage_sym' \ + --exclude='trctrain' ENV CONDA_DIR="/opt/miniconda-latest" \ PATH="/opt/miniconda-latest/bin:$PATH" -RUN export PATH="/opt/miniconda-latest/bin:$PATH" \ +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + bzip2 \ + ca-certificates \ + curl \ + && rm -rf /var/lib/apt/lists/* \ + # 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 install -y -q --name base \ + # Enable `conda activate` + && conda init bash \ + && conda install -y --name base \ "python=3" \ "pip" \ "pandas" \ "setuptools" \ "pandas=0.21.0" \ - && sync && conda clean -y --all && sync \ && bash -c "source activate base \ - && pip install --no-cache-dir \ + && python -m pip install --no-cache-dir \ "nibabel"" \ - && rm -rf ~/.cache/pip/* \ - && sync - + # Clean up + && sync && conda clean --all --yes && sync \ + && rm -rf ~/.cache/pip/* RUN bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' - RUN apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - nodejs \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - + && apt-get install -y -q --no-install-recommends \ + nodejs \ + && rm -rf /var/lib/apt/lists/* RUN bash -c 'npm install -g bids-validator@0.19.8' - ENV FSLDIR="/usr/share/fsl/5.0" \ FSLOUTPUTTYPE="NIFTI_GZ" \ FSLMULTIFILEQUIT="TRUE" \ @@ -136,7 +115,6 @@ ENV FSLDIR="/usr/share/fsl/5.0" \ LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" \ FSLTCLSH="/usr/bin/tclsh" \ FSLWISH="/usr/bin/wish" - ENV OS="Linux" \ FS_OVERRIDE="0" \ FIX_VERTEX_AREA="" \ @@ -154,150 +132,212 @@ ENV OS="Linux" \ MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \ PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ PYTHONPATH="" - RUN mkdir root/matlab && touch root/matlab/startup.m - RUN mkdir /scratch - RUN mkdir /local-scratch - -COPY ["run.py", "/run.py"] - +COPY ["run.py", \ + "/run.py"] RUN chmod +x /run.py - -COPY ["version", "/version"] - +COPY ["version", \ + "/version"] ENTRYPOINT ["/neurodocker/startup.sh", "/run.py"] -RUN echo '{ \ - \n "pkg_manager": "apt", \ - \n "instructions": [ \ - \n [ \ - \n "base", \ - \n "ubuntu:xenial" \ - \n ], \ - \n [ \ - \n "install", \ - \n [ \ - \n "tcsh", \ - \n "bc", \ - \n "tar", \ - \n "libgomp1", \ - \n "perl-modules", \ - \n "wget", \ - \n "curl", \ - \n "libsm-dev", \ - \n "libx11-dev", \ - \n "libxt-dev", \ - \n "libxext-dev", \ - \n "libglu1-mesa", \ - \n "libpython2.7-stdlib" \ - \n ] \ - \n ], \ - \n [ \ - \n "freesurfer", \ - \n { \ - \n "version": "7.1.1", \ - \n "install_path": "/opt/freesurfer" \ - \n } \ - \n ], \ - \n [ \ - \n "miniconda", \ - \n { \ - \n "use_env": "base", \ - \n "conda_install": [ \ - \n "python=3", \ - \n "pip", \ - \n "pandas", \ - \n "setuptools", \ - \n "pandas=0.21.0" \ - \n ], \ - \n "pip_install": [ \ - \n "nibabel" \ - \n ] \ - \n } \ - \n ], \ - \n [ \ - \n "run_bash", \ - \n "curl -sL https://deb.nodesource.com/setup_6.x | bash -" \ - \n ], \ - \n [ \ - \n "install", \ - \n [ \ - \n "nodejs" \ - \n ] \ - \n ], \ - \n [ \ - \n "run_bash", \ - \n "npm install -g bids-validator@0.19.8" \ - \n ], \ - \n [ \ - \n "env", \ - \n { \ - \n "FSLDIR": "/usr/share/fsl/5.0", \ - \n "FSLOUTPUTTYPE": "NIFTI_GZ", \ - \n "FSLMULTIFILEQUIT": "TRUE", \ - \n "POSSUMDIR": "/usr/share/fsl/5.0", \ - \n "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \ - \n "FSLTCLSH": "/usr/bin/tclsh", \ - \n "FSLWISH": "/usr/bin/wish" \ - \n } \ - \n ], \ - \n [ \ - \n "env", \ - \n { \ - \n "OS": "Linux", \ - \n "FS_OVERRIDE": "0", \ - \n "FIX_VERTEX_AREA": "", \ - \n "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ - \n "FSF_OUTPUT_FORMAT": "nii.gz", \ - \n "MNI_DIR": "/opt/freesurfer/mni", \ - \n "LOCAL_DIR": "/opt/freesurfer/local", \ - \n "FREESURFER_HOME": "/opt/freesurfer", \ - \n "FSFAST_HOME": "/opt/freesurfer/fsfast", \ - \n "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ - \n "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ - \n "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ - \n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ - \n "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ - \n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \ - \n "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \ - \n "PYTHONPATH": "" \ - \n } \ - \n ], \ - \n [ \ - \n "run", \ - \n "mkdir root/matlab && touch root/matlab/startup.m" \ - \n ], \ - \n [ \ - \n "run", \ - \n "mkdir /scratch" \ - \n ], \ - \n [ \ - \n "run", \ - \n "mkdir /local-scratch" \ - \n ], \ - \n [ \ - \n "copy", \ - \n [ \ - \n "run.py", \ - \n "/run.py" \ - \n ] \ - \n ], \ - \n [ \ - \n "run", \ - \n "chmod +x /run.py" \ - \n ], \ - \n [ \ - \n "copy", \ - \n [ \ - \n "version", \ - \n "/version" \ - \n ] \ - \n ], \ - \n [ \ - \n "entrypoint", \ - \n "/neurodocker/startup.sh /run.py" \ - \n ] \ - \n ] \ - \n}' > /neurodocker/neurodocker_specs.json +# Save specification to JSON. +RUN printf '{ \ + "pkg_manager": "apt", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "ubuntu:xenial" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "tcsh", \ + "bc", \ + "tar", \ + "libgomp1", \ + "perl-modules", \ + "wget", \ + "curl", \ + "libsm-dev", \ + "libx11-dev", \ + "libxt-dev", \ + "libxext-dev", \ + "libglu1-mesa", \ + "libpython2.7-stdlib" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget \\\\\\n && rm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FREESURFER": "/opt/freesurfer", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/freesurfer\\ncurl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "CONDA_DIR": "/opt/miniconda-latest", \ + "PATH": "/opt/miniconda-latest/bin:$PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "nodejs" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n nodejs \\\\\\n && rm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "FSLDIR": "/usr/share/fsl/5.0", \ + "FSLOUTPUTTYPE": "NIFTI_GZ", \ + "FSLMULTIFILEQUIT": "TRUE", \ + "POSSUMDIR": "/usr/share/fsl/5.0", \ + "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \ + "FSLTCLSH": "/usr/bin/tclsh", \ + "FSLWISH": "/usr/bin/wish" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "FSF_OUTPUT_FORMAT": "nii.gz", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \ + "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \ + "PYTHONPATH": "" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir root/matlab && touch root/matlab/startup.m" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /scratch" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /local-scratch" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "run.py", \ + "/run.py" \ + ], \ + "destination": "/run.py" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "chmod +x /run.py" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "version", \ + "/version" \ + ], \ + "destination": "/version" \ + } \ + }, \ + { \ + "name": "entrypoint", \ + "kwds": { \ + "args": [ \ + "/neurodocker/startup.sh", \ + "/run.py" \ + ] \ + } \ + } \ + ] \ +}' > /.reproenv.json +# End saving to specification to JSON. diff --git a/Singularity b/Singularity index 51d1c0f..a11508c 100644 --- a/Singularity +++ b/Singularity @@ -1,122 +1,148 @@ -# Generated by: Neurodocker version 0.7.0+15.ga4940e3.dirty -# Latest release: Neurodocker version 0.7.0 -# -# 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 -# -# Timestamp: 2020/11/02 20:18:27 UTC +# Generated by Neurodocker and Reproenv. Bootstrap: docker From: ubuntu:xenial -%post -su - root +%files +run.py /run.py +version /version -export ND_ENTRYPOINT="/neurodocker/startup.sh" -apt-get update -qq -apt-get install -y -q --no-install-recommends \ - apt-utils \ - bzip2 \ - ca-certificates \ - 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 +%environment +export OS="Linux" +export PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH" +export FREESURFER_HOME="/opt/freesurfer" +export FREESURFER="/opt/freesurfer" +export SUBJECTS_DIR="/opt/freesurfer/subjects" +export LOCAL_DIR="/opt/freesurfer/local" +export FSFAST_HOME="/opt/freesurfer/fsfast" +export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" +export FUNCTIONALS_DIR="/opt/freesurfer/sessions" +export FS_OVERRIDE="0" +export FIX_VERTEX_AREA="" +export FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" +export MINC_BIN_DIR="/opt/freesurfer/mni/bin" +export MINC_LIB_DIR="/opt/freesurfer/mni/lib" +export MNI_DIR="/opt/freesurfer/mni" +export MNI_DATAPATH="/opt/freesurfer/mni/data" +export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5" +export PERL5LIB="/opt/freesurfer/mni/share/perl5" +export CONDA_DIR="/opt/miniconda-latest" +export PATH="/opt/miniconda-latest/bin:$PATH" +export FSLDIR="/usr/share/fsl/5.0" +export FSLOUTPUTTYPE="NIFTI_GZ" +export FSLMULTIFILEQUIT="TRUE" +export POSSUMDIR="/usr/share/fsl/5.0" +export LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" +export FSLTCLSH="/usr/bin/tclsh" +export FSLWISH="/usr/bin/wish" +export OS="Linux" +export FS_OVERRIDE="0" +export FIX_VERTEX_AREA="" +export SUBJECTS_DIR="/opt/freesurfer/subjects" +export FSF_OUTPUT_FORMAT="nii.gz" +export MNI_DIR="/opt/freesurfer/mni" +export LOCAL_DIR="/opt/freesurfer/local" +export FREESURFER_HOME="/opt/freesurfer" +export FSFAST_HOME="/opt/freesurfer/fsfast" +export MINC_BIN_DIR="/opt/freesurfer/mni/bin" +export MINC_LIB_DIR="/opt/freesurfer/mni/lib" +export MNI_DATAPATH="/opt/freesurfer/mni/data" +export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" +export PERL5LIB="/opt/freesurfer/mni/share/perl5" +export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" +export PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +export PYTHONPATH="" +%post apt-get update -qq apt-get install -y -q --no-install-recommends \ - tcsh \ bc \ - tar \ - libgomp1 \ - perl-modules \ - wget \ curl \ + libglu1-mesa \ + libgomp1 \ + libpython2.7-stdlib \ libsm-dev \ libx11-dev \ - libxt-dev \ libxext-dev \ - libglu1-mesa \ - libpython2.7-stdlib -apt-get clean + libxt-dev \ + perl-modules \ + tar \ + tcsh \ + wget rm -rf /var/lib/apt/lists/* apt-get update -qq apt-get install -y -q --no-install-recommends \ bc \ + ca-certificates \ + curl \ libgomp1 \ libxmu6 \ libxt6 \ perl \ tcsh -apt-get clean rm -rf /var/lib/apt/lists/* echo "Downloading FreeSurfer ..." mkdir -p /opt/freesurfer -curl -fsSL --retry 5 ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \ -| tar -xz -C /opt/freesurfer --strip-components 1 \ - --exclude='freesurfer/average/mult-comp-cor' \ - --exclude='freesurfer/lib/cuda' \ - --exclude='freesurfer/lib/qt' \ - --exclude='freesurfer/subjects/V1_average' \ - --exclude='freesurfer/subjects/bert' \ - --exclude='freesurfer/subjects/cvs_avg35' \ - --exclude='freesurfer/subjects/cvs_avg35_inMNI152' \ - --exclude='freesurfer/subjects/fsaverage3' \ - --exclude='freesurfer/subjects/fsaverage4' \ - --exclude='freesurfer/subjects/fsaverage5' \ - --exclude='freesurfer/subjects/fsaverage6' \ - --exclude='freesurfer/subjects/fsaverage_sym' \ - --exclude='freesurfer/trctrain' -sed -i '$isource "/opt/freesurfer/SetUpFreeSurfer.sh"' "$ND_ENTRYPOINT" +curl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \ +| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \ + --exclude='average/mult-comp-cor' \ + --exclude='lib/cuda' \ + --exclude='lib/qt' \ + --exclude='subjects/V1_average' \ + --exclude='subjects/bert' \ + --exclude='subjects/cvs_avg35' \ + --exclude='subjects/cvs_avg35_inMNI152' \ + --exclude='subjects/fsaverage3' \ + --exclude='subjects/fsaverage4' \ + --exclude='subjects/fsaverage5' \ + --exclude='subjects/fsaverage6' \ + --exclude='subjects/fsaverage_sym' \ + --exclude='trctrain' +apt-get update -qq +apt-get install -y -q --no-install-recommends \ + bzip2 \ + ca-certificates \ + curl +rm -rf /var/lib/apt/lists/* +# 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 install -y -q --name base \ +# Enable `conda activate` +conda init bash +conda install -y --name base \ "python=3" \ "pip" \ "pandas" \ "setuptools" \ "pandas=0.21.0" -sync && conda clean -y --all && sync bash -c "source activate base - pip install --no-cache-dir \ + python -m pip install --no-cache-dir \ "nibabel"" +# Clean up +sync && conda clean --all --yes && sync rm -rf ~/.cache/pip/* -sync - bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' apt-get update -qq apt-get install -y -q --no-install-recommends \ nodejs -apt-get clean rm -rf /var/lib/apt/lists/* bash -c 'npm install -g bids-validator@0.19.8' @@ -129,186 +155,203 @@ mkdir /local-scratch chmod +x /run.py -echo '{ -\n "pkg_manager": "apt", -\n "instructions": [ -\n [ -\n "base", -\n "ubuntu:xenial" -\n ], -\n [ -\n "user", -\n "root" -\n ], -\n [ -\n "_header", -\n { -\n "version": "generic", -\n "method": "custom" -\n } -\n ], -\n [ -\n "install", -\n [ -\n "tcsh", -\n "bc", -\n "tar", -\n "libgomp1", -\n "perl-modules", -\n "wget", -\n "curl", -\n "libsm-dev", -\n "libx11-dev", -\n "libxt-dev", -\n "libxext-dev", -\n "libglu1-mesa", -\n "libpython2.7-stdlib" -\n ] -\n ], -\n [ -\n "freesurfer", -\n { -\n "version": "6.0.1", -\n "install_path": "/opt/freesurfer" -\n } -\n ], -\n [ -\n "miniconda", -\n { -\n "use_env": "base", -\n "conda_install": [ -\n "python=3", -\n "pip", -\n "pandas", -\n "setuptools", -\n "pandas=0.21.0" -\n ], -\n "pip_install": [ -\n "nibabel" -\n ] -\n } -\n ], -\n [ -\n "run_bash", -\n "curl -sL https://deb.nodesource.com/setup_6.x | bash -" -\n ], -\n [ -\n "install", -\n [ -\n "nodejs" -\n ] -\n ], -\n [ -\n "run_bash", -\n "npm install -g bids-validator@0.19.8" -\n ], -\n [ -\n "env", -\n { -\n "FSLDIR": "/usr/share/fsl/5.0", -\n "FSLOUTPUTTYPE": "NIFTI_GZ", -\n "FSLMULTIFILEQUIT": "TRUE", -\n "POSSUMDIR": "/usr/share/fsl/5.0", -\n "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", -\n "FSLTCLSH": "/usr/bin/tclsh", -\n "FSLWISH": "/usr/bin/wish" -\n } -\n ], -\n [ -\n "env", -\n { -\n "OS": "Linux", -\n "FS_OVERRIDE": "0", -\n "FIX_VERTEX_AREA": "", -\n "SUBJECTS_DIR": "/opt/freesurfer/subjects", -\n "FSF_OUTPUT_FORMAT": "nii.gz", -\n "MNI_DIR": "/opt/freesurfer/mni", -\n "LOCAL_DIR": "/opt/freesurfer/local", -\n "FREESURFER_HOME": "/opt/freesurfer", -\n "FSFAST_HOME": "/opt/freesurfer/fsfast", -\n "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", -\n "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", -\n "MNI_DATAPATH": "/opt/freesurfer/mni/data", -\n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", -\n "PERL5LIB": "/opt/freesurfer/mni/share/perl5", -\n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", -\n "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", -\n "PYTHONPATH": "" -\n } -\n ], -\n [ -\n "run", -\n "mkdir root/matlab && touch root/matlab/startup.m" -\n ], -\n [ -\n "run", -\n "mkdir /scratch" -\n ], -\n [ -\n "run", -\n "mkdir /local-scratch" -\n ], -\n [ -\n "copy", -\n [ -\n "run.py", -\n "/run.py" -\n ] -\n ], -\n [ -\n "run", -\n "chmod +x /run.py" -\n ], -\n [ -\n "copy", -\n [ -\n "version", -\n "/version" -\n ] -\n ], -\n [ -\n "entrypoint", -\n "/neurodocker/startup.sh /run.py" -\n ] -\n ] -\n}' > /neurodocker/neurodocker_specs.json - -%environment -export LANG="en_US.UTF-8" -export LC_ALL="en_US.UTF-8" -export ND_ENTRYPOINT="/neurodocker/startup.sh" -export FREESURFER_HOME="/opt/freesurfer" -export PATH="/opt/freesurfer/bin:$PATH" -export CONDA_DIR="/opt/miniconda-latest" -export PATH="/opt/miniconda-latest/bin:$PATH" -export FSLDIR="/usr/share/fsl/5.0" -export FSLOUTPUTTYPE="NIFTI_GZ" -export FSLMULTIFILEQUIT="TRUE" -export POSSUMDIR="/usr/share/fsl/5.0" -export LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" -export FSLTCLSH="/usr/bin/tclsh" -export FSLWISH="/usr/bin/wish" -export OS="Linux" -export FS_OVERRIDE="0" -export FIX_VERTEX_AREA="" -export SUBJECTS_DIR="/opt/freesurfer/subjects" -export FSF_OUTPUT_FORMAT="nii.gz" -export MNI_DIR="/opt/freesurfer/mni" -export LOCAL_DIR="/opt/freesurfer/local" -export FREESURFER_HOME="/opt/freesurfer" -export FSFAST_HOME="/opt/freesurfer/fsfast" -export MINC_BIN_DIR="/opt/freesurfer/mni/bin" -export MINC_LIB_DIR="/opt/freesurfer/mni/lib" -export MNI_DATAPATH="/opt/freesurfer/mni/data" -export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" -export PERL5LIB="/opt/freesurfer/mni/share/perl5" -export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" -export PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -export PYTHONPATH="" - -%files -run.py /run.py -version /version +# Save specification to JSON. +printf '{ \ + "pkg_manager": "apt", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "ubuntu:xenial" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "tcsh", \ + "bc", \ + "tar", \ + "libgomp1", \ + "perl-modules", \ + "wget", \ + "curl", \ + "libsm-dev", \ + "libx11-dev", \ + "libxt-dev", \ + "libxext-dev", \ + "libglu1-mesa", \ + "libpython2.7-stdlib" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FREESURFER": "/opt/freesurfer", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/freesurfer\\ncurl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "CONDA_DIR": "/opt/miniconda-latest", \ + "PATH": "/opt/miniconda-latest/bin:$PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "nodejs" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n nodejs\\nrm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "FSLDIR": "/usr/share/fsl/5.0", \ + "FSLOUTPUTTYPE": "NIFTI_GZ", \ + "FSLMULTIFILEQUIT": "TRUE", \ + "POSSUMDIR": "/usr/share/fsl/5.0", \ + "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \ + "FSLTCLSH": "/usr/bin/tclsh", \ + "FSLWISH": "/usr/bin/wish" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "FSF_OUTPUT_FORMAT": "nii.gz", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \ + "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \ + "PYTHONPATH": "" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir root/matlab && touch root/matlab/startup.m" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /scratch" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /local-scratch" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "run.py" \ + ], \ + "destination": "/run.py" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "chmod +x /run.py" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "version" \ + ], \ + "destination": "/version" \ + } \ + }, \ + { \ + "name": "entrypoint", \ + "kwds": { \ + "args": [ \ + "/neurodocker/startup.sh", \ + "/run.py" \ + ] \ + } \ + } \ + ] \ +}' > /.reproenv.json +# End saving to specification to JSON. %runscript /neurodocker/startup.sh /run.py diff --git a/Singularity_fs7 b/Singularity_fs7 index 8f95b88..bdb2c94 100644 --- a/Singularity_fs7 +++ b/Singularity_fs7 @@ -1,122 +1,148 @@ -# Generated by: Neurodocker version 0.7.0+15.ga4940e3.dirty -# Latest release: Neurodocker version 0.7.0 -# -# 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 -# -# Timestamp: 2020/11/02 20:18:28 UTC +# Generated by Neurodocker and Reproenv. Bootstrap: docker From: ubuntu:xenial -%post -su - root +%files +run.py /run.py +version /version -export ND_ENTRYPOINT="/neurodocker/startup.sh" -apt-get update -qq -apt-get install -y -q --no-install-recommends \ - apt-utils \ - bzip2 \ - ca-certificates \ - 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 +%environment +export OS="Linux" +export PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH" +export FREESURFER_HOME="/opt/freesurfer" +export FREESURFER="/opt/freesurfer" +export SUBJECTS_DIR="/opt/freesurfer/subjects" +export LOCAL_DIR="/opt/freesurfer/local" +export FSFAST_HOME="/opt/freesurfer/fsfast" +export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" +export FUNCTIONALS_DIR="/opt/freesurfer/sessions" +export FS_OVERRIDE="0" +export FIX_VERTEX_AREA="" +export FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" +export MINC_BIN_DIR="/opt/freesurfer/mni/bin" +export MINC_LIB_DIR="/opt/freesurfer/mni/lib" +export MNI_DIR="/opt/freesurfer/mni" +export MNI_DATAPATH="/opt/freesurfer/mni/data" +export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5" +export PERL5LIB="/opt/freesurfer/mni/share/perl5" +export CONDA_DIR="/opt/miniconda-latest" +export PATH="/opt/miniconda-latest/bin:$PATH" +export FSLDIR="/usr/share/fsl/5.0" +export FSLOUTPUTTYPE="NIFTI_GZ" +export FSLMULTIFILEQUIT="TRUE" +export POSSUMDIR="/usr/share/fsl/5.0" +export LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" +export FSLTCLSH="/usr/bin/tclsh" +export FSLWISH="/usr/bin/wish" +export OS="Linux" +export FS_OVERRIDE="0" +export FIX_VERTEX_AREA="" +export SUBJECTS_DIR="/opt/freesurfer/subjects" +export FSF_OUTPUT_FORMAT="nii.gz" +export MNI_DIR="/opt/freesurfer/mni" +export LOCAL_DIR="/opt/freesurfer/local" +export FREESURFER_HOME="/opt/freesurfer" +export FSFAST_HOME="/opt/freesurfer/fsfast" +export MINC_BIN_DIR="/opt/freesurfer/mni/bin" +export MINC_LIB_DIR="/opt/freesurfer/mni/lib" +export MNI_DATAPATH="/opt/freesurfer/mni/data" +export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" +export PERL5LIB="/opt/freesurfer/mni/share/perl5" +export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" +export PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +export PYTHONPATH="" +%post apt-get update -qq apt-get install -y -q --no-install-recommends \ - tcsh \ bc \ - tar \ - libgomp1 \ - perl-modules \ - wget \ curl \ + libglu1-mesa \ + libgomp1 \ + libpython2.7-stdlib \ libsm-dev \ libx11-dev \ - libxt-dev \ libxext-dev \ - libglu1-mesa \ - libpython2.7-stdlib -apt-get clean + libxt-dev \ + perl-modules \ + tar \ + tcsh \ + wget rm -rf /var/lib/apt/lists/* apt-get update -qq apt-get install -y -q --no-install-recommends \ bc \ + ca-certificates \ + curl \ libgomp1 \ libxmu6 \ libxt6 \ perl \ tcsh -apt-get clean rm -rf /var/lib/apt/lists/* echo "Downloading FreeSurfer ..." mkdir -p /opt/freesurfer -curl -fsSL --retry 5 https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.1.1/freesurfer-linux-centos6_x86_64-7.1.1.tar.gz \ -| tar -xz -C /opt/freesurfer --strip-components 1 \ - --exclude='freesurfer/average/mult-comp-cor' \ - --exclude='freesurfer/lib/cuda' \ - --exclude='freesurfer/lib/qt' \ - --exclude='freesurfer/subjects/V1_average' \ - --exclude='freesurfer/subjects/bert' \ - --exclude='freesurfer/subjects/cvs_avg35' \ - --exclude='freesurfer/subjects/cvs_avg35_inMNI152' \ - --exclude='freesurfer/subjects/fsaverage3' \ - --exclude='freesurfer/subjects/fsaverage4' \ - --exclude='freesurfer/subjects/fsaverage5' \ - --exclude='freesurfer/subjects/fsaverage6' \ - --exclude='freesurfer/subjects/fsaverage_sym' \ - --exclude='freesurfer/trctrain' -sed -i '$isource "/opt/freesurfer/SetUpFreeSurfer.sh"' "$ND_ENTRYPOINT" +curl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \ +| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \ + --exclude='average/mult-comp-cor' \ + --exclude='lib/cuda' \ + --exclude='lib/qt' \ + --exclude='subjects/V1_average' \ + --exclude='subjects/bert' \ + --exclude='subjects/cvs_avg35' \ + --exclude='subjects/cvs_avg35_inMNI152' \ + --exclude='subjects/fsaverage3' \ + --exclude='subjects/fsaverage4' \ + --exclude='subjects/fsaverage5' \ + --exclude='subjects/fsaverage6' \ + --exclude='subjects/fsaverage_sym' \ + --exclude='trctrain' +apt-get update -qq +apt-get install -y -q --no-install-recommends \ + bzip2 \ + ca-certificates \ + curl +rm -rf /var/lib/apt/lists/* +# 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 install -y -q --name base \ +# Enable `conda activate` +conda init bash +conda install -y --name base \ "python=3" \ "pip" \ "pandas" \ "setuptools" \ "pandas=0.21.0" -sync && conda clean -y --all && sync bash -c "source activate base - pip install --no-cache-dir \ + python -m pip install --no-cache-dir \ "nibabel"" +# Clean up +sync && conda clean --all --yes && sync rm -rf ~/.cache/pip/* -sync - bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' apt-get update -qq apt-get install -y -q --no-install-recommends \ nodejs -apt-get clean rm -rf /var/lib/apt/lists/* bash -c 'npm install -g bids-validator@0.19.8' @@ -129,186 +155,203 @@ mkdir /local-scratch chmod +x /run.py -echo '{ -\n "pkg_manager": "apt", -\n "instructions": [ -\n [ -\n "base", -\n "ubuntu:xenial" -\n ], -\n [ -\n "user", -\n "root" -\n ], -\n [ -\n "_header", -\n { -\n "version": "generic", -\n "method": "custom" -\n } -\n ], -\n [ -\n "install", -\n [ -\n "tcsh", -\n "bc", -\n "tar", -\n "libgomp1", -\n "perl-modules", -\n "wget", -\n "curl", -\n "libsm-dev", -\n "libx11-dev", -\n "libxt-dev", -\n "libxext-dev", -\n "libglu1-mesa", -\n "libpython2.7-stdlib" -\n ] -\n ], -\n [ -\n "freesurfer", -\n { -\n "version": "7.1.1", -\n "install_path": "/opt/freesurfer" -\n } -\n ], -\n [ -\n "miniconda", -\n { -\n "use_env": "base", -\n "conda_install": [ -\n "python=3", -\n "pip", -\n "pandas", -\n "setuptools", -\n "pandas=0.21.0" -\n ], -\n "pip_install": [ -\n "nibabel" -\n ] -\n } -\n ], -\n [ -\n "run_bash", -\n "curl -sL https://deb.nodesource.com/setup_6.x | bash -" -\n ], -\n [ -\n "install", -\n [ -\n "nodejs" -\n ] -\n ], -\n [ -\n "run_bash", -\n "npm install -g bids-validator@0.19.8" -\n ], -\n [ -\n "env", -\n { -\n "FSLDIR": "/usr/share/fsl/5.0", -\n "FSLOUTPUTTYPE": "NIFTI_GZ", -\n "FSLMULTIFILEQUIT": "TRUE", -\n "POSSUMDIR": "/usr/share/fsl/5.0", -\n "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", -\n "FSLTCLSH": "/usr/bin/tclsh", -\n "FSLWISH": "/usr/bin/wish" -\n } -\n ], -\n [ -\n "env", -\n { -\n "OS": "Linux", -\n "FS_OVERRIDE": "0", -\n "FIX_VERTEX_AREA": "", -\n "SUBJECTS_DIR": "/opt/freesurfer/subjects", -\n "FSF_OUTPUT_FORMAT": "nii.gz", -\n "MNI_DIR": "/opt/freesurfer/mni", -\n "LOCAL_DIR": "/opt/freesurfer/local", -\n "FREESURFER_HOME": "/opt/freesurfer", -\n "FSFAST_HOME": "/opt/freesurfer/fsfast", -\n "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", -\n "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", -\n "MNI_DATAPATH": "/opt/freesurfer/mni/data", -\n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", -\n "PERL5LIB": "/opt/freesurfer/mni/share/perl5", -\n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", -\n "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", -\n "PYTHONPATH": "" -\n } -\n ], -\n [ -\n "run", -\n "mkdir root/matlab && touch root/matlab/startup.m" -\n ], -\n [ -\n "run", -\n "mkdir /scratch" -\n ], -\n [ -\n "run", -\n "mkdir /local-scratch" -\n ], -\n [ -\n "copy", -\n [ -\n "run.py", -\n "/run.py" -\n ] -\n ], -\n [ -\n "run", -\n "chmod +x /run.py" -\n ], -\n [ -\n "copy", -\n [ -\n "version", -\n "/version" -\n ] -\n ], -\n [ -\n "entrypoint", -\n "/neurodocker/startup.sh /run.py" -\n ] -\n ] -\n}' > /neurodocker/neurodocker_specs.json - -%environment -export LANG="en_US.UTF-8" -export LC_ALL="en_US.UTF-8" -export ND_ENTRYPOINT="/neurodocker/startup.sh" -export FREESURFER_HOME="/opt/freesurfer" -export PATH="/opt/freesurfer/bin:$PATH" -export CONDA_DIR="/opt/miniconda-latest" -export PATH="/opt/miniconda-latest/bin:$PATH" -export FSLDIR="/usr/share/fsl/5.0" -export FSLOUTPUTTYPE="NIFTI_GZ" -export FSLMULTIFILEQUIT="TRUE" -export POSSUMDIR="/usr/share/fsl/5.0" -export LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" -export FSLTCLSH="/usr/bin/tclsh" -export FSLWISH="/usr/bin/wish" -export OS="Linux" -export FS_OVERRIDE="0" -export FIX_VERTEX_AREA="" -export SUBJECTS_DIR="/opt/freesurfer/subjects" -export FSF_OUTPUT_FORMAT="nii.gz" -export MNI_DIR="/opt/freesurfer/mni" -export LOCAL_DIR="/opt/freesurfer/local" -export FREESURFER_HOME="/opt/freesurfer" -export FSFAST_HOME="/opt/freesurfer/fsfast" -export MINC_BIN_DIR="/opt/freesurfer/mni/bin" -export MINC_LIB_DIR="/opt/freesurfer/mni/lib" -export MNI_DATAPATH="/opt/freesurfer/mni/data" -export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" -export PERL5LIB="/opt/freesurfer/mni/share/perl5" -export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" -export PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -export PYTHONPATH="" - -%files -run.py /run.py -version /version +# Save specification to JSON. +printf '{ \ + "pkg_manager": "apt", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "ubuntu:xenial" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "tcsh", \ + "bc", \ + "tar", \ + "libgomp1", \ + "perl-modules", \ + "wget", \ + "curl", \ + "libsm-dev", \ + "libx11-dev", \ + "libxt-dev", \ + "libxext-dev", \ + "libglu1-mesa", \ + "libpython2.7-stdlib" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FREESURFER": "/opt/freesurfer", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/freesurfer\\ncurl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "CONDA_DIR": "/opt/miniconda-latest", \ + "PATH": "/opt/miniconda-latest/bin:$PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "nodejs" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n nodejs\\nrm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "FSLDIR": "/usr/share/fsl/5.0", \ + "FSLOUTPUTTYPE": "NIFTI_GZ", \ + "FSLMULTIFILEQUIT": "TRUE", \ + "POSSUMDIR": "/usr/share/fsl/5.0", \ + "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \ + "FSLTCLSH": "/usr/bin/tclsh", \ + "FSLWISH": "/usr/bin/wish" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "FSF_OUTPUT_FORMAT": "nii.gz", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \ + "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \ + "PYTHONPATH": "" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir root/matlab && touch root/matlab/startup.m" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /scratch" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /local-scratch" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "run.py" \ + ], \ + "destination": "/run.py" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "chmod +x /run.py" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "version" \ + ], \ + "destination": "/version" \ + } \ + }, \ + { \ + "name": "entrypoint", \ + "kwds": { \ + "args": [ \ + "/neurodocker/startup.sh", \ + "/run.py" \ + ] \ + } \ + } \ + ] \ +}' > /.reproenv.json +# End saving to specification to JSON. %runscript /neurodocker/startup.sh /run.py diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index b1f4bd2..af1be41 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -39,16 +39,16 @@ # ############################################################################### -image="repronim/neurodocker@sha256:291c40c8efce92260822b6ef40f88c300d77d09f08d577f55c46ef7c4b43d2e5" +image="repronim/neurodocker@sha256:5b80804139b317e6180ae0b0de39aeff5731b27b224e6af4d1b46e040e4785a7" # Generate a dockerfile for building BIDS-Apps Freesurfer container docker run --rm ${image} generate docker \ - --base ubuntu:xenial \ + --base-image ubuntu:xenial \ --pkg-manager apt \ --install tcsh bc tar libgomp1 perl-modules wget curl \ libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ --freesurfer version=6.0.1 install_path=/opt/freesurfer \ - --miniconda use_env=base conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ + --miniconda version=latest conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ --install nodejs \ --run-bash 'npm install -g bids-validator@0.19.8' \ @@ -73,12 +73,12 @@ docker run --rm ${image} generate docker \ > Dockerfile docker run --rm ${image} generate docker \ - --base ubuntu:xenial \ + --base-image ubuntu:xenial \ --pkg-manager apt \ --install tcsh bc tar libgomp1 perl-modules wget curl \ libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ - --freesurfer version=7.1.1 install_path=/opt/freesurfer \ - --miniconda use_env=base conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ + --freesurfer version=7.4.1 install_path=/opt/freesurfer \ + --miniconda version=latest conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ --install nodejs \ --run-bash 'npm install -g bids-validator@0.19.8' \ @@ -105,12 +105,12 @@ docker run --rm ${image} generate docker \ # Generate a singularity recipe for building BIDS-Apps Freesurfer container docker run --rm ${image} generate singularity \ - --base ubuntu:xenial \ + --base-image ubuntu:xenial \ --pkg-manager apt \ --install tcsh bc tar libgomp1 perl-modules wget curl \ libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ --freesurfer version=6.0.1 install_path=/opt/freesurfer \ - --miniconda use_env=base conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ + --miniconda version=latest conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ --install nodejs \ --run-bash 'npm install -g bids-validator@0.19.8' \ @@ -136,12 +136,12 @@ docker run --rm ${image} generate singularity \ docker run --rm ${image} generate singularity \ - --base ubuntu:xenial \ + --base-image ubuntu:xenial \ --pkg-manager apt \ --install tcsh bc tar libgomp1 perl-modules wget curl \ libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ - --freesurfer version=7.1.1 install_path=/opt/freesurfer \ - --miniconda use_env=base conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ + --freesurfer version=7.4.1 install_path=/opt/freesurfer \ + --miniconda version=latest conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ --install nodejs \ --run-bash 'npm install -g bids-validator@0.19.8' \ From e6de8e3c24112d501e884b78a0d43dcac9e409b1 Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Fri, 25 Aug 2023 15:34:55 -0400 Subject: [PATCH 08/33] ubunto to jammy --- generate_freesurfer_images.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index af1be41..a869a9c 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -43,7 +43,7 @@ image="repronim/neurodocker@sha256:5b80804139b317e6180ae0b0de39aeff5731b27b224e6 # Generate a dockerfile for building BIDS-Apps Freesurfer container docker run --rm ${image} generate docker \ - --base-image ubuntu:xenial \ + --base-image ubuntu:jammy \ --pkg-manager apt \ --install tcsh bc tar libgomp1 perl-modules wget curl \ libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ @@ -73,7 +73,7 @@ docker run --rm ${image} generate docker \ > Dockerfile docker run --rm ${image} generate docker \ - --base-image ubuntu:xenial \ + --base-image ubuntu:jammy \ --pkg-manager apt \ --install tcsh bc tar libgomp1 perl-modules wget curl \ libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ @@ -105,7 +105,7 @@ docker run --rm ${image} generate docker \ # Generate a singularity recipe for building BIDS-Apps Freesurfer container docker run --rm ${image} generate singularity \ - --base-image ubuntu:xenial \ + --base-image ubuntu:jammy \ --pkg-manager apt \ --install tcsh bc tar libgomp1 perl-modules wget curl \ libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ @@ -136,7 +136,7 @@ docker run --rm ${image} generate singularity \ docker run --rm ${image} generate singularity \ - --base-image ubuntu:xenial \ + --base-image ubuntu:jammy \ --pkg-manager apt \ --install tcsh bc tar libgomp1 perl-modules wget curl \ libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ From 57b424d9c3e7248a6457c32b48957d5c558463e1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 25 Aug 2023 20:45:24 +0000 Subject: [PATCH 09/33] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .circleci/config.yml | 162 +++++++++++++++++----------------- generate_freesurfer_images.sh | 2 +- run.py | 2 +- 3 files changed, 83 insertions(+), 83 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a62732c..94f339e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -176,93 +176,93 @@ jobs: machine: image: ubuntu-2204:2022.10.2 steps: - - checkout - - restore_cache: - keys: - - v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }} - - run: - name: load and build - command: | - if [[ -e ~/docker/image_fs7.tar ]]; then docker load -i ~/docker/image_fs7.tar; fi - git describe --tags > version - docker build -t bids/${CIRCLE_PROJECT_REPONAME}_fs7 -f Dockerfile_fs7 . - mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}_fs7" > ~/docker/image.tar - mkdir -p ~/license; echo "cHJpbnRmICJEeWxhbi5OaWVsc29uQGdtYWlsLmNvbVxuMzcwNjNcbiAqQ1lrZWhQYUNvRDlNXG4gRlM2N1BTWmRFV2lqb1xuIiA+IH4vbGljZW5zZS9saWNlbnNlLnR4dA==" | base64 -d | sh - no_output_timeout: 6h - - save_cache: - key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }}-{{ epoch }} - paths: - - ~/docker - - ~/license + - checkout + - restore_cache: + keys: + - v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }} + - run: + name: load and build + command: | + if [[ -e ~/docker/image_fs7.tar ]]; then docker load -i ~/docker/image_fs7.tar; fi + git describe --tags > version + docker build -t bids/${CIRCLE_PROJECT_REPONAME}_fs7 -f Dockerfile_fs7 . + mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}_fs7" > ~/docker/image.tar + mkdir -p ~/license; echo "cHJpbnRmICJEeWxhbi5OaWVsc29uQGdtYWlsLmNvbVxuMzcwNjNcbiAqQ1lrZWhQYUNvRDlNXG4gRlM2N1BTWmRFV2lqb1xuIiA+IH4vbGljZW5zZS9saWNlbnNlLnR4dA==" | base64 -d | sh + no_output_timeout: 6h + - save_cache: + key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }}-{{ epoch }} + paths: + - ~/docker + - ~/license test_fs7: machine: image: ubuntu-2204:2022.10.2 steps: - - checkout - - restore_cache: - key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }} - - restore_cache: - key: v_0-test_data - - run: - name: get data - command: | - if [[ ! -d ~/data/ds114_test1 ]]; then wget -c -O ${HOME}/ds114_test1.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e54a326c613b01d7d3ed90" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1.tar -C ${HOME}/data; fi - if [[ ! -d ~/data/ds114_test2 ]]; then wget -c -O ${HOME}/ds114_test2.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2.tar -C ${HOME}/data; fi - if [[ ! -d ~/data/ds114_test1_freesurfer_precomp_v6.0.0 ]]; then wget -c --no-check-certificate -O ${HOME}/ds114_test1_freesurfer_precomp_v6.0.0.tar "https://osf.io/j6zk2/?action=download&version=1" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1_freesurfer_precomp_v6.0.0.tar -C ${HOME}/data; fi - if [[ ! -d ~/data/ds114_test2_freesurfer_precomp_v6.0.0 ]]; then wget -c --no-check-certificate -O ${HOME}/ds114_test2_freesurfer_precomp_v6.0.0.tar "https://osf.io/yhzzj/?action=download&version=1" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2_freesurfer_precomp_v6.0.0.tar -C ${HOME}/data; fi - - save_cache: - key: v_0-test_data - paths: - - ~/data - - run: - name: load image - command: docker load -i ~/docker/image.tar - - run: - name: print version - command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v $PWD/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME}_fs7 --version - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME}_fs7 -h - - run: - name: test 1 - command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs participant --participant_label 01 --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs1/sub-01/scripts/recon-all.done - no_output_timeout: 6h - - run: - name: test 2 - command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs participant --participant_label 01 --steps cross-sectional --session_label test --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done - no_output_timeout: 6h - - run: - name: group2 test 1 - command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs1/ && sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ && cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv - no_output_timeout: 6h - - run: - name: group2 test 2 - command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs2/ && sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ && cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv - no_output_timeout: 6h - - store_artifacts: - path: ~/outputs1 - - store_artifacts: - path: ~/outputs2 + - checkout + - restore_cache: + key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }} + - restore_cache: + key: v_0-test_data + - run: + name: get data + command: | + if [[ ! -d ~/data/ds114_test1 ]]; then wget -c -O ${HOME}/ds114_test1.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e54a326c613b01d7d3ed90" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1.tar -C ${HOME}/data; fi + if [[ ! -d ~/data/ds114_test2 ]]; then wget -c -O ${HOME}/ds114_test2.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2.tar -C ${HOME}/data; fi + if [[ ! -d ~/data/ds114_test1_freesurfer_precomp_v6.0.0 ]]; then wget -c --no-check-certificate -O ${HOME}/ds114_test1_freesurfer_precomp_v6.0.0.tar "https://osf.io/j6zk2/?action=download&version=1" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1_freesurfer_precomp_v6.0.0.tar -C ${HOME}/data; fi + if [[ ! -d ~/data/ds114_test2_freesurfer_precomp_v6.0.0 ]]; then wget -c --no-check-certificate -O ${HOME}/ds114_test2_freesurfer_precomp_v6.0.0.tar "https://osf.io/yhzzj/?action=download&version=1" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2_freesurfer_precomp_v6.0.0.tar -C ${HOME}/data; fi + - save_cache: + key: v_0-test_data + paths: + - ~/data + - run: + name: load image + command: docker load -i ~/docker/image.tar + - run: + name: print version + command: | + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v $PWD/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME}_fs7 --version + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME}_fs7 -h + - run: + name: test 1 + command: | + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs participant --participant_label 01 --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs1/sub-01/scripts/recon-all.done + no_output_timeout: 6h + - run: + name: test 2 + command: | + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs participant --participant_label 01 --steps cross-sectional --session_label test --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done + no_output_timeout: 6h + - run: + name: group2 test 1 + command: | + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs1/ && sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ && cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv + no_output_timeout: 6h + - run: + name: group2 test 2 + command: | + docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs2/ && sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ && cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv + no_output_timeout: 6h + - store_artifacts: + path: ~/outputs1 + - store_artifacts: + path: ~/outputs2 deploy_fs7: machine: image: ubuntu-2204:2022.10.2 steps: - - checkout - - restore_cache: - key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }} - - run: - name: load image - command: docker load -i ~/docker/image.tar - - deploy: - command: | - if [[ -n "$DOCKER_PASS" ]]; then docker login -u $DOCKER_USER -p $DOCKER_PASS && docker push bids/${CIRCLE_PROJECT_REPONAME}_fs7:latest; fi - if [[ -n "$DOCKER_PASS" ]]; then docker login -u $DOCKER_USER -p $DOCKER_PASS && docker tag bids/${CIRCLE_PROJECT_REPONAME}_fs7 bids/${CIRCLE_PROJECT_REPONAME}_fs7:$CIRCLE_TAG && docker push bids/${CIRCLE_PROJECT_REPONAME}_fs7:$CIRCLE_TAG; fi - no_output_timeout: 6h + - checkout + - restore_cache: + key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }} + - run: + name: load image + command: docker load -i ~/docker/image.tar + - deploy: + command: | + if [[ -n "$DOCKER_PASS" ]]; then docker login -u $DOCKER_USER -p $DOCKER_PASS && docker push bids/${CIRCLE_PROJECT_REPONAME}_fs7:latest; fi + if [[ -n "$DOCKER_PASS" ]]; then docker login -u $DOCKER_USER -p $DOCKER_PASS && docker tag bids/${CIRCLE_PROJECT_REPONAME}_fs7 bids/${CIRCLE_PROJECT_REPONAME}_fs7:$CIRCLE_TAG && docker push bids/${CIRCLE_PROJECT_REPONAME}_fs7:$CIRCLE_TAG; fi + no_output_timeout: 6h workflows: build_test_deploy: @@ -306,7 +306,7 @@ workflows: only: /.*/ - test_fs7: requires: - - build_fs7 + - build_fs7 filters: tags: only: /.*/ @@ -314,10 +314,10 @@ workflows: only: /.*/ - deploy_fs7: context: - - dockerhub + - dockerhub requires: - - build_fs7 - - test_fs7 + - build_fs7 + - test_fs7 filters: branches: ignore: /.*/ diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index a869a9c..67744a6 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -163,4 +163,4 @@ docker run --rm ${image} generate singularity \ --run 'chmod +x /run.py' \ --copy version '/version' \ --entrypoint '/neurodocker/startup.sh /run.py' \ -> Singularity_fs7 \ No newline at end of file +> Singularity_fs7 diff --git a/run.py b/run.py index 1c95596..59be1b3 100755 --- a/run.py +++ b/run.py @@ -517,7 +517,7 @@ def run(command, env={}, ignore_errors=False): raise Exception("No freesurfer subject found for %s in %s" % (s, output_dir)) subjects_str = " ".join(subjects) - # The call to python2 is only required if we're running Freesurfer 6, we'll need to check version + # The call to python2 is only required if we're running Freesurfer 6, we'll need to check version # and modify the calls accordingly. with open(os.path.join(os.environ['FREESURFER_HOME'], 'build-stamp.txt'), 'r') as h: bs = h.read() From e4ca37b8bea852cc221bf892170daff49d871b89 Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Fri, 25 Aug 2023 17:08:32 -0400 Subject: [PATCH 10/33] reformat docker calls in test_fs7 --- .circleci/config.yml | 81 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 94f339e..f3a4498 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,7 +171,6 @@ jobs: bash push_docker.sh no_output_timeout: 6h - build_fs7: machine: image: ubuntu-2204:2022.10.2 @@ -194,6 +193,7 @@ jobs: paths: - ~/docker - ~/license + test_fs7: machine: image: ubuntu-2204:2022.10.2 @@ -220,34 +220,99 @@ jobs: - run: name: print version command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v $PWD/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME}_fs7 --version - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset bids/${CIRCLE_PROJECT_REPONAME}_fs7 -h + docker run -ti --rm --read-only \ + -v ~/license/license.txt:/license.txt \ + --tmpfs /tmp --tmpfs /var/tmp \ + -v $PWD/ds114_test1:/bids_dataset \ + bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ + --version + + docker run -ti --rm --read-only \ + -v ~/license/license.txt:/license.txt \ + --tmpfs /tmp --tmpfs /var/tmp \ + -v ${HOME}/data/ds114_test1:/bids_dataset \ + bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ + -h - run: name: test 1 command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs participant --participant_label 01 --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs1/sub-01/scripts/recon-all.done + docker run -ti --rm --read-only \ + -v ~/license/license.txt:/license.txt \ + --tmpfs /tmp --tmpfs /var/tmp \ + -v ${HOME}/data/ds114_test1:/bids_dataset \ + -v ${HOME}/outputs1:/outputs \ + bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ + /bids_dataset \ + /outputs \ + participant \ + --participant_label 01 \ + --license_file=/license.txt \ + --stages autorecon1 \ + + cat ${HOME}/outputs1/sub-01/scripts/recon-all.done no_output_timeout: 6h - run: name: test 2 command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/outputs2:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs participant --participant_label 01 --steps cross-sectional --session_label test --license_file=/license.txt --stages autorecon1 && cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done + docker run -ti --rm --read-only \ + -v ~/license/license.txt:/license.txt \ + --tmpfs /tmp --tmpfs /var/tmp \ + -v ${HOME}/data/ds114_test2:/bids_dataset \ + -v ${HOME}/outputs2:/outputs \ + bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ + /bids_dataset \ + /outputs \ + participant \ + --participant_label 01 \ + --steps cross-sectional \ + --session_label test \ + --license_file=/license.txt \ + --stages autorecon1 + + cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done no_output_timeout: 6h - run: name: group2 test 1 command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test1:/bids_dataset -v ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs1/ && sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ && cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv + docker run -ti --rm --read-only \ + -v ~/license/license.txt:/license.txt \ + --tmpfs /tmp --tmpfs /var/tmp \ + -v ${HOME}/data/ds114_test1:/bids_dataset \ + -v ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0:/outputs \ + bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ + /bids_dataset \ + /outputs \ + group2 \ + --license_file=/license.txt + + mkdir -p ${HOME}/outputs1/ + sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ + cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv + cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv no_output_timeout: 6h - run: name: group2 test 2 command: | - docker run -ti --rm --read-only -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp -v ${HOME}/data/ds114_test2:/bids_dataset -v ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 /bids_dataset /outputs group2 --license_file=/license.txt && mkdir -p ${HOME}/outputs2/ && sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ && cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv && cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv + docker run -ti --rm --read-only \ + -v ~/license/license.txt:/license.txt \ + --tmpfs /tmp --tmpfs /var/tmp \ + -v ${HOME}/data/ds114_test2:/bids_dataset \ + -v ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ + /bids_dataset \ + /outputs \ + group2 \ + --license_file=/license.txt + + mkdir -p ${HOME}/outputs2/ + sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ + cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv + cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv no_output_timeout: 6h - store_artifacts: path: ~/outputs1 - store_artifacts: path: ~/outputs2 - deploy_fs7: machine: image: ubuntu-2204:2022.10.2 From bf95a92175f3b06e11dacf1234e5de9be44d3bda Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 25 Aug 2023 21:08:45 +0000 Subject: [PATCH 11/33] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f3a4498..55a9438 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -286,8 +286,8 @@ jobs: --license_file=/license.txt mkdir -p ${HOME}/outputs1/ - sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ - cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv + sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ + cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv no_output_timeout: 6h - run: @@ -301,11 +301,11 @@ jobs: /bids_dataset \ /outputs \ group2 \ - --license_file=/license.txt + --license_file=/license.txt - mkdir -p ${HOME}/outputs2/ - sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ - cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv + mkdir -p ${HOME}/outputs2/ + sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ + cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv no_output_timeout: 6h - store_artifacts: From 8a1cf186562dbf586c339dcc232f1e17084ba23a Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 25 Aug 2023 17:57:14 -0400 Subject: [PATCH 12/33] update recipes --- Dockerfile_fs6 | 343 ++++++++++++++++++++++++++++++++ Dockerfile_fs7 | 4 +- Singularity_fs6 | 357 ++++++++++++++++++++++++++++++++++ Singularity_fs7 | 4 +- generate_freesurfer_images.sh | 4 +- 5 files changed, 706 insertions(+), 6 deletions(-) create mode 100644 Dockerfile_fs6 create mode 100644 Singularity_fs6 diff --git a/Dockerfile_fs6 b/Dockerfile_fs6 new file mode 100644 index 0000000..b114f6a --- /dev/null +++ b/Dockerfile_fs6 @@ -0,0 +1,343 @@ +# Generated by Neurodocker and Reproenv. + +FROM ubuntu:jammy +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + bc \ + curl \ + libglu1-mesa \ + libgomp1 \ + libpython2.7-stdlib \ + libsm-dev \ + libx11-dev \ + libxext-dev \ + libxt-dev \ + perl-modules \ + tar \ + tcsh \ + wget \ + && rm -rf /var/lib/apt/lists/* +ENV OS="Linux" \ + PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH" \ + FREESURFER_HOME="/opt/freesurfer" \ + FREESURFER="/opt/freesurfer" \ + SUBJECTS_DIR="/opt/freesurfer/subjects" \ + LOCAL_DIR="/opt/freesurfer/local" \ + FSFAST_HOME="/opt/freesurfer/fsfast" \ + FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \ + FUNCTIONALS_DIR="/opt/freesurfer/sessions" \ + FS_OVERRIDE="0" \ + FIX_VERTEX_AREA="" \ + FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" \ + MINC_BIN_DIR="/opt/freesurfer/mni/bin" \ + MINC_LIB_DIR="/opt/freesurfer/mni/lib" \ + MNI_DIR="/opt/freesurfer/mni" \ + MNI_DATAPATH="/opt/freesurfer/mni/data" \ + MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5" \ + PERL5LIB="/opt/freesurfer/mni/share/perl5" +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + bc \ + ca-certificates \ + curl \ + libgomp1 \ + libxmu6 \ + libxt6 \ + perl \ + tcsh \ + && rm -rf /var/lib/apt/lists/* \ + && echo "Downloading FreeSurfer ..." \ + && mkdir -p /opt/freesurfer \ + && curl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \ + | tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \ + --exclude='average/mult-comp-cor' \ + --exclude='lib/cuda' \ + --exclude='lib/qt' \ + --exclude='subjects/V1_average' \ + --exclude='subjects/bert' \ + --exclude='subjects/cvs_avg35' \ + --exclude='subjects/cvs_avg35_inMNI152' \ + --exclude='subjects/fsaverage3' \ + --exclude='subjects/fsaverage4' \ + --exclude='subjects/fsaverage5' \ + --exclude='subjects/fsaverage6' \ + --exclude='subjects/fsaverage_sym' \ + --exclude='trctrain' +ENV CONDA_DIR="/opt/miniconda-latest" \ + PATH="/opt/miniconda-latest/bin:$PATH" +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + bzip2 \ + ca-certificates \ + curl \ + && rm -rf /var/lib/apt/lists/* \ + # Install dependencies. + && export PATH="/opt/miniconda-latest/bin:$PATH" \ + && echo "Downloading Miniconda installer ..." \ + && conda_installer="/tmp/miniconda.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 \ + # Enable `conda activate` + && conda init bash \ + && conda install -y --name base \ + "python=3" \ + "pip" \ + "pandas" \ + "setuptools" \ + "pandas=0.21.0" \ + && bash -c "source activate base \ + && python -m pip install --no-cache-dir \ + "nibabel"" \ + # Clean up + && sync && conda clean --all --yes && sync \ + && rm -rf ~/.cache/pip/* +RUN bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + nodejs \ + && rm -rf /var/lib/apt/lists/* +RUN bash -c 'npm install -g bids-validator@0.19.8' +ENV FSLDIR="/usr/share/fsl/5.0" \ + FSLOUTPUTTYPE="NIFTI_GZ" \ + FSLMULTIFILEQUIT="TRUE" \ + POSSUMDIR="/usr/share/fsl/5.0" \ + LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" \ + FSLTCLSH="/usr/bin/tclsh" \ + FSLWISH="/usr/bin/wish" +ENV OS="Linux" \ + FS_OVERRIDE="0" \ + FIX_VERTEX_AREA="" \ + SUBJECTS_DIR="/opt/freesurfer/subjects" \ + FSF_OUTPUT_FORMAT="nii.gz" \ + MNI_DIR="/opt/freesurfer/mni" \ + LOCAL_DIR="/opt/freesurfer/local" \ + FREESURFER_HOME="/opt/freesurfer" \ + FSFAST_HOME="/opt/freesurfer/fsfast" \ + MINC_BIN_DIR="/opt/freesurfer/mni/bin" \ + MINC_LIB_DIR="/opt/freesurfer/mni/lib" \ + MNI_DATAPATH="/opt/freesurfer/mni/data" \ + FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \ + PERL5LIB="/opt/freesurfer/mni/share/perl5" \ + MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \ + PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ + PYTHONPATH="" +RUN mkdir root/matlab && touch root/matlab/startup.m +RUN mkdir /scratch +RUN mkdir /local-scratch +COPY ["run.py", \ + "/run.py"] +RUN chmod +x /run.py +COPY ["version", \ + "/version"] +ENTRYPOINT ["/neurodocker/startup.sh", "/run.py"] + +# Save specification to JSON. +RUN printf '{ \ + "pkg_manager": "apt", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "ubuntu:jammy" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "tcsh", \ + "bc", \ + "tar", \ + "libgomp1", \ + "perl-modules", \ + "wget", \ + "curl", \ + "libsm-dev", \ + "libx11-dev", \ + "libxt-dev", \ + "libxext-dev", \ + "libglu1-mesa", \ + "libpython2.7-stdlib" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget \\\\\\n && rm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FREESURFER": "/opt/freesurfer", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/freesurfer\\ncurl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "CONDA_DIR": "/opt/miniconda-latest", \ + "PATH": "/opt/miniconda-latest/bin:$PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "nodejs" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n nodejs \\\\\\n && rm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "FSLDIR": "/usr/share/fsl/5.0", \ + "FSLOUTPUTTYPE": "NIFTI_GZ", \ + "FSLMULTIFILEQUIT": "TRUE", \ + "POSSUMDIR": "/usr/share/fsl/5.0", \ + "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \ + "FSLTCLSH": "/usr/bin/tclsh", \ + "FSLWISH": "/usr/bin/wish" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "FSF_OUTPUT_FORMAT": "nii.gz", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \ + "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \ + "PYTHONPATH": "" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir root/matlab && touch root/matlab/startup.m" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /scratch" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /local-scratch" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "run.py", \ + "/run.py" \ + ], \ + "destination": "/run.py" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "chmod +x /run.py" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "version", \ + "/version" \ + ], \ + "destination": "/version" \ + } \ + }, \ + { \ + "name": "entrypoint", \ + "kwds": { \ + "args": [ \ + "/neurodocker/startup.sh", \ + "/run.py" \ + ] \ + } \ + } \ + ] \ +}' > /.reproenv.json +# End saving to specification to JSON. diff --git a/Dockerfile_fs7 b/Dockerfile_fs7 index 84ea1dd..faa9f50 100644 --- a/Dockerfile_fs7 +++ b/Dockerfile_fs7 @@ -1,6 +1,6 @@ # Generated by Neurodocker and Reproenv. -FROM ubuntu:xenial +FROM ubuntu:jammy RUN apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ bc \ @@ -152,7 +152,7 @@ RUN printf '{ \ { \ "name": "from_", \ "kwds": { \ - "base_image": "ubuntu:xenial" \ + "base_image": "ubuntu:jammy" \ } \ }, \ { \ diff --git a/Singularity_fs6 b/Singularity_fs6 new file mode 100644 index 0000000..5fa3e3c --- /dev/null +++ b/Singularity_fs6 @@ -0,0 +1,357 @@ +# Generated by Neurodocker and Reproenv. + +Bootstrap: docker +From: ubuntu:jammy + +%files +run.py /run.py +version /version + +%environment +export OS="Linux" +export PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH" +export FREESURFER_HOME="/opt/freesurfer" +export FREESURFER="/opt/freesurfer" +export SUBJECTS_DIR="/opt/freesurfer/subjects" +export LOCAL_DIR="/opt/freesurfer/local" +export FSFAST_HOME="/opt/freesurfer/fsfast" +export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" +export FUNCTIONALS_DIR="/opt/freesurfer/sessions" +export FS_OVERRIDE="0" +export FIX_VERTEX_AREA="" +export FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" +export MINC_BIN_DIR="/opt/freesurfer/mni/bin" +export MINC_LIB_DIR="/opt/freesurfer/mni/lib" +export MNI_DIR="/opt/freesurfer/mni" +export MNI_DATAPATH="/opt/freesurfer/mni/data" +export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5" +export PERL5LIB="/opt/freesurfer/mni/share/perl5" +export CONDA_DIR="/opt/miniconda-latest" +export PATH="/opt/miniconda-latest/bin:$PATH" +export FSLDIR="/usr/share/fsl/5.0" +export FSLOUTPUTTYPE="NIFTI_GZ" +export FSLMULTIFILEQUIT="TRUE" +export POSSUMDIR="/usr/share/fsl/5.0" +export LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" +export FSLTCLSH="/usr/bin/tclsh" +export FSLWISH="/usr/bin/wish" +export OS="Linux" +export FS_OVERRIDE="0" +export FIX_VERTEX_AREA="" +export SUBJECTS_DIR="/opt/freesurfer/subjects" +export FSF_OUTPUT_FORMAT="nii.gz" +export MNI_DIR="/opt/freesurfer/mni" +export LOCAL_DIR="/opt/freesurfer/local" +export FREESURFER_HOME="/opt/freesurfer" +export FSFAST_HOME="/opt/freesurfer/fsfast" +export MINC_BIN_DIR="/opt/freesurfer/mni/bin" +export MINC_LIB_DIR="/opt/freesurfer/mni/lib" +export MNI_DATAPATH="/opt/freesurfer/mni/data" +export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" +export PERL5LIB="/opt/freesurfer/mni/share/perl5" +export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" +export PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +export PYTHONPATH="" + +%post +apt-get update -qq +apt-get install -y -q --no-install-recommends \ + bc \ + curl \ + libglu1-mesa \ + libgomp1 \ + libpython2.7-stdlib \ + libsm-dev \ + libx11-dev \ + libxext-dev \ + libxt-dev \ + perl-modules \ + tar \ + tcsh \ + wget +rm -rf /var/lib/apt/lists/* + +apt-get update -qq +apt-get install -y -q --no-install-recommends \ + bc \ + ca-certificates \ + curl \ + libgomp1 \ + libxmu6 \ + libxt6 \ + perl \ + tcsh +rm -rf /var/lib/apt/lists/* +echo "Downloading FreeSurfer ..." +mkdir -p /opt/freesurfer +curl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \ +| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \ + --exclude='average/mult-comp-cor' \ + --exclude='lib/cuda' \ + --exclude='lib/qt' \ + --exclude='subjects/V1_average' \ + --exclude='subjects/bert' \ + --exclude='subjects/cvs_avg35' \ + --exclude='subjects/cvs_avg35_inMNI152' \ + --exclude='subjects/fsaverage3' \ + --exclude='subjects/fsaverage4' \ + --exclude='subjects/fsaverage5' \ + --exclude='subjects/fsaverage6' \ + --exclude='subjects/fsaverage_sym' \ + --exclude='trctrain' + +apt-get update -qq +apt-get install -y -q --no-install-recommends \ + bzip2 \ + ca-certificates \ + curl +rm -rf /var/lib/apt/lists/* +# Install dependencies. +export PATH="/opt/miniconda-latest/bin:$PATH" +echo "Downloading Miniconda installer ..." +conda_installer="/tmp/miniconda.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 +# Enable `conda activate` +conda init bash +conda install -y --name base \ + "python=3" \ + "pip" \ + "pandas" \ + "setuptools" \ + "pandas=0.21.0" +bash -c "source activate base + python -m pip install --no-cache-dir \ + "nibabel"" +# Clean up +sync && conda clean --all --yes && sync +rm -rf ~/.cache/pip/* + +bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' + +apt-get update -qq +apt-get install -y -q --no-install-recommends \ + nodejs +rm -rf /var/lib/apt/lists/* + +bash -c 'npm install -g bids-validator@0.19.8' + +mkdir root/matlab && touch root/matlab/startup.m + +mkdir /scratch + +mkdir /local-scratch + +chmod +x /run.py + +# Save specification to JSON. +printf '{ \ + "pkg_manager": "apt", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "ubuntu:jammy" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "tcsh", \ + "bc", \ + "tar", \ + "libgomp1", \ + "perl-modules", \ + "wget", \ + "curl", \ + "libsm-dev", \ + "libx11-dev", \ + "libxt-dev", \ + "libxext-dev", \ + "libglu1-mesa", \ + "libpython2.7-stdlib" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FREESURFER": "/opt/freesurfer", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/freesurfer\\ncurl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "CONDA_DIR": "/opt/miniconda-latest", \ + "PATH": "/opt/miniconda-latest/bin:$PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "nodejs" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n nodejs\\nrm -rf /var/lib/apt/lists/*" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "FSLDIR": "/usr/share/fsl/5.0", \ + "FSLOUTPUTTYPE": "NIFTI_GZ", \ + "FSLMULTIFILEQUIT": "TRUE", \ + "POSSUMDIR": "/usr/share/fsl/5.0", \ + "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \ + "FSLTCLSH": "/usr/bin/tclsh", \ + "FSLWISH": "/usr/bin/wish" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ + "FSF_OUTPUT_FORMAT": "nii.gz", \ + "MNI_DIR": "/opt/freesurfer/mni", \ + "LOCAL_DIR": "/opt/freesurfer/local", \ + "FREESURFER_HOME": "/opt/freesurfer", \ + "FSFAST_HOME": "/opt/freesurfer/fsfast", \ + "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ + "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ + "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ + "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \ + "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \ + "PYTHONPATH": "" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir root/matlab && touch root/matlab/startup.m" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /scratch" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mkdir /local-scratch" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "run.py" \ + ], \ + "destination": "/run.py" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "chmod +x /run.py" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "version" \ + ], \ + "destination": "/version" \ + } \ + }, \ + { \ + "name": "entrypoint", \ + "kwds": { \ + "args": [ \ + "/neurodocker/startup.sh", \ + "/run.py" \ + ] \ + } \ + } \ + ] \ +}' > /.reproenv.json +# End saving to specification to JSON. + +%runscript +/neurodocker/startup.sh /run.py diff --git a/Singularity_fs7 b/Singularity_fs7 index bdb2c94..20501c4 100644 --- a/Singularity_fs7 +++ b/Singularity_fs7 @@ -1,7 +1,7 @@ # Generated by Neurodocker and Reproenv. Bootstrap: docker -From: ubuntu:xenial +From: ubuntu:jammy %files run.py /run.py @@ -165,7 +165,7 @@ printf '{ \ { \ "name": "from_", \ "kwds": { \ - "base_image": "ubuntu:xenial" \ + "base_image": "ubuntu:jammy" \ } \ }, \ { \ diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index 67744a6..98bdad8 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -70,7 +70,7 @@ docker run --rm ${image} generate docker \ --run 'chmod +x /run.py' \ --copy version '/version' \ --entrypoint '/neurodocker/startup.sh /run.py' \ -> Dockerfile +> Dockerfile_fs6 docker run --rm ${image} generate docker \ --base-image ubuntu:jammy \ @@ -132,7 +132,7 @@ docker run --rm ${image} generate singularity \ --run 'chmod +x /run.py' \ --copy version '/version' \ --entrypoint '/neurodocker/startup.sh /run.py' \ -> Singularity +> Singularity_fs6 docker run --rm ${image} generate singularity \ From 3867ebcda973e4e82496676141c78b6d2a93f6dd Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 25 Aug 2023 18:17:37 -0400 Subject: [PATCH 13/33] refactor --- .circleci/config.yml | 176 +++++++++------------ Dockerfile | 365 ------------------------------------------ Singularity | 368 ------------------------------------------- 3 files changed, 78 insertions(+), 831 deletions(-) delete mode 100644 Dockerfile delete mode 100644 Singularity diff --git a/.circleci/config.yml b/.circleci/config.yml index 55a9438..db610b8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,30 +3,36 @@ version: 2.1 jobs: build: + machine: image: ubuntu-2204:2022.10.2 + parameters: + version: + type: string steps: - checkout - restore_cache: keys: - - v_0-image_cache-{{ checksum "Dockerfile" }} + - v_0-image_cache_fs<< parameters.version >>-{{ checksum "Dockerfile_fs<< parameters.version >>" }} - run: name: load and build command: | - wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/build_docker.sh - bash build_docker.sh + if [[ -e ~/docker/image_fs<< parameters.version >>.tar ]]; then docker load -i ~/docker/image_fs<< parameters.version >>.tar; fi + git describe --tags > version + docker build -t bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> -f Dockerfile_fs<< parameters.version >> . + mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >>" > ~/docker/image_fs<< parameters.version >>.tar mkdir -p ~/license echo "cHJpbnRmICJEeWxhbi5OaWVsc29uQGdtYWlsLmNvbVxuMzcwNjNcbiAqQ1lrZWhQYUNvRDlNXG4gRlM2N1BTWmRFV2lqb1xuIiA+IH4vbGljZW5zZS9saWNlbnNlLnR4dA==" | base64 -d | sh no_output_timeout: 6h - save_cache: - key: v_0-image_cache-{{ checksum "Dockerfile" }}-{{ .Revision }}-{{ epoch }} + key: v_0-image_cache_fs<< parameters.version >>-{{ checksum "Dockerfile_fs<< parameters.version >>" }}-{{ .Revision }}-{{ epoch }} paths: - ~/docker - ~/license - persist_to_workspace: root: /home/circleci paths: - - docker/image.tar + - docker/image_fs<< parameters.version >>.tar - license/license.txt get_data: @@ -62,21 +68,20 @@ jobs: image: ubuntu-2204:2022.10.2 steps: - checkout - - attach_workspace: at: /tmp/workspace - run: command: | docker load -i /tmp/workspace/docker/image.tar - - run: name: print version command: | docker run -ti --rm --read-only \ -v /tmp/workspace/license/license.txt:/license.txt \ - --tmpfs /tmp --tmpfs /var/tmp \ -v $PWD/ds114_test1:/bids_dataset \ + --tmpfs /tmp --tmpfs /var/tmp \ bids/${CIRCLE_PROJECT_REPONAME} --version + docker run -ti --rm --read-only \ -v /tmp/workspace/license/license.txt:/license.txt \ --tmpfs /tmp --tmpfs /var/tmp \ @@ -87,12 +92,15 @@ jobs: command: | docker run -ti --rm --read-only \ -v /tmp/workspace/license/license.txt:/license.txt \ - --tmpfs /tmp --tmpfs /var/tmp \ -v /tmp/workspace/data/ds114_test1:/bids_dataset \ -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME} \ - /bids_dataset /outputs participant \ - --participant_label 01 \ - --license_file=/license.txt --stages autorecon1 + --tmpfs /tmp --tmpfs /var/tmp \ + /bids_dataset + /outputs \ + participant \ + --participant_label 01 \ + --license_file=/license.txt \ + --stages autorecon1 cat ${HOME}/outputs1/sub-01/scripts/recon-all.done no_output_timeout: 6h @@ -101,9 +109,9 @@ jobs: command: | docker run -ti --rm --read-only \ -v /tmp/workspace/license/license.txt:/license.txt \ - --tmpfs /tmp --tmpfs /var/tmp \ -v /tmp/workspace/data/ds114_test2:/bids_dataset \ -v ${HOME}/outputs2:/outputs \ + --tmpfs /tmp --tmpfs /var/tmp \ bids/${CIRCLE_PROJECT_REPONAME} \ /bids_dataset \ /outputs \ @@ -113,42 +121,44 @@ jobs: --session_label test \ --license_file=/license.txt \ --stages autorecon1 - cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done no_output_timeout: 6h + - run: name: group2 test 1 command: | docker run -ti --rm --read-only \ -v /tmp/workspace/license/license.txt:/license.txt \ - --tmpfs /tmp --tmpfs /var/tmp \ -v /tmp/workspace/data/ds114_test1:/bids_dataset \ -v /tmp/workspace/data/ds114_test1_freesurfer_precomp_v6.0.0:/outputs \ + --tmpfs /tmp --tmpfs /var/tmp \ bids/${CIRCLE_PROJECT_REPONAME} \ /bids_dataset \ /outputs \ group2 \ - --license_file=/license.txt - mkdir -p ${HOME}/outputs1/ - sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ - cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv - cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv + --license_file=/license.txt + + mkdir -p ${HOME}/outputs1/ + sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ + cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv + cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv no_output_timeout: 6h - run: name: group2 test 2 command: | docker run -ti --rm --read-only \ - -v ~/license/license.txt:/license.txt --tmpfs /tmp --tmpfs /var/tmp \ + -v ~/license/license.txt:/license.txt \ -v /tmp/workspace/data/ds114_test2:/bids_dataset \ -v /tmp/workspace/data/ds114_test2_freesurfer_precomp_v6.0.0:/outputs \ + --tmpfs /tmp --tmpfs /var/tmp \ bids/${CIRCLE_PROJECT_REPONAME} \ /bids_dataset /outputs group2 \ --license_file=/license.txt - mkdir -p ${HOME}/outputs2/ - sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ - cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv - cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv + mkdir -p ${HOME}/outputs2/ + sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ + cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv + cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv no_output_timeout: 6h - store_artifacts: path: ~/outputs1 @@ -158,62 +168,52 @@ jobs: deploy: machine: image: ubuntu-2204:2022.10.2 + parameters: + version: + type: string steps: - checkout - attach_workspace: at: /tmp/workspace - run: command: | - docker load -i /tmp/workspace/docker/image.tar + docker load -i /tmp/workspace/docker/image_fs<< parameters.version >>.tar - run: command: | - wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/push_docker.sh - bash push_docker.sh - no_output_timeout: 6h + if [[ -n "${DOCKER_TOKEN}" ]]; then - build_fs7: - machine: - image: ubuntu-2204:2022.10.2 - steps: - - checkout - - restore_cache: - keys: - - v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }} - - run: - name: load and build - command: | - if [[ -e ~/docker/image_fs7.tar ]]; then docker load -i ~/docker/image_fs7.tar; fi - git describe --tags > version - docker build -t bids/${CIRCLE_PROJECT_REPONAME}_fs7 -f Dockerfile_fs7 . - mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}_fs7" > ~/docker/image.tar - mkdir -p ~/license; echo "cHJpbnRmICJEeWxhbi5OaWVsc29uQGdtYWlsLmNvbVxuMzcwNjNcbiAqQ1lrZWhQYUNvRDlNXG4gRlM2N1BTWmRFV2lqb1xuIiA+IH4vbGljZW5zZS9saWNlbnNlLnR4dA==" | base64 -d | sh + # make sure we have a lowercase repo + user_name="bids" + repo_name=$(echo "${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >>" | tr '[:upper:]' '[:lower:]') + + if [[ -n "${DOCKER_TOKEN}" ]]; then + 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 + + fi + + else + : "No DOCKER_TOKEN, skipping push to DockerHub" + exit 1 + fi no_output_timeout: 6h - - save_cache: - key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }}-{{ epoch }} - paths: - - ~/docker - - ~/license + test_fs7: machine: image: ubuntu-2204:2022.10.2 steps: - checkout - - restore_cache: - key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }} - - restore_cache: - key: v_0-test_data - - run: - name: get data - command: | - if [[ ! -d ~/data/ds114_test1 ]]; then wget -c -O ${HOME}/ds114_test1.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e54a326c613b01d7d3ed90" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1.tar -C ${HOME}/data; fi - if [[ ! -d ~/data/ds114_test2 ]]; then wget -c -O ${HOME}/ds114_test2.tar "https://files.osf.io/v1/resources/9q7dv/providers/osfstorage/57e549f9b83f6901d457d162" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2.tar -C ${HOME}/data; fi - if [[ ! -d ~/data/ds114_test1_freesurfer_precomp_v6.0.0 ]]; then wget -c --no-check-certificate -O ${HOME}/ds114_test1_freesurfer_precomp_v6.0.0.tar "https://osf.io/j6zk2/?action=download&version=1" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test1_freesurfer_precomp_v6.0.0.tar -C ${HOME}/data; fi - if [[ ! -d ~/data/ds114_test2_freesurfer_precomp_v6.0.0 ]]; then wget -c --no-check-certificate -O ${HOME}/ds114_test2_freesurfer_precomp_v6.0.0.tar "https://osf.io/yhzzj/?action=download&version=1" && mkdir -p ${HOME}/data && tar xf ${HOME}/ds114_test2_freesurfer_precomp_v6.0.0.tar -C ${HOME}/data; fi - - save_cache: - key: v_0-test_data - paths: - - ~/data - run: name: load image command: docker load -i ~/docker/image.tar @@ -313,37 +313,29 @@ jobs: - store_artifacts: path: ~/outputs2 - deploy_fs7: - machine: - image: ubuntu-2204:2022.10.2 - steps: - - checkout - - restore_cache: - key: v_0-image_cache_fs7-{{ checksum "Dockerfile_fs7" }}-{{ .Revision }} - - run: - name: load image - command: docker load -i ~/docker/image.tar - - deploy: - command: | - if [[ -n "$DOCKER_PASS" ]]; then docker login -u $DOCKER_USER -p $DOCKER_PASS && docker push bids/${CIRCLE_PROJECT_REPONAME}_fs7:latest; fi - if [[ -n "$DOCKER_PASS" ]]; then docker login -u $DOCKER_USER -p $DOCKER_PASS && docker tag bids/${CIRCLE_PROJECT_REPONAME}_fs7 bids/${CIRCLE_PROJECT_REPONAME}_fs7:$CIRCLE_TAG && docker push bids/${CIRCLE_PROJECT_REPONAME}_fs7:$CIRCLE_TAG; fi - no_output_timeout: 6h + workflows: build_test_deploy: jobs: + - get_data: filters: tags: only: /.*/ branches: only: /.*/ + - build: + matrix: + parameters: + version: ['6', '7'] filters: tags: only: /.*/ branches: only: /.*/ + - test: requires: - build @@ -353,7 +345,11 @@ workflows: only: /.*/ branches: only: /.*/ + - deploy: + matrix: + parameters: + version: ['6', '7'] context: - dockerhub requires: @@ -363,28 +359,12 @@ workflows: ignore: /.*/ tags: only: /.*/ - - build_fs7: - filters: - tags: - only: /.*/ - branches: - only: /.*/ + - test_fs7: requires: - - build_fs7 + - build filters: tags: only: /.*/ branches: only: /.*/ - - deploy_fs7: - context: - - dockerhub - requires: - - build_fs7 - - test_fs7 - filters: - branches: - ignore: /.*/ - tags: - only: /.*/ diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 7074294..0000000 --- a/Dockerfile +++ /dev/null @@ -1,365 +0,0 @@ -<<<<<<< HEAD -# Generated by Neurodocker and Reproenv. -======= -# Generated by Neurodocker version 0.4.2-3-gf7055a1 -# Timestamp: 2020-06-29 18:20:44 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/kaczmarj/neurodocker ->>>>>>> master - -FROM ubuntu:xenial -RUN apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - bc \ - curl \ - libglu1-mesa \ - libgomp1 \ - libpython2.7-stdlib \ - libsm-dev \ - libx11-dev \ - libxext-dev \ - libxt-dev \ - perl-modules \ - tar \ - tcsh \ - wget \ - && rm -rf /var/lib/apt/lists/* -ENV OS="Linux" \ - PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH" \ - FREESURFER_HOME="/opt/freesurfer" \ - FREESURFER="/opt/freesurfer" \ - SUBJECTS_DIR="/opt/freesurfer/subjects" \ - LOCAL_DIR="/opt/freesurfer/local" \ - FSFAST_HOME="/opt/freesurfer/fsfast" \ - FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \ - FUNCTIONALS_DIR="/opt/freesurfer/sessions" \ - FS_OVERRIDE="0" \ - FIX_VERTEX_AREA="" \ - FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" \ - MINC_BIN_DIR="/opt/freesurfer/mni/bin" \ - MINC_LIB_DIR="/opt/freesurfer/mni/lib" \ - MNI_DIR="/opt/freesurfer/mni" \ - MNI_DATAPATH="/opt/freesurfer/mni/data" \ - MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5" \ - PERL5LIB="/opt/freesurfer/mni/share/perl5" -RUN apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - bc \ - ca-certificates \ - curl \ - libgomp1 \ - libxmu6 \ - libxt6 \ - perl \ - tcsh \ - && rm -rf /var/lib/apt/lists/* \ - && echo "Downloading FreeSurfer ..." \ - && mkdir -p /opt/freesurfer \ - && curl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \ - | tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \ - --exclude='average/mult-comp-cor' \ - --exclude='lib/cuda' \ - --exclude='lib/qt' \ - --exclude='subjects/V1_average' \ - --exclude='subjects/bert' \ - --exclude='subjects/cvs_avg35' \ - --exclude='subjects/cvs_avg35_inMNI152' \ - --exclude='subjects/fsaverage3' \ - --exclude='subjects/fsaverage4' \ - --exclude='subjects/fsaverage5' \ - --exclude='subjects/fsaverage6' \ - --exclude='subjects/fsaverage_sym' \ - --exclude='trctrain' -ENV CONDA_DIR="/opt/miniconda-latest" \ - PATH="/opt/miniconda-latest/bin:$PATH" -RUN apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - bzip2 \ - ca-certificates \ - curl \ - && rm -rf /var/lib/apt/lists/* \ - # Install dependencies. - && export PATH="/opt/miniconda-latest/bin:$PATH" \ - && echo "Downloading Miniconda installer ..." \ - && conda_installer="/tmp/miniconda.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 \ -<<<<<<< HEAD - # Enable `conda activate` - && conda init bash \ - && conda install -y --name base \ - "python=3" \ - "pip" \ - "pandas" \ - "setuptools" \ - "pandas=0.21.0" \ -======= - && sync && conda clean -tip && sync \ - && conda install -y -q --name base \ - 'python=3' \ - 'pip' \ - 'pandas' \ - 'setuptools' \ - 'pandas=0.21.0' \ - && sync && conda clean -tipsy && sync \ ->>>>>>> master - && bash -c "source activate base \ - && python -m pip install --no-cache-dir \ - "nibabel"" \ - # Clean up - && sync && conda clean --all --yes && sync \ - && rm -rf ~/.cache/pip/* -RUN bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' -RUN apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - nodejs \ - && rm -rf /var/lib/apt/lists/* -RUN bash -c 'npm install -g bids-validator@0.19.8' -ENV FSLDIR="/usr/share/fsl/5.0" \ - FSLOUTPUTTYPE="NIFTI_GZ" \ - FSLMULTIFILEQUIT="TRUE" \ - POSSUMDIR="/usr/share/fsl/5.0" \ - LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" \ - FSLTCLSH="/usr/bin/tclsh" \ - FSLWISH="/usr/bin/wish" -ENV OS="Linux" \ - FS_OVERRIDE="0" \ - FIX_VERTEX_AREA="" \ - SUBJECTS_DIR="/opt/freesurfer/subjects" \ - FSF_OUTPUT_FORMAT="nii.gz" \ - MNI_DIR="/opt/freesurfer/mni" \ - LOCAL_DIR="/opt/freesurfer/local" \ - FREESURFER_HOME="/opt/freesurfer" \ - FSFAST_HOME="/opt/freesurfer/fsfast" \ - MINC_BIN_DIR="/opt/freesurfer/mni/bin" \ - MINC_LIB_DIR="/opt/freesurfer/mni/lib" \ - MNI_DATAPATH="/opt/freesurfer/mni/data" \ - FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \ - PERL5LIB="/opt/freesurfer/mni/share/perl5" \ - MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \ - PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ - PYTHONPATH="" -RUN mkdir root/matlab && touch root/matlab/startup.m -RUN mkdir /scratch -RUN mkdir /local-scratch -COPY ["run.py", \ - "/run.py"] -RUN chmod +x /run.py -COPY ["version", \ - "/version"] -ENTRYPOINT ["/neurodocker/startup.sh", "/run.py"] - -# Save specification to JSON. -RUN printf '{ \ - "pkg_manager": "apt", \ - "existing_users": [ \ - "root" \ - ], \ - "instructions": [ \ - { \ - "name": "from_", \ - "kwds": { \ - "base_image": "ubuntu:xenial" \ - } \ - }, \ - { \ - "name": "install", \ - "kwds": { \ - "pkgs": [ \ - "tcsh", \ - "bc", \ - "tar", \ - "libgomp1", \ - "perl-modules", \ - "wget", \ - "curl", \ - "libsm-dev", \ - "libx11-dev", \ - "libxt-dev", \ - "libxext-dev", \ - "libglu1-mesa", \ - "libpython2.7-stdlib" \ - ], \ - "opts": null \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget \\\\\\n && rm -rf /var/lib/apt/lists/*" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "OS": "Linux", \ - "PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \ - "FREESURFER_HOME": "/opt/freesurfer", \ - "FREESURFER": "/opt/freesurfer", \ - "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ - "LOCAL_DIR": "/opt/freesurfer/local", \ - "FSFAST_HOME": "/opt/freesurfer/fsfast", \ - "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ - "FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \ - "FS_OVERRIDE": "0", \ - "FIX_VERTEX_AREA": "", \ - "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ - "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ - "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ - "MNI_DIR": "/opt/freesurfer/mni", \ - "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ - "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ - "PERL5LIB": "/opt/freesurfer/mni/share/perl5" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/freesurfer\\ncurl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "CONDA_DIR": "/opt/miniconda-latest", \ - "PATH": "/opt/miniconda-latest/bin:$PATH" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ - } \ - }, \ - { \ - "name": "install", \ - "kwds": { \ - "pkgs": [ \ - "nodejs" \ - ], \ - "opts": null \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n nodejs \\\\\\n && rm -rf /var/lib/apt/lists/*" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "FSLDIR": "/usr/share/fsl/5.0", \ - "FSLOUTPUTTYPE": "NIFTI_GZ", \ - "FSLMULTIFILEQUIT": "TRUE", \ - "POSSUMDIR": "/usr/share/fsl/5.0", \ - "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \ - "FSLTCLSH": "/usr/bin/tclsh", \ - "FSLWISH": "/usr/bin/wish" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "OS": "Linux", \ - "FS_OVERRIDE": "0", \ - "FIX_VERTEX_AREA": "", \ - "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ - "FSF_OUTPUT_FORMAT": "nii.gz", \ - "MNI_DIR": "/opt/freesurfer/mni", \ - "LOCAL_DIR": "/opt/freesurfer/local", \ - "FREESURFER_HOME": "/opt/freesurfer", \ - "FSFAST_HOME": "/opt/freesurfer/fsfast", \ - "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ - "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ - "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ - "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ - "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ - "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \ - "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \ - "PYTHONPATH": "" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "mkdir root/matlab && touch root/matlab/startup.m" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "mkdir /scratch" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "mkdir /local-scratch" \ - } \ - }, \ - { \ - "name": "copy", \ - "kwds": { \ - "source": [ \ - "run.py", \ - "/run.py" \ - ], \ - "destination": "/run.py" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "chmod +x /run.py" \ - } \ - }, \ - { \ - "name": "copy", \ - "kwds": { \ - "source": [ \ - "version", \ - "/version" \ - ], \ - "destination": "/version" \ - } \ - }, \ - { \ - "name": "entrypoint", \ - "kwds": { \ - "args": [ \ - "/neurodocker/startup.sh", \ - "/run.py" \ - ] \ - } \ - } \ - ] \ -}' > /.reproenv.json -# End saving to specification to JSON. diff --git a/Singularity b/Singularity deleted file mode 100644 index d49378b..0000000 --- a/Singularity +++ /dev/null @@ -1,368 +0,0 @@ -<<<<<<< HEAD -# Generated by Neurodocker and Reproenv. -======= -# Generated by Neurodocker version 0.4.2-3-gf7055a1 -# Timestamp: 2020-06-29 18:20:45 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/kaczmarj/neurodocker ->>>>>>> master - -Bootstrap: docker -From: ubuntu:xenial - -%files -run.py /run.py -version /version - -%environment -export OS="Linux" -export PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH" -export FREESURFER_HOME="/opt/freesurfer" -export FREESURFER="/opt/freesurfer" -export SUBJECTS_DIR="/opt/freesurfer/subjects" -export LOCAL_DIR="/opt/freesurfer/local" -export FSFAST_HOME="/opt/freesurfer/fsfast" -export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" -export FUNCTIONALS_DIR="/opt/freesurfer/sessions" -export FS_OVERRIDE="0" -export FIX_VERTEX_AREA="" -export FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" -export MINC_BIN_DIR="/opt/freesurfer/mni/bin" -export MINC_LIB_DIR="/opt/freesurfer/mni/lib" -export MNI_DIR="/opt/freesurfer/mni" -export MNI_DATAPATH="/opt/freesurfer/mni/data" -export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5" -export PERL5LIB="/opt/freesurfer/mni/share/perl5" -export CONDA_DIR="/opt/miniconda-latest" -export PATH="/opt/miniconda-latest/bin:$PATH" -export FSLDIR="/usr/share/fsl/5.0" -export FSLOUTPUTTYPE="NIFTI_GZ" -export FSLMULTIFILEQUIT="TRUE" -export POSSUMDIR="/usr/share/fsl/5.0" -export LD_LIBRARY_PATH="/usr/lib/fsl/5.0:" -export FSLTCLSH="/usr/bin/tclsh" -export FSLWISH="/usr/bin/wish" -export OS="Linux" -export FS_OVERRIDE="0" -export FIX_VERTEX_AREA="" -export SUBJECTS_DIR="/opt/freesurfer/subjects" -export FSF_OUTPUT_FORMAT="nii.gz" -export MNI_DIR="/opt/freesurfer/mni" -export LOCAL_DIR="/opt/freesurfer/local" -export FREESURFER_HOME="/opt/freesurfer" -export FSFAST_HOME="/opt/freesurfer/fsfast" -export MINC_BIN_DIR="/opt/freesurfer/mni/bin" -export MINC_LIB_DIR="/opt/freesurfer/mni/lib" -export MNI_DATAPATH="/opt/freesurfer/mni/data" -export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" -export PERL5LIB="/opt/freesurfer/mni/share/perl5" -export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" -export PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -export PYTHONPATH="" - -%post -apt-get update -qq -apt-get install -y -q --no-install-recommends \ - bc \ - curl \ - libglu1-mesa \ - libgomp1 \ - libpython2.7-stdlib \ - libsm-dev \ - libx11-dev \ - libxext-dev \ - libxt-dev \ - perl-modules \ - tar \ - tcsh \ - wget -rm -rf /var/lib/apt/lists/* - -apt-get update -qq -apt-get install -y -q --no-install-recommends \ - bc \ - ca-certificates \ - curl \ - libgomp1 \ - libxmu6 \ - libxt6 \ - perl \ - tcsh -rm -rf /var/lib/apt/lists/* -echo "Downloading FreeSurfer ..." -mkdir -p /opt/freesurfer -curl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \ -| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \ - --exclude='average/mult-comp-cor' \ - --exclude='lib/cuda' \ - --exclude='lib/qt' \ - --exclude='subjects/V1_average' \ - --exclude='subjects/bert' \ - --exclude='subjects/cvs_avg35' \ - --exclude='subjects/cvs_avg35_inMNI152' \ - --exclude='subjects/fsaverage3' \ - --exclude='subjects/fsaverage4' \ - --exclude='subjects/fsaverage5' \ - --exclude='subjects/fsaverage6' \ - --exclude='subjects/fsaverage_sym' \ - --exclude='trctrain' - -apt-get update -qq -apt-get install -y -q --no-install-recommends \ - bzip2 \ - ca-certificates \ - curl -rm -rf /var/lib/apt/lists/* -# Install dependencies. -export PATH="/opt/miniconda-latest/bin:$PATH" -echo "Downloading Miniconda installer ..." -conda_installer="/tmp/miniconda.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 -# Enable `conda activate` -conda init bash -conda install -y --name base \ - "python=3" \ - "pip" \ - "pandas" \ - "setuptools" \ - "pandas=0.21.0" -bash -c "source activate base - python -m pip install --no-cache-dir \ - "nibabel"" -# Clean up -sync && conda clean --all --yes && sync -rm -rf ~/.cache/pip/* - -bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' - -apt-get update -qq -apt-get install -y -q --no-install-recommends \ - nodejs -rm -rf /var/lib/apt/lists/* - -bash -c 'npm install -g bids-validator@0.19.8' - -mkdir root/matlab && touch root/matlab/startup.m - -mkdir /scratch - -mkdir /local-scratch - -chmod +x /run.py - -# Save specification to JSON. -printf '{ \ - "pkg_manager": "apt", \ - "existing_users": [ \ - "root" \ - ], \ - "instructions": [ \ - { \ - "name": "from_", \ - "kwds": { \ - "base_image": "ubuntu:xenial" \ - } \ - }, \ - { \ - "name": "install", \ - "kwds": { \ - "pkgs": [ \ - "tcsh", \ - "bc", \ - "tar", \ - "libgomp1", \ - "perl-modules", \ - "wget", \ - "curl", \ - "libsm-dev", \ - "libx11-dev", \ - "libxt-dev", \ - "libxext-dev", \ - "libglu1-mesa", \ - "libpython2.7-stdlib" \ - ], \ - "opts": null \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "OS": "Linux", \ - "PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \ - "FREESURFER_HOME": "/opt/freesurfer", \ - "FREESURFER": "/opt/freesurfer", \ - "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ - "LOCAL_DIR": "/opt/freesurfer/local", \ - "FSFAST_HOME": "/opt/freesurfer/fsfast", \ - "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ - "FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \ - "FS_OVERRIDE": "0", \ - "FIX_VERTEX_AREA": "", \ - "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ - "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ - "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ - "MNI_DIR": "/opt/freesurfer/mni", \ - "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ - "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ - "PERL5LIB": "/opt/freesurfer/mni/share/perl5" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/freesurfer\\ncurl -fL ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "CONDA_DIR": "/opt/miniconda-latest", \ - "PATH": "/opt/miniconda-latest/bin:$PATH" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ - } \ - }, \ - { \ - "name": "install", \ - "kwds": { \ - "pkgs": [ \ - "nodejs" \ - ], \ - "opts": null \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n nodejs\\nrm -rf /var/lib/apt/lists/*" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "FSLDIR": "/usr/share/fsl/5.0", \ - "FSLOUTPUTTYPE": "NIFTI_GZ", \ - "FSLMULTIFILEQUIT": "TRUE", \ - "POSSUMDIR": "/usr/share/fsl/5.0", \ - "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \ - "FSLTCLSH": "/usr/bin/tclsh", \ - "FSLWISH": "/usr/bin/wish" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "OS": "Linux", \ - "FS_OVERRIDE": "0", \ - "FIX_VERTEX_AREA": "", \ - "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ - "FSF_OUTPUT_FORMAT": "nii.gz", \ - "MNI_DIR": "/opt/freesurfer/mni", \ - "LOCAL_DIR": "/opt/freesurfer/local", \ - "FREESURFER_HOME": "/opt/freesurfer", \ - "FSFAST_HOME": "/opt/freesurfer/fsfast", \ - "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ - "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ - "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ - "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ - "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ - "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \ - "PATH": "/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \ - "PYTHONPATH": "" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "mkdir root/matlab && touch root/matlab/startup.m" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "mkdir /scratch" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "mkdir /local-scratch" \ - } \ - }, \ - { \ - "name": "copy", \ - "kwds": { \ - "source": [ \ - "run.py" \ - ], \ - "destination": "/run.py" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "chmod +x /run.py" \ - } \ - }, \ - { \ - "name": "copy", \ - "kwds": { \ - "source": [ \ - "version" \ - ], \ - "destination": "/version" \ - } \ - }, \ - { \ - "name": "entrypoint", \ - "kwds": { \ - "args": [ \ - "/neurodocker/startup.sh", \ - "/run.py" \ - ] \ - } \ - } \ - ] \ -}' > /.reproenv.json -# End saving to specification to JSON. - -%runscript -/neurodocker/startup.sh /run.py From 892ed67d6b50030cc4dc76f8bc5083884f0314f9 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 25 Aug 2023 18:36:13 -0400 Subject: [PATCH 14/33] refactor --- .circleci/config.yml | 167 ++++++++----------------------------------- 1 file changed, 31 insertions(+), 136 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index db610b8..2c0cde7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,7 +23,7 @@ jobs: mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >>" > ~/docker/image_fs<< parameters.version >>.tar mkdir -p ~/license echo "cHJpbnRmICJEeWxhbi5OaWVsc29uQGdtYWlsLmNvbVxuMzcwNjNcbiAqQ1lrZWhQYUNvRDlNXG4gRlM2N1BTWmRFV2lqb1xuIiA+IH4vbGljZW5zZS9saWNlbnNlLnR4dA==" | base64 -d | sh - no_output_timeout: 6h + - save_cache: key: v_0-image_cache_fs<< parameters.version >>-{{ checksum "Dockerfile_fs<< parameters.version >>" }}-{{ .Revision }}-{{ epoch }} paths: @@ -66,36 +66,47 @@ jobs: test: machine: image: ubuntu-2204:2022.10.2 + parameters: + version: + type: string steps: - checkout - attach_workspace: at: /tmp/workspace + - run: command: | - docker load -i /tmp/workspace/docker/image.tar + docker load -i /tmp/workspace/docker/image_fs<< parameters.version >>.tar + - run: name: print version command: | docker run -ti --rm --read-only \ -v /tmp/workspace/license/license.txt:/license.txt \ - -v $PWD/ds114_test1:/bids_dataset \ + -v /tmp/workspace/ds114_test1:/bids_dataset \ --tmpfs /tmp --tmpfs /var/tmp \ - bids/${CIRCLE_PROJECT_REPONAME} --version - + bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> --version + - run: + name: print help + command: | docker run -ti --rm --read-only \ -v /tmp/workspace/license/license.txt:/license.txt \ - --tmpfs /tmp --tmpfs /var/tmp \ -v /tmp/workspace/data/ds114_test1:/bids_dataset \ - bids/${CIRCLE_PROJECT_REPONAME} -h + --tmpfs /tmp --tmpfs /var/tmp \ + bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> -h + + - run: mkdir -p ${HOME}/outputs1 ${HOME}/outputs2 + - run: name: test 1 command: | docker run -ti --rm --read-only \ -v /tmp/workspace/license/license.txt:/license.txt \ -v /tmp/workspace/data/ds114_test1:/bids_dataset \ - -v ${HOME}/outputs1:/outputs bids/${CIRCLE_PROJECT_REPONAME} \ + -v ${HOME}/outputs1:/outputs \ --tmpfs /tmp --tmpfs /var/tmp \ - /bids_dataset + bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> \ + /bids_dataset /outputs \ participant \ --participant_label 01 \ @@ -103,7 +114,7 @@ jobs: --stages autorecon1 cat ${HOME}/outputs1/sub-01/scripts/recon-all.done - no_output_timeout: 6h + - run: name: test 2 command: | @@ -112,7 +123,7 @@ jobs: -v /tmp/workspace/data/ds114_test2:/bids_dataset \ -v ${HOME}/outputs2:/outputs \ --tmpfs /tmp --tmpfs /var/tmp \ - bids/${CIRCLE_PROJECT_REPONAME} \ + bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> \ /bids_dataset \ /outputs \ participant \ @@ -121,8 +132,8 @@ jobs: --session_label test \ --license_file=/license.txt \ --stages autorecon1 + cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done - no_output_timeout: 6h - run: name: group2 test 1 @@ -132,34 +143,32 @@ jobs: -v /tmp/workspace/data/ds114_test1:/bids_dataset \ -v /tmp/workspace/data/ds114_test1_freesurfer_precomp_v6.0.0:/outputs \ --tmpfs /tmp --tmpfs /var/tmp \ - bids/${CIRCLE_PROJECT_REPONAME} \ + bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> \ /bids_dataset \ /outputs \ group2 \ --license_file=/license.txt - mkdir -p ${HOME}/outputs1/ sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv - no_output_timeout: 6h + - run: name: group2 test 2 command: | docker run -ti --rm --read-only \ - -v ~/license/license.txt:/license.txt \ + -v /tmp/workspace/license/license.txt:/license.txt \ -v /tmp/workspace/data/ds114_test2:/bids_dataset \ -v /tmp/workspace/data/ds114_test2_freesurfer_precomp_v6.0.0:/outputs \ --tmpfs /tmp --tmpfs /var/tmp \ - bids/${CIRCLE_PROJECT_REPONAME} \ + bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> \ /bids_dataset /outputs group2 \ --license_file=/license.txt - mkdir -p ${HOME}/outputs2/ sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv - no_output_timeout: 6h + - store_artifacts: path: ~/outputs1 - store_artifacts: @@ -206,114 +215,6 @@ jobs: : "No DOCKER_TOKEN, skipping push to DockerHub" exit 1 fi - no_output_timeout: 6h - - - test_fs7: - machine: - image: ubuntu-2204:2022.10.2 - steps: - - checkout - - run: - name: load image - command: docker load -i ~/docker/image.tar - - run: - name: print version - command: | - docker run -ti --rm --read-only \ - -v ~/license/license.txt:/license.txt \ - --tmpfs /tmp --tmpfs /var/tmp \ - -v $PWD/ds114_test1:/bids_dataset \ - bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ - --version - - docker run -ti --rm --read-only \ - -v ~/license/license.txt:/license.txt \ - --tmpfs /tmp --tmpfs /var/tmp \ - -v ${HOME}/data/ds114_test1:/bids_dataset \ - bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ - -h - - run: - name: test 1 - command: | - docker run -ti --rm --read-only \ - -v ~/license/license.txt:/license.txt \ - --tmpfs /tmp --tmpfs /var/tmp \ - -v ${HOME}/data/ds114_test1:/bids_dataset \ - -v ${HOME}/outputs1:/outputs \ - bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ - /bids_dataset \ - /outputs \ - participant \ - --participant_label 01 \ - --license_file=/license.txt \ - --stages autorecon1 \ - - cat ${HOME}/outputs1/sub-01/scripts/recon-all.done - no_output_timeout: 6h - - run: - name: test 2 - command: | - docker run -ti --rm --read-only \ - -v ~/license/license.txt:/license.txt \ - --tmpfs /tmp --tmpfs /var/tmp \ - -v ${HOME}/data/ds114_test2:/bids_dataset \ - -v ${HOME}/outputs2:/outputs \ - bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ - /bids_dataset \ - /outputs \ - participant \ - --participant_label 01 \ - --steps cross-sectional \ - --session_label test \ - --license_file=/license.txt \ - --stages autorecon1 - - cat ${HOME}/outputs2/sub-01_ses-test/scripts/recon-all.done - no_output_timeout: 6h - - run: - name: group2 test 1 - command: | - docker run -ti --rm --read-only \ - -v ~/license/license.txt:/license.txt \ - --tmpfs /tmp --tmpfs /var/tmp \ - -v ${HOME}/data/ds114_test1:/bids_dataset \ - -v ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0:/outputs \ - bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ - /bids_dataset \ - /outputs \ - group2 \ - --license_file=/license.txt - - mkdir -p ${HOME}/outputs1/ - sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ - cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv - cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv - no_output_timeout: 6h - - run: - name: group2 test 2 - command: | - docker run -ti --rm --read-only \ - -v ~/license/license.txt:/license.txt \ - --tmpfs /tmp --tmpfs /var/tmp \ - -v ${HOME}/data/ds114_test2:/bids_dataset \ - -v ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0:/outputs bids/${CIRCLE_PROJECT_REPONAME}_fs7 \ - /bids_dataset \ - /outputs \ - group2 \ - --license_file=/license.txt - - mkdir -p ${HOME}/outputs2/ - sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ - cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv - cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv - no_output_timeout: 6h - - store_artifacts: - path: ~/outputs1 - - store_artifacts: - path: ~/outputs2 - - workflows: build_test_deploy: @@ -337,6 +238,9 @@ workflows: only: /.*/ - test: + matrix: + parameters: + version: ['6', '7'] requires: - build - get_data @@ -359,12 +263,3 @@ workflows: ignore: /.*/ tags: only: /.*/ - - - test_fs7: - requires: - - build - filters: - tags: - only: /.*/ - branches: - only: /.*/ From 61c29c4d37f3ff72ce53f4f142f9356fcd111669 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 25 Aug 2023 18:41:05 -0400 Subject: [PATCH 15/33] refactor --- .circleci/config.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c0cde7..8382bf1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,6 @@ version: 2.1 jobs: build: - machine: image: ubuntu-2204:2022.10.2 parameters: @@ -17,13 +16,15 @@ jobs: - run: name: load and build command: | - if [[ -e ~/docker/image_fs<< parameters.version >>.tar ]]; then docker load -i ~/docker/image_fs<< parameters.version >>.tar; fi + tar_name=image_fs<< parameters.version >>.tar + if [[ -e ~/docker/${tar_name} ]]; then + docker load -i ~/docker/${tar_name} + fi git describe --tags > version docker build -t bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> -f Dockerfile_fs<< parameters.version >> . - mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >>" > ~/docker/image_fs<< parameters.version >>.tar + mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >>" > ~/docker/${tar_name} mkdir -p ~/license echo "cHJpbnRmICJEeWxhbi5OaWVsc29uQGdtYWlsLmNvbVxuMzcwNjNcbiAqQ1lrZWhQYUNvRDlNXG4gRlM2N1BTWmRFV2lqb1xuIiA+IH4vbGljZW5zZS9saWNlbnNlLnR4dA==" | base64 -d | sh - - save_cache: key: v_0-image_cache_fs<< parameters.version >>-{{ checksum "Dockerfile_fs<< parameters.version >>" }}-{{ .Revision }}-{{ epoch }} paths: @@ -86,6 +87,7 @@ jobs: -v /tmp/workspace/ds114_test1:/bids_dataset \ --tmpfs /tmp --tmpfs /var/tmp \ bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> --version + - run: name: print help command: | From 5e42c2730bc4f5a2f5a744a2911f9aae83159fba Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Mon, 28 Aug 2023 17:33:57 -0400 Subject: [PATCH 16/33] refactor bash script --- generate_freesurfer_images.sh | 171 ++++++++++------------------------ 1 file changed, 48 insertions(+), 123 deletions(-) diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index 98bdad8..71b5dd5 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -40,127 +40,52 @@ ############################################################################### image="repronim/neurodocker@sha256:5b80804139b317e6180ae0b0de39aeff5731b27b224e6af4d1b46e040e4785a7" +for TARGET in docker singularity +do + if [ $TARGET = docker ] + then + OUTFILEBASE=Dockerfile + else + OUTFILEBASE=Singularity + fi + for VERSION in "6.0.1" "7.4.1" + do + if [ $VERSION = "6.0.1" ] + then + OUTFILE=${OUTFILEBASE}_fs6 + else + OUTFILE=${OUTFILEBASE}_fs7 + fi -# Generate a dockerfile for building BIDS-Apps Freesurfer container -docker run --rm ${image} generate docker \ - --base-image ubuntu:jammy \ - --pkg-manager apt \ - --install tcsh bc tar libgomp1 perl-modules wget curl \ - libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ - --freesurfer version=6.0.1 install_path=/opt/freesurfer \ - --miniconda version=latest conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ - --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ - --install nodejs \ - --run-bash 'npm install -g bids-validator@0.19.8' \ - --env FSLDIR=/usr/share/fsl/5.0 FSLOUTPUTTYPE=NIFTI_GZ \ - FSLMULTIFILEQUIT=TRUE POSSUMDIR=/usr/share/fsl/5.0 LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \ - FSLTCLSH=/usr/bin/tclsh FSLWISH=/usr/bin/wish FSLOUTPUTTYPE=NIFTI_GZ \ - --env OS=Linux FS_OVERRIDE=0 FIX_VERTEX_AREA= SUBJECTS_DIR=/opt/freesurfer/subjects \ - FSF_OUTPUT_FORMAT=nii.gz MNI_DIR=/opt/freesurfer/mni LOCAL_DIR=/opt/freesurfer/local \ - FREESURFER_HOME=/opt/freesurfer FSFAST_HOME=/opt/freesurfer/fsfast MINC_BIN_DIR=/opt/freesurfer/mni/bin \ - MINC_LIB_DIR=/opt/freesurfer/mni/lib MNI_DATAPATH=/opt/freesurfer/mni/data \ - FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast PERL5LIB=/opt/freesurfer/mni/share/perl5 \ - MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \ - PATH=/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ - PYTHONPATH="" \ - --run 'mkdir root/matlab && touch root/matlab/startup.m' \ - --run 'mkdir /scratch' \ - --run 'mkdir /local-scratch' \ - --copy run.py '/run.py' \ - --run 'chmod +x /run.py' \ - --copy version '/version' \ - --entrypoint '/neurodocker/startup.sh /run.py' \ -> Dockerfile_fs6 - -docker run --rm ${image} generate docker \ - --base-image ubuntu:jammy \ - --pkg-manager apt \ - --install tcsh bc tar libgomp1 perl-modules wget curl \ - libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ - --freesurfer version=7.4.1 install_path=/opt/freesurfer \ - --miniconda version=latest conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ - --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ - --install nodejs \ - --run-bash 'npm install -g bids-validator@0.19.8' \ - --env FSLDIR=/usr/share/fsl/5.0 FSLOUTPUTTYPE=NIFTI_GZ \ - FSLMULTIFILEQUIT=TRUE POSSUMDIR=/usr/share/fsl/5.0 LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \ - FSLTCLSH=/usr/bin/tclsh FSLWISH=/usr/bin/wish FSLOUTPUTTYPE=NIFTI_GZ \ - --env OS=Linux FS_OVERRIDE=0 FIX_VERTEX_AREA= SUBJECTS_DIR=/opt/freesurfer/subjects \ - FSF_OUTPUT_FORMAT=nii.gz MNI_DIR=/opt/freesurfer/mni LOCAL_DIR=/opt/freesurfer/local \ - FREESURFER_HOME=/opt/freesurfer FSFAST_HOME=/opt/freesurfer/fsfast MINC_BIN_DIR=/opt/freesurfer/mni/bin \ - MINC_LIB_DIR=/opt/freesurfer/mni/lib MNI_DATAPATH=/opt/freesurfer/mni/data \ - FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast PERL5LIB=/opt/freesurfer/mni/share/perl5 \ - MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \ - PATH=/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ - PYTHONPATH="" \ - --run 'mkdir root/matlab && touch root/matlab/startup.m' \ - --run 'mkdir /scratch' \ - --run 'mkdir /local-scratch' \ - --copy run.py '/run.py' \ - --run 'chmod +x /run.py' \ - --copy version '/version' \ - --entrypoint '/neurodocker/startup.sh /run.py' \ -> Dockerfile_fs7 - - -# Generate a singularity recipe for building BIDS-Apps Freesurfer container -docker run --rm ${image} generate singularity \ - --base-image ubuntu:jammy \ - --pkg-manager apt \ - --install tcsh bc tar libgomp1 perl-modules wget curl \ - libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ - --freesurfer version=6.0.1 install_path=/opt/freesurfer \ - --miniconda version=latest conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ - --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ - --install nodejs \ - --run-bash 'npm install -g bids-validator@0.19.8' \ - --env FSLDIR=/usr/share/fsl/5.0 FSLOUTPUTTYPE=NIFTI_GZ \ - FSLMULTIFILEQUIT=TRUE POSSUMDIR=/usr/share/fsl/5.0 LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \ - FSLTCLSH=/usr/bin/tclsh FSLWISH=/usr/bin/wish FSLOUTPUTTYPE=NIFTI_GZ \ - --env OS=Linux FS_OVERRIDE=0 FIX_VERTEX_AREA= SUBJECTS_DIR=/opt/freesurfer/subjects \ - FSF_OUTPUT_FORMAT=nii.gz MNI_DIR=/opt/freesurfer/mni LOCAL_DIR=/opt/freesurfer/local \ - FREESURFER_HOME=/opt/freesurfer FSFAST_HOME=/opt/freesurfer/fsfast MINC_BIN_DIR=/opt/freesurfer/mni/bin \ - MINC_LIB_DIR=/opt/freesurfer/mni/lib MNI_DATAPATH=/opt/freesurfer/mni/data \ - FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast PERL5LIB=/opt/freesurfer/mni/share/perl5 \ - MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \ - PATH=/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ - PYTHONPATH="" \ - --run 'mkdir root/matlab && touch root/matlab/startup.m' \ - --run 'mkdir /scratch' \ - --run 'mkdir /local-scratch' \ - --copy run.py '/run.py' \ - --run 'chmod +x /run.py' \ - --copy version '/version' \ - --entrypoint '/neurodocker/startup.sh /run.py' \ -> Singularity_fs6 - - -docker run --rm ${image} generate singularity \ - --base-image ubuntu:jammy \ - --pkg-manager apt \ - --install tcsh bc tar libgomp1 perl-modules wget curl \ - libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ - --freesurfer version=7.4.1 install_path=/opt/freesurfer \ - --miniconda version=latest conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ - --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ - --install nodejs \ - --run-bash 'npm install -g bids-validator@0.19.8' \ - --env FSLDIR=/usr/share/fsl/5.0 FSLOUTPUTTYPE=NIFTI_GZ \ - FSLMULTIFILEQUIT=TRUE POSSUMDIR=/usr/share/fsl/5.0 LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \ - FSLTCLSH=/usr/bin/tclsh FSLWISH=/usr/bin/wish FSLOUTPUTTYPE=NIFTI_GZ \ - --env OS=Linux FS_OVERRIDE=0 FIX_VERTEX_AREA= SUBJECTS_DIR=/opt/freesurfer/subjects \ - FSF_OUTPUT_FORMAT=nii.gz MNI_DIR=/opt/freesurfer/mni LOCAL_DIR=/opt/freesurfer/local \ - FREESURFER_HOME=/opt/freesurfer FSFAST_HOME=/opt/freesurfer/fsfast MINC_BIN_DIR=/opt/freesurfer/mni/bin \ - MINC_LIB_DIR=/opt/freesurfer/mni/lib MNI_DATAPATH=/opt/freesurfer/mni/data \ - FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast PERL5LIB=/opt/freesurfer/mni/share/perl5 \ - MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \ - PATH=/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ - PYTHONPATH="" \ - --run 'mkdir root/matlab && touch root/matlab/startup.m' \ - --run 'mkdir /scratch' \ - --run 'mkdir /local-scratch' \ - --copy run.py '/run.py' \ - --run 'chmod +x /run.py' \ - --copy version '/version' \ - --entrypoint '/neurodocker/startup.sh /run.py' \ -> Singularity_fs7 + # Generate a dockerfile for building BIDS-Apps Freesurfer container + docker run --rm ${image} generate ${TARGET} \ + --base-image ubuntu:jammy \ + --pkg-manager apt \ + --install tcsh bc tar libgomp1 perl-modules wget curl \ + libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ + --freesurfer version=${VERSION} install_path=/opt/freesurfer \ + --miniconda version=latest conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ + --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ + --install nodejs \ + --run-bash 'npm install -g bids-validator@0.19.8' \ + --env FSLDIR=/usr/share/fsl/5.0 FSLOUTPUTTYPE=NIFTI_GZ \ + FSLMULTIFILEQUIT=TRUE POSSUMDIR=/usr/share/fsl/5.0 LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \ + FSLTCLSH=/usr/bin/tclsh FSLWISH=/usr/bin/wish FSLOUTPUTTYPE=NIFTI_GZ \ + --env OS=Linux FS_OVERRIDE=0 FIX_VERTEX_AREA= SUBJECTS_DIR=/opt/freesurfer/subjects \ + FSF_OUTPUT_FORMAT=nii.gz MNI_DIR=/opt/freesurfer/mni LOCAL_DIR=/opt/freesurfer/local \ + FREESURFER_HOME=/opt/freesurfer FSFAST_HOME=/opt/freesurfer/fsfast MINC_BIN_DIR=/opt/freesurfer/mni/bin \ + MINC_LIB_DIR=/opt/freesurfer/mni/lib MNI_DATAPATH=/opt/freesurfer/mni/data \ + FMRI_ANALYSIS_DIR=/opt/freesurfer/fsfast PERL5LIB=/opt/freesurfer/mni/share/perl5 \ + MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \ + PATH=/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + PYTHONPATH="" \ + --run 'mkdir root/matlab && touch root/matlab/startup.m' \ + --run 'mkdir /scratch' \ + --run 'mkdir /local-scratch' \ + --copy run.py '/run.py' \ + --run 'chmod +x /run.py' \ + --copy version '/version' \ + --entrypoint '/neurodocker/startup.sh /run.py' \ + > $OUTFILE + done +done From e6ec4fa1f6c3fc9c0a26bbc2829dffa12a6a8cdb Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Mon, 28 Aug 2023 20:54:50 -0400 Subject: [PATCH 17/33] use mamba, bumb bids-validator version --- Dockerfile | 70 +++++++++++++++++++++++++++++++++++ Dockerfile_fs6 | 16 ++++---- Dockerfile_fs7 | 16 ++++---- Singularity_fs6 | 18 ++++----- Singularity_fs7 | 18 ++++----- generate_freesurfer_images.sh | 6 +-- 6 files changed, 103 insertions(+), 41 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..92c683a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,70 @@ +# Generated by Neurodocker and Reproenv. + +FROM ubuntu:jammy +ENV CONDA_DIR="/opt/miniconda-latest" \ + PATH="/opt/miniconda-latest/bin:$PATH" +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + bzip2 \ + ca-certificates \ + curl \ + && rm -rf /var/lib/apt/lists/* \ + # Install dependencies. + && export PATH="/opt/miniconda-latest/bin:$PATH" \ + && echo "Downloading Miniconda installer ..." \ + && conda_installer="/tmp/miniconda.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 \ + && 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 + # 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 \ + # Enable `conda activate` + && conda init bash \ + && conda install -y --name base \ + "numpy" \ + && bash -c "source activate base \ + && python -m pip install --no-cache-dir \ + "nibabel"" \ + # Clean up + && sync && conda clean --all --yes && sync \ + && rm -rf ~/.cache/pip/* + +# Save specification to JSON. +RUN printf '{ \ + "pkg_manager": "apt", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "ubuntu:jammy" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "CONDA_DIR": "/opt/miniconda-latest", \ + "PATH": "/opt/miniconda-latest/bin:$PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"numpy\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + } \ + } \ + ] \ +}' > /.reproenv.json +# End saving to specification to JSON. diff --git a/Dockerfile_fs6 b/Dockerfile_fs6 index b114f6a..4870565 100644 --- a/Dockerfile_fs6 +++ b/Dockerfile_fs6 @@ -79,6 +79,8 @@ RUN apt-get update -qq \ && 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 @@ -91,23 +93,19 @@ RUN apt-get update -qq \ # Enable `conda activate` && conda init bash \ && conda install -y --name base \ - "python=3" \ - "pip" \ "pandas" \ - "setuptools" \ - "pandas=0.21.0" \ && bash -c "source activate base \ && python -m pip install --no-cache-dir \ "nibabel"" \ # Clean up && sync && conda clean --all --yes && sync \ && rm -rf ~/.cache/pip/* -RUN bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' +RUN bash -c 'curl -sL https://deb.nodesource.com/setup_16.x | bash -' RUN apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ nodejs \ && rm -rf /var/lib/apt/lists/* -RUN bash -c 'npm install -g bids-validator@0.19.8' +RUN bash -c 'npm install -g bids-validator@1.12.0' ENV FSLDIR="/usr/share/fsl/5.0" \ FSLOUTPUTTYPE="NIFTI_GZ" \ FSLMULTIFILEQUIT="TRUE" \ @@ -221,13 +219,13 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_16.x | bash -'"'"'" \ } \ }, \ { \ @@ -248,7 +246,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ + "command": "bash -c '"'"'npm install -g bids-validator@1.12.0'"'"'" \ } \ }, \ { \ diff --git a/Dockerfile_fs7 b/Dockerfile_fs7 index faa9f50..777bba5 100644 --- a/Dockerfile_fs7 +++ b/Dockerfile_fs7 @@ -79,6 +79,8 @@ RUN apt-get update -qq \ && 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 @@ -91,23 +93,19 @@ RUN apt-get update -qq \ # Enable `conda activate` && conda init bash \ && conda install -y --name base \ - "python=3" \ - "pip" \ "pandas" \ - "setuptools" \ - "pandas=0.21.0" \ && bash -c "source activate base \ && python -m pip install --no-cache-dir \ "nibabel"" \ # Clean up && sync && conda clean --all --yes && sync \ && rm -rf ~/.cache/pip/* -RUN bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' +RUN bash -c 'curl -sL https://deb.nodesource.com/setup_16.x | bash -' RUN apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ nodejs \ && rm -rf /var/lib/apt/lists/* -RUN bash -c 'npm install -g bids-validator@0.19.8' +RUN bash -c 'npm install -g bids-validator@1.12.0' ENV FSLDIR="/usr/share/fsl/5.0" \ FSLOUTPUTTYPE="NIFTI_GZ" \ FSLMULTIFILEQUIT="TRUE" \ @@ -221,13 +219,13 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_16.x | bash -'"'"'" \ } \ }, \ { \ @@ -248,7 +246,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ + "command": "bash -c '"'"'npm install -g bids-validator@1.12.0'"'"'" \ } \ }, \ { \ diff --git a/Singularity_fs6 b/Singularity_fs6 index 5fa3e3c..f3710a8 100644 --- a/Singularity_fs6 +++ b/Singularity_fs6 @@ -114,6 +114,8 @@ curl -fsSL -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3- 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 @@ -126,11 +128,7 @@ conda config --system --set show_channel_urls true # Enable `conda activate` conda init bash conda install -y --name base \ - "python=3" \ - "pip" \ - "pandas" \ - "setuptools" \ - "pandas=0.21.0" + "pandas" bash -c "source activate base python -m pip install --no-cache-dir \ "nibabel"" @@ -138,14 +136,14 @@ bash -c "source activate base sync && conda clean --all --yes && sync rm -rf ~/.cache/pip/* -bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' +bash -c 'curl -sL https://deb.nodesource.com/setup_16.x | bash -' apt-get update -qq apt-get install -y -q --no-install-recommends \ nodejs rm -rf /var/lib/apt/lists/* -bash -c 'npm install -g bids-validator@0.19.8' +bash -c 'npm install -g bids-validator@1.12.0' mkdir root/matlab && touch root/matlab/startup.m @@ -234,13 +232,13 @@ printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_16.x | bash -'"'"'" \ } \ }, \ { \ @@ -261,7 +259,7 @@ printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ + "command": "bash -c '"'"'npm install -g bids-validator@1.12.0'"'"'" \ } \ }, \ { \ diff --git a/Singularity_fs7 b/Singularity_fs7 index 20501c4..f433b57 100644 --- a/Singularity_fs7 +++ b/Singularity_fs7 @@ -114,6 +114,8 @@ curl -fsSL -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3- 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 @@ -126,11 +128,7 @@ conda config --system --set show_channel_urls true # Enable `conda activate` conda init bash conda install -y --name base \ - "python=3" \ - "pip" \ - "pandas" \ - "setuptools" \ - "pandas=0.21.0" + "pandas" bash -c "source activate base python -m pip install --no-cache-dir \ "nibabel"" @@ -138,14 +136,14 @@ bash -c "source activate base sync && conda clean --all --yes && sync rm -rf ~/.cache/pip/* -bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' +bash -c 'curl -sL https://deb.nodesource.com/setup_16.x | bash -' apt-get update -qq apt-get install -y -q --no-install-recommends \ nodejs rm -rf /var/lib/apt/lists/* -bash -c 'npm install -g bids-validator@0.19.8' +bash -c 'npm install -g bids-validator@1.12.0' mkdir root/matlab && touch root/matlab/startup.m @@ -234,13 +232,13 @@ printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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\\" \\\\\\n \\"pip\\" \\\\\\n \\"pandas\\" \\\\\\n \\"setuptools\\" \\\\\\n \\"pandas=0.21.0\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_6.x | bash -'"'"'" \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_16.x | bash -'"'"'" \ } \ }, \ { \ @@ -261,7 +259,7 @@ printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'npm install -g bids-validator@0.19.8'"'"'" \ + "command": "bash -c '"'"'npm install -g bids-validator@1.12.0'"'"'" \ } \ }, \ { \ diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index 71b5dd5..f3c16ef 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -64,10 +64,10 @@ do --install tcsh bc tar libgomp1 perl-modules wget curl \ libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ --freesurfer version=${VERSION} install_path=/opt/freesurfer \ - --miniconda version=latest conda_install="python=3 pip pandas setuptools pandas=0.21.0" pip_install="nibabel" \ - --run-bash 'curl -sL https://deb.nodesource.com/setup_6.x | bash -' \ + --miniconda version=latest mamba=true conda_install="pandas" pip_install="nibabel" \ + --run-bash 'curl -sL https://deb.nodesource.com/setup_16.x | bash -' \ --install nodejs \ - --run-bash 'npm install -g bids-validator@0.19.8' \ + --run-bash 'npm install -g bids-validator@1.12.0' \ --env FSLDIR=/usr/share/fsl/5.0 FSLOUTPUTTYPE=NIFTI_GZ \ FSLMULTIFILEQUIT=TRUE POSSUMDIR=/usr/share/fsl/5.0 LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \ FSLTCLSH=/usr/bin/tclsh FSLWISH=/usr/bin/wish FSLOUTPUTTYPE=NIFTI_GZ \ From e696f672ad9e5419216e7713585d5aa91e070cac Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 29 Aug 2023 00:55:08 +0000 Subject: [PATCH 18/33] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- generate_freesurfer_images.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index f3c16ef..cf33511 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -43,7 +43,7 @@ image="repronim/neurodocker@sha256:5b80804139b317e6180ae0b0de39aeff5731b27b224e6 for TARGET in docker singularity do if [ $TARGET = docker ] - then + then OUTFILEBASE=Dockerfile else OUTFILEBASE=Singularity From ad31d94cf0d89ac9d4abefbe820caeca1d037564 Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Mon, 28 Aug 2023 21:02:01 -0400 Subject: [PATCH 19/33] update neurodocker --- generate_freesurfer_images.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index cf33511..6c71248 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -39,7 +39,7 @@ # ############################################################################### -image="repronim/neurodocker@sha256:5b80804139b317e6180ae0b0de39aeff5731b27b224e6af4d1b46e040e4785a7" +image="repronim/neurodocker@sha256:e552690641a7175ece97e0ef05dd2679d7f916a5bb6864aa92515bd350c24758" for TARGET in docker singularity do if [ $TARGET = docker ] From f168a6040d5e0998a76c2dd3c20d3e55f3f90690 Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Tue, 29 Aug 2023 09:21:57 -0400 Subject: [PATCH 20/33] parameterize license directory to avoide cache collision --- .circleci/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8382bf1..beecd43 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,18 +23,18 @@ jobs: git describe --tags > version docker build -t bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> -f Dockerfile_fs<< parameters.version >> . mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >>" > ~/docker/${tar_name} - mkdir -p ~/license + mkdir -p ~/license_fs<< parameters.version >> echo "cHJpbnRmICJEeWxhbi5OaWVsc29uQGdtYWlsLmNvbVxuMzcwNjNcbiAqQ1lrZWhQYUNvRDlNXG4gRlM2N1BTWmRFV2lqb1xuIiA+IH4vbGljZW5zZS9saWNlbnNlLnR4dA==" | base64 -d | sh - save_cache: key: v_0-image_cache_fs<< parameters.version >>-{{ checksum "Dockerfile_fs<< parameters.version >>" }}-{{ .Revision }}-{{ epoch }} paths: - ~/docker - - ~/license + - ~/license_fs<< parameters.version >> - persist_to_workspace: root: /home/circleci paths: - docker/image_fs<< parameters.version >>.tar - - license/license.txt + - license_fs<< parameters.version >>/license.txt get_data: machine: @@ -83,7 +83,7 @@ jobs: name: print version command: | docker run -ti --rm --read-only \ - -v /tmp/workspace/license/license.txt:/license.txt \ + -v /tmp/workspace/license_fs<< parameters.version >>/license.txt:/license.txt \ -v /tmp/workspace/ds114_test1:/bids_dataset \ --tmpfs /tmp --tmpfs /var/tmp \ bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> --version @@ -92,7 +92,7 @@ jobs: name: print help command: | docker run -ti --rm --read-only \ - -v /tmp/workspace/license/license.txt:/license.txt \ + -v /tmp/workspace/license_fs<< parameters.version >>/license.txt:/license.txt \ -v /tmp/workspace/data/ds114_test1:/bids_dataset \ --tmpfs /tmp --tmpfs /var/tmp \ bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> -h @@ -103,7 +103,7 @@ jobs: name: test 1 command: | docker run -ti --rm --read-only \ - -v /tmp/workspace/license/license.txt:/license.txt \ + -v /tmp/workspace/license_fs<< parameters.version >>/license.txt:/license.txt \ -v /tmp/workspace/data/ds114_test1:/bids_dataset \ -v ${HOME}/outputs1:/outputs \ --tmpfs /tmp --tmpfs /var/tmp \ @@ -121,7 +121,7 @@ jobs: name: test 2 command: | docker run -ti --rm --read-only \ - -v /tmp/workspace/license/license.txt:/license.txt \ + -v /tmp/workspace/license_fs<< parameters.version >>/license.txt:/license.txt \ -v /tmp/workspace/data/ds114_test2:/bids_dataset \ -v ${HOME}/outputs2:/outputs \ --tmpfs /tmp --tmpfs /var/tmp \ @@ -141,7 +141,7 @@ jobs: name: group2 test 1 command: | docker run -ti --rm --read-only \ - -v /tmp/workspace/license/license.txt:/license.txt \ + -v /tmp/workspace/license_fs<< parameters.version >>/license.txt:/license.txt \ -v /tmp/workspace/data/ds114_test1:/bids_dataset \ -v /tmp/workspace/data/ds114_test1_freesurfer_precomp_v6.0.0:/outputs \ --tmpfs /tmp --tmpfs /var/tmp \ @@ -159,7 +159,7 @@ jobs: name: group2 test 2 command: | docker run -ti --rm --read-only \ - -v /tmp/workspace/license/license.txt:/license.txt \ + -v /tmp/workspace/license_fs<< parameters.version >>/license.txt:/license.txt \ -v /tmp/workspace/data/ds114_test2:/bids_dataset \ -v /tmp/workspace/data/ds114_test2_freesurfer_precomp_v6.0.0:/outputs \ --tmpfs /tmp --tmpfs /var/tmp \ From 6bb0ddd1bbff432feafed717b0b0392caa064e00 Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Tue, 29 Aug 2023 10:47:43 -0400 Subject: [PATCH 21/33] change entrypoint to python --- Dockerfile_fs6 | 4 ++-- Dockerfile_fs7 | 4 ++-- Singularity_fs6 | 4 ++-- Singularity_fs7 | 4 ++-- generate_freesurfer_images.sh | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile_fs6 b/Dockerfile_fs6 index 4870565..c58e900 100644 --- a/Dockerfile_fs6 +++ b/Dockerfile_fs6 @@ -138,7 +138,7 @@ COPY ["run.py", \ RUN chmod +x /run.py COPY ["version", \ "/version"] -ENTRYPOINT ["/neurodocker/startup.sh", "/run.py"] +ENTRYPOINT ["python", "/run.py"] # Save specification to JSON. RUN printf '{ \ @@ -331,7 +331,7 @@ RUN printf '{ \ "name": "entrypoint", \ "kwds": { \ "args": [ \ - "/neurodocker/startup.sh", \ + "python", \ "/run.py" \ ] \ } \ diff --git a/Dockerfile_fs7 b/Dockerfile_fs7 index 777bba5..256dddc 100644 --- a/Dockerfile_fs7 +++ b/Dockerfile_fs7 @@ -138,7 +138,7 @@ COPY ["run.py", \ RUN chmod +x /run.py COPY ["version", \ "/version"] -ENTRYPOINT ["/neurodocker/startup.sh", "/run.py"] +ENTRYPOINT ["python", "/run.py"] # Save specification to JSON. RUN printf '{ \ @@ -331,7 +331,7 @@ RUN printf '{ \ "name": "entrypoint", \ "kwds": { \ "args": [ \ - "/neurodocker/startup.sh", \ + "python", \ "/run.py" \ ] \ } \ diff --git a/Singularity_fs6 b/Singularity_fs6 index f3710a8..54901a1 100644 --- a/Singularity_fs6 +++ b/Singularity_fs6 @@ -342,7 +342,7 @@ printf '{ \ "name": "entrypoint", \ "kwds": { \ "args": [ \ - "/neurodocker/startup.sh", \ + "python", \ "/run.py" \ ] \ } \ @@ -352,4 +352,4 @@ printf '{ \ # End saving to specification to JSON. %runscript -/neurodocker/startup.sh /run.py +python /run.py diff --git a/Singularity_fs7 b/Singularity_fs7 index f433b57..ea65ca3 100644 --- a/Singularity_fs7 +++ b/Singularity_fs7 @@ -342,7 +342,7 @@ printf '{ \ "name": "entrypoint", \ "kwds": { \ "args": [ \ - "/neurodocker/startup.sh", \ + "python", \ "/run.py" \ ] \ } \ @@ -352,4 +352,4 @@ printf '{ \ # End saving to specification to JSON. %runscript -/neurodocker/startup.sh /run.py +python /run.py diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index 6c71248..d199729 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -85,7 +85,7 @@ do --copy run.py '/run.py' \ --run 'chmod +x /run.py' \ --copy version '/version' \ - --entrypoint '/neurodocker/startup.sh /run.py' \ + --entrypoint 'python /run.py' \ > $OUTFILE done done From cf587a08c977018679db9f55d13ab2afd2e2962e Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Tue, 29 Aug 2023 12:05:54 -0400 Subject: [PATCH 22/33] update versions in readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6962831..de97c0f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ This app implements surface reconstruction using Freesurfer. It reconstructs the surface for each subject individually and then creates a study specific template. In case there are multiple sessions the Freesurfer longitudinal pipeline is used (creating subject specific templates) unless instructed to combine data across sessions. -The current Freesurfer version is based on: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0.tar.gz +The current Freesurfer version for Freesurfer 6 is based on: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz +The current Freesurfer version for Freesurfer 7 is based on: freesurfer-linux-centos7_x86_64-7.4.1.tar.gz The output of the pipeline consist of the SUBJECTS_DIR created during the analysis. From 9352c3f30c059deea9218f0bb5551dc4e34e261d Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Tue, 29 Aug 2023 12:33:51 -0400 Subject: [PATCH 23/33] deal with license --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index beecd43..00def8e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,10 @@ jobs: docker build -t bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> -f Dockerfile_fs<< parameters.version >> . mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >>" > ~/docker/${tar_name} mkdir -p ~/license_fs<< parameters.version >> + mkdir -p ~/license echo "cHJpbnRmICJEeWxhbi5OaWVsc29uQGdtYWlsLmNvbVxuMzcwNjNcbiAqQ1lrZWhQYUNvRDlNXG4gRlM2N1BTWmRFV2lqb1xuIiA+IH4vbGljZW5zZS9saWNlbnNlLnR4dA==" | base64 -d | sh + cp ~/license/license.txt ~/license_fs<< parameters.version >>/license.txt + rm -r ~/license - save_cache: key: v_0-image_cache_fs<< parameters.version >>-{{ checksum "Dockerfile_fs<< parameters.version >>" }}-{{ .Revision }}-{{ epoch }} paths: From 6fa22d0ea597772f00b87f1bcad9c3aaa2232020 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 29 Aug 2023 19:26:27 +0200 Subject: [PATCH 24/33] Update .circleci/config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 00def8e..50f389e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -111,7 +111,7 @@ jobs: -v ${HOME}/outputs1:/outputs \ --tmpfs /tmp --tmpfs /var/tmp \ bids/${CIRCLE_PROJECT_REPONAME}_fs<< parameters.version >> \ - /bids_dataset + /bids_dataset \ /outputs \ participant \ --participant_label 01 \ From 8b9d99e2205db32a25859cdfe0d41d2f9aa2e599 Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Tue, 29 Aug 2023 14:54:07 -0400 Subject: [PATCH 25/33] bump node to 18.x --- Dockerfile_fs6 | 4 ++-- Dockerfile_fs7 | 4 ++-- Singularity_fs6 | 4 ++-- Singularity_fs7 | 4 ++-- generate_freesurfer_images.sh | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile_fs6 b/Dockerfile_fs6 index c58e900..33be1a4 100644 --- a/Dockerfile_fs6 +++ b/Dockerfile_fs6 @@ -100,7 +100,7 @@ RUN apt-get update -qq \ # Clean up && sync && conda clean --all --yes && sync \ && rm -rf ~/.cache/pip/* -RUN bash -c 'curl -sL https://deb.nodesource.com/setup_16.x | bash -' +RUN bash -c 'curl -sL https://deb.nodesource.com/setup_18.x | bash -' RUN apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ nodejs \ @@ -225,7 +225,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_16.x | bash -'"'"'" \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_18.x | bash -'"'"'" \ } \ }, \ { \ diff --git a/Dockerfile_fs7 b/Dockerfile_fs7 index 256dddc..5793ff2 100644 --- a/Dockerfile_fs7 +++ b/Dockerfile_fs7 @@ -100,7 +100,7 @@ RUN apt-get update -qq \ # Clean up && sync && conda clean --all --yes && sync \ && rm -rf ~/.cache/pip/* -RUN bash -c 'curl -sL https://deb.nodesource.com/setup_16.x | bash -' +RUN bash -c 'curl -sL https://deb.nodesource.com/setup_18.x | bash -' RUN apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ nodejs \ @@ -225,7 +225,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_16.x | bash -'"'"'" \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_18.x | bash -'"'"'" \ } \ }, \ { \ diff --git a/Singularity_fs6 b/Singularity_fs6 index 54901a1..f61602f 100644 --- a/Singularity_fs6 +++ b/Singularity_fs6 @@ -136,7 +136,7 @@ bash -c "source activate base sync && conda clean --all --yes && sync rm -rf ~/.cache/pip/* -bash -c 'curl -sL https://deb.nodesource.com/setup_16.x | bash -' +bash -c 'curl -sL https://deb.nodesource.com/setup_18.x | bash -' apt-get update -qq apt-get install -y -q --no-install-recommends \ @@ -238,7 +238,7 @@ printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_16.x | bash -'"'"'" \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_18.x | bash -'"'"'" \ } \ }, \ { \ diff --git a/Singularity_fs7 b/Singularity_fs7 index ea65ca3..fced02f 100644 --- a/Singularity_fs7 +++ b/Singularity_fs7 @@ -136,7 +136,7 @@ bash -c "source activate base sync && conda clean --all --yes && sync rm -rf ~/.cache/pip/* -bash -c 'curl -sL https://deb.nodesource.com/setup_16.x | bash -' +bash -c 'curl -sL https://deb.nodesource.com/setup_18.x | bash -' apt-get update -qq apt-get install -y -q --no-install-recommends \ @@ -238,7 +238,7 @@ printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_16.x | bash -'"'"'" \ + "command": "bash -c '"'"'curl -sL https://deb.nodesource.com/setup_18.x | bash -'"'"'" \ } \ }, \ { \ diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index d199729..e81149a 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -65,7 +65,7 @@ do libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ --freesurfer version=${VERSION} install_path=/opt/freesurfer \ --miniconda version=latest mamba=true conda_install="pandas" pip_install="nibabel" \ - --run-bash 'curl -sL https://deb.nodesource.com/setup_16.x | bash -' \ + --run-bash 'curl -sL https://deb.nodesource.com/setup_18.x | bash -' \ --install nodejs \ --run-bash 'npm install -g bids-validator@1.12.0' \ --env FSLDIR=/usr/share/fsl/5.0 FSLOUTPUTTYPE=NIFTI_GZ \ From b6f992919682a9aa8de09b1ab895e11ec6626d7a Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Tue, 29 Aug 2023 15:02:37 -0400 Subject: [PATCH 26/33] trigger circle? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index de97c0f..f659ba5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ### Description This app implements surface reconstruction using Freesurfer. It reconstructs the surface for each subject individually and then -creates a study specific template. In case there are multiple sessions the Freesurfer longitudinal pipeline is used (creating subject specific templates) unless instructed to combine data across sessions. +creates a study specific template. In case there are multiple sessions the Freesurfer longitudinal pipeline is used (creating subject specific templates) unless instructed to combine data across sessions. This app is available for both Freesurfer 6 and 7. The current Freesurfer version for Freesurfer 6 is based on: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz The current Freesurfer version for Freesurfer 7 is based on: freesurfer-linux-centos7_x86_64-7.4.1.tar.gz From 0a9a239cdc24b20a258df4a7ad9ea16f18b4b276 Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Tue, 29 Aug 2023 19:01:39 -0400 Subject: [PATCH 27/33] add python2 for fs6 and fix installation directory for fs7 --- Dockerfile_fs6 | 13 +++++++++++-- Dockerfile_fs7 | 13 +++++++++++-- Singularity_fs6 | 14 ++++++++++++-- Singularity_fs7 | 14 ++++++++++++-- generate_freesurfer_images.sh | 5 ++++- 5 files changed, 50 insertions(+), 9 deletions(-) diff --git a/Dockerfile_fs6 b/Dockerfile_fs6 index 33be1a4..bf3ec5f 100644 --- a/Dockerfile_fs6 +++ b/Dockerfile_fs6 @@ -13,6 +13,7 @@ RUN apt-get update -qq \ libxext-dev \ libxt-dev \ perl-modules \ + python2 \ tar \ tcsh \ wget \ @@ -130,6 +131,7 @@ ENV OS="Linux" \ MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \ PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ PYTHONPATH="" +RUN ls RUN mkdir root/matlab && touch root/matlab/startup.m RUN mkdir /scratch RUN mkdir /local-scratch @@ -169,7 +171,8 @@ RUN printf '{ \ "libxt-dev", \ "libxext-dev", \ "libglu1-mesa", \ - "libpython2.7-stdlib" \ + "libpython2.7-stdlib", \ + "python2" \ ], \ "opts": null \ } \ @@ -177,7 +180,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget \\\\\\n && rm -rf /var/lib/apt/lists/*" \ + "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n python2 \\\\\\n tar \\\\\\n tcsh \\\\\\n wget \\\\\\n && rm -rf /var/lib/apt/lists/*" \ } \ }, \ { \ @@ -283,6 +286,12 @@ RUN printf '{ \ "PYTHONPATH": "" \ } \ }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "ls" \ + } \ + }, \ { \ "name": "run", \ "kwds": { \ diff --git a/Dockerfile_fs7 b/Dockerfile_fs7 index 5793ff2..e776234 100644 --- a/Dockerfile_fs7 +++ b/Dockerfile_fs7 @@ -13,6 +13,7 @@ RUN apt-get update -qq \ libxext-dev \ libxt-dev \ perl-modules \ + python2 \ tar \ tcsh \ wget \ @@ -130,6 +131,7 @@ ENV OS="Linux" \ MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \ PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ PYTHONPATH="" +RUN mv /opt/freesurfer/freesurfer /opt/fstmp && rm -rf /opt/freesurfer && mv /opt/fstmp /opt/freesurfer RUN mkdir root/matlab && touch root/matlab/startup.m RUN mkdir /scratch RUN mkdir /local-scratch @@ -169,7 +171,8 @@ RUN printf '{ \ "libxt-dev", \ "libxext-dev", \ "libglu1-mesa", \ - "libpython2.7-stdlib" \ + "libpython2.7-stdlib", \ + "python2" \ ], \ "opts": null \ } \ @@ -177,7 +180,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget \\\\\\n && rm -rf /var/lib/apt/lists/*" \ + "command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n python2 \\\\\\n tar \\\\\\n tcsh \\\\\\n wget \\\\\\n && rm -rf /var/lib/apt/lists/*" \ } \ }, \ { \ @@ -283,6 +286,12 @@ RUN printf '{ \ "PYTHONPATH": "" \ } \ }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mv /opt/freesurfer/freesurfer /opt/fstmp && rm -rf /opt/freesurfer && mv /opt/fstmp /opt/freesurfer" \ + } \ + }, \ { \ "name": "run", \ "kwds": { \ diff --git a/Singularity_fs6 b/Singularity_fs6 index f61602f..83432da 100644 --- a/Singularity_fs6 +++ b/Singularity_fs6 @@ -66,6 +66,7 @@ apt-get install -y -q --no-install-recommends \ libxext-dev \ libxt-dev \ perl-modules \ + python2 \ tar \ tcsh \ wget @@ -145,6 +146,8 @@ rm -rf /var/lib/apt/lists/* bash -c 'npm install -g bids-validator@1.12.0' +ls + mkdir root/matlab && touch root/matlab/startup.m mkdir /scratch @@ -182,7 +185,8 @@ printf '{ \ "libxt-dev", \ "libxext-dev", \ "libglu1-mesa", \ - "libpython2.7-stdlib" \ + "libpython2.7-stdlib", \ + "python2" \ ], \ "opts": null \ } \ @@ -190,7 +194,7 @@ printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n python2 \\\\\\n tar \\\\\\n tcsh \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*" \ } \ }, \ { \ @@ -296,6 +300,12 @@ printf '{ \ "PYTHONPATH": "" \ } \ }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "ls" \ + } \ + }, \ { \ "name": "run", \ "kwds": { \ diff --git a/Singularity_fs7 b/Singularity_fs7 index fced02f..b70d614 100644 --- a/Singularity_fs7 +++ b/Singularity_fs7 @@ -66,6 +66,7 @@ apt-get install -y -q --no-install-recommends \ libxext-dev \ libxt-dev \ perl-modules \ + python2 \ tar \ tcsh \ wget @@ -145,6 +146,8 @@ rm -rf /var/lib/apt/lists/* bash -c 'npm install -g bids-validator@1.12.0' +mv /opt/freesurfer/freesurfer /opt/fstmp && rm -rf /opt/freesurfer && mv /opt/fstmp /opt/freesurfer + mkdir root/matlab && touch root/matlab/startup.m mkdir /scratch @@ -182,7 +185,8 @@ printf '{ \ "libxt-dev", \ "libxext-dev", \ "libglu1-mesa", \ - "libpython2.7-stdlib" \ + "libpython2.7-stdlib", \ + "python2" \ ], \ "opts": null \ } \ @@ -190,7 +194,7 @@ printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n tar \\\\\\n tcsh \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n curl \\\\\\n libglu1-mesa \\\\\\n libgomp1 \\\\\\n libpython2.7-stdlib \\\\\\n libsm-dev \\\\\\n libx11-dev \\\\\\n libxext-dev \\\\\\n libxt-dev \\\\\\n perl-modules \\\\\\n python2 \\\\\\n tar \\\\\\n tcsh \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*" \ } \ }, \ { \ @@ -296,6 +300,12 @@ printf '{ \ "PYTHONPATH": "" \ } \ }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "mv /opt/freesurfer/freesurfer /opt/fstmp && rm -rf /opt/freesurfer && mv /opt/fstmp /opt/freesurfer" \ + } \ + }, \ { \ "name": "run", \ "kwds": { \ diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index e81149a..7ea8ef3 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -53,8 +53,10 @@ do if [ $VERSION = "6.0.1" ] then OUTFILE=${OUTFILEBASE}_fs6 + MVCMD="ls" else OUTFILE=${OUTFILEBASE}_fs7 + MVCMD="mv /opt/freesurfer/freesurfer /opt/fstmp && rm -rf /opt/freesurfer && mv /opt/fstmp /opt/freesurfer" fi # Generate a dockerfile for building BIDS-Apps Freesurfer container @@ -62,7 +64,7 @@ do --base-image ubuntu:jammy \ --pkg-manager apt \ --install tcsh bc tar libgomp1 perl-modules wget curl \ - libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib\ + libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib python2 \ --freesurfer version=${VERSION} install_path=/opt/freesurfer \ --miniconda version=latest mamba=true conda_install="pandas" pip_install="nibabel" \ --run-bash 'curl -sL https://deb.nodesource.com/setup_18.x | bash -' \ @@ -79,6 +81,7 @@ do MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \ PATH=/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ PYTHONPATH="" \ + --run "${MVCMD}" \ --run 'mkdir root/matlab && touch root/matlab/startup.m' \ --run 'mkdir /scratch' \ --run 'mkdir /local-scratch' \ From d615c8abcd88c0e05e56d4bc8e98d3e3471f80c5 Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Tue, 29 Aug 2023 20:29:40 -0400 Subject: [PATCH 28/33] fix fs7 install dir --- Dockerfile_fs6 | 7 ---- Dockerfile_fs7 | 69 ++++++++++++++++------------------ Singularity_fs6 | 8 ---- Singularity_fs7 | 70 ++++++++++++++++------------------- generate_freesurfer_images.sh | 7 ++-- 5 files changed, 65 insertions(+), 96 deletions(-) diff --git a/Dockerfile_fs6 b/Dockerfile_fs6 index bf3ec5f..9e5cf30 100644 --- a/Dockerfile_fs6 +++ b/Dockerfile_fs6 @@ -131,7 +131,6 @@ ENV OS="Linux" \ MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \ PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ PYTHONPATH="" -RUN ls RUN mkdir root/matlab && touch root/matlab/startup.m RUN mkdir /scratch RUN mkdir /local-scratch @@ -286,12 +285,6 @@ RUN printf '{ \ "PYTHONPATH": "" \ } \ }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "ls" \ - } \ - }, \ { \ "name": "run", \ "kwds": { \ diff --git a/Dockerfile_fs7 b/Dockerfile_fs7 index e776234..dfdd846 100644 --- a/Dockerfile_fs7 +++ b/Dockerfile_fs7 @@ -19,23 +19,23 @@ RUN apt-get update -qq \ wget \ && rm -rf /var/lib/apt/lists/* ENV OS="Linux" \ - PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH" \ - FREESURFER_HOME="/opt/freesurfer" \ - FREESURFER="/opt/freesurfer" \ - SUBJECTS_DIR="/opt/freesurfer/subjects" \ - LOCAL_DIR="/opt/freesurfer/local" \ - FSFAST_HOME="/opt/freesurfer/fsfast" \ - FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \ - FUNCTIONALS_DIR="/opt/freesurfer/sessions" \ + PATH="/opt//bin:/opt//fsfast/bin:/opt//tktools:/opt//mni/bin:$PATH" \ + FREESURFER_HOME="/opt/" \ + FREESURFER="/opt/" \ + SUBJECTS_DIR="/opt//subjects" \ + LOCAL_DIR="/opt//local" \ + FSFAST_HOME="/opt//fsfast" \ + FMRI_ANALYSIS_DIR="/opt//fsfast" \ + FUNCTIONALS_DIR="/opt//sessions" \ FS_OVERRIDE="0" \ FIX_VERTEX_AREA="" \ FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" \ - MINC_BIN_DIR="/opt/freesurfer/mni/bin" \ - MINC_LIB_DIR="/opt/freesurfer/mni/lib" \ - MNI_DIR="/opt/freesurfer/mni" \ - MNI_DATAPATH="/opt/freesurfer/mni/data" \ - MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5" \ - PERL5LIB="/opt/freesurfer/mni/share/perl5" + MINC_BIN_DIR="/opt//mni/bin" \ + MINC_LIB_DIR="/opt//mni/lib" \ + MNI_DIR="/opt//mni" \ + MNI_DATAPATH="/opt//mni/data" \ + MNI_PERL5LIB="/opt//mni/share/perl5" \ + PERL5LIB="/opt//mni/share/perl5" RUN apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ bc \ @@ -48,9 +48,9 @@ RUN apt-get update -qq \ tcsh \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FreeSurfer ..." \ - && mkdir -p /opt/freesurfer \ + && mkdir -p /opt/ \ && curl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \ - | tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \ + | tar -xz -C /opt/ --owner root --group root --no-same-owner --strip-components 1 \ --exclude='average/mult-comp-cor' \ --exclude='lib/cuda' \ --exclude='lib/qt' \ @@ -131,7 +131,6 @@ ENV OS="Linux" \ MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \ PATH="/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ PYTHONPATH="" -RUN mv /opt/freesurfer/freesurfer /opt/fstmp && rm -rf /opt/freesurfer && mv /opt/fstmp /opt/freesurfer RUN mkdir root/matlab && touch root/matlab/startup.m RUN mkdir /scratch RUN mkdir /local-scratch @@ -187,29 +186,29 @@ RUN printf '{ \ "name": "env", \ "kwds": { \ "OS": "Linux", \ - "PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \ - "FREESURFER_HOME": "/opt/freesurfer", \ - "FREESURFER": "/opt/freesurfer", \ - "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ - "LOCAL_DIR": "/opt/freesurfer/local", \ - "FSFAST_HOME": "/opt/freesurfer/fsfast", \ - "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ - "FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \ + "PATH": "/opt//bin:/opt//fsfast/bin:/opt//tktools:/opt//mni/bin:$PATH", \ + "FREESURFER_HOME": "/opt/", \ + "FREESURFER": "/opt/", \ + "SUBJECTS_DIR": "/opt//subjects", \ + "LOCAL_DIR": "/opt//local", \ + "FSFAST_HOME": "/opt//fsfast", \ + "FMRI_ANALYSIS_DIR": "/opt//fsfast", \ + "FUNCTIONALS_DIR": "/opt//sessions", \ "FS_OVERRIDE": "0", \ "FIX_VERTEX_AREA": "", \ "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ - "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ - "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ - "MNI_DIR": "/opt/freesurfer/mni", \ - "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ - "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ - "PERL5LIB": "/opt/freesurfer/mni/share/perl5" \ + "MINC_BIN_DIR": "/opt//mni/bin", \ + "MINC_LIB_DIR": "/opt//mni/lib", \ + "MNI_DIR": "/opt//mni", \ + "MNI_DATAPATH": "/opt//mni/data", \ + "MNI_PERL5LIB": "/opt//mni/share/perl5", \ + "PERL5LIB": "/opt//mni/share/perl5" \ } \ }, \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/freesurfer\\ncurl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/\\ncurl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \\\\\\n| tar -xz -C /opt/ --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ } \ }, \ { \ @@ -286,12 +285,6 @@ RUN printf '{ \ "PYTHONPATH": "" \ } \ }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "mv /opt/freesurfer/freesurfer /opt/fstmp && rm -rf /opt/freesurfer && mv /opt/fstmp /opt/freesurfer" \ - } \ - }, \ { \ "name": "run", \ "kwds": { \ diff --git a/Singularity_fs6 b/Singularity_fs6 index 83432da..2e41cf6 100644 --- a/Singularity_fs6 +++ b/Singularity_fs6 @@ -146,8 +146,6 @@ rm -rf /var/lib/apt/lists/* bash -c 'npm install -g bids-validator@1.12.0' -ls - mkdir root/matlab && touch root/matlab/startup.m mkdir /scratch @@ -300,12 +298,6 @@ printf '{ \ "PYTHONPATH": "" \ } \ }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "ls" \ - } \ - }, \ { \ "name": "run", \ "kwds": { \ diff --git a/Singularity_fs7 b/Singularity_fs7 index b70d614..9ebd2eb 100644 --- a/Singularity_fs7 +++ b/Singularity_fs7 @@ -9,23 +9,23 @@ version /version %environment export OS="Linux" -export PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH" -export FREESURFER_HOME="/opt/freesurfer" -export FREESURFER="/opt/freesurfer" -export SUBJECTS_DIR="/opt/freesurfer/subjects" -export LOCAL_DIR="/opt/freesurfer/local" -export FSFAST_HOME="/opt/freesurfer/fsfast" -export FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" -export FUNCTIONALS_DIR="/opt/freesurfer/sessions" +export PATH="/opt//bin:/opt//fsfast/bin:/opt//tktools:/opt//mni/bin:$PATH" +export FREESURFER_HOME="/opt/" +export FREESURFER="/opt/" +export SUBJECTS_DIR="/opt//subjects" +export LOCAL_DIR="/opt//local" +export FSFAST_HOME="/opt//fsfast" +export FMRI_ANALYSIS_DIR="/opt//fsfast" +export FUNCTIONALS_DIR="/opt//sessions" export FS_OVERRIDE="0" export FIX_VERTEX_AREA="" export FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" -export MINC_BIN_DIR="/opt/freesurfer/mni/bin" -export MINC_LIB_DIR="/opt/freesurfer/mni/lib" -export MNI_DIR="/opt/freesurfer/mni" -export MNI_DATAPATH="/opt/freesurfer/mni/data" -export MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5" -export PERL5LIB="/opt/freesurfer/mni/share/perl5" +export MINC_BIN_DIR="/opt//mni/bin" +export MINC_LIB_DIR="/opt//mni/lib" +export MNI_DIR="/opt//mni" +export MNI_DATAPATH="/opt//mni/data" +export MNI_PERL5LIB="/opt//mni/share/perl5" +export PERL5LIB="/opt//mni/share/perl5" export CONDA_DIR="/opt/miniconda-latest" export PATH="/opt/miniconda-latest/bin:$PATH" export FSLDIR="/usr/share/fsl/5.0" @@ -84,9 +84,9 @@ apt-get install -y -q --no-install-recommends \ tcsh rm -rf /var/lib/apt/lists/* echo "Downloading FreeSurfer ..." -mkdir -p /opt/freesurfer +mkdir -p /opt/ curl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \ -| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \ +| tar -xz -C /opt/ --owner root --group root --no-same-owner --strip-components 1 \ --exclude='average/mult-comp-cor' \ --exclude='lib/cuda' \ --exclude='lib/qt' \ @@ -146,8 +146,6 @@ rm -rf /var/lib/apt/lists/* bash -c 'npm install -g bids-validator@1.12.0' -mv /opt/freesurfer/freesurfer /opt/fstmp && rm -rf /opt/freesurfer && mv /opt/fstmp /opt/freesurfer - mkdir root/matlab && touch root/matlab/startup.m mkdir /scratch @@ -201,29 +199,29 @@ printf '{ \ "name": "env", \ "kwds": { \ "OS": "Linux", \ - "PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH", \ - "FREESURFER_HOME": "/opt/freesurfer", \ - "FREESURFER": "/opt/freesurfer", \ - "SUBJECTS_DIR": "/opt/freesurfer/subjects", \ - "LOCAL_DIR": "/opt/freesurfer/local", \ - "FSFAST_HOME": "/opt/freesurfer/fsfast", \ - "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \ - "FUNCTIONALS_DIR": "/opt/freesurfer/sessions", \ + "PATH": "/opt//bin:/opt//fsfast/bin:/opt//tktools:/opt//mni/bin:$PATH", \ + "FREESURFER_HOME": "/opt/", \ + "FREESURFER": "/opt/", \ + "SUBJECTS_DIR": "/opt//subjects", \ + "LOCAL_DIR": "/opt//local", \ + "FSFAST_HOME": "/opt//fsfast", \ + "FMRI_ANALYSIS_DIR": "/opt//fsfast", \ + "FUNCTIONALS_DIR": "/opt//sessions", \ "FS_OVERRIDE": "0", \ "FIX_VERTEX_AREA": "", \ "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ - "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \ - "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \ - "MNI_DIR": "/opt/freesurfer/mni", \ - "MNI_DATAPATH": "/opt/freesurfer/mni/data", \ - "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5", \ - "PERL5LIB": "/opt/freesurfer/mni/share/perl5" \ + "MINC_BIN_DIR": "/opt//mni/bin", \ + "MINC_LIB_DIR": "/opt//mni/lib", \ + "MNI_DIR": "/opt//mni", \ + "MNI_DATAPATH": "/opt//mni/data", \ + "MNI_PERL5LIB": "/opt//mni/share/perl5", \ + "PERL5LIB": "/opt//mni/share/perl5" \ } \ }, \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/freesurfer\\ncurl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n libgomp1 \\\\\\n libxmu6 \\\\\\n libxt6 \\\\\\n perl \\\\\\n tcsh\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FreeSurfer ...\\"\\nmkdir -p /opt/\\ncurl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz \\\\\\n| tar -xz -C /opt/ --owner root --group root --no-same-owner --strip-components 1 \\\\\\n --exclude='"'"'average/mult-comp-cor'"'"' \\\\\\n --exclude='"'"'lib/cuda'"'"' \\\\\\n --exclude='"'"'lib/qt'"'"' \\\\\\n --exclude='"'"'subjects/V1_average'"'"' \\\\\\n --exclude='"'"'subjects/bert'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35'"'"' \\\\\\n --exclude='"'"'subjects/cvs_avg35_inMNI152'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage3'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage4'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage5'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage6'"'"' \\\\\\n --exclude='"'"'subjects/fsaverage_sym'"'"' \\\\\\n --exclude='"'"'trctrain'"'"'" \ } \ }, \ { \ @@ -300,12 +298,6 @@ printf '{ \ "PYTHONPATH": "" \ } \ }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "mv /opt/freesurfer/freesurfer /opt/fstmp && rm -rf /opt/freesurfer && mv /opt/fstmp /opt/freesurfer" \ - } \ - }, \ { \ "name": "run", \ "kwds": { \ diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index 7ea8ef3..c27f112 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -53,10 +53,10 @@ do if [ $VERSION = "6.0.1" ] then OUTFILE=${OUTFILEBASE}_fs6 - MVCMD="ls" + INSTALL_DIR=/opt/freesurfer else OUTFILE=${OUTFILEBASE}_fs7 - MVCMD="mv /opt/freesurfer/freesurfer /opt/fstmp && rm -rf /opt/freesurfer && mv /opt/fstmp /opt/freesurfer" + INSTALL_DIR=/opt/ fi # Generate a dockerfile for building BIDS-Apps Freesurfer container @@ -65,7 +65,7 @@ do --pkg-manager apt \ --install tcsh bc tar libgomp1 perl-modules wget curl \ libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib python2 \ - --freesurfer version=${VERSION} install_path=/opt/freesurfer \ + --freesurfer version=${VERSION} install_path=$INSTALL_DIR \ --miniconda version=latest mamba=true conda_install="pandas" pip_install="nibabel" \ --run-bash 'curl -sL https://deb.nodesource.com/setup_18.x | bash -' \ --install nodejs \ @@ -81,7 +81,6 @@ do MNI_PERL5LIB=/opt/freesurfer/mni/share/perl5/ \ PATH=/opt/miniconda-latest/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/lib/fsl/5.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ PYTHONPATH="" \ - --run "${MVCMD}" \ --run 'mkdir root/matlab && touch root/matlab/startup.m' \ --run 'mkdir /scratch' \ --run 'mkdir /local-scratch' \ From 7dcb0591f17a41cdc3a76d4e4ab6b20cbbbb3448 Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Tue, 29 Aug 2023 20:33:20 -0400 Subject: [PATCH 29/33] parameterize job names --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 50f389e..26a5ffb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -236,6 +236,7 @@ workflows: matrix: parameters: version: ['6', '7'] + name: build_<< parameters.version >> filters: tags: only: /.*/ @@ -247,7 +248,7 @@ workflows: parameters: version: ['6', '7'] requires: - - build + - build_<< parameters.version >> - get_data filters: tags: From 39894c45d1f14e845542160f4388af558a2e2b3b Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Tue, 29 Aug 2023 20:39:54 -0400 Subject: [PATCH 30/33] paramterize job dependencies --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 26a5ffb..ebe95e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -233,10 +233,10 @@ workflows: only: /.*/ - build: + name: build_<< matrix.version >> matrix: parameters: version: ['6', '7'] - name: build_<< parameters.version >> filters: tags: only: /.*/ @@ -248,7 +248,7 @@ workflows: parameters: version: ['6', '7'] requires: - - build_<< parameters.version >> + - build_<< matrix.version >> - get_data filters: tags: From 6bef10cc86fda0585db7610c0a6f01068d5e048f Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Wed, 30 Aug 2023 08:00:40 -0400 Subject: [PATCH 31/33] pin pandas as 1.5.3 --- Dockerfile_fs6 | 4 ++-- Dockerfile_fs7 | 4 ++-- Singularity_fs6 | 4 ++-- Singularity_fs7 | 4 ++-- generate_freesurfer_images.sh | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile_fs6 b/Dockerfile_fs6 index 9e5cf30..741c75e 100644 --- a/Dockerfile_fs6 +++ b/Dockerfile_fs6 @@ -94,7 +94,7 @@ RUN apt-get update -qq \ # Enable `conda activate` && conda init bash \ && conda install -y --name base \ - "pandas" \ + "pandas=1.5.3" \ && bash -c "source activate base \ && python -m pip install --no-cache-dir \ "nibabel"" \ @@ -221,7 +221,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas=1.5.3\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ diff --git a/Dockerfile_fs7 b/Dockerfile_fs7 index dfdd846..241ac6d 100644 --- a/Dockerfile_fs7 +++ b/Dockerfile_fs7 @@ -94,7 +94,7 @@ RUN apt-get update -qq \ # Enable `conda activate` && conda init bash \ && conda install -y --name base \ - "pandas" \ + "pandas=1.5.3" \ && bash -c "source activate base \ && python -m pip install --no-cache-dir \ "nibabel"" \ @@ -221,7 +221,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas=1.5.3\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ diff --git a/Singularity_fs6 b/Singularity_fs6 index 2e41cf6..d44a85f 100644 --- a/Singularity_fs6 +++ b/Singularity_fs6 @@ -129,7 +129,7 @@ conda config --system --set show_channel_urls true # Enable `conda activate` conda init bash conda install -y --name base \ - "pandas" + "pandas=1.5.3" bash -c "source activate base python -m pip install --no-cache-dir \ "nibabel"" @@ -234,7 +234,7 @@ printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas=1.5.3\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ diff --git a/Singularity_fs7 b/Singularity_fs7 index 9ebd2eb..d310859 100644 --- a/Singularity_fs7 +++ b/Singularity_fs7 @@ -129,7 +129,7 @@ conda config --system --set show_channel_urls true # Enable `conda activate` conda init bash conda install -y --name base \ - "pandas" + "pandas=1.5.3" bash -c "source activate base python -m pip install --no-cache-dir \ "nibabel"" @@ -234,7 +234,7 @@ printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"pandas=1.5.3\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ } \ }, \ { \ diff --git a/generate_freesurfer_images.sh b/generate_freesurfer_images.sh index c27f112..6aec875 100644 --- a/generate_freesurfer_images.sh +++ b/generate_freesurfer_images.sh @@ -66,7 +66,7 @@ do --install tcsh bc tar libgomp1 perl-modules wget curl \ libsm-dev libx11-dev libxt-dev libxext-dev libglu1-mesa libpython2.7-stdlib python2 \ --freesurfer version=${VERSION} install_path=$INSTALL_DIR \ - --miniconda version=latest mamba=true conda_install="pandas" pip_install="nibabel" \ + --miniconda version=latest mamba=true conda_install="pandas=1.5.3" pip_install="nibabel" \ --run-bash 'curl -sL https://deb.nodesource.com/setup_18.x | bash -' \ --install nodejs \ --run-bash 'npm install -g bids-validator@1.12.0' \ From 0f069fb3b4f4721c071e1aca9474348417072af3 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 30 Aug 2023 10:38:37 -0400 Subject: [PATCH 32/33] rm Dockerfile --- Dockerfile | 70 ------------------------------------------------------ 1 file changed, 70 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 92c683a..0000000 --- a/Dockerfile +++ /dev/null @@ -1,70 +0,0 @@ -# Generated by Neurodocker and Reproenv. - -FROM ubuntu:jammy -ENV CONDA_DIR="/opt/miniconda-latest" \ - PATH="/opt/miniconda-latest/bin:$PATH" -RUN apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - bzip2 \ - ca-certificates \ - curl \ - && rm -rf /var/lib/apt/lists/* \ - # Install dependencies. - && export PATH="/opt/miniconda-latest/bin:$PATH" \ - && echo "Downloading Miniconda installer ..." \ - && conda_installer="/tmp/miniconda.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 \ - && 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 - # 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 \ - # Enable `conda activate` - && conda init bash \ - && conda install -y --name base \ - "numpy" \ - && bash -c "source activate base \ - && python -m pip install --no-cache-dir \ - "nibabel"" \ - # Clean up - && sync && conda clean --all --yes && sync \ - && rm -rf ~/.cache/pip/* - -# Save specification to JSON. -RUN printf '{ \ - "pkg_manager": "apt", \ - "existing_users": [ \ - "root" \ - ], \ - "instructions": [ \ - { \ - "name": "from_", \ - "kwds": { \ - "base_image": "ubuntu:jammy" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "CONDA_DIR": "/opt/miniconda-latest", \ - "PATH": "/opt/miniconda-latest/bin:$PATH" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\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 \\"numpy\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"nibabel\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ - } \ - } \ - ] \ -}' > /.reproenv.json -# End saving to specification to JSON. From 765a747844da7745a49b19c1087a8098ce213589 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 30 Aug 2023 10:57:57 -0400 Subject: [PATCH 33/33] it is always a path issue --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ebe95e7..b65a677 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -154,7 +154,7 @@ jobs: group2 \ --license_file=/license.txt - sudo mv ${HOME}/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ + sudo mv /tmp/workspace/data/ds114_test1_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs1/ cat ${HOME}/outputs1/00_group2_stats_tables/lh.aparc.thickness.tsv cat ${HOME}/outputs1/00_group2_stats_tables/euler.tsv @@ -170,7 +170,7 @@ jobs: /bids_dataset /outputs group2 \ --license_file=/license.txt - sudo mv ${HOME}/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ + sudo mv /tmp/workspace/data/ds114_test2_freesurfer_precomp_v6.0.0/00_group* ${HOME}/outputs2/ cat ${HOME}/outputs2/00_group2_stats_tables/lh.aparc.thickness.tsv cat ${HOME}/outputs2/00_group2_stats_tables/euler.tsv