From 85b0be6c6f4298963baa4e80fa2daaac37c2952d Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 27 Mar 2024 16:52:27 -0400 Subject: [PATCH 01/17] Prototype of a neurodocker invocation script to produce a container It is not yet finished - did not even try FSL installation - AFNI installation relies on incomplete fixes proposed in https://github.com/ReproNim/neurodocker/pull/601 - moved away attempt to install bids-validator (would be useful) due those failing too ATM --- generate_container.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 generate_container.sh diff --git a/generate_container.sh b/generate_container.sh new file mode 100755 index 0000000..a0081ef --- /dev/null +++ b/generate_container.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -eu + +generate() { + # more details might come on https://github.com/ReproNim/neurodocker/issues/330 + [ "$1" == singularity ] && add_entry=' "$@"' || add_entry='' + #neurodocker generate "$1" \ + ndversion=0.9.5 + #ndversion=master + #docker run --rm repronim/neurodocker:$ndversion \ + # ATM needs devel version of neurodocker for a fix to AFNI recipe + neurodocker \ + generate "$1" \ + --base-image neurodebian:bookworm \ + --ndfreeze date=20240320 \ + --copy environment.yml /opt/environment.yml \ + --miniconda \ + version=latest \ + env_name=dsstdeface \ + env_exists=false \ + yaml_file=/opt/environment.yml \ + --pkg-manager=apt \ + --install vim wget strace time ncdu gnupg curl procps pigz less tree \ + --run "apt-get update && apt-get -y dist-upgrade" \ + --afni method=binaries version=latest \ + --user=dsst \ + --entrypoint "bash" + #--run "curl -sL https://deb.nodesource.com/setup_16.x | bash - " \ + #--install nodejs npm \ + #--run "npm install -g bids-validator@1.14.4" \ + #--fsl version=6.0.7.1 \ +} + +generate docker > Dockerfile +# generate singularity > Singularity From 0b37ac23f1385807b2b4434727676fe7bbf7a8b8 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 7 May 2024 14:55:04 -0400 Subject: [PATCH 02/17] Perspective neurodocker invocation + produced Dockerfile (broken) It is based on WIP done in https://github.com/ReproNim/neurodocker/pull/611 to add support for Gentoo. But it is just a dirty draft so produced docker file is not good. --- Dockerfile | 174 +++++++++++++++++++++ generate_container.sh | 19 ++- gentoo-portage/make.conf | 21 +++ gentoo-portage/package.accept_keywords/gen | 2 + gentoo-portage/package.mask/bugs | 2 + gentoo-portage/repos.conf/gentoo | 6 + gentoo-portage/repos.conf/science | 6 + 7 files changed, 222 insertions(+), 8 deletions(-) create mode 100644 Dockerfile create mode 100644 gentoo-portage/make.conf create mode 100644 gentoo-portage/package.accept_keywords/gen create mode 100644 gentoo-portage/package.mask/bugs create mode 100644 gentoo-portage/repos.conf/gentoo create mode 100644 gentoo-portage/repos.conf/science diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0811d6f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,174 @@ +# Generated by Neurodocker and Reproenv. + +FROM docker.io/gentoo/portage:20240324 as portage +FROM docker.io/gentoo/stage3:20240318 +RUN COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo \ + && RUN emerge -v --noreplace dev-vcs/git \ + && RUN emerge -v1u portage \ + # Pinned commits for the dependency tree state + && ARG gentoo_hash=2d25617a1d085316761b06c17a93ec972f172fc6 \ + && ARG science_hash=73916dd3680ffd92e5bd3d32b262e5d78c86a448 \ + && ARG FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" \ + # This will be bound, and contents available outside of container + && RUN mkdir /outputs \ + && COPY gentoo-portage/ /etc/portage/ \ + # Moving gentoo repo from default rsync to git + && RUN rm /var/db/repos/gentoo -rf \ + # Cloning manually to prevent vdb update, pinning state via git + # Allegedly it's better to chain everything in one command, something with container layers 🤔 + && RUN \ + REPO_URL=$(grep "^sync-uri" /etc/portage/repos.conf/gentoo | sed -e "s/sync-uri *= *//g") && \ + mkdir -p /var/db/repos/gentoo && pushd /var/db/repos/gentoo && git init . && \ + git remote add origin ${REPO_URL} && \ + git fetch --filter="blob:none" origin $gentoo_hash && \ + git reset --hard $gentoo_hash && rm .git -rf && popd && \ + REPO_URL=$(grep "^sync-uri" /etc/portage/repos.conf/science | sed -e "s/sync-uri *= *//g") && \ + mkdir -p /var/db/repos/science && pushd /var/db/repos/science && git init . && \ + git remote add origin ${REPO_URL} && \ + git fetch --filter="blob:none" origin $science_hash && \ + git reset --hard $science_hash && rm .git -rf && popd \ + # Old Christian: Remove sync-uri to not accidentally re-sync if we work with the package management interactively + # Christian from the future: Maybe we want the option to re-sync if we're debugging it interactively... + #RUN sed -i /etc/portage/repos.conf/{gentoo,science} -e "s/sync-type *= *git/sync-type =/g" + #RUN sed -i /etc/portage/repos.conf/{gentoo,science} -e "/sync-uri/d" + #RUN sed -i /etc/portage/repos.conf/{gentoo,science} -e "/sync-git-verify-commit-signature/d" + # Make sure all CPU flags supported by the hardware are whitelisted + # This only affects packages with handwritten assembly language optimizations, e.g. ffmpeg. + # Removing it is safe, software will just not take full advantage of processor capabilities. + #RUN emerge cpuid2cpuflags + #RUN echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags + ### Emerge cool stuff here + ### Autounmask-continue enables all features on dependencies which the top level packages require + ### By default this needs user confirmation which would interrupt the build. +RUN emerge --autounmask-continue \ + afni \ + fsl \ + && rm -rf /var/tmp/portage/* +COPY ["environment.yml", \ + "/opt/environment.yml"] +COPY ["src", \ + "/opt/dsst-defacing-pipeline"] +ENV CONDA_DIR="/opt/miniconda-latest" \ + PATH="/opt/miniconda-latest/bin:$PATH" +RUN \ + # 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 env create --name dsstdeface --file /opt/environment.yml \ + # Clean up + && sync && conda clean --all --yes && sync \ + && rm -rf ~/.cache/pip/* +RUN test "$(getent passwd dsst)" \ + || useradd --no-user-group --create-home --shell /bin/bash dsst +USER dsst +ENTRYPOINT ["/opt/dsst-defacing-pipeline/run.py"] + +# Save specification to JSON. +USER root +RUN printf '{ \ + "pkg_manager": "portage", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "docker.io/gentoo/portage:20240324 as portage" \ + } \ + }, \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "docker.io/gentoo/stage3:20240318" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo\\nRUN emerge -v --noreplace dev-vcs/git\\nRUN emerge -v1u portage\\n# Pinned commits for the dependency tree state\\nARG gentoo_hash=2d25617a1d085316761b06c17a93ec972f172fc6\\nARG science_hash=73916dd3680ffd92e5bd3d32b262e5d78c86a448\\nARG FEATURES=\\"-ipc-sandbox -network-sandbox -pid-sandbox\\"\\n# This will be bound, and contents available outside of container\\nRUN mkdir /outputs\\nCOPY gentoo-portage/ /etc/portage/\\n# Moving gentoo repo from default rsync to git\\nRUN rm /var/db/repos/gentoo -rf\\n# Cloning manually to prevent vdb update, pinning state via git\\n# Allegedly it'"'"'s better to chain everything in one command, something with container layers \\ud83e\\udd14\\nRUN \\\\\\n REPO_URL=$\(grep \\"^sync-uri\\" /etc/portage/repos.conf/gentoo | sed -e \\"s/sync-uri *= *//g\\"\) && \\\\\\n mkdir -p /var/db/repos/gentoo && pushd /var/db/repos/gentoo && git init . && \\\\\\n git remote add origin ${REPO_URL} && \\\\\\n git fetch --filter=\\"blob:none\\" origin $gentoo_hash && \\\\\\n git reset --hard $gentoo_hash && rm .git -rf && popd && \\\\\\n REPO_URL=$\(grep \\"^sync-uri\\" /etc/portage/repos.conf/science | sed -e \\"s/sync-uri *= *//g\\"\) && \\\\\\n mkdir -p /var/db/repos/science && pushd /var/db/repos/science && git init . && \\\\\\n git remote add origin ${REPO_URL} && \\\\\\n git fetch --filter=\\"blob:none\\" origin $science_hash && \\\\\\n git reset --hard $science_hash && rm .git -rf && popd\\n# Old Christian: Remove sync-uri to not accidentally re-sync if we work with the package management interactively\\n# Christian from the future: Maybe we want the option to re-sync if we'"'"'re debugging it interactively...\\n#RUN sed -i /etc/portage/repos.conf/{gentoo,science} -e \\"s/sync-type *= *git/sync-type =/g\\"\\n#RUN sed -i /etc/portage/repos.conf/{gentoo,science} -e \\"/sync-uri/d\\"\\n#RUN sed -i /etc/portage/repos.conf/{gentoo,science} -e \\"/sync-git-verify-commit-signature/d\\"\\n# Make sure all CPU flags supported by the hardware are whitelisted\\n# This only affects packages with handwritten assembly language optimizations, e.g. ffmpeg.\\n# Removing it is safe, software will just not take full advantage of processor capabilities.\\n#RUN emerge cpuid2cpuflags\\n#RUN echo \\"*/* $\(cpuid2cpuflags\)\\" > /etc/portage/package.use/00cpu-flags\\n### Emerge cool stuff here\\n### Autounmask-continue enables all features on dependencies which the top level packages require\\n### By default this needs user confirmation which would interrupt the build." \ + } \ + }, \ + { \ + "name": "install", \ + "kwds": { \ + "pkgs": [ \ + "afni", \ + "fsl" \ + ], \ + "opts": null \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "emerge --autounmask-continue \\\\\\n afni \\\\\\n fsl \\\\\\n && rm -rf /var/tmp/portage/*" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "environment.yml", \ + "/opt/environment.yml" \ + ], \ + "destination": "/opt/environment.yml" \ + } \ + }, \ + { \ + "name": "copy", \ + "kwds": { \ + "source": [ \ + "src", \ + "/opt/dsst-defacing-pipeline" \ + ], \ + "destination": "/opt/dsst-defacing-pipeline" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "CONDA_DIR": "/opt/miniconda-latest", \ + "PATH": "/opt/miniconda-latest/bin:$PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "\\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 env create --name dsstdeface --file /opt/environment.yml\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + } \ + }, \ + { \ + "name": "user", \ + "kwds": { \ + "user": "dsst" \ + } \ + }, \ + { \ + "name": "entrypoint", \ + "kwds": { \ + "args": [ \ + "/opt/dsst-defacing-pipeline/run.py" \ + ] \ + } \ + } \ + ] \ +}' > /.reproenv.json +USER dsst +# End saving to specification to JSON. diff --git a/generate_container.sh b/generate_container.sh index a0081ef..de045f9 100755 --- a/generate_container.sh +++ b/generate_container.sh @@ -6,26 +6,29 @@ generate() { # more details might come on https://github.com/ReproNim/neurodocker/issues/330 [ "$1" == singularity ] && add_entry=' "$@"' || add_entry='' #neurodocker generate "$1" \ - ndversion=0.9.5 + #ndversion=0.9.5 #ndversion=master #docker run --rm repronim/neurodocker:$ndversion \ # ATM needs devel version of neurodocker for a fix to AFNI recipe + #--base-image neurodebian:bookworm \ + #--ndfreeze date=20240320 \ + dest=/opt/dsst-defacing-pipeline neurodocker \ generate "$1" \ - --base-image neurodebian:bookworm \ - --ndfreeze date=20240320 \ + --pkg-manager portage \ + --base-image "docker.io/gentoo/portage:20240324 as portage" \ + --base-image "docker.io/gentoo/stage3:20240318" \ + --gentoo gentoo_hash=2d25617a1d085316761b06c17a93ec972f172fc6 \ + --install afni fsl \ --copy environment.yml /opt/environment.yml \ + --copy src "$dest" \ --miniconda \ version=latest \ env_name=dsstdeface \ env_exists=false \ yaml_file=/opt/environment.yml \ - --pkg-manager=apt \ - --install vim wget strace time ncdu gnupg curl procps pigz less tree \ - --run "apt-get update && apt-get -y dist-upgrade" \ - --afni method=binaries version=latest \ --user=dsst \ - --entrypoint "bash" + --entrypoint "$dest/run.py" #--run "curl -sL https://deb.nodesource.com/setup_16.x | bash - " \ #--install nodejs npm \ #--run "npm install -g bids-validator@1.14.4" \ diff --git a/gentoo-portage/make.conf b/gentoo-portage/make.conf new file mode 100644 index 0000000..5d2eded --- /dev/null +++ b/gentoo-portage/make.conf @@ -0,0 +1,21 @@ +### This file contains system-wide build variables, including Gentoo variables such as USE, which enable/disable optional package features. + +COMMON_FLAGS="-O2 -pipe -march=native" +# Comment the following out on systems with less than 8 threads +MAKEOPTS="--jobs 8 --load-average 9" +CFLAGS="${COMMON_FLAGS}" +CXXFLAGS="${COMMON_FLAGS}" +FCFLAGS="${COMMON_FLAGS}" +FFLAGS="${COMMON_FLAGS}" + +# NOTE: This stage was built with the bindist Use flag enabled + +# This sets the language of build output to English. +# Please keep this setting intact when reporting bugs. +LC_MESSAGES=C + +USE="${USE} science" +ACCEPT_LICENSE="*" + +# Needed in the container environment +#FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" diff --git a/gentoo-portage/package.accept_keywords/gen b/gentoo-portage/package.accept_keywords/gen new file mode 100644 index 0000000..467373b --- /dev/null +++ b/gentoo-portage/package.accept_keywords/gen @@ -0,0 +1,2 @@ +### This is needed because ::science packages are generally not marked as stable +*/* ~amd64 diff --git a/gentoo-portage/package.mask/bugs b/gentoo-portage/package.mask/bugs new file mode 100644 index 0000000..1e593eb --- /dev/null +++ b/gentoo-portage/package.mask/bugs @@ -0,0 +1,2 @@ +### This is empty, thankfully. +### If we find bugs in some version of some package we can blacklist the package, version, or feature that causes it here. diff --git a/gentoo-portage/repos.conf/gentoo b/gentoo-portage/repos.conf/gentoo new file mode 100644 index 0000000..5d53ee4 --- /dev/null +++ b/gentoo-portage/repos.conf/gentoo @@ -0,0 +1,6 @@ +[gentoo] +location = /var/db/repos/gentoo +# We sync manually, but we need sync-uri to be written down somewhere to do so +sync-type = git +sync-uri = https://anongit.gentoo.org/git/repo/gentoo.git +sync-git-verify-commit-signature = yes diff --git a/gentoo-portage/repos.conf/science b/gentoo-portage/repos.conf/science new file mode 100644 index 0000000..4a03df2 --- /dev/null +++ b/gentoo-portage/repos.conf/science @@ -0,0 +1,6 @@ +[science] +location = /var/db/repos/science +# We sync manually, but we need sync-uri to be written down somewhere to do so +sync-type = git +sync-uri = https://anongit.gentoo.org/git/proj/sci.git +priority = 7777 From 828184e3ec9163caa141211fc2856bf854daeae6 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 7 May 2024 14:55:28 -0400 Subject: [PATCH 03/17] Fixed up Dockerfile --- Dockerfile | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0811d6f..fb8a443 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,21 +2,19 @@ FROM docker.io/gentoo/portage:20240324 as portage FROM docker.io/gentoo/stage3:20240318 -RUN COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo \ - && RUN emerge -v --noreplace dev-vcs/git \ - && RUN emerge -v1u portage \ - # Pinned commits for the dependency tree state - && ARG gentoo_hash=2d25617a1d085316761b06c17a93ec972f172fc6 \ - && ARG science_hash=73916dd3680ffd92e5bd3d32b262e5d78c86a448 \ - && ARG FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" \ - # This will be bound, and contents available outside of container - && RUN mkdir /outputs \ - && COPY gentoo-portage/ /etc/portage/ \ - # Moving gentoo repo from default rsync to git - && RUN rm /var/db/repos/gentoo -rf \ - # Cloning manually to prevent vdb update, pinning state via git - # Allegedly it's better to chain everything in one command, something with container layers 🤔 - && RUN \ + +COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo +COPY gentoo-portage/ /etc/portage/ + +ARG gentoo_hash=2d25617a1d085316761b06c17a93ec972f172fc6 \ +ARG science_hash=73916dd3680ffd92e5bd3d32b262e5d78c86a448 \ +ARG FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" \ + +RUN emerge -v --noreplace dev-vcs/git \ + && emerge -v1u portage \ + && mkdir /outputs \ + && rm /var/db/repos/gentoo -rf \ + && \ REPO_URL=$(grep "^sync-uri" /etc/portage/repos.conf/gentoo | sed -e "s/sync-uri *= *//g") && \ mkdir -p /var/db/repos/gentoo && pushd /var/db/repos/gentoo && git init . && \ git remote add origin ${REPO_URL} && \ @@ -52,7 +50,7 @@ ENV CONDA_DIR="/opt/miniconda-latest" \ PATH="/opt/miniconda-latest/bin:$PATH" RUN \ # Install dependencies. - && export PATH="/opt/miniconda-latest/bin:$PATH" \ + 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 \ From 73ac16bfe5487049893934b19e4dc5f24ecec1e5 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 7 May 2024 14:56:15 -0400 Subject: [PATCH 04/17] Add shebang to src/run.py and make it executable --- src/run.py | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 src/run.py diff --git a/src/run.py b/src/run.py old mode 100644 new mode 100755 index 9209b49..09a77fe --- a/src/run.py +++ b/src/run.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import argparse import json import re From a4e71124e48822723482b36426b0f2c88e1aaecc Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 7 May 2024 15:05:20 -0400 Subject: [PATCH 05/17] Announce a string with unescaped backslash to be raw --- src/deface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/deface.py b/src/deface.py index 148673c..fb04356 100644 --- a/src/deface.py +++ b/src/deface.py @@ -63,7 +63,7 @@ def compress_to_gz(input_file, output_file): def copy_over_sidecar(scan_filepath, input_anat_dir, output_anat_dir): - prefix = '_'.join([i for i in re.split('_|\.', scan_filepath.name) if i not in ['defaced', 'nii', 'gz']]) + prefix = '_'.join([i for i in re.split(r'_|\.', scan_filepath.name) if i not in ['defaced', 'nii', 'gz']]) filename = prefix + '.json' json_sidecar = input_anat_dir / filename shutil.copy2(json_sidecar, output_anat_dir / filename) From def763000d2c9841cd93c978709a3dbc715106e4 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 21 May 2024 16:53:12 -0400 Subject: [PATCH 06/17] One more fix to Dockerfile -- there must be no \ at the end of ARG lines otherwise it was just placing everything, including the RUN into value of gentoo_hash (I guess) and not really installing anything --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fb8a443..51dd915 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,9 @@ FROM docker.io/gentoo/stage3:20240318 COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo COPY gentoo-portage/ /etc/portage/ -ARG gentoo_hash=2d25617a1d085316761b06c17a93ec972f172fc6 \ -ARG science_hash=73916dd3680ffd92e5bd3d32b262e5d78c86a448 \ -ARG FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" \ +ARG gentoo_hash=2d25617a1d085316761b06c17a93ec972f172fc6 +ARG science_hash=73916dd3680ffd92e5bd3d32b262e5d78c86a448 +ARG FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" RUN emerge -v --noreplace dev-vcs/git \ && emerge -v1u portage \ From a072028794211f09af2e8a7e3c0b8e8642c1dcdb Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 21 May 2024 17:42:04 -0400 Subject: [PATCH 07/17] Do configured default branch in gentoo so that git has a chance to operate ok --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 51dd915..3d4b449 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ RUN emerge -v --noreplace dev-vcs/git \ && emerge -v1u portage \ && mkdir /outputs \ && rm /var/db/repos/gentoo -rf \ + && git config --global init.defaultBranch master \ && \ REPO_URL=$(grep "^sync-uri" /etc/portage/repos.conf/gentoo | sed -e "s/sync-uri *= *//g") && \ mkdir -p /var/db/repos/gentoo && pushd /var/db/repos/gentoo && git init . && \ From 8f7ea208fd961a3a9a1b4360368029ddc887d1ca Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 21 May 2024 17:52:57 -0400 Subject: [PATCH 08/17] remove trailing \ after popd before many lines of comments --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3d4b449..493ecc1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN emerge -v --noreplace dev-vcs/git \ mkdir -p /var/db/repos/science && pushd /var/db/repos/science && git init . && \ git remote add origin ${REPO_URL} && \ git fetch --filter="blob:none" origin $science_hash && \ - git reset --hard $science_hash && rm .git -rf && popd \ + git reset --hard $science_hash && rm .git -rf && popd # Old Christian: Remove sync-uri to not accidentally re-sync if we work with the package management interactively # Christian from the future: Maybe we want the option to re-sync if we're debugging it interactively... #RUN sed -i /etc/portage/repos.conf/{gentoo,science} -e "s/sync-type *= *git/sync-type =/g" From 7b662bd2da296c44c675ca120018fdee031e7d9b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 21 May 2024 18:56:18 -0400 Subject: [PATCH 09/17] TEMP(ish): add set -x and GIT_TRACE=1 to see what leads to that RPC call fail etc from git relevant info https://bugs.gentoo.org/824782#c17 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 493ecc1..4f77444 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN emerge -v --noreplace dev-vcs/git \ && git config --global init.defaultBranch master \ && \ REPO_URL=$(grep "^sync-uri" /etc/portage/repos.conf/gentoo | sed -e "s/sync-uri *= *//g") && \ - mkdir -p /var/db/repos/gentoo && pushd /var/db/repos/gentoo && git init . && \ + set -x && export GIT_TRACE=1 && mkdir -p /var/db/repos/gentoo && pushd /var/db/repos/gentoo && git init . && \ git remote add origin ${REPO_URL} && \ git fetch --filter="blob:none" origin $gentoo_hash && \ git reset --hard $gentoo_hash && rm .git -rf && popd && \ From 8b72b072c4c6a024c0be3e8ba64c950360187bad Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 21 May 2024 19:07:03 -0400 Subject: [PATCH 10/17] Refactor the entire cloning of gentoo to avoid filter (migth be not supported) and using --depth 1 --- Dockerfile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4f77444..45c4b3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,16 +16,19 @@ RUN emerge -v --noreplace dev-vcs/git \ && rm /var/db/repos/gentoo -rf \ && git config --global init.defaultBranch master \ && \ + set -x && export GIT_TRACE=1 && \ REPO_URL=$(grep "^sync-uri" /etc/portage/repos.conf/gentoo | sed -e "s/sync-uri *= *//g") && \ - set -x && export GIT_TRACE=1 && mkdir -p /var/db/repos/gentoo && pushd /var/db/repos/gentoo && git init . && \ - git remote add origin ${REPO_URL} && \ - git fetch --filter="blob:none" origin $gentoo_hash && \ - git reset --hard $gentoo_hash && rm .git -rf && popd && \ + git clone --depth 1 ${REPO_URL} /var/db/repos/gentoo && \ + cd /var/db/repos/gentoo && \ + git fetch --depth 1 origin $gentoo_hash && \ + git reset --hard $gentoo_hash && \ + rm .git -rf && \ REPO_URL=$(grep "^sync-uri" /etc/portage/repos.conf/science | sed -e "s/sync-uri *= *//g") && \ - mkdir -p /var/db/repos/science && pushd /var/db/repos/science && git init . && \ - git remote add origin ${REPO_URL} && \ - git fetch --filter="blob:none" origin $science_hash && \ - git reset --hard $science_hash && rm .git -rf && popd + git clone --depth 1 ${REPO_URL} /var/db/repos/science && \ + cd /var/db/repos/science && \ + git fetch --depth 1 origin $science_hash && \ + git reset --hard $science_hash && \ + rm .git -rf # Old Christian: Remove sync-uri to not accidentally re-sync if we work with the package management interactively # Christian from the future: Maybe we want the option to re-sync if we're debugging it interactively... #RUN sed -i /etc/portage/repos.conf/{gentoo,science} -e "s/sync-type *= *git/sync-type =/g" From 6fc5e2a5f4fc6e5dd6f846fcce90ac174a2cdc1c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 21 May 2024 14:53:02 -0400 Subject: [PATCH 11/17] [DATALAD RUNCMD] Replace fixed shebangs for python to use /usr/bin/env python3 === Do not change lines below === { "chain": [], "cmd": "sed -i -e 's,/usr/local/bin/python3,/usr/bin/env python3,g' src/deface.py src/generate_mappings.py src/prepare_shareable.py src/prepare_to_share.py src/register.py src/run.py", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- src/generate_mappings.py | 2 +- src/prepare_shareable.py | 2 +- src/prepare_to_share.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generate_mappings.py b/src/generate_mappings.py index c4c8673..a7b4473 100644 --- a/src/generate_mappings.py +++ b/src/generate_mappings.py @@ -1,4 +1,4 @@ -#!/usr/local/bin/python3 +#!/usr/bin/env python3 """Generates Primary to "others" mapping file and prints VisualQC's T1 MRI utility command. diff --git a/src/prepare_shareable.py b/src/prepare_shareable.py index dd5297e..a3d3ac7 100644 --- a/src/prepare_shareable.py +++ b/src/prepare_shareable.py @@ -1,4 +1,4 @@ -#!/usr/local/bin/python3 +#!/usr/bin/env python3 import argparse import subprocess diff --git a/src/prepare_to_share.py b/src/prepare_to_share.py index ac21ee7..93936f4 100644 --- a/src/prepare_to_share.py +++ b/src/prepare_to_share.py @@ -1,4 +1,4 @@ -#!/usr/local/bin/python3 +#!/usr/bin/env python3 import argparse import subprocess From 5503f6bd8929e7fa510654e7e0dc66995a49c9e4 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 21 May 2024 16:22:13 -0400 Subject: [PATCH 12/17] Remove "module load" invocations from the code It is a hardcoded assumption on a configuration of the environment, should not be there! --- src/deface.py | 3 +-- src/register.py | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/deface.py b/src/deface.py index fb04356..6cb6fd4 100644 --- a/src/deface.py +++ b/src/deface.py @@ -173,8 +173,7 @@ def run_afni_refacer(primary_t1, others, subj_input_dir, sess_dir, output_dir): # afni refacer commands refacer_cmd = f"@afni_refacer_run -input {primary_t1} -mode_deface -no_clean -prefix {fspath(subj_outdir / prefix)}" - # TODO remove module load afni - full_cmd = f"module load afni ; export OMP_NUM_THREADS=1 ; {refacer_cmd}" + full_cmd = f"export OMP_NUM_THREADS=1 ; {refacer_cmd}" # TODO make log text less ugly; perhaps in a separate function log_filename = subj_outdir / 'defacing_pipeline.log' diff --git a/src/register.py b/src/register.py index ed9bd03..56fd778 100644 --- a/src/register.py +++ b/src/register.py @@ -11,16 +11,13 @@ def preprocess_facemask(fmask_path, logfile_obj): prefix = fmask_path.parent.joinpath('afni_facemask') defacemask = fmask_path.parent.joinpath('afni_defacemask.nii.gz') - # load fsl module - c0 = f"module load fsl" - # split the 4D volume c1 = f"fslroi {fmask_path} {prefix} 1 1" # arithmetic on the result from above c2 = f"fslmaths {prefix}.nii.gz -abs -binv {defacemask}" print(f"Generating a defacemask... \n ") - run_command('; '.join([c0, c1, c2]), logfile_obj) + run_command('; '.join([c1, c2]), logfile_obj) try: if defacemask.exists(): return defacemask @@ -68,7 +65,7 @@ def register_to_primary_scan(subj_dir, afni_workdir, primary_scan, other_scans_l mask_cmd = f"fslmaths {other} -mas {other_mask} {other_defaced}" - full_cmd = " ; ".join(["module load fsl", cp_cmd, flirt_cmd, applyxfm_cmd, mask_cmd]) + '\n' + full_cmd = " ; ".join([cp_cmd, flirt_cmd, applyxfm_cmd, mask_cmd]) + '\n' print(f"Registering {other.name} to {primary_scan.name} and applying defacemask...") run_command(full_cmd, log_fileobj) From 75fee4c5955af68eee92f691c462eab720332b0c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 23 May 2024 12:34:31 -0400 Subject: [PATCH 13/17] Add basic checking that external command succeeded Someone could add a CLI option like --on-error=error,continue,ignore so that if continue it would continue but error at the end with some summary etc, and ignore just exit normally --- src/deface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/deface.py b/src/deface.py index 6cb6fd4..475b17e 100644 --- a/src/deface.py +++ b/src/deface.py @@ -9,10 +9,10 @@ import register -def run_command(cmdstr, logfile): +def run_command(cmdstr, logfile, check : bool=True): if not logfile: logfile = subprocess.PIPE - subprocess.run(cmdstr, stdout=logfile, stderr=subprocess.STDOUT, encoding='utf8', shell=True) + subprocess.run(cmdstr, stdout=logfile, stderr=subprocess.STDOUT, encoding='utf8', shell=True, check=check) def rename_afni_workdir(workdir_path): From c7ef010505bc30979986b18efe4405963aeb4d94 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 23 May 2024 13:58:44 -0400 Subject: [PATCH 14/17] Move gentoo config bootstrapping inside the Dockerfile Although does not matter much for this particular case, aiming for NeuroDocker - we do need to have produced Dockerfile self contained. Hence here we are practicing on how to make it happen --- Dockerfile | 52 +++++++++++++++++++++- gentoo-portage/make.conf | 21 --------- gentoo-portage/package.accept_keywords/gen | 2 - gentoo-portage/package.mask/bugs | 2 - gentoo-portage/repos.conf/gentoo | 6 --- gentoo-portage/repos.conf/science | 6 --- 6 files changed, 51 insertions(+), 38 deletions(-) delete mode 100644 gentoo-portage/make.conf delete mode 100644 gentoo-portage/package.accept_keywords/gen delete mode 100644 gentoo-portage/package.mask/bugs delete mode 100644 gentoo-portage/repos.conf/gentoo delete mode 100644 gentoo-portage/repos.conf/science diff --git a/Dockerfile b/Dockerfile index 45c4b3c..c777957 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,62 @@ FROM docker.io/gentoo/portage:20240324 as portage FROM docker.io/gentoo/stage3:20240318 COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo -COPY gentoo-portage/ /etc/portage/ + ARG gentoo_hash=2d25617a1d085316761b06c17a93ec972f172fc6 ARG science_hash=73916dd3680ffd92e5bd3d32b262e5d78c86a448 ARG FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" +# Instead of +# COPY gentoo-portage/ /etc/portage/ +# produced by https://gist.github.com/yarikoptic/5da985d200fa1a2185a702ce9913d4d4 +# with further HEAVY tune up to make it work +# Lessons: +# - needed to use echo -n so we could have new lines +# - \n at the beginning since otherwise # lines are ignored as comments +RUN \ + mkdir -p /etc/portage/; \ + echo -e "### This file contains system-wide build variables, including Gentoo variables such as USE, which enable/disable optional package features. \ +\n \ +\nCOMMON_FLAGS=\"-O2 -pipe -march=native\" \ +\n# Comment the following out on systems with less than 8 threads \ +\nMAKEOPTS=\"--jobs 8 --load-average 9\" \ +\nCFLAGS=\"\${COMMON_FLAGS}\" \ +\nCXXFLAGS=\"\${COMMON_FLAGS}\" \ +\nFCFLAGS=\"\${COMMON_FLAGS}\" \ +\nFFLAGS=\"\${COMMON_FLAGS}\" \ +\n \ +\n# NOTE: This stage was built with the bindist Use flag enabled \ +\n \ +\n# This sets the language of build output to English. \ +\n# Please keep this setting intact when reporting bugs. \ +\nLC_MESSAGES=C \ +\n \ +\nUSE=\"\${USE} science\" \ +\nACCEPT_LICENSE=\"*\" \ +\n \ +\n# Needed in the container environment \ +\n#FEATURES=\"-ipc-sandbox -network-sandbox -pid-sandbox\"" > "/etc/portage/make.conf"; \ +mkdir -p "/etc/portage/package.accept_keywords"; \ +echo -e "### This is needed because ::science packages are generally not marked as stable \ +\n*/* ~amd64" > "/etc/portage/package.accept_keywords/gen" ; \ +mkdir -p "/etc/portage/package.mask"; \ +echo -e "### This is empty, thankfully. \ +\n### If we find bugs in some version of some package we can blacklist the package, version, or feature that causes it here." > "/etc/portage/package.mask/bugs"; \ +mkdir -p "/etc/portage/repos.conf" ; \ +echo -e "[gentoo] \ +\nlocation = /var/db/repos/gentoo \ +\n# We sync manually, but we need sync-uri to be written down somewhere to do so \ +\nsync-type = git \ +\nsync-uri = https://anongit.gentoo.org/git/repo/gentoo.git \ +\nsync-git-verify-commit-signature = yes" > "/etc/portage/repos.conf/gentoo"; \ +echo -e "[science] \ +\nlocation = /var/db/repos/science \ +\n# We sync manually, but we need sync-uri to be written down somewhere to do so \ +\nsync-type = git \ +\nsync-uri = https://anongit.gentoo.org/git/proj/sci.git \ +\npriority = 7777" > "/etc/portage/repos.conf/science" + RUN emerge -v --noreplace dev-vcs/git \ && emerge -v1u portage \ && mkdir /outputs \ diff --git a/gentoo-portage/make.conf b/gentoo-portage/make.conf deleted file mode 100644 index 5d2eded..0000000 --- a/gentoo-portage/make.conf +++ /dev/null @@ -1,21 +0,0 @@ -### This file contains system-wide build variables, including Gentoo variables such as USE, which enable/disable optional package features. - -COMMON_FLAGS="-O2 -pipe -march=native" -# Comment the following out on systems with less than 8 threads -MAKEOPTS="--jobs 8 --load-average 9" -CFLAGS="${COMMON_FLAGS}" -CXXFLAGS="${COMMON_FLAGS}" -FCFLAGS="${COMMON_FLAGS}" -FFLAGS="${COMMON_FLAGS}" - -# NOTE: This stage was built with the bindist Use flag enabled - -# This sets the language of build output to English. -# Please keep this setting intact when reporting bugs. -LC_MESSAGES=C - -USE="${USE} science" -ACCEPT_LICENSE="*" - -# Needed in the container environment -#FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" diff --git a/gentoo-portage/package.accept_keywords/gen b/gentoo-portage/package.accept_keywords/gen deleted file mode 100644 index 467373b..0000000 --- a/gentoo-portage/package.accept_keywords/gen +++ /dev/null @@ -1,2 +0,0 @@ -### This is needed because ::science packages are generally not marked as stable -*/* ~amd64 diff --git a/gentoo-portage/package.mask/bugs b/gentoo-portage/package.mask/bugs deleted file mode 100644 index 1e593eb..0000000 --- a/gentoo-portage/package.mask/bugs +++ /dev/null @@ -1,2 +0,0 @@ -### This is empty, thankfully. -### If we find bugs in some version of some package we can blacklist the package, version, or feature that causes it here. diff --git a/gentoo-portage/repos.conf/gentoo b/gentoo-portage/repos.conf/gentoo deleted file mode 100644 index 5d53ee4..0000000 --- a/gentoo-portage/repos.conf/gentoo +++ /dev/null @@ -1,6 +0,0 @@ -[gentoo] -location = /var/db/repos/gentoo -# We sync manually, but we need sync-uri to be written down somewhere to do so -sync-type = git -sync-uri = https://anongit.gentoo.org/git/repo/gentoo.git -sync-git-verify-commit-signature = yes diff --git a/gentoo-portage/repos.conf/science b/gentoo-portage/repos.conf/science deleted file mode 100644 index 4a03df2..0000000 --- a/gentoo-portage/repos.conf/science +++ /dev/null @@ -1,6 +0,0 @@ -[science] -location = /var/db/repos/science -# We sync manually, but we need sync-uri to be written down somewhere to do so -sync-type = git -sync-uri = https://anongit.gentoo.org/git/proj/sci.git -priority = 7777 From a175c5a3969eeb5d23fb1c8ee3f4751879bd4e11 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 23 May 2024 14:14:09 -0400 Subject: [PATCH 15/17] Minimize bootstrapped config by removing comments --- Dockerfile | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index c777957..dd3a06c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,6 @@ FROM docker.io/gentoo/stage3:20240318 COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo - ARG gentoo_hash=2d25617a1d085316761b06c17a93ec972f172fc6 ARG science_hash=73916dd3680ffd92e5bd3d32b262e5d78c86a448 ARG FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" @@ -17,45 +16,33 @@ ARG FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" # Lessons: # - needed to use echo -n so we could have new lines # - \n at the beginning since otherwise # lines are ignored as comments +# NOTES/QUESTIONS: +# - hardcoded --jobs and --load-average -- I wonder if some generic way RUN \ mkdir -p /etc/portage/; \ - echo -e "### This file contains system-wide build variables, including Gentoo variables such as USE, which enable/disable optional package features. \ -\n \ + echo -e "\ \nCOMMON_FLAGS=\"-O2 -pipe -march=native\" \ -\n# Comment the following out on systems with less than 8 threads \ \nMAKEOPTS=\"--jobs 8 --load-average 9\" \ \nCFLAGS=\"\${COMMON_FLAGS}\" \ \nCXXFLAGS=\"\${COMMON_FLAGS}\" \ \nFCFLAGS=\"\${COMMON_FLAGS}\" \ \nFFLAGS=\"\${COMMON_FLAGS}\" \ -\n \ -\n# NOTE: This stage was built with the bindist Use flag enabled \ -\n \ -\n# This sets the language of build output to English. \ -\n# Please keep this setting intact when reporting bugs. \ \nLC_MESSAGES=C \ -\n \ \nUSE=\"\${USE} science\" \ \nACCEPT_LICENSE=\"*\" \ -\n \ -\n# Needed in the container environment \ -\n#FEATURES=\"-ipc-sandbox -network-sandbox -pid-sandbox\"" > "/etc/portage/make.conf"; \ +" > "/etc/portage/make.conf"; \ mkdir -p "/etc/portage/package.accept_keywords"; \ -echo -e "### This is needed because ::science packages are generally not marked as stable \ -\n*/* ~amd64" > "/etc/portage/package.accept_keywords/gen" ; \ +echo -e "*/* ~amd64" > "/etc/portage/package.accept_keywords/gen" ; \ mkdir -p "/etc/portage/package.mask"; \ -echo -e "### This is empty, thankfully. \ -\n### If we find bugs in some version of some package we can blacklist the package, version, or feature that causes it here." > "/etc/portage/package.mask/bugs"; \ +touch "/etc/portage/package.mask/bugs"; \ mkdir -p "/etc/portage/repos.conf" ; \ echo -e "[gentoo] \ \nlocation = /var/db/repos/gentoo \ -\n# We sync manually, but we need sync-uri to be written down somewhere to do so \ \nsync-type = git \ \nsync-uri = https://anongit.gentoo.org/git/repo/gentoo.git \ \nsync-git-verify-commit-signature = yes" > "/etc/portage/repos.conf/gentoo"; \ echo -e "[science] \ \nlocation = /var/db/repos/science \ -\n# We sync manually, but we need sync-uri to be written down somewhere to do so \ \nsync-type = git \ \nsync-uri = https://anongit.gentoo.org/git/proj/sci.git \ \npriority = 7777" > "/etc/portage/repos.conf/science" From 076fa2c56dae8b1f69960a415d15670fc7783037 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Sat, 8 Jun 2024 06:50:35 -0400 Subject: [PATCH 16/17] Updated hashes to include AFNI nifti-clib fix from upstream https://github.com/afni/afni/issues/639#issuecomment-2145703256 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index dd3a06c..1f13a75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,8 @@ FROM docker.io/gentoo/stage3:20240318 COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo -ARG gentoo_hash=2d25617a1d085316761b06c17a93ec972f172fc6 -ARG science_hash=73916dd3680ffd92e5bd3d32b262e5d78c86a448 +ARG gentoo_hash=0e9370b45a589867220384ca6c63bc6bcaec3f74 +ARG science_hash=5307342730267714f7019d62f77b2d9bf7624d8c ARG FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" # Instead of From c1f18241aa7d03e4cbd8e64abc24c64b3db8fd40 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 9 Jun 2024 10:07:05 -0400 Subject: [PATCH 17/17] Set AFNI_ATLAS_PATH to point to location of the templates now included --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 1f13a75..2d4d82c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -88,6 +88,7 @@ COPY ["environment.yml", \ COPY ["src", \ "/opt/dsst-defacing-pipeline"] ENV CONDA_DIR="/opt/miniconda-latest" \ + AFNI_ATLAS_PATH=/usr/share/afni-datasets/ \ PATH="/opt/miniconda-latest/bin:$PATH" RUN \ # Install dependencies.