From 65067b63335c782265fec32d46253c7eae2e80ba Mon Sep 17 00:00:00 2001 From: Tom Close Date: Sat, 30 Apr 2022 01:33:58 +1000 Subject: [PATCH 001/211] added escape of single quotest to _get_instructions (#443) --- neurodocker/reproenv/renderers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/neurodocker/reproenv/renderers.py b/neurodocker/reproenv/renderers.py index 68d2a35c..120f7879 100644 --- a/neurodocker/reproenv/renderers.py +++ b/neurodocker/reproenv/renderers.py @@ -425,6 +425,8 @@ def _get_instructions(self) -> str: j = " \\\n".join(j.splitlines()) # Escape the % characters so printf does not interpret them as delimiters. j = j.replace("%", "%%") + # Escape single quotes with '"'"' + j = j.replace("'", "'\"'\"'") cmd = f"printf '{j}' > {REPROENV_SPEC_FILE_IN_CONTAINER}" return cmd From 3da4e04b9d3659c0b0381db127fa2dcc86bfd056 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Sat, 9 Jul 2022 08:58:45 +1000 Subject: [PATCH 002/211] fix afni recipe (R package issues, line break) fix afni recipe (R package issues, line break) --- neurodocker/templates/afni.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/neurodocker/templates/afni.yaml b/neurodocker/templates/afni.yaml index c40acdf4..d04abd65 100644 --- a/neurodocker/templates/afni.yaml +++ b/neurodocker/templates/afni.yaml @@ -18,15 +18,20 @@ binaries: dependencies: apt: - ca-certificates + - cmake - curl - ed - gsl-bin + - libcurl4-openssl-dev - libgl1-mesa-dri + - libjpeg-turbo8-dev - libglu1-mesa-dev - libglib2.0-0 - libglw1-mesa - libgomp1 - libjpeg62 + - libssl-dev + - libudunits2-dev - libxm4 - multiarch-support - netpbm @@ -34,19 +39,24 @@ binaries: - xfonts-base - xvfb yum: + - cmake - curl - ed - gsl + - libcurl-devel - libGLU - libgomp + - libjpeg-turbo-devel - libpng12 - libXp - libXpm - mesa-dri-drivers - netpbm-progs - openmotif + - openssl-devel - R - tcsh + - udunits2-devel - which - xorg-x11-fonts-misc - xorg-x11-server-Xvfb @@ -55,9 +65,9 @@ binaries: - http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb instructions: | {{ self.install_dependencies() }} - {%- if self.install_python3.lower() in ["true", "1", "y"] %} + {% if self.install_python3.lower() in ["true", "1", "y"] -%} {{ self.install(["python3"]) }} - {% endif %} + {%- endif %} gsl_path="$(find / -name 'libgsl.so.??' || printf '')" if [ -n "$gsl_path" ]; then \ ln -sfv "$gsl_path" "$(dirname $gsl_path)/libgsl.so.0"; \ From ea9b775ecf7808471bc449ae5f04067d68e14ef8 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Wed, 13 Jul 2022 10:28:58 +1000 Subject: [PATCH 003/211] added python fixes --- neurodocker/templates/afni.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/neurodocker/templates/afni.yaml b/neurodocker/templates/afni.yaml index d04abd65..40d75791 100644 --- a/neurodocker/templates/afni.yaml +++ b/neurodocker/templates/afni.yaml @@ -35,6 +35,8 @@ binaries: - libxm4 - multiarch-support - netpbm + - python-is-python3 + - python3-pip - tcsh - xfonts-base - xvfb @@ -54,6 +56,8 @@ binaries: - netpbm-progs - openmotif - openssl-devel + - python-is-python3 + - python3-pip - R - tcsh - udunits2-devel @@ -67,6 +71,7 @@ binaries: {{ self.install_dependencies() }} {% if self.install_python3.lower() in ["true", "1", "y"] -%} {{ self.install(["python3"]) }} + pip3 install matplotlib {%- endif %} gsl_path="$(find / -name 'libgsl.so.??' || printf '')" if [ -n "$gsl_path" ]; then \ From 36e9ce35b92b3ef6e95b603976d9774522cff3f9 Mon Sep 17 00:00:00 2001 From: Jennings Zhang Date: Thu, 28 Jul 2022 22:12:15 -0400 Subject: [PATCH 004/211] Add freesurfer 7.3.0 and 7.3.1 --- neurodocker/templates/freesurfer.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/neurodocker/templates/freesurfer.yaml b/neurodocker/templates/freesurfer.yaml index 56898295..e7e15a9b 100644 --- a/neurodocker/templates/freesurfer.yaml +++ b/neurodocker/templates/freesurfer.yaml @@ -22,6 +22,8 @@ binaries: subjects/fsaverage_sym trctrain urls: + "7.3.1": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.1/freesurfer-linux-centos7_x86_64-7.3.1.tar.gz + "7.3.0": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.0/freesurfer-linux-centos7_x86_64-7.3.0.tar.gz "7.2.0": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.2.0/freesurfer-linux-centos6_x86_64-7.2.0.tar.gz "7.1.1": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.1.1/freesurfer-linux-centos6_x86_64-7.1.1.tar.gz "7.1.1-min": https://dl.dropbox.com/s/c3earkfhhvdyuo4/freesurfer-7.1.1-min.tgz From 26251841ea865d6922e7f211b7fc13a08661676e Mon Sep 17 00:00:00 2001 From: Paul Wighton Date: Wed, 3 Aug 2022 15:03:19 -0400 Subject: [PATCH 005/211] [FIX] fix for issue #449 --- neurodocker/templates/freesurfer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neurodocker/templates/freesurfer.yaml b/neurodocker/templates/freesurfer.yaml index e7e15a9b..bdd32442 100644 --- a/neurodocker/templates/freesurfer.yaml +++ b/neurodocker/templates/freesurfer.yaml @@ -56,7 +56,7 @@ binaries: # From https://github.com/freesurfer/freesurfer/blob/54018f7d6f620d6288b28f50e14a0a4ba421757c/Dockerfile#L20-L42 # freesurfer env OS: "Linux" - PATH: "{{ self.install_path }}/bin:{{ self.install_path }}/fsfast/bin:{{ self.install_path }}/tktools:{{ self.install_path }}/mni/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + PATH: "{{ self.install_path }}/bin:{{ self.install_path }}/fsfast/bin:{{ self.install_path }}/tktools:{{ self.install_path }}/mni/bin:$PATH" FREESURFER_HOME: "{{ self.install_path }}" FREESURFER: "{{ self.install_path }}" SUBJECTS_DIR: "{{ self.install_path }}/subjects" From 18abc87bac0f9c15cb64c76bcd19c8e528480849 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 4 Aug 2022 11:18:23 +0200 Subject: [PATCH 006/211] basic set up for auto doc main CLI --- docs/conf.py | 1 + docs/user_guide/cli_auto.rst | 7 +++++++ docs/user_guide/index.rst | 1 + setup.cfg | 1 + 4 files changed, 10 insertions(+) create mode 100644 docs/user_guide/cli_auto.rst diff --git a/docs/conf.py b/docs/conf.py index ebe09bec..a3c02855 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -45,6 +45,7 @@ "sphinx.ext.viewcode", # "sphinx.ext.linkcode", "sphinxcontrib.apidoc", + 'sphinx_click', ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/user_guide/cli_auto.rst b/docs/user_guide/cli_auto.rst new file mode 100644 index 00000000..3a6c2e34 --- /dev/null +++ b/docs/user_guide/cli_auto.rst @@ -0,0 +1,7 @@ +Command-line Interface +====================== + +.. click:: neurodocker.cli.cli:cli + :prog: neurodocker + :nested: full + diff --git a/docs/user_guide/index.rst b/docs/user_guide/index.rst index 5c5b372b..83ab6dc0 100644 --- a/docs/user_guide/index.rst +++ b/docs/user_guide/index.rst @@ -6,6 +6,7 @@ User Guide installation quickstart cli + cli_auto examples common_uses minify diff --git a/setup.cfg b/setup.cfg index 8806d74e..ce030758 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,6 +50,7 @@ docs = sphinx >= 3.4 pydata-sphinx-theme sphinxcontrib.apidoc >= 0.3 + sphinx-click all = %(minify)s %(dev)s From 3a572c1740c3a8107926d56b0bd26526c11113e1 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Fri, 5 Aug 2022 02:11:47 +1000 Subject: [PATCH 007/211] added _Renderer.labels method that enables adding labels with special chars in the label name (#453) * added _Renderer.labels method that enables adding labels with special chars in the label name * added tests for _Renderer.labels and fixed apparent bug in SingularityRender.label where multiple labels weren't separated by newlines --- neurodocker/reproenv/renderers.py | 10 ++++++++-- neurodocker/reproenv/tests/test_renderers_docker.py | 4 +++- .../reproenv/tests/test_renderers_singularity.py | 4 +++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/neurodocker/reproenv/renderers.py b/neurodocker/reproenv/renderers.py index 120f7879..93e64e29 100644 --- a/neurodocker/reproenv/renderers.py +++ b/neurodocker/reproenv/renderers.py @@ -391,6 +391,12 @@ def install(self, pkgs: ty.List[str], opts: str = None) -> _Renderer: def label(self, **kwds: str) -> _Renderer: raise NotImplementedError() + def labels(self, labels_dict: dict) -> _Renderer: + """Adds a set of labels to the dockerfile from a dict. This permits + labels that can include special chars (e.g. '.').""" + self.label(**labels_dict) + return self + def run(self, command: str) -> _Renderer: raise NotImplementedError() @@ -612,9 +618,9 @@ def render(self) -> str: # Add labels. if self._labels: - s += "\n\n%labels\n" + s += "\n\n%labels" for kv in self._labels.items(): - s += " ".join(kv) + s += "\n" + " ".join(kv) return s diff --git a/neurodocker/reproenv/tests/test_renderers_docker.py b/neurodocker/reproenv/tests/test_renderers_docker.py index 5f3a3c13..5b77cde6 100644 --- a/neurodocker/reproenv/tests/test_renderers_docker.py +++ b/neurodocker/reproenv/tests/test_renderers_docker.py @@ -177,6 +177,7 @@ def test_docker_render_from_instance_methods(): ) d.env(PATH="$PATH:/opt/foo/bin") d.label(ORG="myorg") + d.labels({'org.test.label': 'another label'}) rendered = str(d) rendered = prune_rendered(rendered).strip() assert ( @@ -188,7 +189,8 @@ def test_docker_render_from_instance_methods(): "foo/baz/cat.txt", \\ "/opt/"] ENV PATH="$PATH:/opt/foo/bin" -LABEL ORG="myorg\"""" +LABEL ORG="myorg" +LABEL org.test.label="another label\"""" ) d = DockerRenderer("apt") diff --git a/neurodocker/reproenv/tests/test_renderers_singularity.py b/neurodocker/reproenv/tests/test_renderers_singularity.py index e122373b..2f1407ba 100644 --- a/neurodocker/reproenv/tests/test_renderers_singularity.py +++ b/neurodocker/reproenv/tests/test_renderers_singularity.py @@ -164,6 +164,7 @@ def test_singularity_render_from_instance_methods(): s.copy(["foo/bar/baz.txt", "foo/baz/cat.txt"], "/opt/") s.env(FOO="BAR") s.label(ORG="BAZ") + s.labels({'org.test.label': 'BAX'}) s.run("echo foobar") rendered = str(s) rendered = prune_rendered(rendered).strip() @@ -184,7 +185,8 @@ def test_singularity_render_from_instance_methods(): echo foobar %labels -ORG BAZ""" +ORG BAZ +org.test.label BAX""" ) # User From 97b7a3c46a0fc7a9651d51c730b55d5a81275bbb Mon Sep 17 00:00:00 2001 From: Paul Wighton Date: Thu, 4 Aug 2022 13:48:19 -0400 Subject: [PATCH 008/211] [FIX] fix for issue #449 (#462) --- neurodocker/templates/freesurfer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neurodocker/templates/freesurfer.yaml b/neurodocker/templates/freesurfer.yaml index e7e15a9b..bdd32442 100644 --- a/neurodocker/templates/freesurfer.yaml +++ b/neurodocker/templates/freesurfer.yaml @@ -56,7 +56,7 @@ binaries: # From https://github.com/freesurfer/freesurfer/blob/54018f7d6f620d6288b28f50e14a0a4ba421757c/Dockerfile#L20-L42 # freesurfer env OS: "Linux" - PATH: "{{ self.install_path }}/bin:{{ self.install_path }}/fsfast/bin:{{ self.install_path }}/tktools:{{ self.install_path }}/mni/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + PATH: "{{ self.install_path }}/bin:{{ self.install_path }}/fsfast/bin:{{ self.install_path }}/tktools:{{ self.install_path }}/mni/bin:$PATH" FREESURFER_HOME: "{{ self.install_path }}" FREESURFER: "{{ self.install_path }}" SUBJECTS_DIR: "{{ self.install_path }}/subjects" From ad2f3a62afa9a8852bbf0ff3f1df1aadb3b74c8d Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Thu, 4 Aug 2022 14:04:46 -0400 Subject: [PATCH 009/211] fix path to include cli/minify/_trace.sh (#464) --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 8806d74e..8490ffee 100644 --- a/setup.cfg +++ b/setup.cfg @@ -63,7 +63,7 @@ console_scripts = neurodocker = templates/*.yaml reproenv/schemas/*.json - reprozip/_trace.sh + cli/minify/_trace.sh [versioneer] VCS = git From ff8c977ac5130530c3ba4c88d028ffb059bd32e0 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Mon, 22 Aug 2022 17:44:32 +1000 Subject: [PATCH 010/211] removed multiarch-support --- neurodocker/templates/matlabmcr.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/neurodocker/templates/matlabmcr.yaml b/neurodocker/templates/matlabmcr.yaml index 7d21662a..29d19747 100644 --- a/neurodocker/templates/matlabmcr.yaml +++ b/neurodocker/templates/matlabmcr.yaml @@ -43,7 +43,6 @@ binaries: - libxmu6 - libxpm-dev - libxt6 - - multiarch-support - unzip - openjdk-8-jre - dbus-x11 From 6497afdefe2002f9d3a5890ef30261e479da6d35 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Mon, 22 Aug 2022 17:50:47 +1000 Subject: [PATCH 011/211] removed http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb because it needs multi-arch --- neurodocker/templates/matlabmcr.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/neurodocker/templates/matlabmcr.yaml b/neurodocker/templates/matlabmcr.yaml index 29d19747..38e3b25e 100644 --- a/neurodocker/templates/matlabmcr.yaml +++ b/neurodocker/templates/matlabmcr.yaml @@ -56,8 +56,6 @@ binaries: - unzip - java-1.8.0-openjdk - dbus-x11 - debs: - - http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb env: LD_LIBRARY_PATH: | {% set versionTovXX = {"2021b": "v911", "2021a": "v910", "2020b": "v99", "2020a": "v98", "2019b": "v97", "2019a": "v96", "2018b": "v95", "2018a": "v94", "2017b": "v93", "2017a": "v92", "2016b": "v91", "2016a": "v901", "2015b": "v90", "2015aSP1": "v851", "2015a": "v85", "2014b": "v84", "2014a": "v83", "2013b": "v82", "2013a": "v81", "2012b": "v80", "2012a": "v717"} -%} From a078e25b2702b6a6838e1760094ee8482548c793 Mon Sep 17 00:00:00 2001 From: araikes Date: Wed, 7 Sep 2022 15:15:01 -0700 Subject: [PATCH 012/211] Add ANTs 2.4.1 Add ANTs 2.4.1 as an option using official binary zip file --- neurodocker/templates/ants.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/neurodocker/templates/ants.yaml b/neurodocker/templates/ants.yaml index e6e3d2b9..d002728b 100644 --- a/neurodocker/templates/ants.yaml +++ b/neurodocker/templates/ants.yaml @@ -8,7 +8,9 @@ binaries: optional: install_path: /opt/ants-{{ self.version }} urls: - # Binaries were compiled by Jakub Kaczmarzyk (https://github.com/kaczmarj) + # Official binaries are provided as of 2.4.1 (https://github.com/ANTsX/ANTs/releases) + "2.4.1": https://github.com/ANTsX/ANTs/releases/download/v2.4.1/ants-2.4.1-centos7-X64-gcc.zip + # Binaries prior to 2.4.x were compiled by Jakub Kaczmarzyk (https://github.com/kaczmarj) "2.3.4": https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz "2.3.2": https://dl.dropbox.com/s/hrm530kcqe3zo68/ants-Linux-centos6_x86_64-v2.3.2.tar.gz "2.3.1": https://dl.dropbox.com/s/1xfhydsf4t4qoxg/ants-Linux-centos6_x86_64-v2.3.1.tar.gz @@ -21,17 +23,26 @@ binaries: apt: - ca-certificates - curl + - unzip yum: - curl + - unzip env: ANTSPATH: "{{ self.install_path }}/" PATH: "{{ self.install_path }}:$PATH" instructions: | {{ self.install_dependencies() }} echo "Downloading ANTs ..." + {% if self.version == "2.4.1" -%} + curl -fsSL -o ants.zip {{ self.urls[self.version] }} + unzip ants.zip -d /opt + mv /opt/{{ self.install_path }}/bin/* /opt/{{ self.install_path }} + rm ants.zip + {% elif self.version != "2.4.1" -%} mkdir -p {{ self.install_path }} curl -fsSL {{ self.urls[self.version] }} \ | tar -xz -C {{ self.install_path }} --strip-components 1 + {% endif -%} source: arguments: From 0add95370172fe50325254dfdbbdd511147c4444 Mon Sep 17 00:00:00 2001 From: Adam Raikes Date: Wed, 7 Sep 2022 15:38:19 -0700 Subject: [PATCH 013/211] Fixed mv command for binaries into ANTSPATH --- neurodocker/templates/ants.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/neurodocker/templates/ants.yaml b/neurodocker/templates/ants.yaml index d002728b..42feeed1 100644 --- a/neurodocker/templates/ants.yaml +++ b/neurodocker/templates/ants.yaml @@ -36,7 +36,7 @@ binaries: {% if self.version == "2.4.1" -%} curl -fsSL -o ants.zip {{ self.urls[self.version] }} unzip ants.zip -d /opt - mv /opt/{{ self.install_path }}/bin/* /opt/{{ self.install_path }} + mv {{ self.install_path }}/bin/* {{ self.install_path }} rm ants.zip {% elif self.version != "2.4.1" -%} mkdir -p {{ self.install_path }} @@ -96,5 +96,3 @@ source: mv ../Scripts/* {{ self.install_path }} ; \ fi rm -rf /tmp/ants - - \ No newline at end of file From 7085be2165175a344f690e6c4b4e39412b02ebe8 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Jan 2023 16:39:56 +0100 Subject: [PATCH 014/211] update precommit and fix files until 'pre-commit run -a' passes --- .pre-commit-config.yaml | 2 +- docs/user_guide/installation.rst | 2 +- docs/user_guide/quickstart.rst | 4 ++-- neurodocker/reproenv/renderers.py | 2 +- neurodocker/reproenv/schemas/renderer.json | 2 +- neurodocker/reproenv/tests/test_renderers_docker.py | 2 +- neurodocker/reproenv/tests/test_renderers_singularity.py | 2 +- neurodocker/templates/ants.yaml | 2 -- neurodocker/templates/cat12.yaml | 2 -- 9 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d5c5a4a5..44179662 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,6 @@ repos: - id: check-yaml - id: check-added-large-files - repo: https://github.com/psf/black - rev: 20.8b1 + rev: "22.12.0" hooks: - id: black diff --git a/docs/user_guide/installation.rst b/docs/user_guide/installation.rst index bf161777..4725623c 100644 --- a/docs/user_guide/installation.rst +++ b/docs/user_guide/installation.rst @@ -29,7 +29,7 @@ the Neurodocker Python API. Python 3.7 or newer is required. conda ----- -We recommend using a virtual environment or a :code:`conda` environment. +We recommend using a virtual environment or a :code:`conda` environment. In order to create a new :code:`conda` environment and install Neurodocker: .. code-block:: bash diff --git a/docs/user_guide/quickstart.rst b/docs/user_guide/quickstart.rst index a98cec1e..3334bace 100644 --- a/docs/user_guide/quickstart.rst +++ b/docs/user_guide/quickstart.rst @@ -62,8 +62,8 @@ Feel free to create a new notebook and :code:`import nipype`. Singularity ~~~~~~~~~~~ -In most cases the only difference between generating Dockerfile and -`Singularity definition file `_ (the file that is used to create a Singularity container) is in +In most cases the only difference between generating Dockerfile and +`Singularity definition file `_ (the file that is used to create a Singularity container) is in a form of :code:`neurodocker generate` command, `neurodocker generate singularity` has to be used instead of :code:`neurodocker generate docker`. **This requires having `Singularity `_ installed first.** diff --git a/neurodocker/reproenv/renderers.py b/neurodocker/reproenv/renderers.py index 93e64e29..a14e1a46 100644 --- a/neurodocker/reproenv/renderers.py +++ b/neurodocker/reproenv/renderers.py @@ -50,7 +50,7 @@ def _raise_helper(msg: str) -> ty.NoReturn: def _render_string_from_template( source: str, template: _BaseInstallationTemplate ) -> str: - """Take a string from a template and render """ + """Take a string from a template and render""" # TODO: we could use a while loop or recursive function to render the template until # there are no jinja-specific things. At this point, we support one level of # nesting. diff --git a/neurodocker/reproenv/schemas/renderer.json b/neurodocker/reproenv/schemas/renderer.json index 7e5073e6..d01880de 100644 --- a/neurodocker/reproenv/schemas/renderer.json +++ b/neurodocker/reproenv/schemas/renderer.json @@ -394,4 +394,4 @@ "additionalProperties": false } } -} \ No newline at end of file +} diff --git a/neurodocker/reproenv/tests/test_renderers_docker.py b/neurodocker/reproenv/tests/test_renderers_docker.py index 5b77cde6..e033214f 100644 --- a/neurodocker/reproenv/tests/test_renderers_docker.py +++ b/neurodocker/reproenv/tests/test_renderers_docker.py @@ -177,7 +177,7 @@ def test_docker_render_from_instance_methods(): ) d.env(PATH="$PATH:/opt/foo/bin") d.label(ORG="myorg") - d.labels({'org.test.label': 'another label'}) + d.labels({"org.test.label": "another label"}) rendered = str(d) rendered = prune_rendered(rendered).strip() assert ( diff --git a/neurodocker/reproenv/tests/test_renderers_singularity.py b/neurodocker/reproenv/tests/test_renderers_singularity.py index 2f1407ba..ceb560e4 100644 --- a/neurodocker/reproenv/tests/test_renderers_singularity.py +++ b/neurodocker/reproenv/tests/test_renderers_singularity.py @@ -164,7 +164,7 @@ def test_singularity_render_from_instance_methods(): s.copy(["foo/bar/baz.txt", "foo/baz/cat.txt"], "/opt/") s.env(FOO="BAR") s.label(ORG="BAZ") - s.labels({'org.test.label': 'BAX'}) + s.labels({"org.test.label": "BAX"}) s.run("echo foobar") rendered = str(s) rendered = prune_rendered(rendered).strip() diff --git a/neurodocker/templates/ants.yaml b/neurodocker/templates/ants.yaml index e6e3d2b9..d7df1a12 100644 --- a/neurodocker/templates/ants.yaml +++ b/neurodocker/templates/ants.yaml @@ -85,5 +85,3 @@ source: mv ../Scripts/* {{ self.install_path }} ; \ fi rm -rf /tmp/ants - - \ No newline at end of file diff --git a/neurodocker/templates/cat12.yaml b/neurodocker/templates/cat12.yaml index 09991037..c9bdb7fa 100644 --- a/neurodocker/templates/cat12.yaml +++ b/neurodocker/templates/cat12.yaml @@ -25,9 +25,7 @@ binaries: FORCE_SPMMCR: "1" SPM_HTML_BROWSER: "0" MCR_INHIBIT_CTF_LOCK: "1" - SPM_HTML_BROWSER: "0" SPMROOT: "{{ self.install_path }}" - MCR_INHIBIT_CTF_LOCK: "1" PATH: "{{ self.install_path }}:$PATH" instructions: | From f5b02d032ecb4baf55404782350617544c7386ff Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Jan 2023 16:44:55 +0100 Subject: [PATCH 015/211] update black version in setup --- .pre-commit-config.yaml | 6 ++++++ setup.cfg | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 44179662..5fb05c48 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,3 +12,9 @@ repos: rev: "22.12.0" hooks: - id: black + +- repo: https://github.com/pycqa/flake8 + rev: "6.0.0" + hooks: + - id: flake8 + exclude: tests_.*.py|version.*.py|setup.py # ignore tests and versioneer related code diff --git a/setup.cfg b/setup.cfg index 8490ffee..7ba3f1d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,7 @@ minify = docker >= 4.4.1 dev = %(minify)s - black <= 21.12b0 + black >= 22.12.0 codecov flake8 mypy == 0.790 From 83a0bd7c88168c166e1d16d88fad4144c130e044 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Jan 2023 16:46:46 +0100 Subject: [PATCH 016/211] add flake8 to pre commit --- .pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5fb05c48..c3f1b66a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,4 +17,3 @@ repos: rev: "6.0.0" hooks: - id: flake8 - exclude: tests_.*.py|version.*.py|setup.py # ignore tests and versioneer related code From e317a54cc344561f99e3040d0786353e2327fd59 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Jan 2023 17:03:23 +0100 Subject: [PATCH 017/211] app mypy to pre commit and update mypy config accordingly --- .pre-commit-config.yaml | 9 +++++++++ setup.cfg | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c3f1b66a..8297deb1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,3 +17,12 @@ repos: rev: "6.0.0" hooks: - id: flake8 + + +- repo: https://github.com/pre-commit/mirrors-mypy + rev: "v0.991" + hooks: + - id: mypy + additional_dependencies: [types-all] + files: neurodocker + args: ["--config-file", "setup.cfg"] diff --git a/setup.cfg b/setup.cfg index 7ba3f1d5..700ceefd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,7 @@ classifiers = packages = find: python_requires = >= 3.7 install_requires = - click >= 7.0, <8.0 + click etelemetry >= 0.2.0 jinja2 >= 2.0 jsonschema >= 3.0 @@ -40,7 +40,7 @@ dev = black >= 22.12.0 codecov flake8 - mypy == 0.790 + mypy pre-commit pytest >= 6.0 pytest-cov >= 2.0.0 @@ -78,9 +78,19 @@ max-line-length = 88 extend-ignore = E203 exclude = neurodocker/_version.py +[mypy] +exclude = ['reproenv/tests/'] +no_implicit_optional=False + [mypy-neurodocker._version] ignore_errors = True +[mypy-neurodocker.reproenv.tests.*] +ignore_errors = True + +[mypy-pytest] +ignore_missing_imports = True + [mypy-docker] ignore_missing_imports = True From ea9b2cdd65c825317c6c096211f1b996e1d02291 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 16:39:45 +0100 Subject: [PATCH 018/211] add docker build workflow --- .github/workflows/docker_build.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker_build.yml diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml new file mode 100644 index 00000000..cc1eaac6 --- /dev/null +++ b/.github/workflows/docker_build.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . From 536e3c8293236be2e2d97cd54f3c4b52d917b407 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 16:40:09 +0100 Subject: [PATCH 019/211] always run --- .github/workflows/docker_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index cc1eaac6..6bf4f9e5 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -2,9 +2,9 @@ name: Docker Image CI on: push: - branches: [ main ] + branches: [ "*" ] pull_request: - branches: [ main ] + branches: [ "*" ] jobs: From bd6f91043305517379494ac829119cf9a28b1195 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 16:59:32 +0100 Subject: [PATCH 020/211] add install --- .github/workflows/docker_build.yml | 12 ++++++++++++ README.md | 1 + 2 files changed, 13 insertions(+) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 6bf4f9e5..3add6eb7 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -14,5 +14,17 @@ jobs: steps: - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: version + run: neurodocker --version + - name: Build the Docker image run: docker build . diff --git a/README.md b/README.md index e2bb63ce..2fed25fb 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ docker run --rm repronim/neurodocker:0.7.0 --help The Docker images were moved to [repronim/neurodocker](https://hub.docker.com/r/repronim/neurodocker) from [kaczmarj/neurodocker](https://hub.docker.com/r/kaczmarj/neurodocker). + This project can also be installed with `pip`: ```shell From c87551c624e69c21fb6d8a2060bd34fe2133086e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 17:05:56 +0100 Subject: [PATCH 021/211] test docker file --- .github/workflows/docker_build.yml | 11 +++- Dockerfile_u2004_fs73 | 95 ++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 Dockerfile_u2004_fs73 diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 3add6eb7..c54dd1c2 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -23,8 +23,13 @@ jobs: - name: Install neurodocker run: python -m pip install --editable .[dev] - - name: version - run: neurodocker --version + - name: Generate Dockerfile + run: | + neurodocker \ + generate docker \ + --base-image=ubuntu:20.04 \ + --pkg-manager=apt \ + --freesurfer version=7.3.1 > Dockerfile_u2004_fs73 - name: Build the Docker image - run: docker build . + run: docker build -f Dockerfile_u2004_fs73 diff --git a/Dockerfile_u2004_fs73 b/Dockerfile_u2004_fs73 new file mode 100644 index 00000000..bc4874dc --- /dev/null +++ b/Dockerfile_u2004_fs73 @@ -0,0 +1,95 @@ +# Generated by Neurodocker and Reproenv. + +FROM ubuntu:20.04 +ENV OS="Linux" \ + PATH="/opt/freesurfer-7.3.1/bin:/opt/freesurfer-7.3.1/fsfast/bin:/opt/freesurfer-7.3.1/tktools:/opt/freesurfer-7.3.1/mni/bin:$PATH" \ + FREESURFER_HOME="/opt/freesurfer-7.3.1" \ + FREESURFER="/opt/freesurfer-7.3.1" \ + SUBJECTS_DIR="/opt/freesurfer-7.3.1/subjects" \ + LOCAL_DIR="/opt/freesurfer-7.3.1/local" \ + FSFAST_HOME="/opt/freesurfer-7.3.1/fsfast" \ + FMRI_ANALYSIS_DIR="/opt/freesurfer-7.3.1/fsfast" \ + FUNCTIONALS_DIR="/opt/freesurfer-7.3.1/sessions" \ + FS_OVERRIDE="0" \ + FIX_VERTEX_AREA="" \ + FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" \ + MINC_BIN_DIR="/opt/freesurfer-7.3.1/mni/bin" \ + MINC_LIB_DIR="/opt/freesurfer-7.3.1/mni/lib" \ + MNI_DIR="/opt/freesurfer-7.3.1/mni" \ + MNI_DATAPATH="/opt/freesurfer-7.3.1/mni/data" \ + MNI_PERL5LIB="/opt/freesurfer-7.3.1/mni/share/perl5" \ + PERL5LIB="/opt/freesurfer-7.3.1/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-7.3.1 \ + && curl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.1/freesurfer-linux-centos7_x86_64-7.3.1.tar.gz \ + | tar -xz -C /opt/freesurfer-7.3.1 --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' + +# Save specification to JSON. +RUN printf '{ \ + "pkg_manager": "apt", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "ubuntu:20.04" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "OS": "Linux", \ + "PATH": "/opt/freesurfer-7.3.1/bin:/opt/freesurfer-7.3.1/fsfast/bin:/opt/freesurfer-7.3.1/tktools:/opt/freesurfer-7.3.1/mni/bin:$PATH", \ + "FREESURFER_HOME": "/opt/freesurfer-7.3.1", \ + "FREESURFER": "/opt/freesurfer-7.3.1", \ + "SUBJECTS_DIR": "/opt/freesurfer-7.3.1/subjects", \ + "LOCAL_DIR": "/opt/freesurfer-7.3.1/local", \ + "FSFAST_HOME": "/opt/freesurfer-7.3.1/fsfast", \ + "FMRI_ANALYSIS_DIR": "/opt/freesurfer-7.3.1/fsfast", \ + "FUNCTIONALS_DIR": "/opt/freesurfer-7.3.1/sessions", \ + "FS_OVERRIDE": "0", \ + "FIX_VERTEX_AREA": "", \ + "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ + "MINC_BIN_DIR": "/opt/freesurfer-7.3.1/mni/bin", \ + "MINC_LIB_DIR": "/opt/freesurfer-7.3.1/mni/lib", \ + "MNI_DIR": "/opt/freesurfer-7.3.1/mni", \ + "MNI_DATAPATH": "/opt/freesurfer-7.3.1/mni/data", \ + "MNI_PERL5LIB": "/opt/freesurfer-7.3.1/mni/share/perl5", \ + "PERL5LIB": "/opt/freesurfer-7.3.1/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-7.3.1\\ncurl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.1/freesurfer-linux-centos7_x86_64-7.3.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer-7.3.1 --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'"'"'" \ + } \ + } \ + ] \ +}' > /.reproenv.json +# End saving to specification to JSON. From ff628204fab3f999ab85668b16051546cca1a039 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 17:07:08 +0100 Subject: [PATCH 022/211] typo fix --- .github/workflows/docker_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index c54dd1c2..954cb770 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -29,7 +29,7 @@ jobs: generate docker \ --base-image=ubuntu:20.04 \ --pkg-manager=apt \ - --freesurfer version=7.3.1 > Dockerfile_u2004_fs73 + --freesurfer version=7.3.1 > Dockerfile_u2004_fs73 . - name: Build the Docker image run: docker build -f Dockerfile_u2004_fs73 From 8f4d71c8b51bb4d96e3960d0c35f30792d1b34b1 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 17:11:15 +0100 Subject: [PATCH 023/211] add different base image --- .github/workflows/docker_build.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 954cb770..f1c7c899 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -6,12 +6,18 @@ on: pull_request: branches: [ "*" ] +# fedora:36, ubuntu:22.04, ubuntu:18.04, ubuntu:16.04, centos:8 + jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + base_image: ["fedora:36", "ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04", "centos:8"] + steps: - uses: actions/checkout@v3 @@ -26,10 +32,10 @@ jobs: - name: Generate Dockerfile run: | neurodocker \ - generate docker \ - --base-image=ubuntu:20.04 \ + generate docker \ + --base-image=${{ matrix.base_image }} \ --pkg-manager=apt \ - --freesurfer version=7.3.1 > Dockerfile_u2004_fs73 . + --freesurfer version=7.3.1 > Dockerfile_tmp - name: Build the Docker image - run: docker build -f Dockerfile_u2004_fs73 + run: docker build -f Dockerfile_tmp . From e33cd91e5539044e9a74f577f378d8cf745a4830 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 17:36:08 +0100 Subject: [PATCH 024/211] use proper package manager --- .github/workflows/docker_build.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index f1c7c899..b3a67fa3 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - base_image: ["fedora:36", "ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04", "centos:8"] + base_image: ["fedora:36", "centos:8", "ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04"] steps: - uses: actions/checkout@v3 @@ -29,7 +29,8 @@ jobs: - name: Install neurodocker run: python -m pip install --editable .[dev] - - name: Generate Dockerfile + - name: Generate Dockerfile apt + if: contains( ["ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04"], ${{ matrix.base_image }} ) run: | neurodocker \ generate docker \ @@ -37,5 +38,14 @@ jobs: --pkg-manager=apt \ --freesurfer version=7.3.1 > Dockerfile_tmp + - name: Generate Dockerfile yum + if: contains( ["fedora:36", "centos:8"], ${{ matrix.base_image }} ) + run: | + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=yum \ + --freesurfer version=7.3.1 > Dockerfile_tmp + - name: Build the Docker image run: docker build -f Dockerfile_tmp . From d73acb5e67e1280fd501bc21a3504ea4d124ab27 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 17:42:38 +0100 Subject: [PATCH 025/211] try some shell conditional --- .github/workflows/docker_build.yml | 79 +++++++++++++++++------------- 1 file changed, 44 insertions(+), 35 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index b3a67fa3..03cdd835 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -2,50 +2,59 @@ name: Docker Image CI on: push: - branches: [ "*" ] + branches: ["*"] pull_request: - branches: [ "*" ] + branches: ["*"] # fedora:36, ubuntu:22.04, ubuntu:18.04, ubuntu:16.04, centos:8 jobs: - build: - runs-on: ubuntu-latest strategy: matrix: - base_image: ["fedora:36", "centos:8", "ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04"] + base_image: + [ + "fedora:36", + "centos:8", + "ubuntu:22.04", + "ubuntu:18.04", + "ubuntu:16.04", + ] steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile apt - if: contains( ["ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04"], ${{ matrix.base_image }} ) - run: | - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=apt \ - --freesurfer version=7.3.1 > Dockerfile_tmp - - - name: Generate Dockerfile yum - if: contains( ["fedora:36", "centos:8"], ${{ matrix.base_image }} ) - run: | - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=yum \ - --freesurfer version=7.3.1 > Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile apt + if: + contains( ["ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04"], ${{ + matrix.base_image }} ) + run: | + + + yum_based=("fedora:36", "centos:8") + + pkg_manager="apt" + if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="yum" + fi + + : echo "pkg_manager=${pkg_manager}" + + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=${pkg_manager} \ + --freesurfer version=7.3.1 > Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . From 148a8c46fb00a999f4844f796ea2cddf969769b7 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 18:29:52 +0100 Subject: [PATCH 026/211] do not fail fast --- .github/workflows/docker_build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 03cdd835..858eceed 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: base_image: [ @@ -34,21 +35,20 @@ jobs: - name: Install neurodocker run: python -m pip install --editable .[dev] - - name: Generate Dockerfile apt - if: - contains( ["ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04"], ${{ - matrix.base_image }} ) + - name: Generate Dockerfile run: | + apt_based=("ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04") + if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="apt" + fi yum_based=("fedora:36", "centos:8") - - pkg_manager="apt" if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi - : echo "pkg_manager=${pkg_manager}" + echo "pkg_manager will b: ${pkg_manager}" neurodocker \ generate docker \ From e2cd1f3a539a000c8b2bed916bc752c4991e2ddc Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 18:38:35 +0100 Subject: [PATCH 027/211] add version --- .github/workflows/docker_build.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 858eceed..e31a25b4 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -1,4 +1,4 @@ -name: Docker Image CI +name: freesurfer on: push: @@ -6,10 +6,10 @@ on: pull_request: branches: ["*"] -# fedora:36, ubuntu:22.04, ubuntu:18.04, ubuntu:16.04, centos:8 - jobs: - build: + + freesurfer: + runs-on: ubuntu-latest strategy: @@ -23,6 +23,7 @@ jobs: "ubuntu:18.04", "ubuntu:16.04", ] + version: ["7.3.1", "6.0.0"] steps: - uses: actions/checkout@v3 @@ -54,7 +55,7 @@ jobs: generate docker \ --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ - --freesurfer version=7.3.1 > Dockerfile_tmp + --freesurfer version=${{ matrix.version }} > Dockerfile_tmp - name: Build the Docker image run: docker build -f Dockerfile_tmp . From d5a422b0660de7598c63e03cd8ba6c38913af465 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 19:44:43 +0100 Subject: [PATCH 028/211] add jinja template --- .github/workflows/afni.yml | 54 +++++++++++++++++++++++++++ .github/workflows/create_workflows.py | 54 +++++++++++++++++++++++++++ .github/workflows/docker_build.jinja | 54 +++++++++++++++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 .github/workflows/afni.yml create mode 100644 .github/workflows/create_workflows.py create mode 100644 .github/workflows/docker_build.jinja diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml new file mode 100644 index 00000000..cde1afbd --- /dev/null +++ b/.github/workflows/afni.yml @@ -0,0 +1,54 @@ +name: afni + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +jobs: + + afni: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile + run: | + + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="apt" + fi + + yum_based=('centos:8', 'fedora:36') + if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="yum" + fi + + echo "pkg_manager will be: ${pkg_manager}" + + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=${pkg_manager} \ + --afni > Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py new file mode 100644 index 00000000..27807514 --- /dev/null +++ b/.github/workflows/create_workflows.py @@ -0,0 +1,54 @@ +from pathlib import Path + +from jinja2 import Environment, FileSystemLoader, select_autoescape + +apt_based = ["ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04"] +yum_based = ["centos:8", "fedora:36"] + +softwares: dict[str, list[str]] = {"afni": []} + +output_dir = Path(__file__).parent + +def stringify_list(some_list: list[str]) -> str: + return "'" + "', '".join(some_list) + "'" + + +def main(): + + env = Environment( + loader=FileSystemLoader(Path(__file__).parent), autoescape=select_autoescape() + ) + + template = env.get_template("docker_build.jinja") + + os = { + "apt_based": stringify_list(apt_based), + "yum_based": stringify_list(yum_based), + "all": stringify_list(apt_based + yum_based), + } + + for software, versions in softwares.items(): + + if versions and len(versions) > 0: + wf = { + "os": os, + "software": software, + "add_version": 'yup', + "versions": stringify_list(versions), + } + else: + wf = { + "os": os, + "software": software + } + + print(wf) + + print(template.render(wf=wf)) + + with open(output_dir.joinpath(software).with_suffix('.yml'), 'w') as f: + print(template.render(wf=wf), file=f) + + +if __name__ == "__main__": + main() diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja new file mode 100644 index 00000000..c06d30d7 --- /dev/null +++ b/.github/workflows/docker_build.jinja @@ -0,0 +1,54 @@ +name: {{ wf.software }} + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +jobs: + + {{ wf.software }}: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + base_image: [{{ wf.os.all }}] + {% if wf.add_version %}version: [{{ wf.versions }}]{% endif %} + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile + run: | + + apt_based=({{ wf.os.apt_based }}) + if [[ " ${apt_based[*]} " =~ ${{ '{{' }} matrix.base_image {{ '}}' }} ]]; then + pkg_manager="apt" + fi + + yum_based=({{ wf.os.yum_based }}) + if [[ " ${yum_based[*]} " =~ ${{ '{{' }} matrix.base_image {{ '}}' }} ]]; then + pkg_manager="yum" + fi + + echo "pkg_manager will be: ${pkg_manager}" + + neurodocker \ + generate docker \ + --base-image=${{ '{{' }} matrix.base_image {{ '}}' }} \ + --pkg-manager=${pkg_manager} \ + --{{ wf.software }} {% if wf.add_version %}version=${{ '{{' }} matrix.version {{ '}}' }}{% endif %} > Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . From d201c3f126a620668710872d1273b2a5f9c151ba Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 19:47:29 +0100 Subject: [PATCH 029/211] add jinja template --- .github/workflows/afni.yml | 3 ++- .github/workflows/create_workflows.py | 4 +++- .github/workflows/docker_build.jinja | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index cde1afbd..d3f4ecb6 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -1,3 +1,4 @@ +# This is file is automatically generated. Do not edit. name: afni on: @@ -16,7 +17,7 @@ jobs: fail-fast: false matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] - + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 27807514..ede2e54c 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -31,7 +31,7 @@ def main(): if versions and len(versions) > 0: wf = { - "os": os, + "os": os, "software": software, "add_version": 'yup', "versions": stringify_list(versions), @@ -42,6 +42,8 @@ def main(): "software": software } + wf["header"] = "# This is file is automatically generated. Do not edit." + print(wf) print(template.render(wf=wf)) diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index c06d30d7..68b82665 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -1,3 +1,4 @@ +{{ wf.header }} name: {{ wf.software }} on: From a0da149ee77073d43eb4eceada5ed581a24797a1 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 20:15:45 +0100 Subject: [PATCH 030/211] deal with install method --- .github/workflows/afni.yml | 6 ++++-- .github/workflows/create_workflows.py | 30 +++++++++++++++------------ .github/workflows/docker_build.jinja | 20 +++++++++++++----- 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index d3f4ecb6..15ec4630 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] - + method: ['binaries'] steps: - uses: actions/checkout@v3 @@ -49,7 +49,9 @@ jobs: generate docker \ --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ - --afni > Dockerfile_tmp + --afni \ + method=${{ matrix.method }} \ + > Dockerfile_tmp - name: Build the Docker image run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index ede2e54c..ef43ede6 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -5,18 +5,23 @@ apt_based = ["ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04"] yum_based = ["centos:8", "fedora:36"] -softwares: dict[str, list[str]] = {"afni": []} +softwares: dict[str, list[str]] = {"afni": {"versions": [], "methods": ["binaries"] }} output_dir = Path(__file__).parent def stringify_list(some_list: list[str]) -> str: + if len(some_list) == 1: + return f"'{some_list[0]}'" return "'" + "', '".join(some_list) + "'" def main(): env = Environment( - loader=FileSystemLoader(Path(__file__).parent), autoescape=select_autoescape() + loader=FileSystemLoader(Path(__file__).parent), + autoescape=select_autoescape(), + trim_blocks=True, + lstrip_blocks=True ) template = env.get_template("docker_build.jinja") @@ -27,22 +32,21 @@ def main(): "all": stringify_list(apt_based + yum_based), } - for software, versions in softwares.items(): + for software, spec in softwares.items(): - if versions and len(versions) > 0: - wf = { - "os": os, - "software": software, - "add_version": 'yup', - "versions": stringify_list(versions), - } - else: - wf = { + wf = { + "header": "# This is file is automatically generated. Do not edit.", "os": os, "software": software } - wf["header"] = "# This is file is automatically generated. Do not edit." + if spec["versions"] and len(spec["versions"]) > 0: + wf["add_version"] = 'yup' + wf["versions"] = stringify_list(spec["versions"]) + + if spec["methods"] and len(spec["methods"]) > 0: + wf["add_method"] = 'yup' + wf["methods"] = stringify_list(spec["methods"]) print(wf) diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index 68b82665..d8409cff 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -17,7 +17,12 @@ jobs: fail-fast: false matrix: base_image: [{{ wf.os.all }}] - {% if wf.add_version %}version: [{{ wf.versions }}]{% endif %} + {% if wf.add_version %} + version: [{{ wf.versions }}] + {% endif %} + {% if wf.add_method %} + method: [{{ wf.methods }}] + {% endif %} steps: - uses: actions/checkout@v3 @@ -42,14 +47,19 @@ jobs: if [[ " ${yum_based[*]} " =~ ${{ '{{' }} matrix.base_image {{ '}}' }} ]]; then pkg_manager="yum" fi - - echo "pkg_manager will be: ${pkg_manager}" - + neurodocker \ generate docker \ --base-image=${{ '{{' }} matrix.base_image {{ '}}' }} \ --pkg-manager=${pkg_manager} \ - --{{ wf.software }} {% if wf.add_version %}version=${{ '{{' }} matrix.version {{ '}}' }}{% endif %} > Dockerfile_tmp + --{{ wf.software }} \ + {% if wf.add_version %} + version=${{ '{{' }} matrix.version {{ '}}' }} \ + {% endif %} + {% if wf.add_method %} + method=${{ '{{' }} matrix.method {{ '}}' }} \ + {% endif %} + > Dockerfile_tmp - name: Build the Docker image run: docker build -f Dockerfile_tmp . From 47eeae181f20aa86e06659849affd1b8afd3ae08 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 20:24:36 +0100 Subject: [PATCH 031/211] draw the rest of F owl --- .github/workflows/afni.yml | 6 +- .github/workflows/ants.yml | 57 +++++++++++++++++++ .github/workflows/create_workflows.py | 32 +++++++---- .../{docker_build.yml => freesurfer.yml} | 24 +++----- .github/workflows/fsl.yml | 57 +++++++++++++++++++ .github/workflows/mrtrix3.yml | 57 +++++++++++++++++++ .github/workflows/spm12.yml | 57 +++++++++++++++++++ 7 files changed, 259 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/ants.yml rename .github/workflows/{docker_build.yml => freesurfer.yml} (67%) create mode 100644 .github/workflows/fsl.yml create mode 100644 .github/workflows/mrtrix3.yml create mode 100644 .github/workflows/spm12.yml diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index 15ec4630..c2060d95 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] - method: ['binaries'] + method: ['binaries', 'source'] steps: - uses: actions/checkout@v3 @@ -42,9 +42,7 @@ jobs: if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi - - echo "pkg_manager will be: ${pkg_manager}" - + neurodocker \ generate docker \ --base-image=${{ matrix.base_image }} \ diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml new file mode 100644 index 00000000..6f737e87 --- /dev/null +++ b/.github/workflows/ants.yml @@ -0,0 +1,57 @@ +# This is file is automatically generated. Do not edit. +name: ants + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +jobs: + + ants: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + version: ['2.3.4', '2.0.0'] + method: ['binaries', 'source'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile + run: | + + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="apt" + fi + + yum_based=('centos:8', 'fedora:36') + if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="yum" + fi + + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=${pkg_manager} \ + --ants \ + version=${{ matrix.version }} \ + method=${{ matrix.method }} \ + > Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index ef43ede6..eb665115 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -5,10 +5,18 @@ apt_based = ["ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04"] yum_based = ["centos:8", "fedora:36"] -softwares: dict[str, list[str]] = {"afni": {"versions": [], "methods": ["binaries"] }} +softwares: dict[str, list[str]] = { + "afni": {"versions": [], "methods": ["binaries", "source"]}, + "freesurfer": {"versions": ["7.3.1", "6.0.0"], "methods": []}, + "ants": {"versions": ["2.3.4", "2.0.0"], "methods": ["binaries", "source"]}, + "fsl": {"versions": ["6.0.5.1", "5.0.10"], "methods": ["binaries"]}, + "mrtrix3": {"versions": ["3.0.2", "3.0.0"], "methods": ["binaries", "source"]}, + "spm12": {"versions": ["r7771", "r6225"], "methods": ["binaries"]}, +} output_dir = Path(__file__).parent + def stringify_list(some_list: list[str]) -> str: if len(some_list) == 1: return f"'{some_list[0]}'" @@ -18,10 +26,10 @@ def stringify_list(some_list: list[str]) -> str: def main(): env = Environment( - loader=FileSystemLoader(Path(__file__).parent), - autoescape=select_autoescape(), - trim_blocks=True, - lstrip_blocks=True + loader=FileSystemLoader(Path(__file__).parent), + autoescape=select_autoescape(), + trim_blocks=True, + lstrip_blocks=True, ) template = env.get_template("docker_build.jinja") @@ -35,24 +43,24 @@ def main(): for software, spec in softwares.items(): wf = { - "header": "# This is file is automatically generated. Do not edit.", - "os": os, - "software": software - } + "header": "# This is file is automatically generated. Do not edit.", + "os": os, + "software": software, + } if spec["versions"] and len(spec["versions"]) > 0: - wf["add_version"] = 'yup' + wf["add_version"] = "yup" wf["versions"] = stringify_list(spec["versions"]) if spec["methods"] and len(spec["methods"]) > 0: - wf["add_method"] = 'yup' + wf["add_method"] = "yup" wf["methods"] = stringify_list(spec["methods"]) print(wf) print(template.render(wf=wf)) - with open(output_dir.joinpath(software).with_suffix('.yml'), 'w') as f: + with open(output_dir.joinpath(software).with_suffix(".yml"), "w") as f: print(template.render(wf=wf), file=f) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/freesurfer.yml similarity index 67% rename from .github/workflows/docker_build.yml rename to .github/workflows/freesurfer.yml index e31a25b4..064b77a6 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/freesurfer.yml @@ -1,3 +1,4 @@ +# This is file is automatically generated. Do not edit. name: freesurfer on: @@ -15,15 +16,8 @@ jobs: strategy: fail-fast: false matrix: - base_image: - [ - "fedora:36", - "centos:8", - "ubuntu:22.04", - "ubuntu:18.04", - "ubuntu:16.04", - ] - version: ["7.3.1", "6.0.0"] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + version: ['7.3.1', '6.0.0'] steps: - uses: actions/checkout@v3 @@ -39,23 +33,23 @@ jobs: - name: Generate Dockerfile run: | - apt_based=("ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04") + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi - yum_based=("fedora:36", "centos:8") + yum_based=('centos:8', 'fedora:36') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi - - echo "pkg_manager will b: ${pkg_manager}" - + neurodocker \ generate docker \ --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ - --freesurfer version=${{ matrix.version }} > Dockerfile_tmp + --freesurfer \ + version=${{ matrix.version }} \ + > Dockerfile_tmp - name: Build the Docker image run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml new file mode 100644 index 00000000..98594b14 --- /dev/null +++ b/.github/workflows/fsl.yml @@ -0,0 +1,57 @@ +# This is file is automatically generated. Do not edit. +name: fsl + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +jobs: + + fsl: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + version: ['6.0.5.1', '5.0.10'] + method: ['binaries'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile + run: | + + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="apt" + fi + + yum_based=('centos:8', 'fedora:36') + if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="yum" + fi + + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=${pkg_manager} \ + --fsl \ + version=${{ matrix.version }} \ + method=${{ matrix.method }} \ + > Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml new file mode 100644 index 00000000..2c08b0d0 --- /dev/null +++ b/.github/workflows/mrtrix3.yml @@ -0,0 +1,57 @@ +# This is file is automatically generated. Do not edit. +name: mrtrix3 + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +jobs: + + mrtrix3: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + version: ['3.0.2', '3.0.0'] + method: ['binaries', 'source'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile + run: | + + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="apt" + fi + + yum_based=('centos:8', 'fedora:36') + if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="yum" + fi + + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=${pkg_manager} \ + --mrtrix3 \ + version=${{ matrix.version }} \ + method=${{ matrix.method }} \ + > Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml new file mode 100644 index 00000000..b6bc2ac5 --- /dev/null +++ b/.github/workflows/spm12.yml @@ -0,0 +1,57 @@ +# This is file is automatically generated. Do not edit. +name: spm12 + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +jobs: + + spm12: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + version: ['r7771', 'r6225'] + method: ['binaries'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile + run: | + + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="apt" + fi + + yum_based=('centos:8', 'fedora:36') + if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="yum" + fi + + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=${pkg_manager} \ + --spm12 \ + version=${{ matrix.version }} \ + method=${{ matrix.method }} \ + > Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . From d507c89f07ff1fa46f8ad8269cb7f0b676cf2a47 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 20:31:46 +0100 Subject: [PATCH 032/211] remove centos that fails across the board --- .github/workflows/create_workflows.py | 3 ++- .github/workflows/docker_build.jinja | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index eb665115..db02022b 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -3,7 +3,7 @@ from jinja2 import Environment, FileSystemLoader, select_autoescape apt_based = ["ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04"] -yum_based = ["centos:8", "fedora:36"] +yum_based = ["fedora:36"] softwares: dict[str, list[str]] = { "afni": {"versions": [], "methods": ["binaries", "source"]}, @@ -12,6 +12,7 @@ "fsl": {"versions": ["6.0.5.1", "5.0.10"], "methods": ["binaries"]}, "mrtrix3": {"versions": ["3.0.2", "3.0.0"], "methods": ["binaries", "source"]}, "spm12": {"versions": ["r7771", "r6225"], "methods": ["binaries"]}, + "matlabmcr": {"versions": ["2021b", "2010a"], "methods": ["binaries"]}, } output_dir = Path(__file__).parent diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index d8409cff..2d3f491c 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -47,7 +47,7 @@ jobs: if [[ " ${yum_based[*]} " =~ ${{ '{{' }} matrix.base_image {{ '}}' }} ]]; then pkg_manager="yum" fi - + neurodocker \ generate docker \ --base-image=${{ '{{' }} matrix.base_image {{ '}}' }} \ @@ -61,5 +61,7 @@ jobs: {% endif %} > Dockerfile_tmp + cat Dockerfile_tmp + - name: Build the Docker image run: docker build -f Dockerfile_tmp . From a5ce4d2ba51161ff42e1149d8eecf93593562f2b Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 20:37:25 +0100 Subject: [PATCH 033/211] add matlab mcr --- .github/workflows/afni.yml | 8 +++++--- .github/workflows/ants.yml | 8 +++++--- .github/workflows/freesurfer.yml | 8 +++++--- .github/workflows/fsl.yml | 8 +++++--- .github/workflows/mrtrix3.yml | 8 +++++--- .github/workflows/spm12.yml | 8 +++++--- README.md | 9 +++++++++ 7 files changed, 39 insertions(+), 18 deletions(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index c2060d95..e16afd71 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] method: ['binaries', 'source'] steps: @@ -38,11 +38,11 @@ jobs: pkg_manager="apt" fi - yum_based=('centos:8', 'fedora:36') + yum_based=('fedora:36') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi - + neurodocker \ generate docker \ --base-image=${{ matrix.base_image }} \ @@ -51,5 +51,7 @@ jobs: method=${{ matrix.method }} \ > Dockerfile_tmp + cat Dockerfile_tmp + - name: Build the Docker image run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml index 6f737e87..b9256152 100644 --- a/.github/workflows/ants.yml +++ b/.github/workflows/ants.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] version: ['2.3.4', '2.0.0'] method: ['binaries', 'source'] @@ -39,11 +39,11 @@ jobs: pkg_manager="apt" fi - yum_based=('centos:8', 'fedora:36') + yum_based=('fedora:36') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi - + neurodocker \ generate docker \ --base-image=${{ matrix.base_image }} \ @@ -53,5 +53,7 @@ jobs: method=${{ matrix.method }} \ > Dockerfile_tmp + cat Dockerfile_tmp + - name: Build the Docker image run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml index 064b77a6..1a492c74 100644 --- a/.github/workflows/freesurfer.yml +++ b/.github/workflows/freesurfer.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] version: ['7.3.1', '6.0.0'] steps: @@ -38,11 +38,11 @@ jobs: pkg_manager="apt" fi - yum_based=('centos:8', 'fedora:36') + yum_based=('fedora:36') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi - + neurodocker \ generate docker \ --base-image=${{ matrix.base_image }} \ @@ -51,5 +51,7 @@ jobs: version=${{ matrix.version }} \ > Dockerfile_tmp + cat Dockerfile_tmp + - name: Build the Docker image run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index 98594b14..f46124c5 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] version: ['6.0.5.1', '5.0.10'] method: ['binaries'] @@ -39,11 +39,11 @@ jobs: pkg_manager="apt" fi - yum_based=('centos:8', 'fedora:36') + yum_based=('fedora:36') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi - + neurodocker \ generate docker \ --base-image=${{ matrix.base_image }} \ @@ -53,5 +53,7 @@ jobs: method=${{ matrix.method }} \ > Dockerfile_tmp + cat Dockerfile_tmp + - name: Build the Docker image run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml index 2c08b0d0..5d63f6c0 100644 --- a/.github/workflows/mrtrix3.yml +++ b/.github/workflows/mrtrix3.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] version: ['3.0.2', '3.0.0'] method: ['binaries', 'source'] @@ -39,11 +39,11 @@ jobs: pkg_manager="apt" fi - yum_based=('centos:8', 'fedora:36') + yum_based=('fedora:36') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi - + neurodocker \ generate docker \ --base-image=${{ matrix.base_image }} \ @@ -53,5 +53,7 @@ jobs: method=${{ matrix.method }} \ > Dockerfile_tmp + cat Dockerfile_tmp + - name: Build the Docker image run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml index b6bc2ac5..682431fa 100644 --- a/.github/workflows/spm12.yml +++ b/.github/workflows/spm12.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'centos:8', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] version: ['r7771', 'r6225'] method: ['binaries'] @@ -39,11 +39,11 @@ jobs: pkg_manager="apt" fi - yum_based=('centos:8', 'fedora:36') + yum_based=('fedora:36') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi - + neurodocker \ generate docker \ --base-image=${{ matrix.base_image }} \ @@ -53,5 +53,7 @@ jobs: method=${{ matrix.method }} \ > Dockerfile_tmp + cat Dockerfile_tmp + - name: Build the Docker image run: docker build -f Dockerfile_tmp . diff --git a/README.md b/README.md index 2fed25fb..c0927040 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,15 @@ _Neurodocker_ is a command-line program that generates custom Dockerfiles and Si Please see our website https://www.repronim.org/neurodocker for more information. +# image build status + +[![afni](https://github.com/Remi-Gau/neurodocker/actions/workflows/afni.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/afni.yml) +[![ants](https://github.com/Remi-Gau/neurodocker/actions/workflows/ants.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/ants.yml) +[![freesurfer](https://github.com/Remi-Gau/neurodocker/actions/workflows/freesurfer.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/freesurfer.yml) +[![fsl](https://github.com/Remi-Gau/neurodocker/actions/workflows/fsl.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/fsl.yml) +[![mrtrix3](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml) +[![spm12](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml) + # Installation Use the _Neurodocker_ Docker image (recommended): From 725a2b8a8f623f7f5617eae39c7fd3cd69298988 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 20:48:52 +0100 Subject: [PATCH 034/211] add matlab mcr --- .github/workflows/matlabmcr.yml | 59 +++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/matlabmcr.yml diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml new file mode 100644 index 00000000..3e82f3cb --- /dev/null +++ b/.github/workflows/matlabmcr.yml @@ -0,0 +1,59 @@ +# This is file is automatically generated. Do not edit. +name: matlabmcr + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +jobs: + + matlabmcr: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] + version: ['2021b', '2010a'] + method: ['binaries'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile + run: | + + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="apt" + fi + + yum_based=('fedora:36') + if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="yum" + fi + + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=${pkg_manager} \ + --matlabmcr \ + version=${{ matrix.version }} \ + method=${{ matrix.method }} \ + > Dockerfile_tmp + + cat Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . From dbb7f18d2cd1089217431fdc2f90cff8f2cbe47d Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 21:01:12 +0100 Subject: [PATCH 035/211] add debian and cat12 --- .github/workflows/afni.yml | 6 +-- .github/workflows/ants.yml | 6 +-- .github/workflows/cat12.yml | 59 +++++++++++++++++++++++++++ .github/workflows/create_workflows.py | 17 ++++++-- .github/workflows/freesurfer.yml | 6 +-- .github/workflows/fsl.yml | 6 +-- .github/workflows/matlabmcr.yml | 6 +-- .github/workflows/mrtrix3.yml | 6 +-- .github/workflows/spm12.yml | 6 +-- README.md | 1 + 10 files changed, 94 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/cat12.yml diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index e16afd71..38d2ffb7 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] method: ['binaries', 'source'] steps: @@ -33,12 +33,12 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi - yum_based=('fedora:36') + yum_based=('fedora:36', 'centos:8', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml index b9256152..d2d25da3 100644 --- a/.github/workflows/ants.yml +++ b/.github/workflows/ants.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['2.3.4', '2.0.0'] method: ['binaries', 'source'] @@ -34,12 +34,12 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi - yum_based=('fedora:36') + yum_based=('fedora:36', 'centos:8', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml new file mode 100644 index 00000000..b82850d3 --- /dev/null +++ b/.github/workflows/cat12.yml @@ -0,0 +1,59 @@ +# This is file is automatically generated. Do not edit. +name: cat12 + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +jobs: + + cat12: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + version: ['r1933_R2017b'] + method: ['binaries'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile + run: | + + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') + if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="apt" + fi + + yum_based=('fedora:36', 'centos:8', 'centos:7') + if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="yum" + fi + + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=${pkg_manager} \ + --cat12 \ + version=${{ matrix.version }} \ + method=${{ matrix.method }} \ + > Dockerfile_tmp + + cat Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index db02022b..6eb35e52 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -2,17 +2,26 @@ from jinja2 import Environment, FileSystemLoader, select_autoescape -apt_based = ["ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04"] -yum_based = ["fedora:36"] -softwares: dict[str, list[str]] = { +apt_based = [ + "ubuntu:22.04", + "ubuntu:18.04", + "ubuntu:16.04", + "bullseye-20221219-slim", + "buster-20221219-slim", + "stretch-slim", +] +yum_based = ["fedora:36", "centos:8", "centos:7"] + +softwares: dict[str, dict[str, list[str]]] = { "afni": {"versions": [], "methods": ["binaries", "source"]}, "freesurfer": {"versions": ["7.3.1", "6.0.0"], "methods": []}, "ants": {"versions": ["2.3.4", "2.0.0"], "methods": ["binaries", "source"]}, "fsl": {"versions": ["6.0.5.1", "5.0.10"], "methods": ["binaries"]}, "mrtrix3": {"versions": ["3.0.2", "3.0.0"], "methods": ["binaries", "source"]}, - "spm12": {"versions": ["r7771", "r6225"], "methods": ["binaries"]}, "matlabmcr": {"versions": ["2021b", "2010a"], "methods": ["binaries"]}, + "spm12": {"versions": ["r7771", "r6225"], "methods": ["binaries"]}, + "cat12": {"versions": ["r1933_R2017b"], "methods": ["binaries"]}, } output_dir = Path(__file__).parent diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml index 1a492c74..218c021d 100644 --- a/.github/workflows/freesurfer.yml +++ b/.github/workflows/freesurfer.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['7.3.1', '6.0.0'] steps: @@ -33,12 +33,12 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi - yum_based=('fedora:36') + yum_based=('fedora:36', 'centos:8', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index f46124c5..82e8aee8 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['6.0.5.1', '5.0.10'] method: ['binaries'] @@ -34,12 +34,12 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi - yum_based=('fedora:36') + yum_based=('fedora:36', 'centos:8', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml index 3e82f3cb..f81b6a7c 100644 --- a/.github/workflows/matlabmcr.yml +++ b/.github/workflows/matlabmcr.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['2021b', '2010a'] method: ['binaries'] @@ -34,12 +34,12 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi - yum_based=('fedora:36') + yum_based=('fedora:36', 'centos:8', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml index 5d63f6c0..c35a42f3 100644 --- a/.github/workflows/mrtrix3.yml +++ b/.github/workflows/mrtrix3.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['3.0.2', '3.0.0'] method: ['binaries', 'source'] @@ -34,12 +34,12 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi - yum_based=('fedora:36') + yum_based=('fedora:36', 'centos:8', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml index 682431fa..bef547b7 100644 --- a/.github/workflows/spm12.yml +++ b/.github/workflows/spm12.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'fedora:36'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['r7771', 'r6225'] method: ['binaries'] @@ -34,12 +34,12 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi - yum_based=('fedora:36') + yum_based=('fedora:36', 'centos:8', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/README.md b/README.md index c0927040..7f483a67 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Please see our website https://www.repronim.org/neurodocker for more information [![fsl](https://github.com/Remi-Gau/neurodocker/actions/workflows/fsl.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/fsl.yml) [![mrtrix3](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml) [![spm12](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml) +[![matlabmcr](https://github.com/Remi-Gau/neurodocker/actions/workflows/matlabmcr.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/matlabmcr.yml) # Installation From 879aa1819092b88291d73d62d89ea7bdaeabee31 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 21:02:47 +0100 Subject: [PATCH 036/211] update dashboard --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7f483a67..ea3d754c 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Please see our website https://www.repronim.org/neurodocker for more information [![mrtrix3](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml) [![spm12](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml) [![matlabmcr](https://github.com/Remi-Gau/neurodocker/actions/workflows/matlabmcr.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/matlabmcr.yml) +[![cat12](https://github.com/Remi-Gau/neurodocker/actions/workflows/cat12.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/cat12.yml) # Installation From 2ef1864fca32c0a1b04be44fa6fb519fb3bd375d Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 21:13:56 +0100 Subject: [PATCH 037/211] add intermediate versions --- .github/workflows/create_workflows.py | 18 ++++++++++++------ README.md | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 6eb35e52..7c15a225 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -15,12 +15,18 @@ softwares: dict[str, dict[str, list[str]]] = { "afni": {"versions": [], "methods": ["binaries", "source"]}, - "freesurfer": {"versions": ["7.3.1", "6.0.0"], "methods": []}, - "ants": {"versions": ["2.3.4", "2.0.0"], "methods": ["binaries", "source"]}, - "fsl": {"versions": ["6.0.5.1", "5.0.10"], "methods": ["binaries"]}, - "mrtrix3": {"versions": ["3.0.2", "3.0.0"], "methods": ["binaries", "source"]}, - "matlabmcr": {"versions": ["2021b", "2010a"], "methods": ["binaries"]}, - "spm12": {"versions": ["r7771", "r6225"], "methods": ["binaries"]}, + "freesurfer": {"versions": ["7.3.1", "7.2.0", "7.1.0", "6.0.0"], "methods": []}, + "ants": { + "versions": ["2.3.4", "2.2.0", "2.0.0"], + "methods": ["binaries", "source"], + }, + "fsl": {"versions": ["6.0.5.1", "6.0.0", "5.0.10"], "methods": ["binaries"]}, + "mrtrix3": { + "versions": ["3.0.2", "3.0.1", "3.0.0"], + "methods": ["binaries", "source"], + }, + "matlabmcr": {"versions": ["2021b", "2015a", "2010a"], "methods": ["binaries"]}, + "spm12": {"versions": ["r7771", "r6914", "r6225"], "methods": ["binaries"]}, "cat12": {"versions": ["r1933_R2017b"], "methods": ["binaries"]}, } diff --git a/README.md b/README.md index ea3d754c..f6214679 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Please see our website https://www.repronim.org/neurodocker for more information Use the _Neurodocker_ Docker image (recommended): ```shell -docker run --rm repronim/neurodocker:0.7.0 --help +docker run --rm kaczmarj/neurodocker:0.9.1 --help ``` The Docker images were moved to [repronim/neurodocker](https://hub.docker.com/r/repronim/neurodocker) from [kaczmarj/neurodocker](https://hub.docker.com/r/kaczmarj/neurodocker). From 055d3c52cb889ffc45ebecf66438d28984451752 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 22:09:21 +0100 Subject: [PATCH 038/211] rm old dockerfile --- Dockerfile_u2004_fs73 | 95 ------------------------------------------- 1 file changed, 95 deletions(-) delete mode 100644 Dockerfile_u2004_fs73 diff --git a/Dockerfile_u2004_fs73 b/Dockerfile_u2004_fs73 deleted file mode 100644 index bc4874dc..00000000 --- a/Dockerfile_u2004_fs73 +++ /dev/null @@ -1,95 +0,0 @@ -# Generated by Neurodocker and Reproenv. - -FROM ubuntu:20.04 -ENV OS="Linux" \ - PATH="/opt/freesurfer-7.3.1/bin:/opt/freesurfer-7.3.1/fsfast/bin:/opt/freesurfer-7.3.1/tktools:/opt/freesurfer-7.3.1/mni/bin:$PATH" \ - FREESURFER_HOME="/opt/freesurfer-7.3.1" \ - FREESURFER="/opt/freesurfer-7.3.1" \ - SUBJECTS_DIR="/opt/freesurfer-7.3.1/subjects" \ - LOCAL_DIR="/opt/freesurfer-7.3.1/local" \ - FSFAST_HOME="/opt/freesurfer-7.3.1/fsfast" \ - FMRI_ANALYSIS_DIR="/opt/freesurfer-7.3.1/fsfast" \ - FUNCTIONALS_DIR="/opt/freesurfer-7.3.1/sessions" \ - FS_OVERRIDE="0" \ - FIX_VERTEX_AREA="" \ - FSF_OUTPUT_FORMAT="nii.gz# mni env requirements" \ - MINC_BIN_DIR="/opt/freesurfer-7.3.1/mni/bin" \ - MINC_LIB_DIR="/opt/freesurfer-7.3.1/mni/lib" \ - MNI_DIR="/opt/freesurfer-7.3.1/mni" \ - MNI_DATAPATH="/opt/freesurfer-7.3.1/mni/data" \ - MNI_PERL5LIB="/opt/freesurfer-7.3.1/mni/share/perl5" \ - PERL5LIB="/opt/freesurfer-7.3.1/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-7.3.1 \ - && curl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.1/freesurfer-linux-centos7_x86_64-7.3.1.tar.gz \ - | tar -xz -C /opt/freesurfer-7.3.1 --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' - -# Save specification to JSON. -RUN printf '{ \ - "pkg_manager": "apt", \ - "existing_users": [ \ - "root" \ - ], \ - "instructions": [ \ - { \ - "name": "from_", \ - "kwds": { \ - "base_image": "ubuntu:20.04" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "OS": "Linux", \ - "PATH": "/opt/freesurfer-7.3.1/bin:/opt/freesurfer-7.3.1/fsfast/bin:/opt/freesurfer-7.3.1/tktools:/opt/freesurfer-7.3.1/mni/bin:$PATH", \ - "FREESURFER_HOME": "/opt/freesurfer-7.3.1", \ - "FREESURFER": "/opt/freesurfer-7.3.1", \ - "SUBJECTS_DIR": "/opt/freesurfer-7.3.1/subjects", \ - "LOCAL_DIR": "/opt/freesurfer-7.3.1/local", \ - "FSFAST_HOME": "/opt/freesurfer-7.3.1/fsfast", \ - "FMRI_ANALYSIS_DIR": "/opt/freesurfer-7.3.1/fsfast", \ - "FUNCTIONALS_DIR": "/opt/freesurfer-7.3.1/sessions", \ - "FS_OVERRIDE": "0", \ - "FIX_VERTEX_AREA": "", \ - "FSF_OUTPUT_FORMAT": "nii.gz# mni env requirements", \ - "MINC_BIN_DIR": "/opt/freesurfer-7.3.1/mni/bin", \ - "MINC_LIB_DIR": "/opt/freesurfer-7.3.1/mni/lib", \ - "MNI_DIR": "/opt/freesurfer-7.3.1/mni", \ - "MNI_DATAPATH": "/opt/freesurfer-7.3.1/mni/data", \ - "MNI_PERL5LIB": "/opt/freesurfer-7.3.1/mni/share/perl5", \ - "PERL5LIB": "/opt/freesurfer-7.3.1/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-7.3.1\\ncurl -fL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.1/freesurfer-linux-centos7_x86_64-7.3.1.tar.gz \\\\\\n| tar -xz -C /opt/freesurfer-7.3.1 --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'"'"'" \ - } \ - } \ - ] \ -}' > /.reproenv.json -# End saving to specification to JSON. From 4ca682e90a64f8cc6087294b0cb5ba0a5492e7f7 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 22:18:17 +0100 Subject: [PATCH 039/211] fix name of debian distro --- .github/workflows/afni.yml | 4 ++-- .github/workflows/ants.yml | 6 +++--- .github/workflows/cat12.yml | 4 ++-- .github/workflows/create_workflows.py | 4 ++-- .github/workflows/freesurfer.yml | 6 +++--- .github/workflows/fsl.yml | 6 +++--- .github/workflows/matlabmcr.yml | 6 +++--- .github/workflows/mrtrix3.yml | 6 +++--- .github/workflows/spm12.yml | 6 +++--- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index 38d2ffb7..d3df0326 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] method: ['binaries', 'source'] steps: @@ -33,7 +33,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml index d2d25da3..a50908b6 100644 --- a/.github/workflows/ants.yml +++ b/.github/workflows/ants.yml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] - version: ['2.3.4', '2.0.0'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + version: ['2.3.4', '2.2.0', '2.0.0'] method: ['binaries', 'source'] steps: @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml index b82850d3..b9bb2612 100644 --- a/.github/workflows/cat12.yml +++ b/.github/workflows/cat12.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['r1933_R2017b'] method: ['binaries'] @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 7c15a225..2c96c251 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -7,8 +7,8 @@ "ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04", - "bullseye-20221219-slim", - "buster-20221219-slim", + "debian:bullseye-20221219-slim", + "debian:buster-20221219-slim", "stretch-slim", ] yum_based = ["fedora:36", "centos:8", "centos:7"] diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml index 218c021d..1bad3ac4 100644 --- a/.github/workflows/freesurfer.yml +++ b/.github/workflows/freesurfer.yml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] - version: ['7.3.1', '6.0.0'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + version: ['7.3.1', '7.2.0', '7.1.0', '6.0.0'] steps: - uses: actions/checkout@v3 @@ -33,7 +33,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index 82e8aee8..441a1793 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] - version: ['6.0.5.1', '5.0.10'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + version: ['6.0.5.1', '6.0.0', '5.0.10'] method: ['binaries'] steps: @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml index f81b6a7c..b220cf4f 100644 --- a/.github/workflows/matlabmcr.yml +++ b/.github/workflows/matlabmcr.yml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] - version: ['2021b', '2010a'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + version: ['2021b', '2015a', '2010a'] method: ['binaries'] steps: @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml index c35a42f3..7648cff5 100644 --- a/.github/workflows/mrtrix3.yml +++ b/.github/workflows/mrtrix3.yml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] - version: ['3.0.2', '3.0.0'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + version: ['3.0.2', '3.0.1', '3.0.0'] method: ['binaries', 'source'] steps: @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml index bef547b7..7281539e 100644 --- a/.github/workflows/spm12.yml +++ b/.github/workflows/spm12.yml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] - version: ['r7771', 'r6225'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + version: ['r7771', 'r6914', 'r6225'] method: ['binaries'] steps: @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'bullseye-20221219-slim', 'buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi From 18e11394756cf65678a190b8b3df7e30e790e01b Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 22:22:48 +0100 Subject: [PATCH 040/211] just say yes --- .github/workflows/docker_build.jinja | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index 2d3f491c..f4b779f4 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -52,6 +52,7 @@ jobs: generate docker \ --base-image=${{ '{{' }} matrix.base_image {{ '}}' }} \ --pkg-manager=${pkg_manager} \ + --yes \ --{{ wf.software }} \ {% if wf.add_version %} version=${{ '{{' }} matrix.version {{ '}}' }} \ From 814a3ee7ea99cccb1d51df39fa169de938f71eaf Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 22:28:42 +0100 Subject: [PATCH 041/211] update debian stretch name --- .github/workflows/create_workflows.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 2c96c251..581b778a 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -7,9 +7,9 @@ "ubuntu:22.04", "ubuntu:18.04", "ubuntu:16.04", - "debian:bullseye-20221219-slim", - "debian:buster-20221219-slim", - "stretch-slim", + "debian:bullseye-slim", + "debian:buster-slim", + "debian:stretch-slim", ] yum_based = ["fedora:36", "centos:8", "centos:7"] From e3f05be3e2cd2e4a2bddcb948b4e7104c60397e3 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 23:01:48 +0100 Subject: [PATCH 042/211] actually update the workflows --- .github/workflows/afni.yml | 5 +++-- .github/workflows/ants.yml | 5 +++-- .github/workflows/cat12.yml | 5 +++-- .github/workflows/freesurfer.yml | 5 +++-- .github/workflows/fsl.yml | 5 +++-- .github/workflows/matlabmcr.yml | 5 +++-- .github/workflows/mrtrix3.yml | 5 +++-- .github/workflows/spm12.yml | 5 +++-- 8 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index d3df0326..2ff42808 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] method: ['binaries', 'source'] steps: @@ -33,7 +33,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi @@ -47,6 +47,7 @@ jobs: generate docker \ --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ + --yes \ --afni \ method=${{ matrix.method }} \ > Dockerfile_tmp diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml index a50908b6..fb24cc21 100644 --- a/.github/workflows/ants.yml +++ b/.github/workflows/ants.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['2.3.4', '2.2.0', '2.0.0'] method: ['binaries', 'source'] @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi @@ -48,6 +48,7 @@ jobs: generate docker \ --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ + --yes \ --ants \ version=${{ matrix.version }} \ method=${{ matrix.method }} \ diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml index b9bb2612..306e048c 100644 --- a/.github/workflows/cat12.yml +++ b/.github/workflows/cat12.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['r1933_R2017b'] method: ['binaries'] @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi @@ -48,6 +48,7 @@ jobs: generate docker \ --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ + --yes \ --cat12 \ version=${{ matrix.version }} \ method=${{ matrix.method }} \ diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml index 1bad3ac4..66d8a6f3 100644 --- a/.github/workflows/freesurfer.yml +++ b/.github/workflows/freesurfer.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['7.3.1', '7.2.0', '7.1.0', '6.0.0'] steps: @@ -33,7 +33,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi @@ -47,6 +47,7 @@ jobs: generate docker \ --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ + --yes \ --freesurfer \ version=${{ matrix.version }} \ > Dockerfile_tmp diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index 441a1793..504cf512 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['6.0.5.1', '6.0.0', '5.0.10'] method: ['binaries'] @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi @@ -48,6 +48,7 @@ jobs: generate docker \ --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ + --yes \ --fsl \ version=${{ matrix.version }} \ method=${{ matrix.method }} \ diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml index b220cf4f..610ae543 100644 --- a/.github/workflows/matlabmcr.yml +++ b/.github/workflows/matlabmcr.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['2021b', '2015a', '2010a'] method: ['binaries'] @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi @@ -48,6 +48,7 @@ jobs: generate docker \ --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ + --yes \ --matlabmcr \ version=${{ matrix.version }} \ method=${{ matrix.method }} \ diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml index 7648cff5..fa0ae3ce 100644 --- a/.github/workflows/mrtrix3.yml +++ b/.github/workflows/mrtrix3.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['3.0.2', '3.0.1', '3.0.0'] method: ['binaries', 'source'] @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi @@ -48,6 +48,7 @@ jobs: generate docker \ --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ + --yes \ --mrtrix3 \ version=${{ matrix.version }} \ method=${{ matrix.method }} \ diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml index 7281539e..d6906e90 100644 --- a/.github/workflows/spm12.yml +++ b/.github/workflows/spm12.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] version: ['r7771', 'r6914', 'r6225'] method: ['binaries'] @@ -34,7 +34,7 @@ jobs: - name: Generate Dockerfile run: | - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-20221219-slim', 'debian:buster-20221219-slim', 'stretch-slim') + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="apt" fi @@ -48,6 +48,7 @@ jobs: generate docker \ --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ + --yes \ --spm12 \ version=${{ matrix.version }} \ method=${{ matrix.method }} \ From 1bdf467f744b94c1d7e9d78edc405e8cb4a50827 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 8 Jan 2023 00:13:19 +0100 Subject: [PATCH 043/211] add mcr for ants --- .github/workflows/afni.yml | 2 +- .github/workflows/ants.yml | 2 +- .github/workflows/cat12.yml | 3 ++- .github/workflows/create_workflows.py | 14 +++++++------- .github/workflows/docker_build.jinja | 5 ++++- .github/workflows/freesurfer.yml | 2 +- .github/workflows/fsl.yml | 2 +- .github/workflows/matlabmcr.yml | 2 +- .github/workflows/mrtrix3.yml | 2 +- .github/workflows/spm12.yml | 2 +- 10 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index 2ff42808..3216c9eb 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -1,5 +1,5 @@ # This is file is automatically generated. Do not edit. -name: afni +name: 'afni' on: push: diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml index fb24cc21..8e40c6f6 100644 --- a/.github/workflows/ants.yml +++ b/.github/workflows/ants.yml @@ -1,5 +1,5 @@ # This is file is automatically generated. Do not edit. -name: ants +name: 'ants' on: push: diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml index 306e048c..88ddc41b 100644 --- a/.github/workflows/cat12.yml +++ b/.github/workflows/cat12.yml @@ -1,5 +1,5 @@ # This is file is automatically generated. Do not edit. -name: cat12 +name: 'cat12' on: push: @@ -49,6 +49,7 @@ jobs: --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ --yes \ + --matlabmcr method='binaries' version='2021b' \ --cat12 \ version=${{ matrix.version }} \ method=${{ matrix.method }} \ diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 581b778a..85220e90 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -33,7 +33,7 @@ output_dir = Path(__file__).parent -def stringify_list(some_list: list[str]) -> str: +def stringify(some_list: list[str]) -> str: if len(some_list) == 1: return f"'{some_list[0]}'" return "'" + "', '".join(some_list) + "'" @@ -44,16 +44,16 @@ def main(): env = Environment( loader=FileSystemLoader(Path(__file__).parent), autoescape=select_autoescape(), - trim_blocks=True, lstrip_blocks=True, + trim_blocks=True, ) template = env.get_template("docker_build.jinja") os = { - "apt_based": stringify_list(apt_based), - "yum_based": stringify_list(yum_based), - "all": stringify_list(apt_based + yum_based), + "apt_based": stringify(apt_based), + "yum_based": stringify(yum_based), + "all": stringify(apt_based + yum_based), } for software, spec in softwares.items(): @@ -66,11 +66,11 @@ def main(): if spec["versions"] and len(spec["versions"]) > 0: wf["add_version"] = "yup" - wf["versions"] = stringify_list(spec["versions"]) + wf["versions"] = stringify(spec["versions"]) if spec["methods"] and len(spec["methods"]) > 0: wf["add_method"] = "yup" - wf["methods"] = stringify_list(spec["methods"]) + wf["methods"] = stringify(spec["methods"]) print(wf) diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index f4b779f4..924bab9f 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -1,5 +1,5 @@ {{ wf.header }} -name: {{ wf.software }} +name: '{{ wf.software }}' on: push: @@ -53,6 +53,9 @@ jobs: --base-image=${{ '{{' }} matrix.base_image {{ '}}' }} \ --pkg-manager=${pkg_manager} \ --yes \ + {% if wf.software == 'cat12' %} + --matlabmcr method='binaries' version='2021b' \ + {% endif %} --{{ wf.software }} \ {% if wf.add_version %} version=${{ '{{' }} matrix.version {{ '}}' }} \ diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml index 66d8a6f3..818dea89 100644 --- a/.github/workflows/freesurfer.yml +++ b/.github/workflows/freesurfer.yml @@ -1,5 +1,5 @@ # This is file is automatically generated. Do not edit. -name: freesurfer +name: 'freesurfer' on: push: diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index 504cf512..8eeecd23 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -1,5 +1,5 @@ # This is file is automatically generated. Do not edit. -name: fsl +name: 'fsl' on: push: diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml index 610ae543..7f735244 100644 --- a/.github/workflows/matlabmcr.yml +++ b/.github/workflows/matlabmcr.yml @@ -1,5 +1,5 @@ # This is file is automatically generated. Do not edit. -name: matlabmcr +name: 'matlabmcr' on: push: diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml index fa0ae3ce..348fc662 100644 --- a/.github/workflows/mrtrix3.yml +++ b/.github/workflows/mrtrix3.yml @@ -1,5 +1,5 @@ # This is file is automatically generated. Do not edit. -name: mrtrix3 +name: 'mrtrix3' on: push: diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml index d6906e90..a854d61f 100644 --- a/.github/workflows/spm12.yml +++ b/.github/workflows/spm12.yml @@ -1,5 +1,5 @@ # This is file is automatically generated. Do not edit. -name: spm12 +name: 'spm12' on: push: From 16a534a1d9cc85417bb2ece4ad8f9a100a435209 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 8 Jan 2023 00:17:59 +0100 Subject: [PATCH 044/211] rm centos 8 --- .github/workflows/afni.yml | 4 ++-- .github/workflows/ants.yml | 4 ++-- .github/workflows/cat12.yml | 4 ++-- .github/workflows/create_workflows.py | 2 +- .github/workflows/freesurfer.yml | 4 ++-- .github/workflows/fsl.yml | 4 ++-- .github/workflows/matlabmcr.yml | 4 ++-- .github/workflows/mrtrix3.yml | 4 ++-- .github/workflows/spm12.yml | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index 3216c9eb..2f203110 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] method: ['binaries', 'source'] steps: @@ -38,7 +38,7 @@ jobs: pkg_manager="apt" fi - yum_based=('fedora:36', 'centos:8', 'centos:7') + yum_based=('fedora:36', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml index 8e40c6f6..d3ff78d5 100644 --- a/.github/workflows/ants.yml +++ b/.github/workflows/ants.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['2.3.4', '2.2.0', '2.0.0'] method: ['binaries', 'source'] @@ -39,7 +39,7 @@ jobs: pkg_manager="apt" fi - yum_based=('fedora:36', 'centos:8', 'centos:7') + yum_based=('fedora:36', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml index 88ddc41b..3b01edd5 100644 --- a/.github/workflows/cat12.yml +++ b/.github/workflows/cat12.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['r1933_R2017b'] method: ['binaries'] @@ -39,7 +39,7 @@ jobs: pkg_manager="apt" fi - yum_based=('fedora:36', 'centos:8', 'centos:7') + yum_based=('fedora:36', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 85220e90..643a4807 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -11,7 +11,7 @@ "debian:buster-slim", "debian:stretch-slim", ] -yum_based = ["fedora:36", "centos:8", "centos:7"] +yum_based = ["fedora:36", "centos:7"] softwares: dict[str, dict[str, list[str]]] = { "afni": {"versions": [], "methods": ["binaries", "source"]}, diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml index 818dea89..36362889 100644 --- a/.github/workflows/freesurfer.yml +++ b/.github/workflows/freesurfer.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['7.3.1', '7.2.0', '7.1.0', '6.0.0'] steps: @@ -38,7 +38,7 @@ jobs: pkg_manager="apt" fi - yum_based=('fedora:36', 'centos:8', 'centos:7') + yum_based=('fedora:36', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index 8eeecd23..d2269661 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['6.0.5.1', '6.0.0', '5.0.10'] method: ['binaries'] @@ -39,7 +39,7 @@ jobs: pkg_manager="apt" fi - yum_based=('fedora:36', 'centos:8', 'centos:7') + yum_based=('fedora:36', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml index 7f735244..173ca5c0 100644 --- a/.github/workflows/matlabmcr.yml +++ b/.github/workflows/matlabmcr.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['2021b', '2015a', '2010a'] method: ['binaries'] @@ -39,7 +39,7 @@ jobs: pkg_manager="apt" fi - yum_based=('fedora:36', 'centos:8', 'centos:7') + yum_based=('fedora:36', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml index 348fc662..34ec04c3 100644 --- a/.github/workflows/mrtrix3.yml +++ b/.github/workflows/mrtrix3.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['3.0.2', '3.0.1', '3.0.0'] method: ['binaries', 'source'] @@ -39,7 +39,7 @@ jobs: pkg_manager="apt" fi - yum_based=('fedora:36', 'centos:8', 'centos:7') + yum_based=('fedora:36', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml index a854d61f..561d0772 100644 --- a/.github/workflows/spm12.yml +++ b/.github/workflows/spm12.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:8', 'centos:7'] + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['r7771', 'r6914', 'r6225'] method: ['binaries'] @@ -39,7 +39,7 @@ jobs: pkg_manager="apt" fi - yum_based=('fedora:36', 'centos:8', 'centos:7') + yum_based=('fedora:36', 'centos:7') if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then pkg_manager="yum" fi From 7788dc2e1b8aaf946dc3bbbf83d7bb5cb9ecdf77 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 8 Jan 2023 00:55:16 +0100 Subject: [PATCH 045/211] add afni python option --- .github/workflows/afni.yml | 7 +++++++ .github/workflows/ants.yml | 5 +++++ .github/workflows/cat12.yml | 5 +++++ .github/workflows/create_workflows.py | 18 +++++++++++++----- .github/workflows/docker_build.jinja | 23 ++++++++++++++++------- .github/workflows/freesurfer.yml | 5 +++++ .github/workflows/fsl.yml | 5 +++++ .github/workflows/matlabmcr.yml | 5 +++++ .github/workflows/mrtrix3.yml | 5 +++++ .github/workflows/spm12.yml | 5 +++++ 10 files changed, 71 insertions(+), 12 deletions(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index 2f203110..187996a6 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -7,6 +7,10 @@ on: pull_request: branches: ["*"] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: afni: @@ -18,6 +22,8 @@ jobs: matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] method: ['binaries', 'source'] + afni_python: ['true', 'false'] + steps: - uses: actions/checkout@v3 @@ -50,6 +56,7 @@ jobs: --yes \ --afni \ method=${{ matrix.method }} \ + install_python3=${{ matrix.afni_python }} \ > Dockerfile_tmp cat Dockerfile_tmp diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml index d3ff78d5..5b82440c 100644 --- a/.github/workflows/ants.yml +++ b/.github/workflows/ants.yml @@ -7,6 +7,10 @@ on: pull_request: branches: ["*"] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: ants: @@ -19,6 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['2.3.4', '2.2.0', '2.0.0'] method: ['binaries', 'source'] + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml index 3b01edd5..94fc208b 100644 --- a/.github/workflows/cat12.yml +++ b/.github/workflows/cat12.yml @@ -7,6 +7,10 @@ on: pull_request: branches: ["*"] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: cat12: @@ -19,6 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['r1933_R2017b'] method: ['binaries'] + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 643a4807..7792d27f 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -14,7 +14,11 @@ yum_based = ["fedora:36", "centos:7"] softwares: dict[str, dict[str, list[str]]] = { - "afni": {"versions": [], "methods": ["binaries", "source"]}, + "afni": { + "versions": [], + "methods": ["binaries", "source"], + "afni_python": ["true", "false"], + }, "freesurfer": {"versions": ["7.3.1", "7.2.0", "7.1.0", "6.0.0"], "methods": []}, "ants": { "versions": ["2.3.4", "2.2.0", "2.0.0"], @@ -64,14 +68,18 @@ def main(): "software": software, } - if spec["versions"] and len(spec["versions"]) > 0: - wf["add_version"] = "yup" + if spec.get("versions") is not None and len(spec["versions"]) > 0: + wf["add_version"] = True wf["versions"] = stringify(spec["versions"]) - if spec["methods"] and len(spec["methods"]) > 0: - wf["add_method"] = "yup" + if spec.get("methods") is not None and len(spec["methods"]) > 0: + wf["add_method"] = True wf["methods"] = stringify(spec["methods"]) + if spec.get("afni_python") is not None and len(spec["afni_python"]) > 0: + wf["add_afni_python"] = True + wf["afni_python"] = stringify(spec["afni_python"]) + print(wf) print(template.render(wf=wf)) diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index 924bab9f..870de666 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -7,6 +7,10 @@ on: pull_request: branches: ["*"] +concurrency: + group: ${{ '{{' }} github.workflow {{ '}}' }}-${{ '{{' }} github.ref {{ '}}' }} + cancel-in-progress: true + jobs: {{ wf.software }}: @@ -23,6 +27,9 @@ jobs: {% if wf.add_method %} method: [{{ wf.methods }}] {% endif %} + {% if wf.add_afni_python %} + afni_python: [{{ wf.afni_python }}] + {% endif %} steps: - uses: actions/checkout@v3 @@ -53,17 +60,19 @@ jobs: --base-image=${{ '{{' }} matrix.base_image {{ '}}' }} \ --pkg-manager=${pkg_manager} \ --yes \ - {% if wf.software == 'cat12' %} +{% if wf.software == 'cat12' %} --matlabmcr method='binaries' version='2021b' \ - {% endif %} +{% endif %} --{{ wf.software }} \ - {% if wf.add_version %} +{% if wf.add_version %} version=${{ '{{' }} matrix.version {{ '}}' }} \ - {% endif %} - {% if wf.add_method %} +{% endif %} +{% if wf.add_method %} method=${{ '{{' }} matrix.method {{ '}}' }} \ - {% endif %} - > Dockerfile_tmp +{% endif %} +{% if wf.add_afni_python %} + install_python3=${{ '{{' }} matrix.afni_python {{ '}}' }} \ +{% endif %} > Dockerfile_tmp cat Dockerfile_tmp diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml index 36362889..ebb6f543 100644 --- a/.github/workflows/freesurfer.yml +++ b/.github/workflows/freesurfer.yml @@ -7,6 +7,10 @@ on: pull_request: branches: ["*"] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: freesurfer: @@ -18,6 +22,7 @@ jobs: matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['7.3.1', '7.2.0', '7.1.0', '6.0.0'] + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index d2269661..35aac988 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -7,6 +7,10 @@ on: pull_request: branches: ["*"] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: fsl: @@ -19,6 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['6.0.5.1', '6.0.0', '5.0.10'] method: ['binaries'] + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml index 173ca5c0..421dabfe 100644 --- a/.github/workflows/matlabmcr.yml +++ b/.github/workflows/matlabmcr.yml @@ -7,6 +7,10 @@ on: pull_request: branches: ["*"] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: matlabmcr: @@ -19,6 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['2021b', '2015a', '2010a'] method: ['binaries'] + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml index 34ec04c3..d969d9a7 100644 --- a/.github/workflows/mrtrix3.yml +++ b/.github/workflows/mrtrix3.yml @@ -7,6 +7,10 @@ on: pull_request: branches: ["*"] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: mrtrix3: @@ -19,6 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['3.0.2', '3.0.1', '3.0.0'] method: ['binaries', 'source'] + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml index 561d0772..ee9ddefd 100644 --- a/.github/workflows/spm12.yml +++ b/.github/workflows/spm12.yml @@ -7,6 +7,10 @@ on: pull_request: branches: ["*"] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: spm12: @@ -19,6 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['r7771', 'r6914', 'r6225'] method: ['binaries'] + steps: - uses: actions/checkout@v3 From 54c4e19b3354ad93c7f0d94e57f956a7821da1bb Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 8 Jan 2023 02:22:04 +0100 Subject: [PATCH 046/211] update to mcr base version and ants mcr dependency version --- .github/workflows/cat12.yml | 2 +- .github/workflows/create_workflows.py | 2 +- .github/workflows/docker_build.jinja | 2 +- .github/workflows/matlabmcr.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml index 94fc208b..c34409e0 100644 --- a/.github/workflows/cat12.yml +++ b/.github/workflows/cat12.yml @@ -54,7 +54,7 @@ jobs: --base-image=${{ matrix.base_image }} \ --pkg-manager=${pkg_manager} \ --yes \ - --matlabmcr method='binaries' version='2021b' \ + --matlabmcr method='binaries' version='2017b' \ --cat12 \ version=${{ matrix.version }} \ method=${{ matrix.method }} \ diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 7792d27f..a494fc7c 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -29,7 +29,7 @@ "versions": ["3.0.2", "3.0.1", "3.0.0"], "methods": ["binaries", "source"], }, - "matlabmcr": {"versions": ["2021b", "2015a", "2010a"], "methods": ["binaries"]}, + "matlabmcr": {"versions": ["2021b", "2015a", "2012a", "2010a"], "methods": ["binaries"]}, "spm12": {"versions": ["r7771", "r6914", "r6225"], "methods": ["binaries"]}, "cat12": {"versions": ["r1933_R2017b"], "methods": ["binaries"]}, } diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index 870de666..f9c40d0e 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -61,7 +61,7 @@ jobs: --pkg-manager=${pkg_manager} \ --yes \ {% if wf.software == 'cat12' %} - --matlabmcr method='binaries' version='2021b' \ + --matlabmcr method='binaries' version='2017b' \ {% endif %} --{{ wf.software }} \ {% if wf.add_version %} diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml index 421dabfe..272f35a8 100644 --- a/.github/workflows/matlabmcr.yml +++ b/.github/workflows/matlabmcr.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['2021b', '2015a', '2010a'] + version: ['2021b', '2015a', '2012a', '2010a'] method: ['binaries'] From 19c47bc212b7af8f1813756b954c82c964a35cb2 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 8 Jan 2023 02:46:09 +0100 Subject: [PATCH 047/211] add fsl versions$ --- .github/workflows/create_workflows.py | 11 +++++++++-- .github/workflows/fsl.yml | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index a494fc7c..64cd9ab8 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -24,16 +24,23 @@ "versions": ["2.3.4", "2.2.0", "2.0.0"], "methods": ["binaries", "source"], }, - "fsl": {"versions": ["6.0.5.1", "6.0.0", "5.0.10"], "methods": ["binaries"]}, + "fsl": { + "versions": ["6.0.5.1", "6.0.4", "6.0.3", "6.0.2", "6.0.1", "6.0.0", "5.0.10"], + "methods": ["binaries"], + }, "mrtrix3": { "versions": ["3.0.2", "3.0.1", "3.0.0"], "methods": ["binaries", "source"], }, - "matlabmcr": {"versions": ["2021b", "2015a", "2012a", "2010a"], "methods": ["binaries"]}, + "matlabmcr": { + "versions": ["2021b", "2015a", "2012a", "2010a"], + "methods": ["binaries"], + }, "spm12": {"versions": ["r7771", "r6914", "r6225"], "methods": ["binaries"]}, "cat12": {"versions": ["r1933_R2017b"], "methods": ["binaries"]}, } + output_dir = Path(__file__).parent diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index 35aac988..1466827a 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['6.0.5.1', '6.0.0', '5.0.10'] + version: ['6.0.5.1', '6.0.4', '6.0.3', '6.0.2', '6.0.1', '6.0.0', '5.0.10'] method: ['binaries'] From 2316725fd0998563dceb7112c3d3dcd4a234ad87 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 8 Jan 2023 04:29:07 +0100 Subject: [PATCH 048/211] rm - --- neurodocker/templates/afni.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neurodocker/templates/afni.yaml b/neurodocker/templates/afni.yaml index 40d75791..deedc191 100644 --- a/neurodocker/templates/afni.yaml +++ b/neurodocker/templates/afni.yaml @@ -70,7 +70,7 @@ binaries: instructions: | {{ self.install_dependencies() }} {% if self.install_python3.lower() in ["true", "1", "y"] -%} - {{ self.install(["python3"]) }} + {{ self.install(["python3"]) -}} pip3 install matplotlib {%- endif %} gsl_path="$(find / -name 'libgsl.so.??' || printf '')" From 2355a0389a2bf09bc01591e58b440b0540d48603 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 08:53:11 +0000 Subject: [PATCH 049/211] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/afni.yml | 2 +- .github/workflows/ants.yml | 2 +- .github/workflows/cat12.yml | 2 +- .github/workflows/docker_build.jinja | 2 +- .github/workflows/freesurfer.yml | 2 +- .github/workflows/fsl.yml | 2 +- .github/workflows/matlabmcr.yml | 2 +- .github/workflows/mrtrix3.yml | 2 +- .github/workflows/spm12.yml | 2 +- docs/user_guide/installation.rst | 2 +- docs/user_guide/quickstart.rst | 4 ++-- neurodocker/reproenv/schemas/renderer.json | 2 +- neurodocker/templates/ants.yaml | 2 -- 13 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index 187996a6..5c97cc53 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -23,7 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] method: ['binaries', 'source'] afni_python: ['true', 'false'] - + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml index 5b82440c..73eaadb6 100644 --- a/.github/workflows/ants.yml +++ b/.github/workflows/ants.yml @@ -23,7 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['2.3.4', '2.2.0', '2.0.0'] method: ['binaries', 'source'] - + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml index c34409e0..28c0f980 100644 --- a/.github/workflows/cat12.yml +++ b/.github/workflows/cat12.yml @@ -23,7 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['r1933_R2017b'] method: ['binaries'] - + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index f9c40d0e..16c89792 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -29,7 +29,7 @@ jobs: {% endif %} {% if wf.add_afni_python %} afni_python: [{{ wf.afni_python }}] - {% endif %} + {% endif %} steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml index ebb6f543..63f91b20 100644 --- a/.github/workflows/freesurfer.yml +++ b/.github/workflows/freesurfer.yml @@ -22,7 +22,7 @@ jobs: matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['7.3.1', '7.2.0', '7.1.0', '6.0.0'] - + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index 1466827a..e2b5636d 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -23,7 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['6.0.5.1', '6.0.4', '6.0.3', '6.0.2', '6.0.1', '6.0.0', '5.0.10'] method: ['binaries'] - + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml index 272f35a8..2251553f 100644 --- a/.github/workflows/matlabmcr.yml +++ b/.github/workflows/matlabmcr.yml @@ -23,7 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['2021b', '2015a', '2012a', '2010a'] method: ['binaries'] - + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml index d969d9a7..efea0c27 100644 --- a/.github/workflows/mrtrix3.yml +++ b/.github/workflows/mrtrix3.yml @@ -23,7 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['3.0.2', '3.0.1', '3.0.0'] method: ['binaries', 'source'] - + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml index ee9ddefd..4efeb8e6 100644 --- a/.github/workflows/spm12.yml +++ b/.github/workflows/spm12.yml @@ -23,7 +23,7 @@ jobs: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] version: ['r7771', 'r6914', 'r6225'] method: ['binaries'] - + steps: - uses: actions/checkout@v3 diff --git a/docs/user_guide/installation.rst b/docs/user_guide/installation.rst index bf161777..4725623c 100644 --- a/docs/user_guide/installation.rst +++ b/docs/user_guide/installation.rst @@ -29,7 +29,7 @@ the Neurodocker Python API. Python 3.7 or newer is required. conda ----- -We recommend using a virtual environment or a :code:`conda` environment. +We recommend using a virtual environment or a :code:`conda` environment. In order to create a new :code:`conda` environment and install Neurodocker: .. code-block:: bash diff --git a/docs/user_guide/quickstart.rst b/docs/user_guide/quickstart.rst index a98cec1e..3334bace 100644 --- a/docs/user_guide/quickstart.rst +++ b/docs/user_guide/quickstart.rst @@ -62,8 +62,8 @@ Feel free to create a new notebook and :code:`import nipype`. Singularity ~~~~~~~~~~~ -In most cases the only difference between generating Dockerfile and -`Singularity definition file `_ (the file that is used to create a Singularity container) is in +In most cases the only difference between generating Dockerfile and +`Singularity definition file `_ (the file that is used to create a Singularity container) is in a form of :code:`neurodocker generate` command, `neurodocker generate singularity` has to be used instead of :code:`neurodocker generate docker`. **This requires having `Singularity `_ installed first.** diff --git a/neurodocker/reproenv/schemas/renderer.json b/neurodocker/reproenv/schemas/renderer.json index 7e5073e6..d01880de 100644 --- a/neurodocker/reproenv/schemas/renderer.json +++ b/neurodocker/reproenv/schemas/renderer.json @@ -394,4 +394,4 @@ "additionalProperties": false } } -} \ No newline at end of file +} diff --git a/neurodocker/templates/ants.yaml b/neurodocker/templates/ants.yaml index e6e3d2b9..d7df1a12 100644 --- a/neurodocker/templates/ants.yaml +++ b/neurodocker/templates/ants.yaml @@ -85,5 +85,3 @@ source: mv ../Scripts/* {{ self.install_path }} ; \ fi rm -rf /tmp/ants - - \ No newline at end of file From 7705a0715ec474719d91f4a200e3c9cccef5fe43 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 10 Jan 2023 10:11:54 +0100 Subject: [PATCH 050/211] Update README.md --- README.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index f6214679..a3d4b506 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,6 @@ _Neurodocker_ is a command-line program that generates custom Dockerfiles and Si Please see our website https://www.repronim.org/neurodocker for more information. -# image build status - -[![afni](https://github.com/Remi-Gau/neurodocker/actions/workflows/afni.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/afni.yml) -[![ants](https://github.com/Remi-Gau/neurodocker/actions/workflows/ants.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/ants.yml) -[![freesurfer](https://github.com/Remi-Gau/neurodocker/actions/workflows/freesurfer.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/freesurfer.yml) -[![fsl](https://github.com/Remi-Gau/neurodocker/actions/workflows/fsl.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/fsl.yml) -[![mrtrix3](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml) -[![spm12](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml) -[![matlabmcr](https://github.com/Remi-Gau/neurodocker/actions/workflows/matlabmcr.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/matlabmcr.yml) -[![cat12](https://github.com/Remi-Gau/neurodocker/actions/workflows/cat12.yml/badge.svg)](https://github.com/Remi-Gau/neurodocker/actions/workflows/cat12.yml) - # Installation Use the _Neurodocker_ Docker image (recommended): @@ -59,3 +48,8 @@ python -m pip install --no-cache-dir --editable .[all] ``` Before committing changes, initialize `pre-commit` with `pre-commit install`. This will format code with each commit to keep the style consistent. _Neurodocker_ uses `black` for formatting. + + +## Build status + +[![](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg)](https://github.com/Remi-Gau/neurodocker?branch=test_build) From 0f71109e9ae377d84923e8b365c5201c949117cd Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 10 Jan 2023 10:42:40 +0100 Subject: [PATCH 051/211] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3d4b506..a2f8f40e 100644 --- a/README.md +++ b/README.md @@ -52,4 +52,10 @@ Before committing changes, initialize `pre-commit` with `pre-commit install`. Th ## Build status -[![](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg)](https://github.com/Remi-Gau/neurodocker?branch=test_build) +http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build + +[![](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build)](https://github.com/Remi-Gau/neurodocker?branch=test_build) + +http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=spm12 + +[![](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=spm12)](https://github.com/Remi-Gau/neurodocker?branch=test_build) From 6ee813e0e46a16c503b4fd0c654879a29d92e370 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Wed, 11 Jan 2023 07:42:24 -0500 Subject: [PATCH 052/211] remove empty lines --- neurodocker/reproenv/renderers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/neurodocker/reproenv/renderers.py b/neurodocker/reproenv/renderers.py index a14e1a46..f2071f70 100644 --- a/neurodocker/reproenv/renderers.py +++ b/neurodocker/reproenv/renderers.py @@ -717,6 +717,8 @@ def _indent_run_instruction(string: str, indent=4) -> str: lines = string.splitlines() for ii, line in enumerate(lines): line = line.rstrip() + if not line: + continue is_last_line = ii == len(lines) - 1 already_cont = line.startswith(("&&", "&", "||", "|", "fi")) is_comment = line.startswith("#") From f7048d0e6ad2b35d1797654a6a78a8c2a3b6f114 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 14 Jan 2023 14:01:42 +0100 Subject: [PATCH 053/211] test all versions --- .github/workflows/afni.yml | 3 +- .github/workflows/ants.yml | 3 +- .github/workflows/cat12.yml | 1 - .github/workflows/create_workflows.py | 42 ++++++++++++++++++++------- .github/workflows/freesurfer.yml | 3 +- .github/workflows/fsl.yml | 3 +- .github/workflows/matlabmcr.yml | 3 +- .github/workflows/mrtrix3.yml | 1 - .github/workflows/spm12.yml | 3 +- 9 files changed, 38 insertions(+), 24 deletions(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index 5c97cc53..90bfe5fd 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -21,10 +21,10 @@ jobs: fail-fast: false matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] + version: ['latest'] method: ['binaries', 'source'] afni_python: ['true', 'false'] - steps: - uses: actions/checkout@v3 @@ -55,6 +55,7 @@ jobs: --pkg-manager=${pkg_manager} \ --yes \ --afni \ + version=${{ matrix.version }} \ method=${{ matrix.method }} \ install_python3=${{ matrix.afni_python }} \ > Dockerfile_tmp diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml index 73eaadb6..bb4f709f 100644 --- a/.github/workflows/ants.yml +++ b/.github/workflows/ants.yml @@ -21,10 +21,9 @@ jobs: fail-fast: false matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['2.3.4', '2.2.0', '2.0.0'] + version: ['2.3.4', '2.3.2', '2.3.1', '2.3.0', '2.2.0', '2.1.0', '2.0.3', '2.0.0'] method: ['binaries', 'source'] - steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml index 28c0f980..d0dca741 100644 --- a/.github/workflows/cat12.yml +++ b/.github/workflows/cat12.yml @@ -24,7 +24,6 @@ jobs: version: ['r1933_R2017b'] method: ['binaries'] - steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 64cd9ab8..52fc324c 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -1,8 +1,8 @@ from pathlib import Path +import yaml # type: ignore from jinja2 import Environment, FileSystemLoader, select_autoescape - apt_based = [ "ubuntu:22.04", "ubuntu:18.04", @@ -13,35 +13,51 @@ ] yum_based = ["fedora:36", "centos:7"] +""" +Add a "skip_versions" key to the software dictionary if you want to skip +testing a specific version. For example, if you want to skip testing +version 1.0.0 of afni, add the following to the software dictionary: + + "afni": { + "skip_versions": ["1.0.0"], + "methods": ["binaries", "source"], + "afni_python": ["true", "false"], + }, + +""" softwares: dict[str, dict[str, list[str]]] = { "afni": { - "versions": [], "methods": ["binaries", "source"], "afni_python": ["true", "false"], }, - "freesurfer": {"versions": ["7.3.1", "7.2.0", "7.1.0", "6.0.0"], "methods": []}, + "freesurfer": {"methods": []}, "ants": { - "versions": ["2.3.4", "2.2.0", "2.0.0"], "methods": ["binaries", "source"], }, "fsl": { - "versions": ["6.0.5.1", "6.0.4", "6.0.3", "6.0.2", "6.0.1", "6.0.0", "5.0.10"], "methods": ["binaries"], }, "mrtrix3": { - "versions": ["3.0.2", "3.0.1", "3.0.0"], "methods": ["binaries", "source"], }, "matlabmcr": { - "versions": ["2021b", "2015a", "2012a", "2010a"], "methods": ["binaries"], }, - "spm12": {"versions": ["r7771", "r6914", "r6225"], "methods": ["binaries"]}, - "cat12": {"versions": ["r1933_R2017b"], "methods": ["binaries"]}, + "spm12": {"methods": ["binaries"]}, + "cat12": {"methods": ["binaries"]}, } output_dir = Path(__file__).parent +template_folder = Path(__file__).parents[2].joinpath("neurodocker", "templates") + + +def get_versions_from_neurodocker_template(software: str) -> list[str]: + """Load the list of versions to test from the software template.""" + template = template_folder.joinpath(software).with_suffix(".yaml") + with open(template, "r") as f: + data = yaml.load(f, Loader=yaml.FullLoader) + return list(data["binaries"]["urls"].keys()) def stringify(some_list: list[str]) -> str: @@ -75,9 +91,13 @@ def main(): "software": software, } - if spec.get("versions") is not None and len(spec["versions"]) > 0: + versions = get_versions_from_neurodocker_template(software) + for i in spec.get("skip_versions", []): + versions.remove(i) + + if versions is not None and len(versions) > 0: wf["add_version"] = True - wf["versions"] = stringify(spec["versions"]) + wf["versions"] = stringify(versions) if spec.get("methods") is not None and len(spec["methods"]) > 0: wf["add_method"] = True diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml index 63f91b20..2c321761 100644 --- a/.github/workflows/freesurfer.yml +++ b/.github/workflows/freesurfer.yml @@ -21,8 +21,7 @@ jobs: fail-fast: false matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['7.3.1', '7.2.0', '7.1.0', '6.0.0'] - + version: ['7.3.1', '7.3.0', '7.2.0', '7.1.1', '7.1.1-min', '7.1.0', '6.0.1', '6.0.0', '6.0.0-min'] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index e2b5636d..7eb142a2 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -21,10 +21,9 @@ jobs: fail-fast: false matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['6.0.5.1', '6.0.4', '6.0.3', '6.0.2', '6.0.1', '6.0.0', '5.0.10'] + version: ['6.0.5.1', '6.0.5', '6.0.4', '6.0.3', '6.0.2', '6.0.1', '6.0.0', '5.0.11', '5.0.10', '5.0.9', '5.0.8'] method: ['binaries'] - steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml index 2251553f..8c53ee5f 100644 --- a/.github/workflows/matlabmcr.yml +++ b/.github/workflows/matlabmcr.yml @@ -21,10 +21,9 @@ jobs: fail-fast: false matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['2021b', '2015a', '2012a', '2010a'] + version: ['2021b', '2021a', '2020b', '2020a', '2019b', '2019a', '2018b', '2018a', '2017b', '2017a', '2016b', '2016a', '2015b', '2015aSP1', '2015a', '2014a', '2014b', '2013b', '2013a', '2012b', '2012a', '2010a'] method: ['binaries'] - steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml index efea0c27..796a6cc8 100644 --- a/.github/workflows/mrtrix3.yml +++ b/.github/workflows/mrtrix3.yml @@ -24,7 +24,6 @@ jobs: version: ['3.0.2', '3.0.1', '3.0.0'] method: ['binaries', 'source'] - steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml index 4efeb8e6..f946d4b7 100644 --- a/.github/workflows/spm12.yml +++ b/.github/workflows/spm12.yml @@ -21,10 +21,9 @@ jobs: fail-fast: false matrix: base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['r7771', 'r6914', 'r6225'] + version: ['r7771', 'r7487', 'r7219', 'r6914', 'r6685', 'r6472', 'r6225'] method: ['binaries'] - steps: - uses: actions/checkout@v3 From f63915e060a55e3267e6df9b8e3bcd5bd459a123 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 14 Jan 2023 14:04:32 +0100 Subject: [PATCH 054/211] add other softwares --- .github/workflows/create_workflows.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 52fc324c..9259cabf 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -30,21 +30,26 @@ "methods": ["binaries", "source"], "afni_python": ["true", "false"], }, - "freesurfer": {"methods": []}, "ants": { "methods": ["binaries", "source"], }, + "cat12": {"methods": ["binaries"]}, + "convert3d": {"methods": ["binaries"]}, + "dcm2niix": { + "methods": ["binaries", "source"], + }, + "freesurfer": {"methods": []}, "fsl": { "methods": ["binaries"], }, - "mrtrix3": { - "methods": ["binaries", "source"], - }, "matlabmcr": { "methods": ["binaries"], }, + "mricron": {"methods": ["binaries"]}, + "mrtrix3": { + "methods": ["binaries", "source"], + }, "spm12": {"methods": ["binaries"]}, - "cat12": {"methods": ["binaries"]}, } From b42fb1208db6e45bb4cd53708e4efa7239eb3dd1 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 14 Jan 2023 14:39:59 +0100 Subject: [PATCH 055/211] add more softwares, a dashboard and cron schedule to run the builds --- .github/workflows/convert3d.yml | 64 ++++++++++++++++ .github/workflows/create_workflows.py | 73 ++++++++++++++++-- .github/workflows/dcm2niix.yml | 64 ++++++++++++++++ .github/workflows/docker_build.jinja | 21 ++++++ .github/workflows/mricron.yml | 64 ++++++++++++++++ README.md | 10 +-- build_dashboard.md | 104 ++++++++++++++++++++++++++ 7 files changed, 387 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/convert3d.yml create mode 100644 .github/workflows/dcm2niix.yml create mode 100644 .github/workflows/mricron.yml create mode 100644 build_dashboard.md diff --git a/.github/workflows/convert3d.yml b/.github/workflows/convert3d.yml new file mode 100644 index 00000000..f9bcba82 --- /dev/null +++ b/.github/workflows/convert3d.yml @@ -0,0 +1,64 @@ +# This is file is automatically generated. Do not edit. +name: 'convert3d' + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + convert3d: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] + version: ['nightly', '1.0.0'] + method: ['binaries'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile + run: | + + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') + if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="apt" + fi + + yum_based=('fedora:36', 'centos:7') + if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="yum" + fi + + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=${pkg_manager} \ + --yes \ + --convert3d \ + version=${{ matrix.version }} \ + method=${{ matrix.method }} \ + > Dockerfile_tmp + + cat Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 9259cabf..4b439ce9 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -1,3 +1,23 @@ +""" +This scripts uses a jinja template to create CI workflows to test: + + - different linux distributions (split by the package manager they use) + - different softwares that neurodocker supports + - different install method for a given software + +All of those are defined in a python dictionary. + +Versions to install are read from the neurodocker template for a given software. +It is possible to skip a version by adding a "skip_versions" key to the software. + +Each workflow: + + - installs the latest version of neurodocker + - builds a dockerfile for a combination of OS / software / version / install method + - cat the dockerfile + - attempts to build the corresponding image + +""" from pathlib import Path import yaml # type: ignore @@ -52,10 +72,50 @@ "spm12": {"methods": ["binaries"]}, } - output_dir = Path(__file__).parent template_folder = Path(__file__).parents[2].joinpath("neurodocker", "templates") +build_dashboard_file = Path(__file__).parents[2].joinpath("build_dashboard.md") +branch = "test_build" # "master" +repo = "Remi-Gau/neurodocker" # "ReproNim/neurodocker" + + +def create_dashboard_file(): + """Create a build dashboard file.""" + + print("creating build dashboard file...") + print(build_dashboard_file) + + gh_actions_url = "http://github-actions.40ants.com/" + + with open(build_dashboard_file, "w") as f: + + image_base_url = f"{gh_actions_url}{repo}/matrix.svg?branch={branch}" + print( + """ +# Build dashboard) + + +""", + file=f, + ) + + for software, _ in softwares.items(): + + image_url = f"{image_base_url}&only={software}" + print( + f""" +## {software} + +[github actions workflow](https://github.com/{repo}/actions/workflows/{software}.yml) + +[![{software} build status]({image_url})] + + +""", + file=f, + ) + def get_versions_from_neurodocker_template(software: str) -> list[str]: """Load the list of versions to test from the software template.""" @@ -112,13 +172,14 @@ def main(): wf["add_afni_python"] = True wf["afni_python"] = stringify(spec["afni_python"]) - print(wf) - - print(template.render(wf=wf)) - - with open(output_dir.joinpath(software).with_suffix(".yml"), "w") as f: + output_file = output_dir.joinpath(software).with_suffix(".yml") + print("creating workflow") + print(f"{output_file}") + with open(output_file, "w") as f: print(template.render(wf=wf), file=f) + create_dashboard_file() + if __name__ == "__main__": main() diff --git a/.github/workflows/dcm2niix.yml b/.github/workflows/dcm2niix.yml new file mode 100644 index 00000000..9a65b337 --- /dev/null +++ b/.github/workflows/dcm2niix.yml @@ -0,0 +1,64 @@ +# This is file is automatically generated. Do not edit. +name: 'dcm2niix' + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + dcm2niix: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] + version: ['latest', 'v1.0.20201102', 'v1.0.20200331', 'v1.0.20190902'] + method: ['binaries', 'source'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile + run: | + + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') + if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="apt" + fi + + yum_based=('fedora:36', 'centos:7') + if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="yum" + fi + + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=${pkg_manager} \ + --yes \ + --dcm2niix \ + version=${{ matrix.version }} \ + method=${{ matrix.method }} \ + > Dockerfile_tmp + + cat Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index 16c89792..c74b2cab 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -1,12 +1,33 @@ {{ wf.header }} name: '{{ wf.software }}' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ '{{' }} github.workflow {{ '}}' }}-${{ '{{' }} github.ref {{ '}}' }} cancel-in-progress: true diff --git a/.github/workflows/mricron.yml b/.github/workflows/mricron.yml new file mode 100644 index 00000000..1771d9b0 --- /dev/null +++ b/.github/workflows/mricron.yml @@ -0,0 +1,64 @@ +# This is file is automatically generated. Do not edit. +name: 'mricron' + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + mricron: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] + version: ['1.0.20190902', '1.0.20190410', '1.0.20181114', '1.0.20180614', '1.0.20180404', '1.0.20171220'] + method: ['binaries'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Generate Dockerfile + run: | + + apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') + if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="apt" + fi + + yum_based=('fedora:36', 'centos:7') + if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then + pkg_manager="yum" + fi + + neurodocker \ + generate docker \ + --base-image=${{ matrix.base_image }} \ + --pkg-manager=${pkg_manager} \ + --yes \ + --mricron \ + version=${{ matrix.version }} \ + method=${{ matrix.method }} \ + > Dockerfile_tmp + + cat Dockerfile_tmp + + - name: Build the Docker image + run: docker build -f Dockerfile_tmp . diff --git a/README.md b/README.md index a2f8f40e..2a35a2d8 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,6 @@ Before committing changes, initialize `pre-commit` with `pre-commit install`. Th ## Build status -http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build - -[![](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build)](https://github.com/Remi-Gau/neurodocker?branch=test_build) - -http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=spm12 - -[![](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=spm12)](https://github.com/Remi-Gau/neurodocker?branch=test_build) +You can check the status of the build of the Docker images +for several of the neuroimaging software packages that are supported by _Neurodocker_ +on [this page](build_dashboard.md). diff --git a/build_dashboard.md b/build_dashboard.md new file mode 100644 index 00000000..1241960e --- /dev/null +++ b/build_dashboard.md @@ -0,0 +1,104 @@ + +# Build dashboard) + + + + +## afni + +[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/afni.yml) + +[![afni build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=afni)] + + + + +## ants + +[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/ants.yml) + +[![ants build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=ants)] + + + + +## cat12 + +[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/cat12.yml) + +[![cat12 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=cat12)] + + + + +## convert3d + +[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/convert3d.yml) + +[![convert3d build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=convert3d)] + + + + +## dcm2niix + +[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/dcm2niix.yml) + +[![dcm2niix build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=dcm2niix)] + + + + +## freesurfer + +[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/freesurfer.yml) + +[![freesurfer build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=freesurfer)] + + + + +## fsl + +[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/fsl.yml) + +[![fsl build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=fsl)] + + + + +## matlabmcr + +[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/matlabmcr.yml) + +[![matlabmcr build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=matlabmcr)] + + + + +## mricron + +[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/mricron.yml) + +[![mricron build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=mricron)] + + + + +## mrtrix3 + +[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml) + +[![mrtrix3 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=mrtrix3)] + + + + +## spm12 + +[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml) + +[![spm12 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=spm12)] + + + From 43c5b455183426346a58397cd39eae8d3a19ecd6 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 14 Jan 2023 14:52:43 +0100 Subject: [PATCH 056/211] minor fixes --- .github/workflows/afni.yml | 21 +++++++++++++++++++++ .github/workflows/ants.yml | 21 +++++++++++++++++++++ .github/workflows/cat12.yml | 21 +++++++++++++++++++++ .github/workflows/convert3d.yml | 21 +++++++++++++++++++++ .github/workflows/dcm2niix.yml | 21 +++++++++++++++++++++ .github/workflows/docker_build.jinja | 2 +- .github/workflows/freesurfer.yml | 21 +++++++++++++++++++++ .github/workflows/fsl.yml | 21 +++++++++++++++++++++ .github/workflows/matlabmcr.yml | 21 +++++++++++++++++++++ .github/workflows/mricron.yml | 21 +++++++++++++++++++++ .github/workflows/mrtrix3.yml | 21 +++++++++++++++++++++ .github/workflows/spm12.yml | 21 +++++++++++++++++++++ 12 files changed, 232 insertions(+), 1 deletion(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index 90bfe5fd..ee1ef470 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -1,12 +1,33 @@ # This is file is automatically generated. Do not edit. name: 'afni' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml index bb4f709f..1326e8ba 100644 --- a/.github/workflows/ants.yml +++ b/.github/workflows/ants.yml @@ -1,12 +1,33 @@ # This is file is automatically generated. Do not edit. name: 'ants' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml index d0dca741..d84776a0 100644 --- a/.github/workflows/cat12.yml +++ b/.github/workflows/cat12.yml @@ -1,12 +1,33 @@ # This is file is automatically generated. Do not edit. name: 'cat12' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/convert3d.yml b/.github/workflows/convert3d.yml index f9bcba82..302ce3f7 100644 --- a/.github/workflows/convert3d.yml +++ b/.github/workflows/convert3d.yml @@ -1,12 +1,33 @@ # This is file is automatically generated. Do not edit. name: 'convert3d' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/dcm2niix.yml b/.github/workflows/dcm2niix.yml index 9a65b337..0d89bbd3 100644 --- a/.github/workflows/dcm2niix.yml +++ b/.github/workflows/dcm2niix.yml @@ -1,12 +1,33 @@ # This is file is automatically generated. Do not edit. name: 'dcm2niix' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index c74b2cab..68e78279 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -2,7 +2,7 @@ name: '{{ wf.software }}' concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ '{{' }} github.workflow {{ '}}' }}-${{ '{{' }} github.ref {{ '}}' }} cancel-in-progress: true on: diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml index 2c321761..4eb6dcb2 100644 --- a/.github/workflows/freesurfer.yml +++ b/.github/workflows/freesurfer.yml @@ -1,12 +1,33 @@ # This is file is automatically generated. Do not edit. name: 'freesurfer' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index 7eb142a2..73558496 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -1,12 +1,33 @@ # This is file is automatically generated. Do not edit. name: 'fsl' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml index 8c53ee5f..b7f984d4 100644 --- a/.github/workflows/matlabmcr.yml +++ b/.github/workflows/matlabmcr.yml @@ -1,12 +1,33 @@ # This is file is automatically generated. Do not edit. name: 'matlabmcr' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/mricron.yml b/.github/workflows/mricron.yml index 1771d9b0..12313efd 100644 --- a/.github/workflows/mricron.yml +++ b/.github/workflows/mricron.yml @@ -1,12 +1,33 @@ # This is file is automatically generated. Do not edit. name: 'mricron' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml index 796a6cc8..f3bf1fed 100644 --- a/.github/workflows/mrtrix3.yml +++ b/.github/workflows/mrtrix3.yml @@ -1,12 +1,33 @@ # This is file is automatically generated. Do not edit. name: 'mrtrix3' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml index f946d4b7..152875c6 100644 --- a/.github/workflows/spm12.yml +++ b/.github/workflows/spm12.yml @@ -1,12 +1,33 @@ # This is file is automatically generated. Do not edit. name: 'spm12' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: ["*"] pull_request: branches: ["*"] +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true From 1a9aa0d3efb206889470eadf5198bae49892bd0f Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 14 Jan 2023 14:54:51 +0100 Subject: [PATCH 057/211] minor fixes --- .github/workflows/create_workflows.py | 1 - build_dashboard.md | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 4b439ce9..71346759 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -111,7 +111,6 @@ def create_dashboard_file(): [![{software} build status]({image_url})] - """, file=f, ) diff --git a/build_dashboard.md b/build_dashboard.md index 1241960e..5c991e62 100644 --- a/build_dashboard.md +++ b/build_dashboard.md @@ -12,7 +12,6 @@ - ## ants [github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/ants.yml) @@ -21,7 +20,6 @@ - ## cat12 [github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/cat12.yml) @@ -30,7 +28,6 @@ - ## convert3d [github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/convert3d.yml) @@ -39,7 +36,6 @@ - ## dcm2niix [github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/dcm2niix.yml) @@ -48,7 +44,6 @@ - ## freesurfer [github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/freesurfer.yml) @@ -57,7 +52,6 @@ - ## fsl [github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/fsl.yml) @@ -66,7 +60,6 @@ - ## matlabmcr [github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/matlabmcr.yml) @@ -75,7 +68,6 @@ - ## mricron [github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/mricron.yml) @@ -84,7 +76,6 @@ - ## mrtrix3 [github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml) @@ -93,7 +84,6 @@ - ## spm12 [github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml) @@ -101,4 +91,3 @@ [![spm12 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=spm12)] - From 1ee8df371aff7a19e804016bc0db55dff77ab6c4 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 14 Jan 2023 14:58:38 +0100 Subject: [PATCH 058/211] rm duplicate --- .github/workflows/afni.yml | 4 -- .github/workflows/ants.yml | 4 -- .github/workflows/cat12.yml | 4 -- .github/workflows/convert3d.yml | 4 -- .github/workflows/create_workflows.py | 18 ++++--- .github/workflows/dcm2niix.yml | 4 -- .github/workflows/docker_build.jinja | 4 -- .github/workflows/freesurfer.yml | 4 -- .github/workflows/fsl.yml | 4 -- .github/workflows/matlabmcr.yml | 4 -- .github/workflows/mricron.yml | 4 -- .github/workflows/mrtrix3.yml | 4 -- .github/workflows/spm12.yml | 4 -- build_dashboard.md | 78 ++++++++++++--------------- 14 files changed, 43 insertions(+), 101 deletions(-) diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml index ee1ef470..2a940e81 100644 --- a/.github/workflows/afni.yml +++ b/.github/workflows/afni.yml @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: afni: diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml index 1326e8ba..9eb1a0a5 100644 --- a/.github/workflows/ants.yml +++ b/.github/workflows/ants.yml @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: ants: diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml index d84776a0..dd11b962 100644 --- a/.github/workflows/cat12.yml +++ b/.github/workflows/cat12.yml @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: cat12: diff --git a/.github/workflows/convert3d.yml b/.github/workflows/convert3d.yml index 302ce3f7..c44ea162 100644 --- a/.github/workflows/convert3d.yml +++ b/.github/workflows/convert3d.yml @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: convert3d: diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 71346759..a2ff334f 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -94,23 +94,25 @@ def create_dashboard_file(): print( """ # Build dashboard) +""", + file=f) + # table of content + for software, _ in softwares.items(): + print(f"""- [{software}](#{software})""", file=f) -""", - file=f, - ) + print("", file=f) + # link to the github actions workflow and image of the build status for software, _ in softwares.items(): image_url = f"{image_base_url}&only={software}" print( - f""" -## {software} - -[github actions workflow](https://github.com/{repo}/actions/workflows/{software}.yml) + f"""## {software} -[![{software} build status]({image_url})] +[{software} github actions workflow](https://github.com/{repo}/actions/workflows/{software}.yml) +![{software} build status]({image_url}) """, file=f, ) diff --git a/.github/workflows/dcm2niix.yml b/.github/workflows/dcm2niix.yml index 0d89bbd3..4a01f19e 100644 --- a/.github/workflows/dcm2niix.yml +++ b/.github/workflows/dcm2niix.yml @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: dcm2niix: diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index 68e78279..de6cf44e 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ '{{' }} github.workflow {{ '}}' }}-${{ '{{' }} github.ref {{ '}}' }} - cancel-in-progress: true - jobs: {{ wf.software }}: diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml index 4eb6dcb2..28725418 100644 --- a/.github/workflows/freesurfer.yml +++ b/.github/workflows/freesurfer.yml @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: freesurfer: diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml index 73558496..291f53a3 100644 --- a/.github/workflows/fsl.yml +++ b/.github/workflows/fsl.yml @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: fsl: diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml index b7f984d4..f3a78e7e 100644 --- a/.github/workflows/matlabmcr.yml +++ b/.github/workflows/matlabmcr.yml @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: matlabmcr: diff --git a/.github/workflows/mricron.yml b/.github/workflows/mricron.yml index 12313efd..c9e3807b 100644 --- a/.github/workflows/mricron.yml +++ b/.github/workflows/mricron.yml @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: mricron: diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml index f3bf1fed..82f4ef11 100644 --- a/.github/workflows/mrtrix3.yml +++ b/.github/workflows/mrtrix3.yml @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: mrtrix3: diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml index 152875c6..4be51e20 100644 --- a/.github/workflows/spm12.yml +++ b/.github/workflows/spm12.yml @@ -28,10 +28,6 @@ on: schedule: - cron: 0 0 1,15 * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: spm12: diff --git a/build_dashboard.md b/build_dashboard.md index 5c991e62..4cdb055f 100644 --- a/build_dashboard.md +++ b/build_dashboard.md @@ -1,93 +1,81 @@ # Build dashboard) - - +- [afni](#afni) +- [ants](#ants) +- [cat12](#cat12) +- [convert3d](#convert3d) +- [dcm2niix](#dcm2niix) +- [freesurfer](#freesurfer) +- [fsl](#fsl) +- [matlabmcr](#matlabmcr) +- [mricron](#mricron) +- [mrtrix3](#mrtrix3) +- [spm12](#spm12) ## afni -[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/afni.yml) - -[![afni build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=afni)] - +[afni github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/afni.yml) +![afni build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=afni) ## ants -[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/ants.yml) - -[![ants build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=ants)] - +[ants github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/ants.yml) +![ants build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=ants) ## cat12 -[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/cat12.yml) - -[![cat12 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=cat12)] - +[cat12 github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/cat12.yml) +![cat12 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=cat12) ## convert3d -[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/convert3d.yml) - -[![convert3d build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=convert3d)] - +[convert3d github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/convert3d.yml) +![convert3d build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=convert3d) ## dcm2niix -[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/dcm2niix.yml) - -[![dcm2niix build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=dcm2niix)] - +[dcm2niix github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/dcm2niix.yml) +![dcm2niix build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=dcm2niix) ## freesurfer -[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/freesurfer.yml) - -[![freesurfer build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=freesurfer)] - +[freesurfer github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/freesurfer.yml) +![freesurfer build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=freesurfer) ## fsl -[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/fsl.yml) - -[![fsl build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=fsl)] - +[fsl github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/fsl.yml) +![fsl build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=fsl) ## matlabmcr -[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/matlabmcr.yml) - -[![matlabmcr build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=matlabmcr)] - +[matlabmcr github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/matlabmcr.yml) +![matlabmcr build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=matlabmcr) ## mricron -[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/mricron.yml) - -[![mricron build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=mricron)] - +[mricron github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/mricron.yml) +![mricron build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=mricron) ## mrtrix3 -[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml) - -[![mrtrix3 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=mrtrix3)] - +[mrtrix3 github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml) +![mrtrix3 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=mrtrix3) ## spm12 -[github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml) - -[![spm12 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=spm12)] +[spm12 github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml) +![spm12 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=spm12) From 995be5800451b8ecc0c8495f24297bd736b6c507 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 14 Jan 2023 15:07:59 +0100 Subject: [PATCH 059/211] Update neurodocker/templates/afni.yaml --- neurodocker/templates/afni.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neurodocker/templates/afni.yaml b/neurodocker/templates/afni.yaml index deedc191..40d75791 100644 --- a/neurodocker/templates/afni.yaml +++ b/neurodocker/templates/afni.yaml @@ -70,7 +70,7 @@ binaries: instructions: | {{ self.install_dependencies() }} {% if self.install_python3.lower() in ["true", "1", "y"] -%} - {{ self.install(["python3"]) -}} + {{ self.install(["python3"]) }} pip3 install matplotlib {%- endif %} gsl_path="$(find / -name 'libgsl.so.??' || printf '')" From 91a50a2b35f9ce994e03d5aef1ec2320e8ea08bf Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 14 Jan 2023 15:09:38 +0100 Subject: [PATCH 060/211] fix typo --- .github/workflows/create_workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index a2ff334f..55ca7a77 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -93,7 +93,7 @@ def create_dashboard_file(): image_base_url = f"{gh_actions_url}{repo}/matrix.svg?branch={branch}" print( """ -# Build dashboard) +# Build dashboard """, file=f) From 3523b49bd5f2033825bd4d4fc1fd9f56d55ee900 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 14 Jan 2023 11:40:03 -0500 Subject: [PATCH 061/211] fix: mypy configuration --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 700ceefd..2dc8279c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -79,7 +79,7 @@ extend-ignore = E203 exclude = neurodocker/_version.py [mypy] -exclude = ['reproenv/tests/'] +exclude = reproenv/tests no_implicit_optional=False [mypy-neurodocker._version] From 7d929988e0e91be07b1d7b62f577ffc93fffc18f Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 14 Jan 2023 11:58:01 -0500 Subject: [PATCH 062/211] fix: install mypy stubs --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 68d50e89..cc622da2 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -41,7 +41,7 @@ jobs: - name: Install neurodocker run: python -m pip install --editable .[dev] - name: Check types - run: mypy neurodocker + run: mypy --install-types --non-interactive neurodocker - name: Check style run: flake8 neurodocker - name: Run python tests From 81b93de9c6dd227c9197ace8b59a76f6b4172e2c Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 14 Jan 2023 12:24:23 -0500 Subject: [PATCH 063/211] fix: remove py 3.7 and add apptainer 1.1.5 --- .github/workflows/pull-request.yml | 45 +++++++++++++++++------------ .gitignore | 3 ++ neurodocker/reproenv/tests/utils.py | 16 +++++----- 3 files changed, 38 insertions(+), 26 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index cc622da2..0f16b7f8 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -8,31 +8,40 @@ on: jobs: run-tests: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 strategy: matrix: - python-version: ['3.10', '3.9', '3.8', '3.7'] + python-version: ['3.11', '3.10', '3.9', '3.8'] steps: - - name: Install Singularity + - name: Install Apptainer + env: + VERSION=1.1.5 run: | sudo apt-get update - sudo apt-get install --yes \ - libssl-dev \ - uuid-dev \ - libgpgme11-dev \ - squashfs-tools - curl -fsSL https://github.com/hpcng/singularity/releases/download/v3.6.4/singularity-3.6.4.tar.gz | tar xz - cd singularity - ./mconfig -p $HOME/opt/singularity - cd builddir - make - sudo make install - - name: Set Singularity environment variables + sudo apt-get update && apt-get install -y \ + build-essential \ + libseccomp-dev \ + pkg-config \ + uidmap \ + squashfs-tools \ + squashfuse \ + fuse2fs \ + fuse-overlayfs \ + fakeroot \ + cryptsetup \ + curl wget git + wget -q https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-${VERSION}.tar.gz && \ + tar -xzf apptainer-${VERSION}.tar.gz && \ + cd apptainer-${VERSION} && \ + ./mconfig --prefix=$HOME/opt/apptainer --without-suid && \ + make -C ./builddir && \ + sudo make -C ./builddir install + - name: Set Apptainer/Singularity environment variables run: | echo $HOME/opt/singularity/bin >> $GITHUB_PATH - # Give reproenv the full path to singularity, so it still works with `sudo`. - echo REPROENV_SINGULARITY_PROGRAM=$HOME/opt/singularity/bin/singularity >> $GITHUB_ENV - echo SINGULARITY_CACHEDIR=/dev/shm/$(whoami)/singularity >> $GITHUB_ENV + # Give reproenv the full path to apptainer, so it still works with `sudo`. + echo REPROENV_APPTAINER_PROGRAM=$HOME/opt/apptainer/bin/apptainer >> $GITHUB_ENV + echo APPTAINER_CACHEDIR=/dev/shm/$(whoami)/singularity >> $GITHUB_ENV - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 diff --git a/.gitignore b/.gitignore index c85911a8..35769a43 100644 --- a/.gitignore +++ b/.gitignore @@ -137,3 +137,6 @@ dmypy.json # Cython debug symbols cython_debug/ + +# Pycharm +.idea/ \ No newline at end of file diff --git a/neurodocker/reproenv/tests/utils.py b/neurodocker/reproenv/tests/utils.py index c3c67e14..9415474f 100644 --- a/neurodocker/reproenv/tests/utils.py +++ b/neurodocker/reproenv/tests/utils.py @@ -83,10 +83,10 @@ def build_docker_image(context: Path, remove=False) -> ty.Generator[str, None, N def build_singularity_image( context: Path, remove=True ) -> ty.Generator[str, None, None]: - """Context manager that builds a Singularity image and removes it on exit. + """Context manager that builds a Apptainer image and removes it on exit. - If `sudo singularity` is not available, the full path to `singularity` can be set - with the environment variable `REPROENV_SINGULARITY_PROGRAM`. + If `sudo singularity` is not available, the full path to `apptainer` can be set + with the environment variable `REPROENV_APPTAINER_PROGRAM`. Yields ------ @@ -95,15 +95,15 @@ def build_singularity_image( """ recipe = context / "Singularity" if not recipe.exists(): - raise FileNotFoundError(f"Singularity recipe not found: {recipe}") + raise FileNotFoundError(f"Apptainer recipe not found: {recipe}") sif = context / f"reproenv-pytest-{uuid.uuid4().hex}.sif" - # Set singularity cache to /dev/shm + # Set apptainer cache to /dev/shm user = getpass.getuser() - cachedir = Path("/") / "dev" / "shm" / user / "singularity" - singularity = os.environ.get("REPROENV_SINGULARITY_PROGRAM", "singularity") + cachedir = Path("/") / "dev" / "shm" / user / "apptainer" + singularity = os.environ.get("REPROENV_APPTAINER_PROGRAM", "apptainer") cmd: ty.List[str] = [ "sudo", - f"SINGULARITY_CACHEDIR={cachedir}", + f"APPTAINER_CACHEDIR={cachedir}", singularity, "build", str(sif), From 714c5de00a7a98fce9ae7114610fa87b8609cb8d Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 14 Jan 2023 13:34:30 -0500 Subject: [PATCH 064/211] fix: adjust optionEatAll for click >= 8 --- neurodocker/cli/generate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neurodocker/cli/generate.py b/neurodocker/cli/generate.py index 08141f73..3fa5ffd6 100644 --- a/neurodocker/cli/generate.py +++ b/neurodocker/cli/generate.py @@ -138,7 +138,6 @@ def parser_process(value, state): if not done: value.append(state.rargs.pop(0)) value = tuple(value) - # call the actual process self._previous_parser_process(value, state) @@ -221,6 +220,7 @@ def _get_common_renderer_params() -> ty.List[click.Parameter]: OptionEatAll( ["--install"], multiple=True, + type=tuple, help="Install packages with system package manager", ), OptionEatAll( From a80dfa48d224697a1bafd62edd6ebedb20d8d249 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 14 Jan 2023 13:40:37 -0500 Subject: [PATCH 065/211] install apptainer from deb files --- .github/workflows/pull-request.yml | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0f16b7f8..af885745 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -18,29 +18,14 @@ jobs: VERSION=1.1.5 run: | sudo apt-get update - sudo apt-get update && apt-get install -y \ - build-essential \ - libseccomp-dev \ - pkg-config \ - uidmap \ - squashfs-tools \ - squashfuse \ - fuse2fs \ - fuse-overlayfs \ - fakeroot \ - cryptsetup \ - curl wget git - wget -q https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-${VERSION}.tar.gz && \ - tar -xzf apptainer-${VERSION}.tar.gz && \ - cd apptainer-${VERSION} && \ - ./mconfig --prefix=$HOME/opt/apptainer --without-suid && \ - make -C ./builddir && \ - sudo make -C ./builddir install + sudo apt-get install -y wget + wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer_${VERSION}_amd64.deb + wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-suid_${VERSION}_amd64.deb + sudo apt-get install --yes ./apptainer* - name: Set Apptainer/Singularity environment variables run: | - echo $HOME/opt/singularity/bin >> $GITHUB_PATH # Give reproenv the full path to apptainer, so it still works with `sudo`. - echo REPROENV_APPTAINER_PROGRAM=$HOME/opt/apptainer/bin/apptainer >> $GITHUB_ENV + echo REPROENV_APPTAINER_PROGRAM=apptainer >> $GITHUB_ENV echo APPTAINER_CACHEDIR=/dev/shm/$(whoami)/singularity >> $GITHUB_ENV - uses: actions/checkout@v2 - name: Set up Python From f7f2aaf34d0156969cf899405662f4eaec4ead48 Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Sat, 14 Jan 2023 14:30:07 -0500 Subject: [PATCH 066/211] remove /docs from .dockerignore By excluding `/docs` from the Docker images, we were modifying the state of the git repository, and `git status` was reporting uncommitted changes. This caused the command `neurodocker --version` to show that there were uncommitted changes (by including the `dirty` suffix in the version). We do not want users to be under the impression that the version includes uncommitted changes. Indeed, kaczmarj excluded `/docs` from the docker builds as a premature optimization... it turns out that they only consume 136 kb, which is negligible. --- .dockerignore | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index 9a36a2ab..c85911a8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,3 @@ -# Sphinx documentation. -# The Docker image is not intended to be used to build docs. -/docs - # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] From 9792c6aea8ed75dad2e593b9e4f6b8bd082cfd0e Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 14 Jan 2023 15:38:57 -0500 Subject: [PATCH 067/211] remove minify option and tests --- neurodocker/cli/cli.py | 7 +++++-- neurodocker/cli/minify/_trace.sh | 6 ++---- neurodocker/cli/minify/tests/test_minify.py | 7 +++++-- neurodocker/reproenv/tests/test_state.py | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/neurodocker/cli/cli.py b/neurodocker/cli/cli.py index 995cc3d6..a44ad7ce 100644 --- a/neurodocker/cli/cli.py +++ b/neurodocker/cli/cli.py @@ -10,7 +10,7 @@ def cli(): """Generate custom containers, and minify existing containers. - The minify command is available only if Docker is installed and running. + Note: The minify command has been removed due to lack of ptrace in docker. """ @@ -20,11 +20,14 @@ def cli(): # `docker-py` is required for minification but is not installed by default. # We also pass if there is an error retrieving the Docker client. # Say, for example, the Docker engine is not running (or it is not installed). +""" +# Removing minify due to lack of ptrace availability in docker + try: from neurodocker.cli.minify.trace import minify - cli.add_command(minify) except (ImportError, RuntimeError): # TODO: should we log a debug message? We don't even have a logger at the # time of writing, so probably not. pass +""" diff --git a/neurodocker/cli/minify/_trace.sh b/neurodocker/cli/minify/_trace.sh index 256deb0d..f9f04861 100644 --- a/neurodocker/cli/minify/_trace.sh +++ b/neurodocker/cli/minify/_trace.sh @@ -40,14 +40,12 @@ function install_missing_dependencies() { function install_conda_reprozip() { TMP_CONDA_INSTALLER=/tmp/miniconda.sh ls /tmp - curl -sSL -o "$TMP_CONDA_INSTALLER" "$CONDA_URL" - ls /tmp + curl -sSL -o "$TMP_CONDA_INSTALLER" "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" bash $TMP_CONDA_INSTALLER -b -f -p $REPROZIP_CONDA rm -f $TMP_CONDA_INSTALLER - ${REPROZIP_CONDA}/bin/python -m pip install --no-cache-dir reprozip + ${REPROZIP_CONDA}/bin/mamba install -c conda-forge -y reprozip } - function run_reprozip_trace() { # https://askubuntu.com/a/674347 cmds=("$@") diff --git a/neurodocker/cli/minify/tests/test_minify.py b/neurodocker/cli/minify/tests/test_minify.py index 70969cec..9aa8c659 100644 --- a/neurodocker/cli/minify/tests/test_minify.py +++ b/neurodocker/cli/minify/tests/test_minify.py @@ -8,9 +8,11 @@ docker = pytest.importorskip("docker", reason="docker-py not found") +@pytest.mark.skip(reason="ptrace no longer supported under docker") def test_minify(): client = docker.from_env() - container = client.containers.run("python:3.9-slim", detach=True, tty=True) + container = client.containers.run("python:3.9-slim", detach=True, tty=True, + platform="Linux/amd64", privileged=True) commands = ["python --version", """python -c 'print(123)'"""] try: runner = CliRunner() @@ -37,6 +39,7 @@ def test_minify(): container.remove() +@pytest.mark.skip(reason="ptrace no longer supported under docker") def test_minify_abort(): client = docker.from_env() container = client.containers.run("python:3.9-slim", detach=True, tty=True) @@ -64,7 +67,7 @@ def test_minify_abort(): container.stop() container.remove() - +@pytest.mark.skip(reason="ptrace no longer supported under docker") def test_minify_with_mounted_volume(tmp_path: Path): client = docker.from_env() diff --git a/neurodocker/reproenv/tests/test_state.py b/neurodocker/reproenv/tests/test_state.py index 1bb97385..ba40d0bf 100644 --- a/neurodocker/reproenv/tests/test_state.py +++ b/neurodocker/reproenv/tests/test_state.py @@ -13,7 +13,7 @@ def test_validate_template_invalid_templates(): _validate_template({}) with pytest.raises( - exceptions.TemplateError, match="'binaries' is a required property" + exceptions.TemplateError, match="{'name': 'bar'} is not valid" ): _validate_template({"name": "bar"}) From 139a245a545511413a4e93867221f277b6f695e7 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 14 Jan 2023 15:43:07 -0500 Subject: [PATCH 068/211] fix flake --- neurodocker/cli/minify/tests/test_minify.py | 1 + 1 file changed, 1 insertion(+) diff --git a/neurodocker/cli/minify/tests/test_minify.py b/neurodocker/cli/minify/tests/test_minify.py index 9aa8c659..d129d71a 100644 --- a/neurodocker/cli/minify/tests/test_minify.py +++ b/neurodocker/cli/minify/tests/test_minify.py @@ -67,6 +67,7 @@ def test_minify_abort(): container.stop() container.remove() + @pytest.mark.skip(reason="ptrace no longer supported under docker") def test_minify_with_mounted_volume(tmp_path: Path): client = docker.from_env() From 9c19d663bd511270ccaa3bb24c4ef953326faaa9 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 14 Jan 2023 16:05:10 -0500 Subject: [PATCH 069/211] CFG: restrict workflows to PRs only --- .github/workflows/pull-request.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index cc622da2..ecd60e06 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,8 +1,6 @@ name: CI on: - push: - branches: [ master ] pull_request: branches: [ master ] From 218697a6bb482fa1b8ebeb2b76608bf9c4ee6f4a Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 14 Jan 2023 16:16:55 -0500 Subject: [PATCH 070/211] fix: workflow file --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 177c1590..9c37ce52 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Install Apptainer env: - VERSION=1.1.5 + VERSION: 1.1.5 run: | sudo apt-get update sudo apt-get install -y wget From 43cb3b2cde2a0743c6267a3495932e8cbfdf627c Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 14 Jan 2023 16:57:49 -0500 Subject: [PATCH 071/211] enh: add release workflow --- .github/workflows/publish.yml | 27 ++++++++++++++++++++++ .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ setup.cfg | 5 ++-- 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..b462f600 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,27 @@ +name: Publish to pypi on Github release + +on: + release: + types: [published] + +jobs: + pypi-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install build & twine + run: python -m pip install build twine + + - name: Publish to pypi + run: | + python -m build + twine upload dist/* + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..fa55b1f5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Auto-release on PR merge + +on: + # ATM, this is the closest trigger to a PR merging + push: + branches: + - master + +env: + AUTO_VERSION: v10.37.6 + +jobs: + auto-release: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" + steps: + - uses: actions/checkout@v3 + + - name: Prepare repository + # Fetch full git history and tags + run: git fetch --unshallow --tags + + - name: Unset header + # checkout@v2 adds a header that makes branch protection report errors + # because the Github action bot is not a collaborator on the repo + run: git config --local --unset http.https://github.com/.extraheader + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Download auto + run: | + auto_download_url="$(curl -fsSL https://api.github.com/repos/intuit/auto/releases/tags/$AUTO_VERSION | jq -r '.assets[] | select(.name == "auto-linux.gz") | .browser_download_url')" + wget -O- "$auto_download_url" | gunzip > ~/auto + chmod a+x ~/auto + + - name: Create release + run: | + ~/auto shipit -vv + env: + GH_TOKEN: ${{ secrets.AUTO_USER_TOKEN }} diff --git a/setup.cfg b/setup.cfg index 2dc8279c..acf241c6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,15 +14,16 @@ classifiers = Operating System :: OS Independent Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 Topic :: Software Development Topic :: Software Development :: Libraries :: Python Modules [options] packages = find: -python_requires = >= 3.7 +python_requires = >= 3.8 install_requires = click etelemetry >= 0.2.0 From 90e23dc923f16629ab14b4efae8407d183d0ef7e Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 14 Jan 2023 18:10:36 -0500 Subject: [PATCH 072/211] fix: auto setup --- .autorc | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .autorc diff --git a/.autorc b/.autorc new file mode 100644 index 00000000..eaf43f22 --- /dev/null +++ b/.autorc @@ -0,0 +1,7 @@ +{ + "onlyPublishWithReleaseLabel": true, + "baseBranch": "master", + "author": "Repronim Bot ", + "noVersionPrefix": true, + "plugins": ["git-tag"] +} From 942c7295eeda126b41004c6375b8c866783d2fec Mon Sep 17 00:00:00 2001 From: Repronim Bot Date: Sat, 14 Jan 2023 23:35:45 +0000 Subject: [PATCH 073/211] Update CHANGELOG.md [skip ci] --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..f6404581 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +# 0.9.2 (Sat Jan 14 2023) + +#### 🐛 Bug Fix + +- fix: auto setup [#496](https://github.com/ReproNim/neurodocker/pull/496) ([@satra](https://github.com/satra)) +- enh: add release workflow [#495](https://github.com/ReproNim/neurodocker/pull/495) ([@satra](https://github.com/satra)) +- remove empty lines [#488](https://github.com/ReproNim/neurodocker/pull/488) ([@satra](https://github.com/satra)) +- FIX: --version output in containers [#493](https://github.com/ReproNim/neurodocker/pull/493) ([@kaczmarj](https://github.com/kaczmarj)) +- fix: remove py 3.7 and add apptainer 1.1.5 [#490](https://github.com/ReproNim/neurodocker/pull/490) ([@satra](https://github.com/satra)) +- fix: adjust optionEatAll for click >= 8 [#492](https://github.com/ReproNim/neurodocker/pull/492) ([@satra](https://github.com/satra)) +- update pre-commit [#482](https://github.com/ReproNim/neurodocker/pull/482) ([@Remi-Gau](https://github.com/Remi-Gau)) + +#### ⚠️ Pushed to `master` + +- fix: install mypy stubs ([@satra](https://github.com/satra)) +- fix: mypy configuration ([@satra](https://github.com/satra)) + +#### Authors: 3 + +- Jakub Kaczmarzyk ([@kaczmarj](https://github.com/kaczmarj)) +- Remi Gau ([@Remi-Gau](https://github.com/Remi-Gau)) +- Satrajit Ghosh ([@satra](https://github.com/satra)) From b881469990444e857fc1ac2389bdf0b45de6f40e Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Mon, 16 Jan 2023 11:14:26 -0500 Subject: [PATCH 074/211] FIX: skip minification tests on M1/M2 macs and run them otherwise (#497) * skip minification tests on M1/M2 macs This adds back in the minification tests to CI. These tests passed on my Debian Linux machine (intel 64-bit). See https://github.com/docker/for-mac/issues/5191 for an explanation of why ptrace does not work on arm macs. * do not add minify command on arm macs * rm platform and privileged args in container run * annotate bool return for _arm_on_mac * import _arm_on_mac from cli.py --- neurodocker/cli/cli.py | 28 ++++++++++++++------- neurodocker/cli/minify/tests/test_minify.py | 14 +++++++---- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/neurodocker/cli/cli.py b/neurodocker/cli/cli.py index a44ad7ce..547aeb67 100644 --- a/neurodocker/cli/cli.py +++ b/neurodocker/cli/cli.py @@ -8,26 +8,36 @@ @click.group() @click.version_option(__version__, message="%(prog)s version %(version)s") def cli(): - """Generate custom containers, and minify existing containers. - - Note: The minify command has been removed due to lack of ptrace in docker. - """ + """Generate custom containers, and minify existing containers.""" cli.add_command(generate) cli.add_command(genfromjson) + +def _arm_on_mac() -> bool: + """Return True if on an ARM processor (M1/M2) in macos operating system.""" + import platform + + is_mac = platform.system().lower() == "darwin" + is_arm = platform.processor().lower() == "arm" + return is_mac and is_arm + + +# If dockerpy is installed, the Docker client can be instantiated, and if we are not +# running on an ARM-based mac computer, then we add the minification command. +# See https://github.com/docker/for-mac/issues/5191 for more information about why +# we skip ARM-based macs. +# # `docker-py` is required for minification but is not installed by default. # We also pass if there is an error retrieving the Docker client. # Say, for example, the Docker engine is not running (or it is not installed). -""" -# Removing minify due to lack of ptrace availability in docker - try: from neurodocker.cli.minify.trace import minify - cli.add_command(minify) + + if not _arm_on_mac(): + cli.add_command(minify) except (ImportError, RuntimeError): # TODO: should we log a debug message? We don't even have a logger at the # time of writing, so probably not. pass -""" diff --git a/neurodocker/cli/minify/tests/test_minify.py b/neurodocker/cli/minify/tests/test_minify.py index d129d71a..d9832056 100644 --- a/neurodocker/cli/minify/tests/test_minify.py +++ b/neurodocker/cli/minify/tests/test_minify.py @@ -3,16 +3,20 @@ from click.testing import CliRunner import pytest +from neurodocker.cli.cli import _arm_on_mac from neurodocker.cli.minify.trace import minify docker = pytest.importorskip("docker", reason="docker-py not found") +skip_arm_on_mac = pytest.mark.skipif( + _arm_on_mac(), reason="minification does not work on M1/M2 macs" +) -@pytest.mark.skip(reason="ptrace no longer supported under docker") + +@skip_arm_on_mac def test_minify(): client = docker.from_env() - container = client.containers.run("python:3.9-slim", detach=True, tty=True, - platform="Linux/amd64", privileged=True) + container = client.containers.run("python:3.9-slim", detach=True, tty=True) commands = ["python --version", """python -c 'print(123)'"""] try: runner = CliRunner() @@ -39,7 +43,7 @@ def test_minify(): container.remove() -@pytest.mark.skip(reason="ptrace no longer supported under docker") +@skip_arm_on_mac def test_minify_abort(): client = docker.from_env() container = client.containers.run("python:3.9-slim", detach=True, tty=True) @@ -68,7 +72,7 @@ def test_minify_abort(): container.remove() -@pytest.mark.skip(reason="ptrace no longer supported under docker") +@skip_arm_on_mac def test_minify_with_mounted_volume(tmp_path: Path): client = docker.from_env() From 4f1cd1493005dc07b19d7b78de62191d5ced24cc Mon Sep 17 00:00:00 2001 From: Repronim Bot Date: Mon, 16 Jan 2023 16:14:51 +0000 Subject: [PATCH 075/211] Update CHANGELOG.md [skip ci] --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6404581..41900ad3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# 0.9.3 (Mon Jan 16 2023) + +#### 🐛 Bug Fix + +- FIX: skip minification tests on M1/M2 macs and run them otherwise [#497](https://github.com/ReproNim/neurodocker/pull/497) ([@kaczmarj](https://github.com/kaczmarj)) +- Add/ants24x [#473](https://github.com/ReproNim/neurodocker/pull/473) ([@araikes](https://github.com/araikes) [@kaczmarj](https://github.com/kaczmarj)) + +#### Authors: 2 + +- [@araikes](https://github.com/araikes) +- Jakub Kaczmarzyk ([@kaczmarj](https://github.com/kaczmarj)) + +--- + # 0.9.2 (Sat Jan 14 2023) #### 🐛 Bug Fix From e87a71d012b4574705849b05ec63db4de7e7c49b Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 16 Jan 2023 18:46:03 +0100 Subject: [PATCH 076/211] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a35a2d8..4a6715fa 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Please see our website https://www.repronim.org/neurodocker for more information Use the _Neurodocker_ Docker image (recommended): ```shell -docker run --rm kaczmarj/neurodocker:0.9.1 --help +docker run --rm repronim/neurodocker:latest --help ``` The Docker images were moved to [repronim/neurodocker](https://hub.docker.com/r/repronim/neurodocker) from [kaczmarj/neurodocker](https://hub.docker.com/r/kaczmarj/neurodocker). From 50c473fc12d6d928f48350de8e1b78ac51d81d11 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 17 Jan 2023 23:09:29 +0100 Subject: [PATCH 077/211] start bootstrap --- .github/workflows/afni.yml | 83 -------------------------------- .github/workflows/ants.yml | 81 ------------------------------- .github/workflows/bootstrap.yml | 29 +++++++++++ .github/workflows/cat12.yml | 82 ------------------------------- .github/workflows/convert3d.yml | 81 ------------------------------- .github/workflows/dcm2niix.yml | 81 ------------------------------- .github/workflows/freesurfer.yml | 79 ------------------------------ .github/workflows/fsl.yml | 81 ------------------------------- .github/workflows/matlabmcr.yml | 81 ------------------------------- .github/workflows/mricron.yml | 81 ------------------------------- .github/workflows/mrtrix3.yml | 81 ------------------------------- .github/workflows/spm12.yml | 81 ------------------------------- 12 files changed, 29 insertions(+), 892 deletions(-) delete mode 100644 .github/workflows/afni.yml delete mode 100644 .github/workflows/ants.yml create mode 100644 .github/workflows/bootstrap.yml delete mode 100644 .github/workflows/cat12.yml delete mode 100644 .github/workflows/convert3d.yml delete mode 100644 .github/workflows/dcm2niix.yml delete mode 100644 .github/workflows/freesurfer.yml delete mode 100644 .github/workflows/fsl.yml delete mode 100644 .github/workflows/matlabmcr.yml delete mode 100644 .github/workflows/mricron.yml delete mode 100644 .github/workflows/mrtrix3.yml delete mode 100644 .github/workflows/spm12.yml diff --git a/.github/workflows/afni.yml b/.github/workflows/afni.yml deleted file mode 100644 index 2a940e81..00000000 --- a/.github/workflows/afni.yml +++ /dev/null @@ -1,83 +0,0 @@ -# This is file is automatically generated. Do not edit. -name: 'afni' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - -jobs: - - afni: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['latest'] - method: ['binaries', 'source'] - afni_python: ['true', 'false'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile - run: | - - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') - if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="apt" - fi - - yum_based=('fedora:36', 'centos:7') - if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="yum" - fi - - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=${pkg_manager} \ - --yes \ - --afni \ - version=${{ matrix.version }} \ - method=${{ matrix.method }} \ - install_python3=${{ matrix.afni_python }} \ - > Dockerfile_tmp - - cat Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/ants.yml b/.github/workflows/ants.yml deleted file mode 100644 index 9eb1a0a5..00000000 --- a/.github/workflows/ants.yml +++ /dev/null @@ -1,81 +0,0 @@ -# This is file is automatically generated. Do not edit. -name: 'ants' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - -jobs: - - ants: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['2.3.4', '2.3.2', '2.3.1', '2.3.0', '2.2.0', '2.1.0', '2.0.3', '2.0.0'] - method: ['binaries', 'source'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile - run: | - - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') - if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="apt" - fi - - yum_based=('fedora:36', 'centos:7') - if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="yum" - fi - - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=${pkg_manager} \ - --yes \ - --ants \ - version=${{ matrix.version }} \ - method=${{ matrix.method }} \ - > Dockerfile_tmp - - cat Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml new file mode 100644 index 00000000..5e0db749 --- /dev/null +++ b/.github/workflows/bootstrap.yml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + branches: [ "*" ] + pull_request: + branches: [ "*" ] + +jobs: + run-tests: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + + - name: Install dependencies + run: python -m pip install jinja2 pyyaml + + - name: Create workflows + run: | + python .github/workflows/create_workflows.py + ls -l .github/workflows + + diff --git a/.github/workflows/cat12.yml b/.github/workflows/cat12.yml deleted file mode 100644 index dd11b962..00000000 --- a/.github/workflows/cat12.yml +++ /dev/null @@ -1,82 +0,0 @@ -# This is file is automatically generated. Do not edit. -name: 'cat12' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - -jobs: - - cat12: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['r1933_R2017b'] - method: ['binaries'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile - run: | - - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') - if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="apt" - fi - - yum_based=('fedora:36', 'centos:7') - if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="yum" - fi - - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=${pkg_manager} \ - --yes \ - --matlabmcr method='binaries' version='2017b' \ - --cat12 \ - version=${{ matrix.version }} \ - method=${{ matrix.method }} \ - > Dockerfile_tmp - - cat Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/convert3d.yml b/.github/workflows/convert3d.yml deleted file mode 100644 index c44ea162..00000000 --- a/.github/workflows/convert3d.yml +++ /dev/null @@ -1,81 +0,0 @@ -# This is file is automatically generated. Do not edit. -name: 'convert3d' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - -jobs: - - convert3d: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['nightly', '1.0.0'] - method: ['binaries'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile - run: | - - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') - if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="apt" - fi - - yum_based=('fedora:36', 'centos:7') - if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="yum" - fi - - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=${pkg_manager} \ - --yes \ - --convert3d \ - version=${{ matrix.version }} \ - method=${{ matrix.method }} \ - > Dockerfile_tmp - - cat Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/dcm2niix.yml b/.github/workflows/dcm2niix.yml deleted file mode 100644 index 4a01f19e..00000000 --- a/.github/workflows/dcm2niix.yml +++ /dev/null @@ -1,81 +0,0 @@ -# This is file is automatically generated. Do not edit. -name: 'dcm2niix' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - -jobs: - - dcm2niix: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['latest', 'v1.0.20201102', 'v1.0.20200331', 'v1.0.20190902'] - method: ['binaries', 'source'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile - run: | - - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') - if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="apt" - fi - - yum_based=('fedora:36', 'centos:7') - if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="yum" - fi - - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=${pkg_manager} \ - --yes \ - --dcm2niix \ - version=${{ matrix.version }} \ - method=${{ matrix.method }} \ - > Dockerfile_tmp - - cat Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/freesurfer.yml b/.github/workflows/freesurfer.yml deleted file mode 100644 index 28725418..00000000 --- a/.github/workflows/freesurfer.yml +++ /dev/null @@ -1,79 +0,0 @@ -# This is file is automatically generated. Do not edit. -name: 'freesurfer' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - -jobs: - - freesurfer: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['7.3.1', '7.3.0', '7.2.0', '7.1.1', '7.1.1-min', '7.1.0', '6.0.1', '6.0.0', '6.0.0-min'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile - run: | - - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') - if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="apt" - fi - - yum_based=('fedora:36', 'centos:7') - if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="yum" - fi - - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=${pkg_manager} \ - --yes \ - --freesurfer \ - version=${{ matrix.version }} \ - > Dockerfile_tmp - - cat Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/fsl.yml b/.github/workflows/fsl.yml deleted file mode 100644 index 291f53a3..00000000 --- a/.github/workflows/fsl.yml +++ /dev/null @@ -1,81 +0,0 @@ -# This is file is automatically generated. Do not edit. -name: 'fsl' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - -jobs: - - fsl: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['6.0.5.1', '6.0.5', '6.0.4', '6.0.3', '6.0.2', '6.0.1', '6.0.0', '5.0.11', '5.0.10', '5.0.9', '5.0.8'] - method: ['binaries'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile - run: | - - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') - if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="apt" - fi - - yum_based=('fedora:36', 'centos:7') - if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="yum" - fi - - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=${pkg_manager} \ - --yes \ - --fsl \ - version=${{ matrix.version }} \ - method=${{ matrix.method }} \ - > Dockerfile_tmp - - cat Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/matlabmcr.yml b/.github/workflows/matlabmcr.yml deleted file mode 100644 index f3a78e7e..00000000 --- a/.github/workflows/matlabmcr.yml +++ /dev/null @@ -1,81 +0,0 @@ -# This is file is automatically generated. Do not edit. -name: 'matlabmcr' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - -jobs: - - matlabmcr: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['2021b', '2021a', '2020b', '2020a', '2019b', '2019a', '2018b', '2018a', '2017b', '2017a', '2016b', '2016a', '2015b', '2015aSP1', '2015a', '2014a', '2014b', '2013b', '2013a', '2012b', '2012a', '2010a'] - method: ['binaries'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile - run: | - - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') - if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="apt" - fi - - yum_based=('fedora:36', 'centos:7') - if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="yum" - fi - - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=${pkg_manager} \ - --yes \ - --matlabmcr \ - version=${{ matrix.version }} \ - method=${{ matrix.method }} \ - > Dockerfile_tmp - - cat Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/mricron.yml b/.github/workflows/mricron.yml deleted file mode 100644 index c9e3807b..00000000 --- a/.github/workflows/mricron.yml +++ /dev/null @@ -1,81 +0,0 @@ -# This is file is automatically generated. Do not edit. -name: 'mricron' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - -jobs: - - mricron: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['1.0.20190902', '1.0.20190410', '1.0.20181114', '1.0.20180614', '1.0.20180404', '1.0.20171220'] - method: ['binaries'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile - run: | - - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') - if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="apt" - fi - - yum_based=('fedora:36', 'centos:7') - if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="yum" - fi - - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=${pkg_manager} \ - --yes \ - --mricron \ - version=${{ matrix.version }} \ - method=${{ matrix.method }} \ - > Dockerfile_tmp - - cat Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/mrtrix3.yml b/.github/workflows/mrtrix3.yml deleted file mode 100644 index 82f4ef11..00000000 --- a/.github/workflows/mrtrix3.yml +++ /dev/null @@ -1,81 +0,0 @@ -# This is file is automatically generated. Do not edit. -name: 'mrtrix3' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - -jobs: - - mrtrix3: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['3.0.2', '3.0.1', '3.0.0'] - method: ['binaries', 'source'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile - run: | - - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') - if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="apt" - fi - - yum_based=('fedora:36', 'centos:7') - if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="yum" - fi - - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=${pkg_manager} \ - --yes \ - --mrtrix3 \ - version=${{ matrix.version }} \ - method=${{ matrix.method }} \ - > Dockerfile_tmp - - cat Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . diff --git a/.github/workflows/spm12.yml b/.github/workflows/spm12.yml deleted file mode 100644 index 4be51e20..00000000 --- a/.github/workflows/spm12.yml +++ /dev/null @@ -1,81 +0,0 @@ -# This is file is automatically generated. Do not edit. -name: 'spm12' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - -jobs: - - spm12: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - base_image: ['ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim', 'fedora:36', 'centos:7'] - version: ['r7771', 'r7487', 'r7219', 'r6914', 'r6685', 'r6472', 'r6225'] - method: ['binaries'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install neurodocker - run: python -m pip install --editable .[dev] - - - name: Generate Dockerfile - run: | - - apt_based=('ubuntu:22.04', 'ubuntu:18.04', 'ubuntu:16.04', 'debian:bullseye-slim', 'debian:buster-slim', 'debian:stretch-slim') - if [[ " ${apt_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="apt" - fi - - yum_based=('fedora:36', 'centos:7') - if [[ " ${yum_based[*]} " =~ ${{ matrix.base_image }} ]]; then - pkg_manager="yum" - fi - - neurodocker \ - generate docker \ - --base-image=${{ matrix.base_image }} \ - --pkg-manager=${pkg_manager} \ - --yes \ - --spm12 \ - version=${{ matrix.version }} \ - method=${{ matrix.method }} \ - > Dockerfile_tmp - - cat Dockerfile_tmp - - - name: Build the Docker image - run: docker build -f Dockerfile_tmp . From 6a36db75c56563b007caf29d8c5e30d2c483d0c7 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 17 Jan 2023 23:15:08 +0100 Subject: [PATCH 078/211] try to commit in CI --- .github/workflows/bootstrap.yml | 40 +++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 5e0db749..3cb0fcd1 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -1,4 +1,4 @@ -name: CI +name: bootstrap on: push: @@ -7,7 +7,7 @@ on: branches: [ "*" ] jobs: - run-tests: + bootstrap: runs-on: ubuntu-22.04 steps: @@ -26,4 +26,40 @@ jobs: python .github/workflows/create_workflows.py ls -l .github/workflows + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + # Optional. Commit message for the created commit. + # Defaults to "Apply automatic changes" + commit_message: add workflows + + # Optional. Local and remote branch name where commit is going to be pushed + # to. Defaults to the current branch. + # You might need to set `create_branch: true` if the branch does not exist. + branch: test_docker_build + + # Optional. Options used by `git-commit`. + # See https://git-scm.com/docs/git-commit#_options + commit_options: '--no-verify --signoff' + + # Optional commit user and author settings + commit_user_name: My GitHub Actions Bot # defaults to "github-actions[bot]" + commit_user_email: my-github-actions-bot@example.org # defaults to "41898282+github-actions[bot]@users.noreply.github.com" + commit_author: Author # defaults to author of the commit that triggered the run + + # Optional. Options used by `git-push`. + # See https://git-scm.com/docs/git-push#_options + push_options: '--force' + + # Optional. Disable dirty check and always try to create a commit and push + skip_dirty_check: true + + # Optional. Skip internal call to `git fetch` + skip_fetch: true + + # Optional. Skip internal call to `git checkout` + skip_checkout: true + + # Optional. Create given branch name in local and remote repository. + create_branch: true + From 038719ee9ed523e647d32b4c9c91677773fb545c Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 17 Jan 2023 23:24:46 +0100 Subject: [PATCH 079/211] try using proper auth --- .github/workflows/bootstrap.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 3cb0fcd1..f54edd74 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -41,10 +41,9 @@ jobs: # See https://git-scm.com/docs/git-commit#_options commit_options: '--no-verify --signoff' - # Optional commit user and author settings - commit_user_name: My GitHub Actions Bot # defaults to "github-actions[bot]" - commit_user_email: my-github-actions-bot@example.org # defaults to "41898282+github-actions[bot]@users.noreply.github.com" - commit_author: Author # defaults to author of the commit that triggered the run + # https://github.com/actions/checkout#push-a-commit-using-the-built-in-token + commit_user_name: github-actions + commit_user_email: github-actions@github.com # Optional. Options used by `git-push`. # See https://git-scm.com/docs/git-push#_options From 06fb4835f42d7e1f97f3bd4bcf5671d50b45d106 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 17 Jan 2023 23:27:01 +0100 Subject: [PATCH 080/211] try manual --- .github/workflows/bootstrap.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index f54edd74..f3c73ba1 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -26,6 +26,14 @@ jobs: python .github/workflows/create_workflows.py ls -l .github/workflows + - run: | + git config user.name github-actions + git config user.email github-actions@github.com + git checkout -b test_docker_build + git add . + git commit -m "generated" + git push + - uses: stefanzweifel/git-auto-commit-action@v4 with: # Optional. Commit message for the created commit. From 357461f59bead954da0b8c4a244bb170dd57f772 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 17 Jan 2023 23:28:15 +0100 Subject: [PATCH 081/211] set upstream --- .github/workflows/bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index f3c73ba1..e5b4390c 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -32,7 +32,7 @@ jobs: git checkout -b test_docker_build git add . git commit -m "generated" - git push + git push --set-upstream origin test_docker_build - uses: stefanzweifel/git-auto-commit-action@v4 with: From 6e305611b0aa2fe578f0eedf5735153f1877dbfc Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 17 Jan 2023 23:36:32 +0100 Subject: [PATCH 082/211] try with token --- .github/workflows/bootstrap.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index e5b4390c..5d6b7177 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -12,6 +12,8 @@ jobs: steps: - uses: actions/checkout@v2 + with: + token: ${{ secrets.NEURODOCKER_WORFLOW }} - name: Set up Python uses: actions/setup-python@v2 @@ -26,12 +28,13 @@ jobs: python .github/workflows/create_workflows.py ls -l .github/workflows + # https://github.com/actions/checkout#push-a-commit-using-the-built-in-token - run: | git config user.name github-actions git config user.email github-actions@github.com git checkout -b test_docker_build git add . - git commit -m "generated" + git commit -m "add workflows" git push --set-upstream origin test_docker_build - uses: stefanzweifel/git-auto-commit-action@v4 From 4aa546b3c85bb2c9008e3ef5200d9ccf0007047c Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 17 Jan 2023 23:42:47 +0100 Subject: [PATCH 083/211] try repo secret --- .github/workflows/bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 5d6b7177..e1ffec8a 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - token: ${{ secrets.NEURODOCKER_WORFLOW }} + token: ${{ secrets.CREATE_WORKFLOWS }} - name: Set up Python uses: actions/setup-python@v2 From 4eacd92b5a9d96a144ed329fc6a253c6a1209d12 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 18 Jan 2023 09:50:34 +0100 Subject: [PATCH 084/211] try another token --- .github/workflows/bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index e1ffec8a..6aaaac8f 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - token: ${{ secrets.CREATE_WORKFLOWS }} + token: ${{ secrets.BOOTSTRAP }} - name: Set up Python uses: actions/setup-python@v2 From c6394ee0d0f87b2e13891045c6d0bfaa7fa5f112 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 18 Jan 2023 09:55:17 +0100 Subject: [PATCH 085/211] run test on the proper branch --- .github/workflows/bootstrap.yml | 24 +++++++++++++----------- .github/workflows/create_workflows.py | 4 ++-- .github/workflows/docker_build.jinja | 4 +--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 6aaaac8f..f6b674a6 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -1,10 +1,12 @@ name: bootstrap +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: - branches: [ "*" ] - pull_request: - branches: [ "*" ] + branches: [ "bootstrap" ] jobs: bootstrap: @@ -28,14 +30,14 @@ jobs: python .github/workflows/create_workflows.py ls -l .github/workflows - # https://github.com/actions/checkout#push-a-commit-using-the-built-in-token - - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git checkout -b test_docker_build - git add . - git commit -m "add workflows" - git push --set-upstream origin test_docker_build + # # https://github.com/actions/checkout#push-a-commit-using-the-built-in-token + # - run: | + # git config user.name github-actions + # git config user.email github-actions@github.com + # git checkout -b test_docker_build + # git add . + # git commit -m "add workflows" + # git push --set-upstream origin test_docker_build - uses: stefanzweifel/git-auto-commit-action@v4 with: diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 55ca7a77..af23853a 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -97,7 +97,7 @@ def create_dashboard_file(): """, file=f) - # table of content + # table of content for software, _ in softwares.items(): print(f"""- [{software}](#{software})""", file=f) @@ -110,7 +110,7 @@ def create_dashboard_file(): print( f"""## {software} -[{software} github actions workflow](https://github.com/{repo}/actions/workflows/{software}.yml) +[{software} workflow](https://github.com/{repo}/actions/workflows/{software}.yml) ![{software} build status]({image_url}) """, diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index de6cf44e..da9dd1ec 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -7,9 +7,7 @@ concurrency: on: push: - branches: ["*"] - pull_request: - branches: ["*"] + branches: ["test_docker_build"] # Uses the cron schedule for github actions # From d8a9d8c5b73e057291df36f7cea657fbac76a324 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 18 Jan 2023 10:06:55 +0100 Subject: [PATCH 086/211] adapt before merge and comment --- .github/workflows/bootstrap.yml | 64 +++++++++++++--------------- .github/workflows/docker_build.jinja | 17 -------- 2 files changed, 30 insertions(+), 51 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index f6b674a6..48ebbbd1 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -1,3 +1,10 @@ +# this workflow bootstraps the testing of the build the docker images +# +# - this will run the python script used to generate the workflows +# based on a the jinja template +# - commit and push the generated workflows to the branch test_docker_build +# where they will be executed + name: bootstrap concurrency: @@ -6,7 +13,24 @@ concurrency: on: push: - branches: [ "bootstrap" ] + branches: [ "test_build" ] + +# Uses the cron schedule for github actions +# +# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events +# +# ┌───────────── minute (0 - 59) +# │ ┌───────────── hour (0 - 23) +# │ │ ┌───────────── day of the month (1 - 31) +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) +# │ │ │ │ │ +# │ │ │ │ │ +# │ │ │ │ │ +# * * * * * + + schedule: + - cron: 0 0 1,15 * * jobs: bootstrap: @@ -14,6 +38,7 @@ jobs: steps: - uses: actions/checkout@v2 + # requires a token with repo and workflow permissions with: token: ${{ secrets.BOOTSTRAP }} @@ -28,50 +53,21 @@ jobs: - name: Create workflows run: | python .github/workflows/create_workflows.py - ls -l .github/workflows - - # # https://github.com/actions/checkout#push-a-commit-using-the-built-in-token - # - run: | - # git config user.name github-actions - # git config user.email github-actions@github.com - # git checkout -b test_docker_build - # git add . - # git commit -m "add workflows" - # git push --set-upstream origin test_docker_build + ls -l .github/workflows - - uses: stefanzweifel/git-auto-commit-action@v4 + - name: Push workflows to branch test_docker_build + # action: https://github.com/marketplace/actions/git-auto-commit + uses: stefanzweifel/git-auto-commit-action@v4 with: - # Optional. Commit message for the created commit. - # Defaults to "Apply automatic changes" commit_message: add workflows - - # Optional. Local and remote branch name where commit is going to be pushed - # to. Defaults to the current branch. - # You might need to set `create_branch: true` if the branch does not exist. branch: test_docker_build - - # Optional. Options used by `git-commit`. - # See https://git-scm.com/docs/git-commit#_options commit_options: '--no-verify --signoff' - - # https://github.com/actions/checkout#push-a-commit-using-the-built-in-token commit_user_name: github-actions commit_user_email: github-actions@github.com - - # Optional. Options used by `git-push`. - # See https://git-scm.com/docs/git-push#_options push_options: '--force' - - # Optional. Disable dirty check and always try to create a commit and push skip_dirty_check: true - - # Optional. Skip internal call to `git fetch` skip_fetch: true - - # Optional. Skip internal call to `git checkout` skip_checkout: true - - # Optional. Create given branch name in local and remote repository. create_branch: true diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index da9dd1ec..536a1379 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -9,23 +9,6 @@ on: push: branches: ["test_docker_build"] -# Uses the cron schedule for github actions -# -# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events -# -# ┌───────────── minute (0 - 59) -# │ ┌───────────── hour (0 - 23) -# │ │ ┌───────────── day of the month (1 - 31) -# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) -# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) -# │ │ │ │ │ -# │ │ │ │ │ -# │ │ │ │ │ -# * * * * * - - schedule: - - cron: 0 0 1,15 * * - jobs: {{ wf.software }}: From b4c423450ed52f72c2b591666c347bb59e5bdcf6 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 18 Jan 2023 10:12:24 +0100 Subject: [PATCH 087/211] allow to run workflow manually --- .github/workflows/bootstrap.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 48ebbbd1..7da6ee33 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -32,6 +32,9 @@ on: schedule: - cron: 0 0 1,15 * * + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + jobs: bootstrap: runs-on: ubuntu-22.04 From 3301e48c3d95496964621bed91ad5c60e9d4fc95 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 18 Jan 2023 10:30:07 +0100 Subject: [PATCH 088/211] test dashbord build --- .github/workflows/create_workflows.py | 20 ++++++++++++++++---- .github/workflows/docker_build.jinja | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index af23853a..b9719e98 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -1,5 +1,5 @@ """ -This scripts uses a jinja template to create CI workflows to test: +This scripts uses a jinja template to create CI workflows to test. - different linux distributions (split by the package manager they use) - different softwares that neurodocker supports @@ -17,6 +17,11 @@ - cat the dockerfile - attempts to build the corresponding image +This script will also create a "dashboard" saved in docs/README.md +to be picked up to be rendered by the github pages. +This requires for you to build the pages from the docs folder +and on the branch where the workflows are pushed to (currently "test_docker_build"). + """ from pathlib import Path @@ -73,11 +78,18 @@ } output_dir = Path(__file__).parent + template_folder = Path(__file__).parents[2].joinpath("neurodocker", "templates") -build_dashboard_file = Path(__file__).parents[2].joinpath("build_dashboard.md") -branch = "test_build" # "master" -repo = "Remi-Gau/neurodocker" # "ReproNim/neurodocker" +build_dashboard_file = Path(__file__).parents[2].joinpath("docs", "README.md") + +# this has to match the name of the branch where the workflows are pushed to +# see .github/workflows/bootstrap.yml +branch = "test_docker_build" + +# Update to match your username and repo name if you are testing things on your fork +# "ReproNim/neurodocker" +repo = "Remi-Gau/neurodocker" def create_dashboard_file(): diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index 536a1379..a4f3285c 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -7,7 +7,7 @@ concurrency: on: push: - branches: ["test_docker_build"] + branches: ["master"] jobs: From e9b082e679f3b16fe560ae7ee581d6bacc798ebe Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 18 Jan 2023 10:43:44 +0100 Subject: [PATCH 089/211] rm no jekyll --- docs/.nojekyll | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 docs/.nojekyll diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index e69de29b..00000000 From 42c1af64722db2fe1b19b2cc65eb29692b6be8f4 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 18 Jan 2023 10:46:47 +0100 Subject: [PATCH 090/211] reactivate testing workflows --- .github/workflows/docker_build.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index a4f3285c..536a1379 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -7,7 +7,7 @@ concurrency: on: push: - branches: ["master"] + branches: ["test_docker_build"] jobs: From 76a3b20540f491542fbc6e40acff645d92de81d4 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 18 Jan 2023 10:48:38 +0100 Subject: [PATCH 091/211] rm dashboard --- build_dashboard.md | 81 ---------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 build_dashboard.md diff --git a/build_dashboard.md b/build_dashboard.md deleted file mode 100644 index 4cdb055f..00000000 --- a/build_dashboard.md +++ /dev/null @@ -1,81 +0,0 @@ - -# Build dashboard) - -- [afni](#afni) -- [ants](#ants) -- [cat12](#cat12) -- [convert3d](#convert3d) -- [dcm2niix](#dcm2niix) -- [freesurfer](#freesurfer) -- [fsl](#fsl) -- [matlabmcr](#matlabmcr) -- [mricron](#mricron) -- [mrtrix3](#mrtrix3) -- [spm12](#spm12) - -## afni - -[afni github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/afni.yml) - -![afni build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=afni) - -## ants - -[ants github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/ants.yml) - -![ants build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=ants) - -## cat12 - -[cat12 github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/cat12.yml) - -![cat12 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=cat12) - -## convert3d - -[convert3d github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/convert3d.yml) - -![convert3d build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=convert3d) - -## dcm2niix - -[dcm2niix github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/dcm2niix.yml) - -![dcm2niix build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=dcm2niix) - -## freesurfer - -[freesurfer github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/freesurfer.yml) - -![freesurfer build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=freesurfer) - -## fsl - -[fsl github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/fsl.yml) - -![fsl build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=fsl) - -## matlabmcr - -[matlabmcr github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/matlabmcr.yml) - -![matlabmcr build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=matlabmcr) - -## mricron - -[mricron github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/mricron.yml) - -![mricron build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=mricron) - -## mrtrix3 - -[mrtrix3 github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/mrtrix3.yml) - -![mrtrix3 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=mrtrix3) - -## spm12 - -[spm12 github actions workflow](https://github.com/Remi-Gau/neurodocker/actions/workflows/spm12.yml) - -![spm12 build status](http://github-actions.40ants.com/Remi-Gau/neurodocker/matrix.svg?branch=test_build&only=spm12) - From e867ba62366ce741fe8f2919ec27a0f4d3653f36 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 18 Jan 2023 20:20:02 +0100 Subject: [PATCH 092/211] [FIX] add regression test for 498 (#499) * add regression test * add expected failure --- neurodocker/cli/tests/test_cli.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/neurodocker/cli/tests/test_cli.py b/neurodocker/cli/tests/test_cli.py index 1b108779..1f4b860a 100644 --- a/neurodocker/cli/tests/test_cli.py +++ b/neurodocker/cli/tests/test_cli.py @@ -42,6 +42,26 @@ def test_minimal_args(cmd: str, pkg_manager: str): assert result.exit_code == 0, result.output +@pytest.mark.xfail(reason="https://github.com/ReproNim/neurodocker/issues/498") +def test_copy(): + runner = CliRunner() + result = runner.invoke( + generate, + [ + "docker", + "--pkg-manager", + "apt", + "--base-image", + "debian", + # copy + "--copy", + "file1", + "file2", + ], + ) + assert "file1" in (result.output) + + @pytest.mark.parametrize("cmd", _cmds) @pytest.mark.parametrize("pkg_manager", ["apt", "yum"]) def test_all_args(cmd: str, pkg_manager: str): From 88b0dda32327d1e7a4e84c9baa3016252d361db6 Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Wed, 18 Jan 2023 15:45:21 -0500 Subject: [PATCH 093/211] add long_description to setup.cfg (#465) This will hopefully render the readme in pypi on next release. --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index acf241c6..bae46d07 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,6 +4,8 @@ url = https://github.com/repronim/neurodocker author = Neurodocker Developers author_email = jakub.kaczmarzyk@gmail.com description = A generic generator of Dockerfiles and Singularity recipes +long_description = file: README.md +long_description_content_type = text/markdown license = Apache License, 2.0 classifiers = Development Status :: 4 - Beta From 2992e02b75b7ddd4025169b1a7f2c6fa19ca606b Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Wed, 18 Jan 2023 16:07:07 -0500 Subject: [PATCH 094/211] fix the types in --copy and --entrypoint (#500) * fix the types in --copy and --entrypoint Both of these options use the class OptionEatAll. By default, this class will output a string type, but that would result in a string that looked like a tuple. For example, it is possible to use `ast.literal_eval(value)` on the value to convert it back to a tuple. To fix this, this commit sets the type for --copy and --entrypoint to `tuple` and the subsequent code expects the values for --copy and --entrypoint to be tuples. This commit also adds a type hint to an OptionsEatAll internal to help with debugging. * expand issue 498 tests for --copy and --entrypoint * change assertions to raise click.ClickException This formats the error messages better (and with less clutter). This commit also adds a note to contact the devs in the case of errors that users cannot fix (errors in the implementation...). * raise an error if OptionEatAll is used as a str type The fundamental issue leading to #498 was that the values in OptionEatAll were being coerced to a string type if no type was specified in OptionEatAll. This made a tuple `('foo',)` into a string `'("foo",)'`. This commit raises an error if OptionEatAll is used as a string. Indeed, the 'eat-all' nature of this option suggests that there are multiple options, which suggests the type should be a list or tuple. This commit also adds a test for this. --- neurodocker/cli/generate.py | 24 ++++++++++----- neurodocker/cli/tests/test_cli.py | 50 +++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 10 deletions(-) diff --git a/neurodocker/cli/generate.py b/neurodocker/cli/generate.py index 3fa5ffd6..638c5b41 100644 --- a/neurodocker/cli/generate.py +++ b/neurodocker/cli/generate.py @@ -122,11 +122,16 @@ def __init__(self, *args, **kwargs): nargs = kwargs.pop("nargs", -1) assert nargs == -1, "nargs, if set, must be -1 not {}".format(nargs) super(OptionEatAll, self).__init__(*args, **kwargs) + if self.type is click.STRING: + raise ValueError( + "in the current implementation of OptionEatAll, `type` cannot be a" + " string." + ) self._previous_parser_process = None self._eat_all_parser = None def add_to_parser(self, parser, ctx): - def parser_process(value, state): + def parser_process(value, state: click.parser.ParsingState): # method to hook to the parser.process done = False value = [value] @@ -201,6 +206,7 @@ def _get_common_renderer_params() -> ty.List[click.Parameter]: OptionEatAll( ["--copy"], multiple=True, + type=tuple, help=( "Copy files into the container. Provide at least two paths." " The last path is always the destination path in the container." @@ -215,6 +221,7 @@ def _get_common_renderer_params() -> ty.List[click.Parameter]: OptionEatAll( ["--entrypoint"], multiple=True, + type=tuple, help="Set entrypoint of the container", ), OptionEatAll( @@ -317,12 +324,16 @@ def _get_instruction_for_param( d = {"name": param.name, "kwds": {"base_image": value}} # arg elif param.name == "arg": - assert len(value) == 2, "expected key=value pair for --arg" + if len(value) != 2: + raise click.ClickException("expected key=value pair for --arg") k, v = value d = {"name": param.name, "kwds": {"key": k, "value": v}} # copy elif param.name == "copy": - assert len(value) > 1, "expected at least two values for --copy" + if not isinstance(value, tuple): + raise ValueError("expected this value to be a tuple (contact developers)") + if len(value) < 2: + raise click.ClickException("expected at least two values for --copy") source, destination = list(value[:-1]), value[-1] d = {"name": param.name, "kwds": {"source": source, "destination": destination}} # env @@ -331,10 +342,9 @@ def _get_instruction_for_param( d = {"name": param.name, "kwds": {**value}} # entrypoint elif param.name == "entrypoint": - if isinstance(value, str): - value = [value] - else: - value = list(value) + if not isinstance(value, tuple): + raise ValueError("expected this value to be a tuple (contact developers)") + value = list(value) # convert from tuple to list d = {"name": param.name, "kwds": {"args": value}} # install elif param.name == "install": diff --git a/neurodocker/cli/tests/test_cli.py b/neurodocker/cli/tests/test_cli.py index 1f4b860a..406ca936 100644 --- a/neurodocker/cli/tests/test_cli.py +++ b/neurodocker/cli/tests/test_cli.py @@ -6,6 +6,7 @@ import pytest from neurodocker.cli.cli import generate +from neurodocker.cli.generate import OptionEatAll _cmds = ["docker", "singularity"] @@ -42,8 +43,7 @@ def test_minimal_args(cmd: str, pkg_manager: str): assert result.exit_code == 0, result.output -@pytest.mark.xfail(reason="https://github.com/ReproNim/neurodocker/issues/498") -def test_copy(): +def test_copy_issue_498(): runner = CliRunner() result = runner.invoke( generate, @@ -59,7 +59,51 @@ def test_copy(): "file2", ], ) - assert "file1" in (result.output) + assert "file1" in result.output + assert '\nCOPY ["file1", \\\n "file2"]\n' in result.output + + # Fail if given fewer than two inputs to --copy. + result = runner.invoke( + generate, + [ + "docker", + "--pkg-manager", + "apt", + "--base-image", + "debian", + # copy + "--copy", + "file1", + ], + ) + assert "Error: expected at least two values for --copy" in result.output + assert result.exit_code != 0 + + +# Issue #498 references --copy but the same broken behavior is seen in --entrypoint. +def test_entrypoint_issue_498(): + runner = CliRunner() + result = runner.invoke( + generate, + [ + "docker", + "--pkg-manager", + "apt", + "--base-image", + "debian", + "--entrypoint", + "printf", + "this", + "that", + ], + ) + assert '\nENTRYPOINT ["printf", "this", "that"]\n' in result.output + + +def test_optioneatall_type_issue_498(): + with pytest.raises(ValueError): + OptionEatAll(["--foo"], type=str) + OptionEatAll(["--foo"], type=tuple) @pytest.mark.parametrize("cmd", _cmds) From ed952ecbf81123ef7ead8e665825bcc644026c21 Mon Sep 17 00:00:00 2001 From: Repronim Bot Date: Wed, 18 Jan 2023 21:07:31 +0000 Subject: [PATCH 095/211] Update CHANGELOG.md [skip ci] --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41900ad3..7e9be794 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +# 0.9.4 (Wed Jan 18 2023) + +#### 🐛 Bug Fix + +- fix the types in --copy and --entrypoint [#500](https://github.com/ReproNim/neurodocker/pull/500) ([@kaczmarj](https://github.com/kaczmarj)) +- add long_description to setup.cfg [#465](https://github.com/ReproNim/neurodocker/pull/465) ([@kaczmarj](https://github.com/kaczmarj)) +- [FIX] add regression test for 498 [#499](https://github.com/ReproNim/neurodocker/pull/499) ([@Remi-Gau](https://github.com/Remi-Gau)) + +#### Authors: 2 + +- Jakub Kaczmarzyk ([@kaczmarj](https://github.com/kaczmarj)) +- Remi Gau ([@Remi-Gau](https://github.com/Remi-Gau)) + +--- + # 0.9.3 (Mon Jan 16 2023) #### 🐛 Bug Fix From de43d6fb1dbd6a9ae67abe6f9853ac17f609e9a2 Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Wed, 18 Jan 2023 16:44:15 -0500 Subject: [PATCH 096/211] [TESTS] check black style in github actions (#501) * check that files have been formatted with black * format file with black --- .github/workflows/pull-request.yml | 2 ++ neurodocker/reproenv/tests/test_state.py | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9c37ce52..8924c7e8 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -36,6 +36,8 @@ jobs: run: mypy --install-types --non-interactive neurodocker - name: Check style run: flake8 neurodocker + - name: Check black formatting + run: black --check neurodocker - name: Run python tests run: pytest --numprocesses auto - name: Get code coverage diff --git a/neurodocker/reproenv/tests/test_state.py b/neurodocker/reproenv/tests/test_state.py index ba40d0bf..dd75d2ac 100644 --- a/neurodocker/reproenv/tests/test_state.py +++ b/neurodocker/reproenv/tests/test_state.py @@ -12,9 +12,7 @@ def test_validate_template_invalid_templates(): with pytest.raises(exceptions.TemplateError, match="'name' is a required property"): _validate_template({}) - with pytest.raises( - exceptions.TemplateError, match="{'name': 'bar'} is not valid" - ): + with pytest.raises(exceptions.TemplateError, match="{'name': 'bar'} is not valid"): _validate_template({"name": "bar"}) # missing 'name' top-level key From 4e902ec35643bfb0b5f9b9207c27dda455fe6aa8 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Wed, 18 Jan 2023 17:13:57 -0500 Subject: [PATCH 097/211] add bad versions to et file --- .et | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .et diff --git a/.et b/.et new file mode 100644 index 00000000..77a1472c --- /dev/null +++ b/.et @@ -0,0 +1,2 @@ +{ "bad_versions" : ["0.9.2", "0.9.3"] +} From ce889beafc2088068eb88d6b1d736bb00e90c0a2 Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Thu, 19 Jan 2023 11:16:46 -0500 Subject: [PATCH 098/211] do not install sphinx 6.x The pydata theme we are using seems to be incompatible with sphinx 6.x which was released recently. We prevent this version from being installed for the time being. The error produced with sphinx 6.x is below and is related to https://github.com/pydata/pydata-sphinx-theme/issues/1094. This has been fixed in pydata-sphinx-theme but has not been released yet. The fix should be part of the next release 0.13. ``` Theme error: An error happened in rendering the page api. Reason: UndefinedError("'logo' is undefined") make: *** [Makefile:20: html] Error 2 ``` --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index bae46d07..6157ae15 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,7 +50,7 @@ dev = pytest-reportlog >= 0.1.2 pytest-xdist >= 2.2.0 docs = - sphinx >= 3.4 + sphinx >= 3.4, !=6.* pydata-sphinx-theme sphinxcontrib.apidoc >= 0.3 all = From 709da4a4879132439b185d361202cd78b8ce1e68 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Fri, 3 Feb 2023 14:15:36 -0500 Subject: [PATCH 099/211] testing sphinx build --- .github/workflows/docs.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..fd1484de --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,18 @@ +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build_docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + # Standard usage + - uses: totaldebug/action-sphinx@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + sphinx_src: 'docs' + target_branch: 'gh-pages' From c59c95d60b9b82773fe22756250ec3a4ff9777ae Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Fri, 3 Feb 2023 14:16:28 -0500 Subject: [PATCH 100/211] fix: syntax --- .github/workflows/docs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fd1484de..d4a2eef2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: # Standard usage - uses: totaldebug/action-sphinx@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - sphinx_src: 'docs' - target_branch: 'gh-pages' + with: + token: ${{ secrets.GITHUB_TOKEN }} + sphinx_src: 'docs' + target_branch: 'gh-pages' From ba64412a22bef4ac360ecb78ce0ec046306fc45e Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Fri, 3 Feb 2023 14:26:53 -0500 Subject: [PATCH 101/211] fix docs build --- .github/workflows/docs.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d4a2eef2..06f17bbc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,16 +3,22 @@ on: branches: - master workflow_dispatch: - +permissions: + contents: write jobs: build_docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - # Standard usage - - uses: totaldebug/action-sphinx@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - sphinx_src: 'docs' - target_branch: 'gh-pages' + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install neurodocker + run: python -m pip install --editable .[docs] + - name: build docs + run: sphinx-build docs docs-build + - name: Deploy + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: docs-build # The folder the action should deploy. From 56d5e721c7ffd124d156a02c16e9d494cf8ed7f8 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Fri, 3 Feb 2023 14:34:17 -0500 Subject: [PATCH 102/211] remove on demand --- .github/workflows/docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 06f17bbc..a70c426a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,7 +2,6 @@ on: push: branches: - master - workflow_dispatch: permissions: contents: write jobs: From a2fb4ba5522ddc1f27c9c15b35fed4f550a8d23b Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Fri, 3 Feb 2023 14:35:16 -0500 Subject: [PATCH 103/211] Update .github/workflows/bootstrap.yml --- .github/workflows/bootstrap.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 7da6ee33..96b3dbbf 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -34,7 +34,8 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: - +permissions: + contents: write jobs: bootstrap: runs-on: ubuntu-22.04 From bc03b511d74a28f2fd5d9c475e289c92bfbb45cc Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Fri, 3 Feb 2023 14:35:43 -0500 Subject: [PATCH 104/211] Update .github/workflows/bootstrap.yml --- .github/workflows/bootstrap.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 96b3dbbf..210d6cbc 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -42,9 +42,6 @@ jobs: steps: - uses: actions/checkout@v2 - # requires a token with repo and workflow permissions - with: - token: ${{ secrets.BOOTSTRAP }} - name: Set up Python uses: actions/setup-python@v2 From 5c9caf7c39de5355e6ab0f11eea8fafddcd8a507 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Fri, 3 Feb 2023 14:36:33 -0500 Subject: [PATCH 105/211] Apply suggestions from code review --- .github/workflows/bootstrap.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 210d6cbc..92769fb3 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -41,10 +41,10 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: '3.11' From 3bddeeb7e7676282ca079a63d9906390dbb7ad7f Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Fri, 3 Feb 2023 14:36:56 -0500 Subject: [PATCH 106/211] Update .github/workflows/bootstrap.yml Co-authored-by: Remi Gau --- .github/workflows/bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 92769fb3..5a39b1cc 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -13,7 +13,7 @@ concurrency: on: push: - branches: [ "test_build" ] + branches: [ "master" ] # Uses the cron schedule for github actions # From 3b03838b9da009b9eb8c4651b38a8db232c47388 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 4 Feb 2023 10:06:41 +0100 Subject: [PATCH 107/211] run black --- .github/workflows/create_workflows.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index b9719e98..c5bcce20 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -107,7 +107,8 @@ def create_dashboard_file(): """ # Build dashboard """, - file=f) + file=f, + ) # table of content for software, _ in softwares.items(): From ed39d308333a4275411b031f0c4724cdbe614d30 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 4 Feb 2023 09:42:17 -0500 Subject: [PATCH 108/211] precommit checks --- .github/workflows/bootstrap.yml | 24 +++++++++++------------- .github/workflows/docs.yml | 2 +- .gitignore | 2 +- README.md | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 5a39b1cc..aa13090e 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -1,8 +1,8 @@ # this workflow bootstraps the testing of the build the docker images -# -# - this will run the python script used to generate the workflows +# +# - this will run the python script used to generate the workflows # based on a the jinja template -# - commit and push the generated workflows to the branch test_docker_build +# - commit and push the generated workflows to the branch test_docker_build # where they will be executed name: bootstrap @@ -13,7 +13,7 @@ concurrency: on: push: - branches: [ "master" ] + branches: [ "master" ] # Uses the cron schedule for github actions # @@ -33,9 +33,9 @@ on: - cron: 0 0 1,15 * * # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + workflow_dispatch: permissions: - contents: write + contents: write jobs: bootstrap: runs-on: ubuntu-22.04 @@ -54,7 +54,7 @@ jobs: - name: Create workflows run: | python .github/workflows/create_workflows.py - ls -l .github/workflows + ls -l .github/workflows - name: Push workflows to branch test_docker_build # action: https://github.com/marketplace/actions/git-auto-commit @@ -63,12 +63,10 @@ jobs: commit_message: add workflows branch: test_docker_build commit_options: '--no-verify --signoff' - commit_user_name: github-actions - commit_user_email: github-actions@github.com + commit_user_name: github-actions + commit_user_email: github-actions@github.com push_options: '--force' - skip_dirty_check: true - skip_fetch: true + skip_dirty_check: true + skip_fetch: true skip_checkout: true create_branch: true - - diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a70c426a..3becccab 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,7 @@ on: branches: - master permissions: - contents: write + contents: write jobs: build_docs: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 35769a43..259e7a35 100644 --- a/.gitignore +++ b/.gitignore @@ -139,4 +139,4 @@ dmypy.json cython_debug/ # Pycharm -.idea/ \ No newline at end of file +.idea/ diff --git a/README.md b/README.md index 4a6715fa..75590663 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,6 @@ Before committing changes, initialize `pre-commit` with `pre-commit install`. Th ## Build status -You can check the status of the build of the Docker images +You can check the status of the build of the Docker images for several of the neuroimaging software packages that are supported by _Neurodocker_ on [this page](build_dashboard.md). From 6adc00b56b3bfa1ca526a7b54ca36e8b81abe41d Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 4 Feb 2023 09:45:53 -0500 Subject: [PATCH 109/211] update black --- .pre-commit-config.yaml | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8297deb1..c93aece2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: check-yaml - id: check-added-large-files - repo: https://github.com/psf/black - rev: "22.12.0" + rev: "23.1.0" hooks: - id: black diff --git a/setup.cfg b/setup.cfg index 6157ae15..1473c901 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,7 +40,7 @@ minify = docker >= 4.4.1 dev = %(minify)s - black >= 22.12.0 + black >= 23.1.0 codecov flake8 mypy From 5caa937adb39bf1052cfc273d9943e8b3dcc09c2 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 4 Feb 2023 09:46:38 -0500 Subject: [PATCH 110/211] update black commits --- neurodocker/cli/minify/_prune.py | 1 - neurodocker/reproenv/renderers.py | 1 - .../tests/test_build_images_from_registered_templates.py | 1 - neurodocker/reproenv/tests/test_build_images_simple.py | 1 - 4 files changed, 4 deletions(-) diff --git a/neurodocker/cli/minify/_prune.py b/neurodocker/cli/minify/_prune.py index 027fd04b..2225b9e2 100644 --- a/neurodocker/cli/minify/_prune.py +++ b/neurodocker/cli/minify/_prune.py @@ -21,7 +21,6 @@ def main( yaml_file: ty.Union[str, Path], directories_to_prune: ty.Union[ty.List[str], ty.List[Path]], ): - if not _in_docker(): raise RuntimeError( "Not running in a Docker container. This script should only be used within" diff --git a/neurodocker/reproenv/renderers.py b/neurodocker/reproenv/renderers.py index f2071f70..e9bb2802 100644 --- a/neurodocker/reproenv/renderers.py +++ b/neurodocker/reproenv/renderers.py @@ -339,7 +339,6 @@ def install_dependencies_patch( def add_registered_template( self, name: str, method: installation_methods_type = None, **kwds ) -> _Renderer: - # Template was validated at registration time. template_dict = _TemplateRegistry.get(name) diff --git a/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py b/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py index 79fad9ef..e94b92a3 100644 --- a/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py +++ b/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py @@ -41,7 +41,6 @@ def test_build_using_renderer_from_dict( fd_version_startswith: str, tmp_path: Path, ): - _TemplateRegistry._reset() _TemplateRegistry.register(_template_filepath) diff --git a/neurodocker/reproenv/tests/test_build_images_simple.py b/neurodocker/reproenv/tests/test_build_images_simple.py index 8870d304..b5608ee2 100644 --- a/neurodocker/reproenv/tests/test_build_images_simple.py +++ b/neurodocker/reproenv/tests/test_build_images_simple.py @@ -15,7 +15,6 @@ ], ) def test_build_simple(cmd: str, tmp_path): - rcls = DockerRenderer if cmd == "docker" else SingularityRenderer # Create a Dockerfile. From a24c771ffc625604679c9dff651f10c6720ad435 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 4 Feb 2023 09:49:23 -0500 Subject: [PATCH 111/211] update black commits for github workflow --- .github/workflows/create_workflows.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index c5bcce20..7c367af3 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -101,7 +101,6 @@ def create_dashboard_file(): gh_actions_url = "http://github-actions.40ants.com/" with open(build_dashboard_file, "w") as f: - image_base_url = f"{gh_actions_url}{repo}/matrix.svg?branch={branch}" print( """ @@ -118,7 +117,6 @@ def create_dashboard_file(): # link to the github actions workflow and image of the build status for software, _ in softwares.items(): - image_url = f"{image_base_url}&only={software}" print( f"""## {software} @@ -146,7 +144,6 @@ def stringify(some_list: list[str]) -> str: def main(): - env = Environment( loader=FileSystemLoader(Path(__file__).parent), autoescape=select_autoescape(), @@ -163,7 +160,6 @@ def main(): } for software, spec in softwares.items(): - wf = { "header": "# This is file is automatically generated. Do not edit.", "os": os, From 2e779be7b1616fd349954aa6aebd04d65a5b486b Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Tue, 7 Feb 2023 09:51:55 -0500 Subject: [PATCH 112/211] allow writing actions --- .github/workflows/bootstrap.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index aa13090e..072cae8c 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -36,6 +36,7 @@ on: workflow_dispatch: permissions: contents: write + actions: write jobs: bootstrap: runs-on: ubuntu-22.04 From 5286e68019fb50acb0652683acb3f932b92245e6 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Tue, 7 Feb 2023 09:57:29 -0500 Subject: [PATCH 113/211] simplify git commit --- .github/workflows/bootstrap.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 072cae8c..c6d942c8 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -54,20 +54,7 @@ jobs: - name: Create workflows run: | + git checkout -b test_docker_build python .github/workflows/create_workflows.py ls -l .github/workflows - - - name: Push workflows to branch test_docker_build - # action: https://github.com/marketplace/actions/git-auto-commit - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: add workflows - branch: test_docker_build - commit_options: '--no-verify --signoff' - commit_user_name: github-actions - commit_user_email: github-actions@github.com - push_options: '--force' - skip_dirty_check: true - skip_fetch: true - skip_checkout: true - create_branch: true + git push origin --force test_docker_build From ef301b5f8677611fb5f0b9b62cea2190af00778b Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Tue, 7 Feb 2023 10:02:28 -0500 Subject: [PATCH 114/211] Update bootstrap.yml --- .github/workflows/bootstrap.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index c6d942c8..58278868 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -57,4 +57,6 @@ jobs: git checkout -b test_docker_build python .github/workflows/create_workflows.py ls -l .github/workflows + git add workflows/*.yml + git commit -am "added new workflows" git push origin --force test_docker_build From a7a57a10999ce65913ea29167e55a1c4b0e3db89 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Tue, 7 Feb 2023 10:14:35 -0500 Subject: [PATCH 115/211] add all changed files --- .github/workflows/bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 58278868..fef1248f 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -57,6 +57,6 @@ jobs: git checkout -b test_docker_build python .github/workflows/create_workflows.py ls -l .github/workflows - git add workflows/*.yml + git add . git commit -am "added new workflows" git push origin --force test_docker_build From b83a6c0019a143198a3daa4715c1e618d699bf45 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Tue, 7 Feb 2023 10:17:13 -0500 Subject: [PATCH 116/211] add commit agent --- .github/workflows/bootstrap.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index fef1248f..8c25d59e 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -58,5 +58,7 @@ jobs: python .github/workflows/create_workflows.py ls -l .github/workflows git add . + git config --global user.email "no-reply@repronim.org" + git config --global user.name "Repronim neurodocker bot" git commit -am "added new workflows" git push origin --force test_docker_build From 31aa323c56cd7026765057140382a5df2ddb48fc Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Tue, 7 Feb 2023 10:37:50 -0500 Subject: [PATCH 117/211] add workflow token --- .github/workflows/bootstrap.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 8c25d59e..b3d42d95 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -43,6 +43,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + token: ${{ secrets.CI_FLOW }} - name: Set up Python uses: actions/setup-python@v3 From dc3112fc415ba3352daf4bf980e731c74ea24d05 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Tue, 7 Feb 2023 10:46:17 -0500 Subject: [PATCH 118/211] fix: repo info --- .github/workflows/create_workflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 7c367af3..629b071c 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -89,7 +89,7 @@ # Update to match your username and repo name if you are testing things on your fork # "ReproNim/neurodocker" -repo = "Remi-Gau/neurodocker" +repo = "ReproNim/neurodocker" def create_dashboard_file(): From ca127396fcf8f95f3adb27fee6909a8832809328 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Wed, 8 Feb 2023 09:01:39 +1000 Subject: [PATCH 119/211] switched to debian packages that are unpacked for yum based distributions --- .DS_Store | Bin 0 -> 6148 bytes neurodocker/templates/minc.yaml | 39 +++++++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6843ad8b9ff37bd0a6b0ef0425047219f7e30dc2 GIT binary patch literal 6148 zcmeHLJxc>Y5S=xL2GgVxJFl^@5mMWnA!03Q1i{37kcf#F5+eu}r?o#quoL_VcK!v$ zfP()(v=b40v%5)llbq>9WCwQNW@dKx-MidQE<_}<-AaZiO+-mFMsFV71mifjF`Lnz zMWEm{8nsNm95!2Hna<%9a0>iI1^C(ZXq9TTPe<1CyKuT=#+qR+S89YM_>$$1-do|~ zZrzSoevG&3#@Vn`#8jH=?@M*+Qpwt#W^p==W|$n#-|t_0Ym&prI?Zs%BtFaHBhNod zflrf8sD)ObGVP(&scP}s?%sk|Os2_i^ZMrON%4!#9`c-?ZSmdZ^IEENOdYTcsWQTo zL@=IV@>}_|^fT5m^^4E4_$d86un57XV<|?@S70)TnH(OMANu#uh!0hn6u0&jFIXCP ziKKN*ifyPLoJUY~w=|4pZ36o200tT(h48?HnhI1?g?_~lYC8PB&I>d~ z3e|KHa%ZfgcNY2$MabRZ_hq^&gKFq{r+`zyP#~ekX|Dep@$dh}3^#NNI0gQj0>aDX zb6H%KuB~I&$F Date: Wed, 8 Feb 2023 09:06:04 +1000 Subject: [PATCH 120/211] changed from minc to self --- neurodocker/templates/minc.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neurodocker/templates/minc.yaml b/neurodocker/templates/minc.yaml index 6bf35112..7c745311 100644 --- a/neurodocker/templates/minc.yaml +++ b/neurodocker/templates/minc.yaml @@ -68,8 +68,8 @@ binaries: - git env: MINC_TOOLKIT: "{{ self.install_path }}" - MINC_TOOLKIT_VERSION: "{{ minc.install_path }}" - PATH: "{{ minc.install_path }}/bin:{{ minc.install_path }}/volgenmodel-nipype/extra-scripts:{{ minc.install_path }}/pipeline:$PATH" + MINC_TOOLKIT_VERSION: "{{ self.install_path }}" + PATH: "{{ self.install_path }}/bin:{{ self.install_path }}/volgenmodel-nipype/extra-scripts:{{ self.install_path }}/pipeline:$PATH" PERL5LIB: "{{ self.install_path }}/perl:{{ self.install_path }}/pipeline:${PERL5LIB}" LD_LIBRARY_PATH: "{{ self.install_path }}/lib:{{ self.install_path }}/lib/InsightToolkit:${LD_LIBRARY_PATH}" MNI_DATAPATH: "{{ self.install_path }}/share" @@ -83,8 +83,8 @@ binaries: cd / # ar allows to extract the debian package so we can also install this in centos based OSs. curl {{ self.binaries_url }} -o minc.deb && ar p minc.deb data.tar.gz | tar zx && rm minc.deb - ln -s /opt/minc/{{ minc.version }} {{ minc.install_path }} - git clone https://github.com/CAIsr/volgenmodel-nipype.git {{ minc.install_path }}/volgenmodel-nipype/ + ln -s /opt/minc/{{ self.version }} {{ self.install_path }} + git clone https://github.com/CAIsr/volgenmodel-nipype.git {{ self.install_path }}/volgenmodel-nipype/ curl -fL http://packages.bic.mni.mcgill.ca/tgz/beast-library-1.1.tar.gz \ | tar -xz -C {{ self.install_path }}/share curl -fL -o /tmp/mni_90a.zip http://www.bic.mni.mcgill.ca/~vfonov/icbm/2009/mni_icbm152_nlin_sym_09a_minc2.zip From 79a73076b714137c7658ca1b83c19e1cec78ae9a Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Wed, 8 Feb 2023 10:20:20 +1000 Subject: [PATCH 121/211] added comment about debian packages --- neurodocker/templates/minc.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/neurodocker/templates/minc.yaml b/neurodocker/templates/minc.yaml index 7c745311..8fc95faf 100644 --- a/neurodocker/templates/minc.yaml +++ b/neurodocker/templates/minc.yaml @@ -2,10 +2,8 @@ # # Repository: https://github.com/BIC-MNI/minc-toolkit-v2 # -# Binaries are compiled in a CentOS 6.9 Docker container, based on this -# Dockerfile: -# https://github.com/BIC-MNI/build_packages/blob/master/build_centos_6.9_x64/Dockerfile # Instructions: http://bic-mni.github.io/#on-debianubuntu +# The Debian packages are unpacked for yum based distributions as well name: minc binaries: From 119d7fecf476c4f75a4c8c6e29d608b4e08797d2 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Wed, 8 Feb 2023 10:25:14 +1000 Subject: [PATCH 122/211] removed quotes around versions --- neurodocker/templates/minc.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neurodocker/templates/minc.yaml b/neurodocker/templates/minc.yaml index 8fc95faf..04d08f6b 100644 --- a/neurodocker/templates/minc.yaml +++ b/neurodocker/templates/minc.yaml @@ -13,10 +13,10 @@ binaries: optional: install_path: /opt/minc-{{ self.version }} urls: - "1.9.15": "https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.15-20170529-Ubuntu_16.04-x86_64.deb" - "1.9.16": "https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.16-20180117-Ubuntu_18.04-x86_64.deb" - "1.9.17": "https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.17-20190313-Ubuntu_18.04-x86_64.deb" - "1.9.18": "http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.18-20200813-Ubuntu_20.04-x86_64.deb" + 1.9.15: https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.15-20170529-Ubuntu_16.04-x86_64.deb + 1.9.16: https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.16-20180117-Ubuntu_18.04-x86_64.deb + 1.9.17: https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.17-20190313-Ubuntu_18.04-x86_64.deb + 1.9.18: http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.18-20200813-Ubuntu_20.04-x86_64.deb dependencies: apt: - ca-certificates From f3656c908b82d61d2d9239845714df00279a91d8 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Wed, 8 Feb 2023 10:26:16 +1000 Subject: [PATCH 123/211] try with quotes --- neurodocker/templates/minc.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neurodocker/templates/minc.yaml b/neurodocker/templates/minc.yaml index 04d08f6b..6eeb3511 100644 --- a/neurodocker/templates/minc.yaml +++ b/neurodocker/templates/minc.yaml @@ -13,10 +13,10 @@ binaries: optional: install_path: /opt/minc-{{ self.version }} urls: - 1.9.15: https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.15-20170529-Ubuntu_16.04-x86_64.deb - 1.9.16: https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.16-20180117-Ubuntu_18.04-x86_64.deb - 1.9.17: https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.17-20190313-Ubuntu_18.04-x86_64.deb - 1.9.18: http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.18-20200813-Ubuntu_20.04-x86_64.deb + "1.9.15": https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.15-20170529-Ubuntu_16.04-x86_64.deb + "1.9.16": https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.16-20180117-Ubuntu_18.04-x86_64.deb + "1.9.17": https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.17-20190313-Ubuntu_18.04-x86_64.deb + "1.9.18": http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.18-20200813-Ubuntu_20.04-x86_64.deb dependencies: apt: - ca-certificates From 55cfa6e8a35e0fed3dd33b1733a8f7940f9c56fb Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Wed, 8 Feb 2023 10:27:50 +1000 Subject: [PATCH 124/211] fixed binaries url --- neurodocker/templates/minc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neurodocker/templates/minc.yaml b/neurodocker/templates/minc.yaml index 6eeb3511..ba41ee00 100644 --- a/neurodocker/templates/minc.yaml +++ b/neurodocker/templates/minc.yaml @@ -80,7 +80,7 @@ binaries: echo "Downloading MINC, BEASTLIB, and MODELS..." cd / # ar allows to extract the debian package so we can also install this in centos based OSs. - curl {{ self.binaries_url }} -o minc.deb && ar p minc.deb data.tar.gz | tar zx && rm minc.deb + curl {{ self.urls[self.version] }} -o minc.deb && ar p minc.deb data.tar.gz | tar zx && rm minc.deb ln -s /opt/minc/{{ self.version }} {{ self.install_path }} git clone https://github.com/CAIsr/volgenmodel-nipype.git {{ self.install_path }}/volgenmodel-nipype/ curl -fL http://packages.bic.mni.mcgill.ca/tgz/beast-library-1.1.tar.gz \ From c94a0365076567b00aa2ef8e164e96e8d97f2009 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Wed, 8 Feb 2023 10:31:47 +1000 Subject: [PATCH 125/211] changed to 18.04 --- neurodocker/templates/minc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neurodocker/templates/minc.yaml b/neurodocker/templates/minc.yaml index ba41ee00..cd1dd41b 100644 --- a/neurodocker/templates/minc.yaml +++ b/neurodocker/templates/minc.yaml @@ -16,7 +16,7 @@ binaries: "1.9.15": https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.15-20170529-Ubuntu_16.04-x86_64.deb "1.9.16": https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.16-20180117-Ubuntu_18.04-x86_64.deb "1.9.17": https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.17-20190313-Ubuntu_18.04-x86_64.deb - "1.9.18": http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.18-20200813-Ubuntu_20.04-x86_64.deb + "1.9.18": http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.18-20200813-Ubuntu_18.04-x86_64.deb dependencies: apt: - ca-certificates From 6f06168ddb14fd693eca8676cd8d94be2f2536aa Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Wed, 8 Feb 2023 10:39:34 +1000 Subject: [PATCH 126/211] add https --- neurodocker/templates/minc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neurodocker/templates/minc.yaml b/neurodocker/templates/minc.yaml index cd1dd41b..e9ff06bd 100644 --- a/neurodocker/templates/minc.yaml +++ b/neurodocker/templates/minc.yaml @@ -16,7 +16,7 @@ binaries: "1.9.15": https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.15-20170529-Ubuntu_16.04-x86_64.deb "1.9.16": https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.16-20180117-Ubuntu_18.04-x86_64.deb "1.9.17": https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.17-20190313-Ubuntu_18.04-x86_64.deb - "1.9.18": http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.18-20200813-Ubuntu_18.04-x86_64.deb + "1.9.18": https://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.18-20200813-Ubuntu_18.04-x86_64.deb dependencies: apt: - ca-certificates From e98d13151aaf377e71221f0c22755688868b90c3 Mon Sep 17 00:00:00 2001 From: Sooyoung Ahn Date: Wed, 22 Feb 2023 17:10:02 -0500 Subject: [PATCH 127/211] Update cli.rst updated to include --yes flag in the docs based on https://github.com/ReproNim/neurodocker/issues/508 - did not change the help messages in the python files, but it can be if needed? added other missing flags, including --json flag, as well as missing options and versions, etc. from checking diff with what the `neurodocker generate docker --help` and `neurodocker generate singularity --help` commands generate currently --- docs/user_guide/cli.rst | 95 +++++++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 13 deletions(-) diff --git a/docs/user_guide/cli.rst b/docs/user_guide/cli.rst index 3dea2ff3..680dcaf2 100644 --- a/docs/user_guide/cli.rst +++ b/docs/user_guide/cli.rst @@ -57,12 +57,13 @@ neurodocker generate docker --arg KEY=VALUE Build-time variables (do not persist after container is built) - --copy TEXT Copy files into the container. Provide at least + --copy TUPLE Copy files into the container. Provide at least two paths. The last path is always the destination path in the container. --env KEY=VALUE Set persistent environment variables - --install TEXT Install packages with system package manager + --entrypoint TUPLE Set entrypoint of the container + --install TUPLE Install packages with system package manager --label KEY=VALUE Set labels on the container --run TEXT Run commands in /bin/sh --run-bash TEXT Run commands in a bash shell @@ -70,6 +71,15 @@ neurodocker generate docker does not exist) --workdir TEXT Set the working directory + --yes Reply yes to all prompts for agreeing to any + alerts that a neurodocker template might have. + The alert messages will still be printed but + no confirmation is necessary from the user. + + --json Output instructions as JSON. This can be used + to generate Dockerfiles or Singularity recipes + with Neurodocker. + --_header KEY=VALUE Add _header method=[source] options for method=source @@ -83,6 +93,7 @@ neurodocker generate docker - install_python3 [default: false] options for method=source - version [required] + - repo [default: https://github.com/afni/afni.git] - install_path [default: /opt/afni-{{ self.version }}] - install_r_pkgs [default: false] - install_python3 [default: false] @@ -91,10 +102,11 @@ neurodocker generate docker method=[binaries|source] options for method=binaries - version [required] - version=[2.3.4|2.3.2|2.3.1|2.3.0|2.2.0|2.1.0|2.0.3|2.0.0] + version=[2.4.1|2.3.4|2.3.2|2.3.1|2.3.0|2.2.0|2.1.0|2.0.3|2.0.0] - install_path [default: /opt/ants-{{ self.version }}] options for method=source - version [required] + - repo [default: https://github.com/ANTsX/ANTs.git] - install_path [default: /opt/ants-{{ self.version }}] - cmake_opts [default: -DCMAKE_INSTALL_PREFIX={{ self.install_path }} -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF] - make_opts [default: -j1] @@ -121,6 +133,7 @@ neurodocker generate docker - install_path [default: /opt/dcm2niix-{{ self.version }}] options for method=source - version [required] + - repo [default: https://github.com/rordenlab/dcm2niix] - install_path [default: /opt/dcm2niix-{{ self.version }}] - cmake_opts [default: ] - make_opts [default: -j1] @@ -129,7 +142,7 @@ neurodocker generate docker method=[binaries] options for method=binaries - version [required] - version=[7.1.1-min|7.1.1|7.1.0|6.0.1|6.0.0-min|6.0.0] + version=[7.3.1|7.3.0|7.2.0|7.1.1-min|7.1.1|7.1.0|6.0.1|6.0.0-min|6.0.0] - install_path [default: /opt/freesurfer-{{ self.version }}] - exclude_paths [default: average/mult-comp-cor lib/cuda @@ -150,7 +163,7 @@ neurodocker generate docker method=[binaries] options for method=binaries - version [required] - version=[6.0.4|6.0.3|6.0.2|6.0.1|6.0.0|5.0.9|5.0.8|5.0.11|5.0.10] + version=[6.0.5.1|6.0.5|6.0.4|6.0.3|6.0.2|6.0.1|6.0.0|5.0.9|5.0.8|5.0.11|5.0.10] - install_path [default: /opt/fsl-{{ self.version }}] - exclude_paths [default: ] **Note**: FSL is non-free. If you are considering commercial use of FSL, please consult the relevant license(s). @@ -163,11 +176,19 @@ neurodocker generate docker options for method=source - version [required] + --matlabmcr KEY=VALUE Add matlabmcr + method=[binaries] + options for method=binaries + - version [required] + version=[2021b|2021a|2020b|2020a|2019b|2019a|2018b|2018a|2017b|2017a|2016b|2016a|2015b|2015aSP1|2015a|2014b|2014a|2013b|2013a|2012b|2012a|2010a] + - curl_opts [default: ] + - install_path [default: /opt/MCR-{{ self.version }}] + --minc KEY=VALUE Add minc method=[binaries] options for method=binaries - version [required] - version=[1.9.15] + version=[1.9.18|1.9.17|1.9.16|1.9.15] - install_path [default: /opt/minc-{{ self.version }}] --miniconda KEY=VALUE Add miniconda @@ -201,6 +222,7 @@ neurodocker generate docker - build_processes [default: 1] options for method=source - version [required] + - repo [default: https://github.com/MRtrix3/mrtrix3.git] - install_path [default: /opt/mrtrix3-{{ self.version }}] - build_processes [default: ] @@ -218,6 +240,15 @@ neurodocker generate docker - os_codename [required] - full_or_libre [default: full] + --niftyreg KEY=VALUE Add niftyreg + method=[source] + options for method=source + - version [required] + - repo [default: https://github.com/KCL-BMEIS/niftyreg] + - install_path [default: /opt/niftyreg-{{ self.version }}] + - cmake_opts [default: -DCMAKE_INSTALL_PREFIX={{ self.install_path }} -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF] + - make_opts [default: -j1] + --petpvc KEY=VALUE Add petpvc method=[binaries] options for method=binaries @@ -255,12 +286,13 @@ neurodocker generate singularity --arg KEY=VALUE Build-time variables (do not persist after container is built) - --copy TEXT Copy files into the container. Provide at least + --copy TUPLE Copy files into the container. Provide at least two paths. The last path is always the destination path in the container. --env KEY=VALUE Set persistent environment variables - --install TEXT Install packages with system package manager + --entrypoint TUPLE Set entrypoint of the container + --install TUPLE Install packages with system package manager --label KEY=VALUE Set labels on the container --run TEXT Run commands in /bin/sh --run-bash TEXT Run commands in a bash shell @@ -268,6 +300,14 @@ neurodocker generate singularity does not exist) --workdir TEXT Set the working directory + --yes Reply yes to all prompts for agreeing to any + alerts that a neurodocker template might have. + The alert messages will still be printed but + no confirmation is necessary from the user. + + --json Output instructions as JSON. This can be used + to generate Dockerfiles or Singularity recipes + with Neurodocker. --_header KEY=VALUE Add _header method=[source] options for method=source @@ -281,6 +321,7 @@ neurodocker generate singularity - install_python3 [default: false] options for method=source - version [required] + - repo [default: https://github.com/afni/afni.git] - install_path [default: /opt/afni-{{ self.version }}] - install_r_pkgs [default: false] - install_python3 [default: false] @@ -289,14 +330,23 @@ neurodocker generate singularity method=[binaries|source] options for method=binaries - version [required] - version=[2.3.4|2.3.2|2.3.1|2.3.0|2.2.0|2.1.0|2.0.3|2.0.0] + version=[2.4.1|2.3.4|2.3.2|2.3.1|2.3.0|2.2.0|2.1.0|2.0.3|2.0.0] - install_path [default: /opt/ants-{{ self.version }}] options for method=source - version [required] + - repo [default: https://github.com/ANTsX/ANTs.git] - install_path [default: /opt/ants-{{ self.version }}] - cmake_opts [default: -DCMAKE_INSTALL_PREFIX={{ self.install_path }} -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF] - make_opts [default: -j1] + --cat12 KEY=VALUE Add cat12 + method=[binaries] + options for method=binaries + - version [required] + version=[r1933_R2017b] + - install_path [default: /opt/CAT12-{{ self.version }}] + + --convert3d KEY=VALUE Add convert3d method=[binaries] options for method=binaries @@ -312,6 +362,7 @@ neurodocker generate singularity - install_path [default: /opt/dcm2niix-{{ self.version }}] options for method=source - version [required] + - repo [default: https://github.com/rordenlab/dcm2niix] - install_path [default: /opt/dcm2niix-{{ self.version }}] - cmake_opts [default: ] - make_opts [default: -j1] @@ -320,7 +371,7 @@ neurodocker generate singularity method=[binaries] options for method=binaries - version [required] - version=[7.1.1-min|7.1.1|7.1.0|6.0.1|6.0.0-min|6.0.0] + version=[7.3.1|7.3.0|7.2.0|7.1.1-min|7.1.1|7.1.0|6.0.1|6.0.0-min|6.0.0] - install_path [default: /opt/freesurfer-{{ self.version }}] - exclude_paths [default: average/mult-comp-cor lib/cuda @@ -341,7 +392,7 @@ neurodocker generate singularity method=[binaries] options for method=binaries - version [required] - version=[6.0.4|6.0.3|6.0.2|6.0.1|6.0.0|5.0.9|5.0.8|5.0.11|5.0.10] + version=[6.0.5.1|6.0.5|6.0.4|6.0.3|6.0.2|6.0.1|6.0.0|5.0.9|5.0.8|5.0.11|5.0.10] - install_path [default: /opt/fsl-{{ self.version }}] - exclude_paths [default: ] **Note**: FSL is non-free. If you are considering commercial use of FSL, please consult the relevant license(s). @@ -354,11 +405,19 @@ neurodocker generate singularity options for method=source - version [required] + --matlabmcr KEY=VALUE Add matlabmcr + method=[binaries] + options for method=binaries + - version [required] + version=[2021b|2021a|2020b|2020a|2019b|2019a|2018b|2018a|2017b|2017a|2016b|2016a|2015b|2015aSP1|2015a|2014b|2014a|2013b|2013a|2012b|2012a|2010a] + - curl_opts [default: ] + - install_path [default: /opt/MCR-{{ self.version }}] + --minc KEY=VALUE Add minc method=[binaries] options for method=binaries - version [required] - version=[1.9.15] + version=[1.9.18|1.9.17|1.9.16|1.9.15] - install_path [default: /opt/minc-{{ self.version }}] --miniconda KEY=VALUE Add miniconda @@ -392,6 +451,7 @@ neurodocker generate singularity - build_processes [default: 1] options for method=source - version [required] + - repo [default: https://github.com/MRtrix3/mrtrix3.git] - install_path [default: /opt/mrtrix3-{{ self.version }}] - build_processes [default: ] @@ -409,7 +469,16 @@ neurodocker generate singularity - os_codename [required] - full_or_libre [default: full] - --petpvc KEY=VALUE Add petpvc + --niftyreg KEY=VALUE Add niftyreg + method=[source] + options for method=source + - version [required] + - repo [default: https://github.com/KCL-BMEIS/niftyreg] + - install_path [default: /opt/niftyreg-{{ self.version }}] + - cmake_opts [default: -DCMAKE_INSTALL_PREFIX={{ self.install_path }} -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF] + - make_opts [default: -j1] + + -petpvc KEY=VALUE Add petpvc method=[binaries] options for method=binaries - version [required] From e7660646c202f49ce816d11989010b3b1f182f8d Mon Sep 17 00:00:00 2001 From: Sooyoung Ahn Date: Mon, 27 Feb 2023 22:52:52 -0500 Subject: [PATCH 128/211] updated version tags and added latest tag clarification to docs --- docs/user_guide/installation.rst | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/user_guide/installation.rst b/docs/user_guide/installation.rst index 4725623c..04090540 100644 --- a/docs/user_guide/installation.rst +++ b/docs/user_guide/installation.rst @@ -9,11 +9,25 @@ Docker or Singularity. .. code-block:: bash - docker run --rm repronim/neurodocker:0.7.0 --help + docker run --rm repronim/neurodocker:latest --help .. code-block:: bash - singularity run docker://repronim/neurodocker:0.7.0 --help + singularity run docker://repronim/neurodocker:latest --help + +Note: The version tag `latest` is a moving target and points to the latest stable release. + +.. code-block:: bash + + repronim/neurodocker:latest -> latest release (0.9.4 now) + repronim/neurodocker:master -> master branch + repronim/neurodocker:0.9.4 + repronim/neurodocker:0.9.2 + repronim/neurodocker:0.9.1 + repronim/neurodocker:0.9.0 + repronim/neurodocker:0.8.0 + repronim/neurodocker:0.7.0 + ... pip --- From 19b6a9446e511bbd2dcad962eca7210761570075 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 4 Mar 2023 11:15:37 +0100 Subject: [PATCH 129/211] clean --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 3 +++ README.md | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 6843ad8b9ff37bd0a6b0ef0425047219f7e30dc2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHLJxc>Y5S=xL2GgVxJFl^@5mMWnA!03Q1i{37kcf#F5+eu}r?o#quoL_VcK!v$ zfP()(v=b40v%5)llbq>9WCwQNW@dKx-MidQE<_}<-AaZiO+-mFMsFV71mifjF`Lnz zMWEm{8nsNm95!2Hna<%9a0>iI1^C(ZXq9TTPe<1CyKuT=#+qR+S89YM_>$$1-do|~ zZrzSoevG&3#@Vn`#8jH=?@M*+Qpwt#W^p==W|$n#-|t_0Ym&prI?Zs%BtFaHBhNod zflrf8sD)ObGVP(&scP}s?%sk|Os2_i^ZMrON%4!#9`c-?ZSmdZ^IEENOdYTcsWQTo zL@=IV@>}_|^fT5m^^4E4_$d86un57XV<|?@S70)TnH(OMANu#uh!0hn6u0&jFIXCP ziKKN*ifyPLoJUY~w=|4pZ36o200tT(h48?HnhI1?g?_~lYC8PB&I>d~ z3e|KHa%ZfgcNY2$MabRZ_hq^&gKFq{r+`zyP#~ekX|Dep@$dh}3^#NNI0gQj0>aDX zb6H%KuB~I&$F Date: Wed, 29 Mar 2023 12:54:01 -0400 Subject: [PATCH 130/211] Update README.md fixing link to dashboard --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f6ea43f..4eac3505 100644 --- a/README.md +++ b/README.md @@ -54,4 +54,4 @@ Before committing changes, initialize `pre-commit` with `pre-commit install`. Th You can check the status of the build of the Docker images for several of the neuroimaging software packages that are supported by _Neurodocker_ -on [this page]([build_dashboard.md](https://github.com/ReproNim/neurodocker/blob/test_docker_build/docs/README.md)). +on [this page](https://github.com/ReproNim/neurodocker/blob/test_docker_build/docs/README.md). From a203b237750967c613731f044011d196c2401726 Mon Sep 17 00:00:00 2001 From: araikes Date: Wed, 29 Mar 2023 13:59:59 -0700 Subject: [PATCH 131/211] Update ants.yaml (#521) Update ANTs to get versions 2.4.2 and 2.4.3 Co-authored-by: Jakub Kaczmarzyk --- neurodocker/templates/ants.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neurodocker/templates/ants.yaml b/neurodocker/templates/ants.yaml index 42feeed1..20fd97cc 100644 --- a/neurodocker/templates/ants.yaml +++ b/neurodocker/templates/ants.yaml @@ -9,6 +9,8 @@ binaries: install_path: /opt/ants-{{ self.version }} urls: # Official binaries are provided as of 2.4.1 (https://github.com/ANTsX/ANTs/releases) + "2.4.3": https://github.com/ANTsX/ANTs/releases/download/v2.4.3/ants-2.4.3-centos7-X64-gcc.zip + "2.4.2": https://github.com/ANTsX/ANTs/releases/download/v2.4.2/ants-2.4.2-centos7-X64-gcc.zip "2.4.1": https://github.com/ANTsX/ANTs/releases/download/v2.4.1/ants-2.4.1-centos7-X64-gcc.zip # Binaries prior to 2.4.x were compiled by Jakub Kaczmarzyk (https://github.com/kaczmarj) "2.3.4": https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz @@ -33,7 +35,7 @@ binaries: instructions: | {{ self.install_dependencies() }} echo "Downloading ANTs ..." - {% if self.version == "2.4.1" -%} + {% if (self.version == "2.4.1" or self.version == "2.4.2" or self.version == "2.4.3") -%} curl -fsSL -o ants.zip {{ self.urls[self.version] }} unzip ants.zip -d /opt mv {{ self.install_path }}/bin/* {{ self.install_path }} From 0ce946105544ac98bb8dbc84892548b60b62b274 Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Thu, 30 Mar 2023 15:51:00 +0200 Subject: [PATCH 132/211] Add FSL version 6.0.5.2 (#523) The current recepe probably won't work with FSL 6.0.6 onwards, which uses a new installer. Meanwhile, here is a PR adding the latest version for the 6.0.5.x series. --- neurodocker/templates/fsl.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/neurodocker/templates/fsl.yaml b/neurodocker/templates/fsl.yaml index 68b7bfc5..f4783478 100644 --- a/neurodocker/templates/fsl.yaml +++ b/neurodocker/templates/fsl.yaml @@ -19,6 +19,7 @@ binaries: install_path: /opt/fsl-{{ self.version }} exclude_paths: "" urls: + "6.0.5.2": https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.5.2-centos7_64.tar.gz "6.0.5.1": https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.5.1-centos7_64.tar.gz "6.0.5": https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.5-centos7_64.tar.gz "6.0.4": https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.4-centos6_64.tar.gz From 5dbe50e28312d86bcccdbcdb4807db8b96e5a8b6 Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Thu, 30 Mar 2023 21:05:52 +0200 Subject: [PATCH 133/211] Enable build of docs with Sphinx 6 (#525) `pydata-sphinx-theme` is now compatible with Sphinx 6 since [version 0.13](https://github.com/pydata/pydata-sphinx-theme/pull/1107). Changes in this commit: - Add upper bound on Sphinx as recommended by `pydra-sphinx-theme` - Add lower bound on `pydra-sphinx-theme` to force cache updates if necessary - Drop lower bound on Sphinx, let `pydata-sphinx-theme` handle it. --- setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 1473c901..80a24141 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,8 +50,8 @@ dev = pytest-reportlog >= 0.1.2 pytest-xdist >= 2.2.0 docs = - sphinx >= 3.4, !=6.* - pydata-sphinx-theme + sphinx <7 + pydata-sphinx-theme >= 0.13 sphinxcontrib.apidoc >= 0.3 all = %(minify)s From 80e7cf42bffb92dcd27d8749d6b1ae440619dacd Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Fri, 31 Mar 2023 15:58:45 +0200 Subject: [PATCH 134/211] NEW: Add support for FSL version 6.0.6 onwards (#527) * NEW: Add support for FSL version 6.0.6 onwards * DOC: Update available FSL versions in CLI --- docs/user_guide/cli.rst | 4 ++-- neurodocker/templates/fsl.yaml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/user_guide/cli.rst b/docs/user_guide/cli.rst index 680dcaf2..cded6d75 100644 --- a/docs/user_guide/cli.rst +++ b/docs/user_guide/cli.rst @@ -163,7 +163,7 @@ neurodocker generate docker method=[binaries] options for method=binaries - version [required] - version=[6.0.5.1|6.0.5|6.0.4|6.0.3|6.0.2|6.0.1|6.0.0|5.0.9|5.0.8|5.0.11|5.0.10] + version=[6.0.6.4|6.0.6.3|6.0.6.2|6.0.6.1|6.0.6|6.0.5.2|6.0.5.1|6.0.5|6.0.4|6.0.3|6.0.2|6.0.1|6.0.0|5.0.9|5.0.8|5.0.11|5.0.10] - install_path [default: /opt/fsl-{{ self.version }}] - exclude_paths [default: ] **Note**: FSL is non-free. If you are considering commercial use of FSL, please consult the relevant license(s). @@ -392,7 +392,7 @@ neurodocker generate singularity method=[binaries] options for method=binaries - version [required] - version=[6.0.5.1|6.0.5|6.0.4|6.0.3|6.0.2|6.0.1|6.0.0|5.0.9|5.0.8|5.0.11|5.0.10] + version=[6.0.6.4|6.0.6.3|6.0.6.2|6.0.6.1|6.0.6|6.0.5.2|6.0.5.1|6.0.5|6.0.4|6.0.3|6.0.2|6.0.1|6.0.0|5.0.9|5.0.8|5.0.11|5.0.10] - install_path [default: /opt/fsl-{{ self.version }}] - exclude_paths [default: ] **Note**: FSL is non-free. If you are considering commercial use of FSL, please consult the relevant license(s). diff --git a/neurodocker/templates/fsl.yaml b/neurodocker/templates/fsl.yaml index f4783478..483ed8b3 100644 --- a/neurodocker/templates/fsl.yaml +++ b/neurodocker/templates/fsl.yaml @@ -19,6 +19,11 @@ binaries: install_path: /opt/fsl-{{ self.version }} exclude_paths: "" urls: + "6.0.6.4": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py + "6.0.6.3": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py + "6.0.6.2": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py + "6.0.6.1": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py + "6.0.6": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py "6.0.5.2": https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.5.2-centos7_64.tar.gz "6.0.5.1": https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.5.1-centos7_64.tar.gz "6.0.5": https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.5-centos7_64.tar.gz @@ -53,6 +58,7 @@ binaries: - libxrender1 - libxt6 - nano + - python3 - sudo - wget yum: @@ -76,6 +82,7 @@ binaries: - libpng12 - nano - openblas-serial + - python3 - sudo - wget env: @@ -91,6 +98,10 @@ binaries: FSLGECUDAQ: "cuda.q" instructions: | {{ self.install_dependencies() }} + {% if self.version.split('.') | map('int') | list >= [6, 0, 6] %} + echo "Installing FSL ..." + curl -fsSL {{ self.urls[self.version] }} | python3 - -d {{ self.install_path }} -V {{ self.version }} + {% else %} echo "Downloading FSL ..." mkdir -p {{ self.install_path }} curl -fL {{ self.urls[self.version] }} \ @@ -113,3 +124,4 @@ binaries: echo "Removing bundled with FSLeyes libz likely incompatible with the one from OS" rm -f {{ self.install_path }}/bin/FSLeyes/libz.so.1 {% endif -%} + {% endif -%} From 34aa8c80f0b9c78423d6678b25cbd820005c5b71 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Sat, 1 Apr 2023 01:02:10 +1000 Subject: [PATCH 135/211] changed base image for AFNI to fedora:35 (#520) * changed base image for AFNI to fedora:35 https://github.com/ReproNim/neurodocker/issues/519#issuecomment-1465845156 * Update examples.rst forgot to change pkg-manager from apt to yum * Update docs/user_guide/examples.rst * Update docs/user_guide/examples.rst --------- Co-authored-by: Jakub Kaczmarzyk --- docs/user_guide/examples.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/user_guide/examples.rst b/docs/user_guide/examples.rst index 2a0aaa50..f7b5803f 100644 --- a/docs/user_guide/examples.rst +++ b/docs/user_guide/examples.rst @@ -68,8 +68,8 @@ Docker .. code-block:: bash neurodocker generate docker \ - --pkg-manager apt \ - --base-image debian:buster-slim \ + --pkg-manager yum \ + --base-image fedora:35 \ --afni method=binaries version=latest \ > afni-binaries.Dockerfile @@ -81,8 +81,8 @@ This does not install AFNI's R packages. To install relevant R things, use the f .. code-block:: bash neurodocker generate docker \ - --pkg-manager apt \ - --base-image debian:buster-slim \ + --pkg-manager yum \ + --base-image fedora:35 \ --afni method=binaries version=latest install_r_pkgs=true \ > afni-binaries-r.Dockerfile @@ -95,8 +95,8 @@ Beware that this is AFNI's bleeding edge! .. code-block:: bash neurodocker generate docker \ - --pkg-manager apt \ - --base-image debian:buster-slim \ + --pkg-manager yum \ + --base-image fedora:35 \ --afni method=source version=master \ > afni-source.Dockerfile From f39cffb98d2e3b995c2f11522db29b75ddc380dc Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Mon, 3 Apr 2023 23:42:00 +1000 Subject: [PATCH 136/211] Mcr missing deb libxp6 (#526) * remove debs install * removed debs --- neurodocker/templates/matlabmcr.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/neurodocker/templates/matlabmcr.yaml b/neurodocker/templates/matlabmcr.yaml index 7d21662a..bb8d97e6 100644 --- a/neurodocker/templates/matlabmcr.yaml +++ b/neurodocker/templates/matlabmcr.yaml @@ -57,8 +57,6 @@ binaries: - unzip - java-1.8.0-openjdk - dbus-x11 - debs: - - http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb env: LD_LIBRARY_PATH: | {% set versionTovXX = {"2021b": "v911", "2021a": "v910", "2020b": "v99", "2020a": "v98", "2019b": "v97", "2019a": "v96", "2018b": "v95", "2018a": "v94", "2017b": "v93", "2017a": "v92", "2016b": "v91", "2016a": "v901", "2015b": "v90", "2015aSP1": "v851", "2015a": "v85", "2014b": "v84", "2014a": "v83", "2013b": "v82", "2013a": "v81", "2012b": "v80", "2012a": "v717"} -%} @@ -74,7 +72,6 @@ binaries: {{ self.install_dependencies() }} echo "Downloading MATLAB Compiler Runtime ..." {% if self.version == "2010a" -%} - {{ self.install_debs() }} curl {{ self.curl_opts }} -o "$TMPDIR/MCRInstaller.bin" {{ self.urls[self.version] }} chmod +x "$TMPDIR/MCRInstaller.bin" "$TMPDIR/MCRInstaller.bin" -silent -P installLocation="{{ self.install_path }}" From f2f42e1389001dbde808c02c7de7745e2bb67e25 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 3 Apr 2023 10:17:24 -0400 Subject: [PATCH 137/211] modifying value for entry point to allow -arg or --arg (#515) * modifying value for entry point to allow -arg or --arg * fixing a style --------- Co-authored-by: Jakub Kaczmarzyk --- neurodocker/cli/generate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/neurodocker/cli/generate.py b/neurodocker/cli/generate.py index 638c5b41..a07a3ef5 100644 --- a/neurodocker/cli/generate.py +++ b/neurodocker/cli/generate.py @@ -344,8 +344,10 @@ def _get_instruction_for_param( elif param.name == "entrypoint": if not isinstance(value, tuple): raise ValueError("expected this value to be a tuple (contact developers)") - value = list(value) # convert from tuple to list - d = {"name": param.name, "kwds": {"args": value}} + value_spl = [] + for el in value: + value_spl += el.split() + d = {"name": param.name, "kwds": {"args": value_spl}} # install elif param.name == "install": opts = None From d03967453504cf8eb67418700d3d22c0dd6a61a5 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Fri, 12 May 2023 20:51:25 +1000 Subject: [PATCH 138/211] Afni missing dependencies for suma (#512) * add fedora-35 binary and dependencies * added missing dependencies for suma --- neurodocker/templates/afni.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neurodocker/templates/afni.yaml b/neurodocker/templates/afni.yaml index 40d75791..52b5e247 100644 --- a/neurodocker/templates/afni.yaml +++ b/neurodocker/templates/afni.yaml @@ -64,6 +64,12 @@ binaries: - which - xorg-x11-fonts-misc - xorg-x11-server-Xvfb + - wget + - mesa-dri-drivers + - mesa-libGLw + - which + - unzip + - ncurses-compat-libs debs: - http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb - http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb From 8f5660aec9efe0fe6cebe6d2e5d06642a35721f0 Mon Sep 17 00:00:00 2001 From: Repronim Bot Date: Fri, 12 May 2023 10:51:57 +0000 Subject: [PATCH 139/211] Update CHANGELOG.md [skip ci] --- CHANGELOG.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e9be794..31d3beb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,56 @@ +# 0.9.5 (Fri May 12 2023) + +#### 🐛 Bug Fix + +- Afni missing dependencies for suma [#512](https://github.com/ReproNim/neurodocker/pull/512) ([@stebo85](https://github.com/stebo85)) +- modifying value for entry point to allow -arg or --arg [#515](https://github.com/ReproNim/neurodocker/pull/515) ([@djarecka](https://github.com/djarecka) [@kaczmarj](https://github.com/kaczmarj)) +- Mcr missing deb libxp6 [#526](https://github.com/ReproNim/neurodocker/pull/526) ([@stebo85](https://github.com/stebo85)) +- NEW: Add support for FSL version 6.0.6 onwards [#527](https://github.com/ReproNim/neurodocker/pull/527) ([@ghisvail](https://github.com/ghisvail)) +- Enable build of docs with Sphinx 6 [#525](https://github.com/ReproNim/neurodocker/pull/525) ([@ghisvail](https://github.com/ghisvail)) +- Add FSL version 6.0.5.2 [#523](https://github.com/ReproNim/neurodocker/pull/523) ([@ghisvail](https://github.com/ghisvail)) +- Update ants.yaml [#521](https://github.com/ReproNim/neurodocker/pull/521) ([@araikes](https://github.com/araikes) [@kaczmarj](https://github.com/kaczmarj)) +- [FIX] fix link to build dashboard [#517](https://github.com/ReproNim/neurodocker/pull/517) ([@Remi-Gau](https://github.com/Remi-Gau)) +- Update cli.rst [#514](https://github.com/ReproNim/neurodocker/pull/514) ([@sooyounga](https://github.com/sooyounga) [@djarecka](https://github.com/djarecka)) +- updated version tags and added latest tag clarification to docs [#516](https://github.com/ReproNim/neurodocker/pull/516) ([@sooyounga](https://github.com/sooyounga)) +- Minc install from deb and rpm [#509](https://github.com/ReproNim/neurodocker/pull/509) ([@stebo85](https://github.com/stebo85)) +- fix: repo info ([@satra](https://github.com/satra)) +- [INFRA] test docker builds in CI [#487](https://github.com/ReproNim/neurodocker/pull/487) ([@Remi-Gau](https://github.com/Remi-Gau) [@pre-commit-ci[bot]](https://github.com/pre-commit-ci[bot]) [@satra](https://github.com/satra)) +- do not install sphinx 6.x [#505](https://github.com/ReproNim/neurodocker/pull/505) ([@kaczmarj](https://github.com/kaczmarj)) +- add bad versions to et file [#502](https://github.com/ReproNim/neurodocker/pull/502) ([@satra](https://github.com/satra)) +- [TESTS] check black style in github actions [#501](https://github.com/ReproNim/neurodocker/pull/501) ([@kaczmarj](https://github.com/kaczmarj)) + +#### ⚠️ Pushed to `master` + +- Update README.md ([@djarecka](https://github.com/djarecka)) +- add workflow token ([@satra](https://github.com/satra)) +- add commit agent ([@satra](https://github.com/satra)) +- add all changed files ([@satra](https://github.com/satra)) +- Update bootstrap.yml ([@satra](https://github.com/satra)) +- simplify git commit ([@satra](https://github.com/satra)) +- allow writing actions ([@satra](https://github.com/satra)) +- remove on demand ([@satra](https://github.com/satra)) +- fix docs build ([@satra](https://github.com/satra)) +- fix: syntax ([@satra](https://github.com/satra)) +- testing sphinx build ([@satra](https://github.com/satra)) + +#### 📝 Documentation + +- changed base image for AFNI to fedora:35 [#520](https://github.com/ReproNim/neurodocker/pull/520) ([@stebo85](https://github.com/stebo85) [@kaczmarj](https://github.com/kaczmarj)) + +#### Authors: 9 + +- [@araikes](https://github.com/araikes) +- [@pre-commit-ci[bot]](https://github.com/pre-commit-ci[bot]) +- Dorota Jarecka ([@djarecka](https://github.com/djarecka)) +- Ghislain Vaillant ([@ghisvail](https://github.com/ghisvail)) +- Jakub Kaczmarzyk ([@kaczmarj](https://github.com/kaczmarj)) +- Remi Gau ([@Remi-Gau](https://github.com/Remi-Gau)) +- Satrajit Ghosh ([@satra](https://github.com/satra)) +- Sooyoung Ahn ([@sooyounga](https://github.com/sooyounga)) +- Steffen Bollmann ([@stebo85](https://github.com/stebo85)) + +--- + # 0.9.4 (Wed Jan 18 2023) #### 🐛 Bug Fix From 7be8eb72d06aeaabd21f96917c84020b18e6ff83 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Thu, 1 Jun 2023 23:45:38 +1000 Subject: [PATCH 140/211] Update cat (#533) * update to r2166 and fix longitudinal pipeline * fix path * install path doesn't work * removed copy * fix for longitudinal pipeline * test without * are thse files only there after the funtion call --- neurodocker/templates/cat12.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neurodocker/templates/cat12.yaml b/neurodocker/templates/cat12.yaml index c9bdb7fa..3aedc894 100644 --- a/neurodocker/templates/cat12.yaml +++ b/neurodocker/templates/cat12.yaml @@ -13,6 +13,7 @@ binaries: install_path: /opt/CAT12-{{ self.version }} urls: r1933_R2017b: http://www.neuro.uni-jena.de/cat12/CAT12.8_r1933_R2017b_MCR_Linux.zip + r2166_R2017b: http://www.neuro.uni-jena.de/cat12/CAT12.8.2_r2166_R2017b_MCR_Linux.zip dependencies: apt: - ca-certificates @@ -40,3 +41,6 @@ binaries: chmod -R 777 {{ self.install_path }} # Test {{ self.install_path }}/spm12 function exit + # Fix m file + rm {{ self.install_path }}/spm12_mcr/home/gaser/gaser/spm/spm12/toolbox/cat12/cat_long_main.m + cp {{ self.install_path }}/spm12_mcr/home/gaser/gaser/spm/spm12/toolbox/cat12/cat_long_main.txt {{ self.install_path }}/spm12_mcr/home/gaser/gaser/spm/spm12/toolbox/cat12/cat_long_main.m \ No newline at end of file From c71967b4ecf63fbcc8fd383a7ef3679233c2bb81 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 30 Jun 2023 11:28:56 -0400 Subject: [PATCH 141/211] Update years to have full range of years of the project --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index ebe09bec..c71f84f1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,7 +23,7 @@ # -- Project information ----------------------------------------------------- project = "Neurodocker" -copyright = "2021, Neurodocker Developers" +copyright = "2017-2023, Neurodocker Developers" author = "Neurodocker Developers" From 6db92c74c8412ceb5b070cb725d849816f99c599 Mon Sep 17 00:00:00 2001 From: David Kennedy Date: Thu, 20 Jul 2023 16:20:21 -0400 Subject: [PATCH 142/211] Update matlabmcr.yaml (#539) * Update matlabmcr.yaml added mcr 2023a * Update cli.rst adding mcr 2023a --- docs/user_guide/cli.rst | 2 +- neurodocker/templates/matlabmcr.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/user_guide/cli.rst b/docs/user_guide/cli.rst index cded6d75..0fe70a72 100644 --- a/docs/user_guide/cli.rst +++ b/docs/user_guide/cli.rst @@ -409,7 +409,7 @@ neurodocker generate singularity method=[binaries] options for method=binaries - version [required] - version=[2021b|2021a|2020b|2020a|2019b|2019a|2018b|2018a|2017b|2017a|2016b|2016a|2015b|2015aSP1|2015a|2014b|2014a|2013b|2013a|2012b|2012a|2010a] + version=[2023a|2021b|2021a|2020b|2020a|2019b|2019a|2018b|2018a|2017b|2017a|2016b|2016a|2015b|2015aSP1|2015a|2014b|2014a|2013b|2013a|2012b|2012a|2010a] - curl_opts [default: ] - install_path [default: /opt/MCR-{{ self.version }}] diff --git a/neurodocker/templates/matlabmcr.yaml b/neurodocker/templates/matlabmcr.yaml index bb8d97e6..6d4411e5 100644 --- a/neurodocker/templates/matlabmcr.yaml +++ b/neurodocker/templates/matlabmcr.yaml @@ -12,6 +12,7 @@ binaries: curl_opts: "" install_path: /opt/MCR-{{ self.version }} urls: + "2023a": https://ssd.mathworks.com/supportfiles/downloads/R2023a/Release/4/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2023a_Update_4_glnxa64.zip "2021b": https://ssd.mathworks.com/supportfiles/downloads/R2021b/Release/2/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2021b_Update_2_glnxa64.zip "2021a": https://ssd.mathworks.com/supportfiles/downloads/R2021a/Release/5/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2021a_Update_5_glnxa64.zip "2020b": https://ssd.mathworks.com/supportfiles/downloads/R2020b/Release/6/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2020b_Update_6_glnxa64.zip @@ -63,7 +64,7 @@ binaries: $LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:{{ self.install_path }}/{{ versionTovXX[self.version] }}/runtime/glnxa64:{{ self.install_path }}/{{ versionTovXX[self.version] }}/bin/glnxa64:{{ self.install_path }}/{{ versionTovXX[self.version] }}/sys/os/glnxa64:{{ self.install_path }}/{{ versionTovXX[self.version] }}/extern/bin/glnxa64 MATLABCMD: "{{ self.install_path }}/{{ self.version }}/toolbox/matlab" XAPPLRESDIR: | - {% set versionTovXX = {"2021b": "v911", "2021a": "v910", "2020b": "v99", "2020a": "v98", "2019b": "v97", "2019a": "v96", "2018b": "v95", "2018a": "v94", "2017b": "v93", "2017a": "v92", "2016b": "v91", "2016a": "v901", "2015b": "v90", "2015aSP1": "v851", "2015a": "v85", "2014b": "v84", "2014a": "v83", "2013b": "v82", "2013a": "v81", "2012b": "v80", "2012a": "v717"} -%} + {% set versionTovXX = {"2023a": "v914", "2021b": "v911", "2021a": "v910", "2020b": "v99", "2020a": "v98", "2019b": "v97", "2019a": "v96", "2018b": "v95", "2018a": "v94", "2017b": "v93", "2017a": "v92", "2016b": "v91", "2016a": "v901", "2015b": "v90", "2015aSP1": "v851", "2015a": "v85", "2014b": "v84", "2014a": "v83", "2013b": "v82", "2013a": "v81", "2012b": "v80", "2012a": "v717"} -%} /opt/{{ self.install_path }}/{{ versionTovXX[self.version] }}/x11/app-defaults MCRROOT: "{{ self.install_path }}/{{ self.version }}" From e476266d2661a484e0f7a7747a1c921453ae47c8 Mon Sep 17 00:00:00 2001 From: David Kennedy Date: Fri, 21 Jul 2023 09:51:37 -0400 Subject: [PATCH 143/211] Fixing my update for mcr2023a (#540) * Update cli.rst adding mcr 2023a * Update matlabmcr.yaml one more change to get mcr2023a --- neurodocker/templates/matlabmcr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neurodocker/templates/matlabmcr.yaml b/neurodocker/templates/matlabmcr.yaml index 6d4411e5..5a560e46 100644 --- a/neurodocker/templates/matlabmcr.yaml +++ b/neurodocker/templates/matlabmcr.yaml @@ -60,7 +60,7 @@ binaries: - dbus-x11 env: LD_LIBRARY_PATH: | - {% set versionTovXX = {"2021b": "v911", "2021a": "v910", "2020b": "v99", "2020a": "v98", "2019b": "v97", "2019a": "v96", "2018b": "v95", "2018a": "v94", "2017b": "v93", "2017a": "v92", "2016b": "v91", "2016a": "v901", "2015b": "v90", "2015aSP1": "v851", "2015a": "v85", "2014b": "v84", "2014a": "v83", "2013b": "v82", "2013a": "v81", "2012b": "v80", "2012a": "v717"} -%} + {% set versionTovXX = {"2023a": "v914", "2021b": "v911", "2021a": "v910", "2020b": "v99", "2020a": "v98", "2019b": "v97", "2019a": "v96", "2018b": "v95", "2018a": "v94", "2017b": "v93", "2017a": "v92", "2016b": "v91", "2016a": "v901", "2015b": "v90", "2015aSP1": "v851", "2015a": "v85", "2014b": "v84", "2014a": "v83", "2013b": "v82", "2013a": "v81", "2012b": "v80", "2012a": "v717"} -%} $LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:{{ self.install_path }}/{{ versionTovXX[self.version] }}/runtime/glnxa64:{{ self.install_path }}/{{ versionTovXX[self.version] }}/bin/glnxa64:{{ self.install_path }}/{{ versionTovXX[self.version] }}/sys/os/glnxa64:{{ self.install_path }}/{{ versionTovXX[self.version] }}/extern/bin/glnxa64 MATLABCMD: "{{ self.install_path }}/{{ self.version }}/toolbox/matlab" XAPPLRESDIR: | From 6be21d9fff7163fd5adc5911b8bc8ef9cd7f92aa Mon Sep 17 00:00:00 2001 From: Henry Jeremy Bockholt Date: Thu, 3 Aug 2023 22:53:20 -0400 Subject: [PATCH 144/211] added freesurfer 7.4.1 (#542) --- neurodocker/templates/freesurfer.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/neurodocker/templates/freesurfer.yaml b/neurodocker/templates/freesurfer.yaml index bdd32442..eb2b2843 100644 --- a/neurodocker/templates/freesurfer.yaml +++ b/neurodocker/templates/freesurfer.yaml @@ -22,6 +22,7 @@ binaries: subjects/fsaverage_sym trctrain urls: + "7.4.1": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz "7.3.1": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.1/freesurfer-linux-centos7_x86_64-7.3.1.tar.gz "7.3.0": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.0/freesurfer-linux-centos7_x86_64-7.3.0.tar.gz "7.2.0": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.2.0/freesurfer-linux-centos6_x86_64-7.2.0.tar.gz From 4132721176d00123599dd39846dbf9e30fca4d7b Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Wed, 9 Aug 2023 12:44:23 +1000 Subject: [PATCH 145/211] add fsl 6.0.7.1 --- neurodocker/templates/fsl.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/neurodocker/templates/fsl.yaml b/neurodocker/templates/fsl.yaml index 483ed8b3..4d9c28dc 100644 --- a/neurodocker/templates/fsl.yaml +++ b/neurodocker/templates/fsl.yaml @@ -19,6 +19,7 @@ binaries: install_path: /opt/fsl-{{ self.version }} exclude_paths: "" urls: + "6.0.7.1": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py "6.0.6.4": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py "6.0.6.3": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py "6.0.6.2": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py From 7a7aaea119286d6708f6c104fc2bd580d82e7487 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 21 Aug 2023 18:09:41 -0400 Subject: [PATCH 146/211] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..7373affc --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,22 @@ +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Codespell + uses: codespell-project/actions-codespell@v2 From 21da97d1d4e16afaa54ce528b75b6de332dbfdf2 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 21 Aug 2023 18:09:41 -0400 Subject: [PATCH 147/211] Add rudimentary codespell config --- .codespellrc | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..7bc54b36 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,4 @@ +[codespell] +skip = .git,*.pdf,*.svg,versioneer.py +# +# ignore-words-list = From 1038e35943b359fa00663f82c4d1afba374eaea1 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 21 Aug 2023 18:09:41 -0400 Subject: [PATCH 148/211] Add pre-commit definition for codespell --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c93aece2..a4d53912 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,3 +26,8 @@ repos: additional_dependencies: [types-all] files: neurodocker args: ["--config-file", "setup.cfg"] + +- repo: https://github.com/codespell-project/codespell + rev: v2.2.5 + hooks: + - id: codespell From 260a9c26e4bb7e20172f1101d5dc0c62c0696352 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 21 Aug 2023 18:12:02 -0400 Subject: [PATCH 149/211] Add ignores --- .codespellrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.codespellrc b/.codespellrc index 7bc54b36..aa9f1312 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,4 @@ [codespell] -skip = .git,*.pdf,*.svg,versioneer.py -# -# ignore-words-list = +skip = .git,*.pdf,*.svg,versioneer.py,_version.py +# didi -- some name Dear to someone +ignore-words-list = didi From 9090da3b5f39ca34e881f5548298272fe1f5198a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 21 Aug 2023 18:13:07 -0400 Subject: [PATCH 150/211] [DATALAD RUNCMD] run codespell throughout === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- neurodocker/reproenv/renderers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neurodocker/reproenv/renderers.py b/neurodocker/reproenv/renderers.py index e9bb2802..1cf324b6 100644 --- a/neurodocker/reproenv/renderers.py +++ b/neurodocker/reproenv/renderers.py @@ -569,7 +569,7 @@ def __init__( super().__init__(pkg_manager=pkg_manager, users=users) self._header: _SingularityHeaderType = {} - # The '%setup' section is intentionally ommitted. + # The '%setup' section is intentionally omitted. self._files: ty.List[str] = [] self._environment: ty.List[ty.Tuple[str, str]] = [] self._post: ty.List[str] = [] From 0916305883ba71248b3a412459993b65a4c14606 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Mon, 21 Aug 2023 23:38:15 +0000 Subject: [PATCH 151/211] added freesurfer 7.3.2 --- neurodocker/templates/freesurfer.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/neurodocker/templates/freesurfer.yaml b/neurodocker/templates/freesurfer.yaml index eb2b2843..76f7f064 100644 --- a/neurodocker/templates/freesurfer.yaml +++ b/neurodocker/templates/freesurfer.yaml @@ -23,6 +23,7 @@ binaries: trctrain urls: "7.4.1": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer-linux-centos7_x86_64-7.4.1.tar.gz + "7.3.2": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.2/freesurfer-linux-centos7_x86_64-7.3.2.tar.gz "7.3.1": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.1/freesurfer-linux-centos7_x86_64-7.3.1.tar.gz "7.3.0": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.3.0/freesurfer-linux-centos7_x86_64-7.3.0.tar.gz "7.2.0": https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.2.0/freesurfer-linux-centos6_x86_64-7.2.0.tar.gz From 5c173ed5e630ec62aed30630e9fd3800753de1a4 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 05:17:57 -0400 Subject: [PATCH 152/211] update doc --- docs/conf.py | 2 +- docs/index.rst | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 35163ead..b0a86492 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -66,7 +66,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] +# html_static_path = ["_static"] # -- Options for extensions --------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index 939a497d..16e11e18 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,7 +16,6 @@ This website is in progress. Is there is something you would like to see here, p :caption: Contents: user_guide/index - build_results api From 1d0d2544ba6e32d7a1228f803f24c723aee4d379 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 05:37:20 -0400 Subject: [PATCH 153/211] fix codespell --- .github/workflows/create_workflows.py | 26 +++++++++++++------------- .pre-commit-config.yaml | 8 +++++++- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 629b071c..e6480514 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -2,7 +2,7 @@ This scripts uses a jinja template to create CI workflows to test. - different linux distributions (split by the package manager they use) - - different softwares that neurodocker supports + - different software that neurodocker supports - different install method for a given software All of those are defined in a python dictionary. @@ -50,7 +50,7 @@ }, """ -softwares: dict[str, dict[str, list[str]]] = { +software: dict[str, dict[str, list[str]]] = { "afni": { "methods": ["binaries", "source"], "afni_python": ["true", "false"], @@ -110,20 +110,20 @@ def create_dashboard_file(): ) # table of content - for software, _ in softwares.items(): - print(f"""- [{software}](#{software})""", file=f) + for software_, _ in software.items(): + print(f"""- [{software_}](#{software_})""", file=f) print("", file=f) # link to the github actions workflow and image of the build status - for software, _ in softwares.items(): - image_url = f"{image_base_url}&only={software}" + for software_, _ in software.items(): + image_url = f"{image_base_url}&only={software_}" print( - f"""## {software} + f"""## {software_} -[{software} workflow](https://github.com/{repo}/actions/workflows/{software}.yml) +[{software_} workflow](https://github.com/{repo}/actions/workflows/{software_}.yml) -![{software} build status]({image_url}) +![{software_} build status]({image_url}) """, file=f, ) @@ -159,14 +159,14 @@ def main(): "all": stringify(apt_based + yum_based), } - for software, spec in softwares.items(): + for software_, spec in software.items(): wf = { "header": "# This is file is automatically generated. Do not edit.", "os": os, - "software": software, + "software": software_, } - versions = get_versions_from_neurodocker_template(software) + versions = get_versions_from_neurodocker_template(software_) for i in spec.get("skip_versions", []): versions.remove(i) @@ -182,7 +182,7 @@ def main(): wf["add_afni_python"] = True wf["afni_python"] = stringify(spec["afni_python"]) - output_file = output_dir.joinpath(software).with_suffix(".yml") + output_file = output_dir.joinpath(software_).with_suffix(".yml") print("creating workflow") print(f"{output_file}") with open(output_file, "w") as f: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a4d53912..e9bab3b9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,17 +8,23 @@ repos: - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files + - repo: https://github.com/psf/black rev: "23.1.0" hooks: - id: black +- repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + args: [--profile, black] + - repo: https://github.com/pycqa/flake8 rev: "6.0.0" hooks: - id: flake8 - - repo: https://github.com/pre-commit/mirrors-mypy rev: "v0.991" hooks: From 4d291a1befd261603eeac2645d8f23e0a068aaeb Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 05:39:59 -0400 Subject: [PATCH 154/211] [DATALAD RUNCMD] run isort === Do not change lines below === { "chain": [], "cmd": "isort docs neurodocker && black docs neurodocker", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- docs/conf.py | 3 ++- docs/sphinxext/github_link.py | 4 ++-- neurodocker/__init__.py | 2 +- neurodocker/cli/cli.py | 3 +-- neurodocker/cli/generate.py | 20 +++++++++------- neurodocker/cli/minify/_prune.py | 2 +- neurodocker/cli/minify/tests/test_minify.py | 2 +- neurodocker/cli/minify/trace.py | 2 +- .../cli/tests/test_build_images_with_cli.py | 13 ++++++----- neurodocker/cli/tests/test_cli.py | 2 +- neurodocker/reproenv/__init__.py | 2 +- neurodocker/reproenv/renderers.py | 23 +++++++++---------- neurodocker/reproenv/state.py | 10 ++++---- neurodocker/reproenv/template.py | 8 ++++--- ..._build_images_from_registered_templates.py | 16 ++++++------- .../tests/test_build_images_simple.py | 11 +++++---- neurodocker/reproenv/tests/test_renderers.py | 8 ++++--- neurodocker/reproenv/tests/test_state.py | 3 +-- neurodocker/reproenv/tests/test_template.py | 4 +--- neurodocker/reproenv/tests/utils.py | 2 +- 20 files changed, 74 insertions(+), 66 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index c71f84f1..822c091c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,12 +6,13 @@ # -- Path setup -------------------------------------------------------------- +import sys + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # from pathlib import Path -import sys _here = Path(__file__).parent.absolute() sys.path.insert(0, str(_here / "..")) diff --git a/docs/sphinxext/github_link.py b/docs/sphinxext/github_link.py index fd4b7049..c215e5bb 100644 --- a/docs/sphinxext/github_link.py +++ b/docs/sphinxext/github_link.py @@ -2,12 +2,12 @@ https://github.com/scikit-learn/scikit-learn/blob/master/doc/sphinxext/github_link.py """ -from operator import attrgetter import inspect -import subprocess import os +import subprocess import sys from functools import partial +from operator import attrgetter REVISION_CMD = "git rev-parse --short HEAD" diff --git a/neurodocker/__init__.py b/neurodocker/__init__.py index bedceb43..4c0cb0b2 100644 --- a/neurodocker/__init__.py +++ b/neurodocker/__init__.py @@ -5,8 +5,8 @@ from pathlib import Path -from neurodocker._version import get_versions from neurodocker import reproenv # noqa: F401 +from neurodocker._version import get_versions __version__ = get_versions()["version"] del get_versions diff --git a/neurodocker/cli/cli.py b/neurodocker/cli/cli.py index 547aeb67..9316547e 100644 --- a/neurodocker/cli/cli.py +++ b/neurodocker/cli/cli.py @@ -1,8 +1,7 @@ import click from neurodocker import __version__ -from neurodocker.cli.generate import generate -from neurodocker.cli.generate import genfromjson +from neurodocker.cli.generate import generate, genfromjson @click.group() diff --git a/neurodocker/cli/generate.py b/neurodocker/cli/generate.py index a07a3ef5..9c72542d 100644 --- a/neurodocker/cli/generate.py +++ b/neurodocker/cli/generate.py @@ -6,19 +6,23 @@ # TODO: add a dedicated class for key=value in the eat-all class. import json as json_lib -from pathlib import Path import sys import typing as ty +from pathlib import Path import click -from neurodocker.reproenv.renderers import _Renderer -from neurodocker.reproenv.renderers import DockerRenderer -from neurodocker.reproenv.renderers import SingularityRenderer -from neurodocker.reproenv.state import get_template -from neurodocker.reproenv.state import register_template -from neurodocker.reproenv.state import registered_templates -from neurodocker.reproenv.state import registered_templates_items +from neurodocker.reproenv.renderers import ( + DockerRenderer, + SingularityRenderer, + _Renderer, +) +from neurodocker.reproenv.state import ( + get_template, + register_template, + registered_templates, + registered_templates_items, +) from neurodocker.reproenv.template import Template from neurodocker.reproenv.types import allowed_pkg_managers diff --git a/neurodocker/cli/minify/_prune.py b/neurodocker/cli/minify/_prune.py index 2225b9e2..2419a4e7 100644 --- a/neurodocker/cli/minify/_prune.py +++ b/neurodocker/cli/minify/_prune.py @@ -1,7 +1,7 @@ """Remove all files under a directory but not caught by `reprozip trace`.""" -from pathlib import Path import typing as ty +from pathlib import Path import yaml diff --git a/neurodocker/cli/minify/tests/test_minify.py b/neurodocker/cli/minify/tests/test_minify.py index d9832056..ee8859c8 100644 --- a/neurodocker/cli/minify/tests/test_minify.py +++ b/neurodocker/cli/minify/tests/test_minify.py @@ -1,7 +1,7 @@ from pathlib import Path -from click.testing import CliRunner import pytest +from click.testing import CliRunner from neurodocker.cli.cli import _arm_on_mac from neurodocker.cli.minify.trace import minify diff --git a/neurodocker/cli/minify/trace.py b/neurodocker/cli/minify/trace.py index a900626b..43cbd500 100644 --- a/neurodocker/cli/minify/trace.py +++ b/neurodocker/cli/minify/trace.py @@ -9,9 +9,9 @@ import io import logging -from pathlib import Path import tarfile import typing as ty +from pathlib import Path import click diff --git a/neurodocker/cli/tests/test_build_images_with_cli.py b/neurodocker/cli/tests/test_build_images_with_cli.py index b6066713..f5444535 100644 --- a/neurodocker/cli/tests/test_build_images_with_cli.py +++ b/neurodocker/cli/tests/test_build_images_with_cli.py @@ -1,14 +1,15 @@ from pathlib import Path -from click.testing import CliRunner import pytest +from click.testing import CliRunner -from neurodocker.cli.cli import generate -from neurodocker.cli.cli import genfromjson +from neurodocker.cli.cli import generate, genfromjson from neurodocker.reproenv.state import _TemplateRegistry -from neurodocker.reproenv.tests.utils import get_build_and_run_fns -from neurodocker.reproenv.tests.utils import skip_if_no_docker -from neurodocker.reproenv.tests.utils import skip_if_no_singularity +from neurodocker.reproenv.tests.utils import ( + get_build_and_run_fns, + skip_if_no_docker, + skip_if_no_singularity, +) # Test that a template can be rendered # We need to use `reproenv generate` as the entrypoint here because the generate command diff --git a/neurodocker/cli/tests/test_cli.py b/neurodocker/cli/tests/test_cli.py index 406ca936..ba54339e 100644 --- a/neurodocker/cli/tests/test_cli.py +++ b/neurodocker/cli/tests/test_cli.py @@ -2,8 +2,8 @@ from pathlib import Path -from click.testing import CliRunner import pytest +from click.testing import CliRunner from neurodocker.cli.cli import generate from neurodocker.cli.generate import OptionEatAll diff --git a/neurodocker/reproenv/__init__.py b/neurodocker/reproenv/__init__.py index e13a5700..93f37002 100644 --- a/neurodocker/reproenv/__init__.py +++ b/neurodocker/reproenv/__init__.py @@ -4,7 +4,7 @@ from neurodocker.reproenv.renderers import DockerRenderer # noqa: F401 from neurodocker.reproenv.renderers import SingularityRenderer # noqa: F401 +from neurodocker.reproenv.state import get_template # noqa: F401 from neurodocker.reproenv.state import register_template # noqa: F401 from neurodocker.reproenv.state import registered_templates # noqa: F401 -from neurodocker.reproenv.state import get_template # noqa: F401 from neurodocker.reproenv.template import Template # noqa: F401 diff --git a/neurodocker/reproenv/renderers.py b/neurodocker/reproenv/renderers.py index 1cf324b6..c2fb1f6b 100644 --- a/neurodocker/reproenv/renderers.py +++ b/neurodocker/reproenv/renderers.py @@ -12,18 +12,17 @@ import jinja2 -from neurodocker.reproenv.exceptions import RendererError -from neurodocker.reproenv.exceptions import TemplateError -from neurodocker.reproenv.state import _TemplateRegistry -from neurodocker.reproenv.state import _validate_renderer -from neurodocker.reproenv.template import _BaseInstallationTemplate -from neurodocker.reproenv.template import Template -from neurodocker.reproenv.types import _SingularityHeaderType -from neurodocker.reproenv.types import REPROENV_SPEC_FILE_IN_CONTAINER -from neurodocker.reproenv.types import allowed_pkg_managers -from neurodocker.reproenv.types import allowed_installation_methods -from neurodocker.reproenv.types import installation_methods_type -from neurodocker.reproenv.types import pkg_managers_type +from neurodocker.reproenv.exceptions import RendererError, TemplateError +from neurodocker.reproenv.state import _TemplateRegistry, _validate_renderer +from neurodocker.reproenv.template import Template, _BaseInstallationTemplate +from neurodocker.reproenv.types import ( + REPROENV_SPEC_FILE_IN_CONTAINER, + _SingularityHeaderType, + allowed_installation_methods, + allowed_pkg_managers, + installation_methods_type, + pkg_managers_type, +) # All jinja2 templates are instantiated from this environment object. It is # configured to dislike undefined attributes. For example, if a template is diff --git a/neurodocker/reproenv/state.py b/neurodocker/reproenv/state.py index 090424a9..e092b89a 100644 --- a/neurodocker/reproenv/state.py +++ b/neurodocker/reproenv/state.py @@ -3,8 +3,8 @@ import copy import json import os -from pathlib import Path import typing as ty +from pathlib import Path import jsonschema import yaml @@ -16,9 +16,11 @@ except ImportError: # pragma: no cover from yaml import SafeLoader # type: ignore # pragma: no cover -from neurodocker.reproenv.exceptions import RendererError -from neurodocker.reproenv.exceptions import TemplateError -from neurodocker.reproenv.exceptions import TemplateNotFound +from neurodocker.reproenv.exceptions import ( + RendererError, + TemplateError, + TemplateNotFound, +) from neurodocker.reproenv.types import TemplateType _schemas_path = Path(__file__).parent / "schemas" diff --git a/neurodocker/reproenv/template.py b/neurodocker/reproenv/template.py index 62fe94fb..953720fa 100644 --- a/neurodocker/reproenv/template.py +++ b/neurodocker/reproenv/template.py @@ -7,9 +7,11 @@ from neurodocker.reproenv.exceptions import TemplateKeywordArgumentError from neurodocker.reproenv.state import _validate_template -from neurodocker.reproenv.types import _BinariesTemplateType -from neurodocker.reproenv.types import _SourceTemplateType -from neurodocker.reproenv.types import TemplateType +from neurodocker.reproenv.types import ( + TemplateType, + _BinariesTemplateType, + _SourceTemplateType, +) class Template: diff --git a/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py b/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py index e94b92a3..b857bca3 100644 --- a/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py +++ b/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py @@ -1,18 +1,18 @@ # TODO: add more tests for `from_dict` method. -from pathlib import Path import typing as ty +from pathlib import Path import pytest -from neurodocker.reproenv.renderers import DockerRenderer -from neurodocker.reproenv.renderers import SingularityRenderer +from neurodocker.reproenv.renderers import DockerRenderer, SingularityRenderer from neurodocker.reproenv.state import _TemplateRegistry -from neurodocker.reproenv.tests.utils import get_build_and_run_fns -from neurodocker.reproenv.tests.utils import skip_if_no_docker -from neurodocker.reproenv.tests.utils import skip_if_no_singularity -from neurodocker.reproenv.types import installation_methods_type -from neurodocker.reproenv.types import pkg_managers_type +from neurodocker.reproenv.tests.utils import ( + get_build_and_run_fns, + skip_if_no_docker, + skip_if_no_singularity, +) +from neurodocker.reproenv.types import installation_methods_type, pkg_managers_type _template_filepath = Path(__file__).parent / "sample-template-jq.yaml" diff --git a/neurodocker/reproenv/tests/test_build_images_simple.py b/neurodocker/reproenv/tests/test_build_images_simple.py index b5608ee2..535e8a82 100644 --- a/neurodocker/reproenv/tests/test_build_images_simple.py +++ b/neurodocker/reproenv/tests/test_build_images_simple.py @@ -1,10 +1,11 @@ import pytest -from neurodocker.reproenv.renderers import DockerRenderer -from neurodocker.reproenv.renderers import SingularityRenderer -from neurodocker.reproenv.tests.utils import get_build_and_run_fns -from neurodocker.reproenv.tests.utils import skip_if_no_docker -from neurodocker.reproenv.tests.utils import skip_if_no_singularity +from neurodocker.reproenv.renderers import DockerRenderer, SingularityRenderer +from neurodocker.reproenv.tests.utils import ( + get_build_and_run_fns, + skip_if_no_docker, + skip_if_no_singularity, +) @pytest.mark.parametrize( diff --git a/neurodocker/reproenv/tests/test_renderers.py b/neurodocker/reproenv/tests/test_renderers.py index 31f93cb8..c0a7cfd4 100644 --- a/neurodocker/reproenv/tests/test_renderers.py +++ b/neurodocker/reproenv/tests/test_renderers.py @@ -1,9 +1,11 @@ import pytest from neurodocker.reproenv.exceptions import RendererError -from neurodocker.reproenv.renderers import _Renderer -from neurodocker.reproenv.renderers import DockerRenderer -from neurodocker.reproenv.renderers import SingularityRenderer +from neurodocker.reproenv.renderers import ( + DockerRenderer, + SingularityRenderer, + _Renderer, +) def test_renderer(): diff --git a/neurodocker/reproenv/tests/test_state.py b/neurodocker/reproenv/tests/test_state.py index dd75d2ac..a201a92e 100644 --- a/neurodocker/reproenv/tests/test_state.py +++ b/neurodocker/reproenv/tests/test_state.py @@ -3,9 +3,8 @@ import pytest import yaml -from neurodocker.reproenv import exceptions +from neurodocker.reproenv import exceptions, types from neurodocker.reproenv.state import _TemplateRegistry, _validate_template -from neurodocker.reproenv import types def test_validate_template_invalid_templates(): diff --git a/neurodocker/reproenv/tests/test_template.py b/neurodocker/reproenv/tests/test_template.py index 20a130dd..30f0b186 100644 --- a/neurodocker/reproenv/tests/test_template.py +++ b/neurodocker/reproenv/tests/test_template.py @@ -1,8 +1,6 @@ import pytest -from neurodocker.reproenv import exceptions -from neurodocker.reproenv import template -from neurodocker.reproenv import types +from neurodocker.reproenv import exceptions, template, types def test_template(): diff --git a/neurodocker/reproenv/tests/utils.py b/neurodocker/reproenv/tests/utils.py index 9415474f..b5997f48 100644 --- a/neurodocker/reproenv/tests/utils.py +++ b/neurodocker/reproenv/tests/utils.py @@ -1,10 +1,10 @@ import contextlib import getpass import os -from pathlib import Path import subprocess import typing as ty import uuid +from pathlib import Path import pytest From 974e8c962c1dcc79b1d01ae3c2cebbb19c10b722 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 05:41:57 -0400 Subject: [PATCH 155/211] [DATALAD RUNCMD] run precommit === Do not change lines below === { "chain": [], "cmd": "pre-commit run -a", "exit": 1, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- docs/user_guide/cli.rst | 36 ++++++++++++++++---------------- neurodocker/templates/afni.yaml | 12 +++++------ neurodocker/templates/ants.yaml | 2 +- neurodocker/templates/cat12.yaml | 4 ++-- neurodocker/templates/minc.yaml | 36 ++++++++++++++++---------------- 5 files changed, 45 insertions(+), 45 deletions(-) diff --git a/docs/user_guide/cli.rst b/docs/user_guide/cli.rst index 0fe70a72..479480fe 100644 --- a/docs/user_guide/cli.rst +++ b/docs/user_guide/cli.rst @@ -71,13 +71,13 @@ neurodocker generate docker does not exist) --workdir TEXT Set the working directory - --yes Reply yes to all prompts for agreeing to any + --yes Reply yes to all prompts for agreeing to any alerts that a neurodocker template might have. - The alert messages will still be printed but + The alert messages will still be printed but no confirmation is necessary from the user. - --json Output instructions as JSON. This can be used - to generate Dockerfiles or Singularity recipes + --json Output instructions as JSON. This can be used + to generate Dockerfiles or Singularity recipes with Neurodocker. --_header KEY=VALUE Add _header @@ -93,7 +93,7 @@ neurodocker generate docker - install_python3 [default: false] options for method=source - version [required] - - repo [default: https://github.com/afni/afni.git] + - repo [default: https://github.com/afni/afni.git] - install_path [default: /opt/afni-{{ self.version }}] - install_r_pkgs [default: false] - install_python3 [default: false] @@ -176,14 +176,14 @@ neurodocker generate docker options for method=source - version [required] - --matlabmcr KEY=VALUE Add matlabmcr + --matlabmcr KEY=VALUE Add matlabmcr method=[binaries] options for method=binaries - - version [required] - version=[2021b|2021a|2020b|2020a|2019b|2019a|2018b|2018a|2017b|2017a|2016b|2016a|2015b|2015aSP1|2015a|2014b|2014a|2013b|2013a|2012b|2012a|2010a] - - curl_opts [default: ] - - install_path [default: /opt/MCR-{{ self.version }}] - + - version [required] + version=[2021b|2021a|2020b|2020a|2019b|2019a|2018b|2018a|2017b|2017a|2016b|2016a|2015b|2015aSP1|2015a|2014b|2014a|2013b|2013a|2012b|2012a|2010a] + - curl_opts [default: ] + - install_path [default: /opt/MCR-{{ self.version }}] + --minc KEY=VALUE Add minc method=[binaries] options for method=binaries @@ -240,13 +240,13 @@ neurodocker generate docker - os_codename [required] - full_or_libre [default: full] - --niftyreg KEY=VALUE Add niftyreg - method=[source] - options for method=source - - version [required] - - repo [default: https://github.com/KCL-BMEIS/niftyreg] - - install_path [default: /opt/niftyreg-{{ self.version }}] - - cmake_opts [default: -DCMAKE_INSTALL_PREFIX={{ self.install_path }} -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF] + --niftyreg KEY=VALUE Add niftyreg + method=[source] + options for method=source + - version [required] + - repo [default: https://github.com/KCL-BMEIS/niftyreg] + - install_path [default: /opt/niftyreg-{{ self.version }}] + - cmake_opts [default: -DCMAKE_INSTALL_PREFIX={{ self.install_path }} -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF] - make_opts [default: -j1] --petpvc KEY=VALUE Add petpvc diff --git a/neurodocker/templates/afni.yaml b/neurodocker/templates/afni.yaml index 52b5e247..717986f8 100644 --- a/neurodocker/templates/afni.yaml +++ b/neurodocker/templates/afni.yaml @@ -64,12 +64,12 @@ binaries: - which - xorg-x11-fonts-misc - xorg-x11-server-Xvfb - - wget - - mesa-dri-drivers - - mesa-libGLw - - which - - unzip - - ncurses-compat-libs + - wget + - mesa-dri-drivers + - mesa-libGLw + - which + - unzip + - ncurses-compat-libs debs: - http://mirrors.kernel.org/debian/pool/main/libx/libxp/libxp6_1.0.2-2_amd64.deb - http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb diff --git a/neurodocker/templates/ants.yaml b/neurodocker/templates/ants.yaml index 20fd97cc..ad50a89a 100644 --- a/neurodocker/templates/ants.yaml +++ b/neurodocker/templates/ants.yaml @@ -10,7 +10,7 @@ binaries: urls: # Official binaries are provided as of 2.4.1 (https://github.com/ANTsX/ANTs/releases) "2.4.3": https://github.com/ANTsX/ANTs/releases/download/v2.4.3/ants-2.4.3-centos7-X64-gcc.zip - "2.4.2": https://github.com/ANTsX/ANTs/releases/download/v2.4.2/ants-2.4.2-centos7-X64-gcc.zip + "2.4.2": https://github.com/ANTsX/ANTs/releases/download/v2.4.2/ants-2.4.2-centos7-X64-gcc.zip "2.4.1": https://github.com/ANTsX/ANTs/releases/download/v2.4.1/ants-2.4.1-centos7-X64-gcc.zip # Binaries prior to 2.4.x were compiled by Jakub Kaczmarzyk (https://github.com/kaczmarj) "2.3.4": https://dl.dropbox.com/s/gwf51ykkk5bifyj/ants-Linux-centos6_x86_64-v2.3.4.tar.gz diff --git a/neurodocker/templates/cat12.yaml b/neurodocker/templates/cat12.yaml index 3aedc894..2eb85ef9 100644 --- a/neurodocker/templates/cat12.yaml +++ b/neurodocker/templates/cat12.yaml @@ -13,7 +13,7 @@ binaries: install_path: /opt/CAT12-{{ self.version }} urls: r1933_R2017b: http://www.neuro.uni-jena.de/cat12/CAT12.8_r1933_R2017b_MCR_Linux.zip - r2166_R2017b: http://www.neuro.uni-jena.de/cat12/CAT12.8.2_r2166_R2017b_MCR_Linux.zip + r2166_R2017b: http://www.neuro.uni-jena.de/cat12/CAT12.8.2_r2166_R2017b_MCR_Linux.zip dependencies: apt: - ca-certificates @@ -43,4 +43,4 @@ binaries: {{ self.install_path }}/spm12 function exit # Fix m file rm {{ self.install_path }}/spm12_mcr/home/gaser/gaser/spm/spm12/toolbox/cat12/cat_long_main.m - cp {{ self.install_path }}/spm12_mcr/home/gaser/gaser/spm/spm12/toolbox/cat12/cat_long_main.txt {{ self.install_path }}/spm12_mcr/home/gaser/gaser/spm/spm12/toolbox/cat12/cat_long_main.m \ No newline at end of file + cp {{ self.install_path }}/spm12_mcr/home/gaser/gaser/spm/spm12/toolbox/cat12/cat_long_main.txt {{ self.install_path }}/spm12_mcr/home/gaser/gaser/spm/spm12/toolbox/cat12/cat_long_main.m diff --git a/neurodocker/templates/minc.yaml b/neurodocker/templates/minc.yaml index e9ff06bd..d57da09e 100644 --- a/neurodocker/templates/minc.yaml +++ b/neurodocker/templates/minc.yaml @@ -31,17 +31,17 @@ binaries: - libgomp1 - libjpeg62 - unzip - - octave - - libglu1-mesa - - libgl1-mesa-glx - - perl - - imagemagick - - bc - - ed - - libc6 - - libstdc++6 - - gdebi-core - - binutils + - octave + - libglu1-mesa + - libgl1-mesa-glx + - perl + - imagemagick + - bc + - ed + - libc6 + - libstdc++6 + - gdebi-core + - binutils - git yum: - curl @@ -57,12 +57,12 @@ binaries: - unzip - octave - mesa-dri-drivers - - epel-release - - glibc - - libstdc++ - - ImageMagick - - perl - - binutils + - epel-release + - glibc + - libstdc++ + - ImageMagick + - perl + - binutils - git env: MINC_TOOLKIT: "{{ self.install_path }}" @@ -81,7 +81,7 @@ binaries: cd / # ar allows to extract the debian package so we can also install this in centos based OSs. curl {{ self.urls[self.version] }} -o minc.deb && ar p minc.deb data.tar.gz | tar zx && rm minc.deb - ln -s /opt/minc/{{ self.version }} {{ self.install_path }} + ln -s /opt/minc/{{ self.version }} {{ self.install_path }} git clone https://github.com/CAIsr/volgenmodel-nipype.git {{ self.install_path }}/volgenmodel-nipype/ curl -fL http://packages.bic.mni.mcgill.ca/tgz/beast-library-1.1.tar.gz \ | tar -xz -C {{ self.install_path }}/share From 440e5ff28b45fa2981226235384a3200e71bc8bc Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 06:09:26 -0400 Subject: [PATCH 156/211] simplify typing --- neurodocker/cli/generate.py | 38 +++++------ neurodocker/cli/minify/_prune.py | 8 +-- neurodocker/cli/minify/trace.py | 20 +++--- neurodocker/reproenv/renderers.py | 64 +++++++++---------- neurodocker/reproenv/state.py | 15 +++-- neurodocker/reproenv/template.py | 40 ++++++------ ..._build_images_from_registered_templates.py | 6 +- neurodocker/reproenv/tests/utils.py | 22 +++---- neurodocker/reproenv/types.py | 17 ++--- 9 files changed, 115 insertions(+), 115 deletions(-) diff --git a/neurodocker/cli/generate.py b/neurodocker/cli/generate.py index 9c72542d..3e1cd6a9 100644 --- a/neurodocker/cli/generate.py +++ b/neurodocker/cli/generate.py @@ -5,10 +5,12 @@ # TODO: add a dedicated class for key=value in the eat-all class. +from __future__ import annotations + import json as json_lib import sys -import typing as ty from pathlib import Path +from typing import IO, Any, Optional, Type, cast import click @@ -48,15 +50,15 @@ def __init__(self, *args, **kwds): ) ] - def get_command(self, ctx: click.Context, name: str) -> ty.Optional[click.Command]: + def get_command(self, ctx: click.Context, name: str) -> Optional[click.Command]: command = self.commands.get(name) if command is None: return command # return immediately to error can be logged # This is only set if a subcommand is called. Calling --help on the group # does not set --template-path. - template_path: ty.Tuple[str] = ctx.params.get("template_path", tuple()) - yamls: ty.List[Path] = [] + template_path: tuple[str] = ctx.params.get("template_path", tuple()) + yamls: list[Path] = [] for p in template_path: path = Path(p) for pattern in ("*.yaml", "*.yml"): @@ -65,7 +67,7 @@ def get_command(self, ctx: click.Context, name: str) -> ty.Optional[click.Comman for path in yamls: _ = register_template(path) - params: ty.List[click.Parameter] = [ + params: list[click.Parameter] = [ click.Option( ["-p", "--pkg-manager"], type=click.Choice(list(allowed_pkg_managers), case_sensitive=False), @@ -86,11 +88,11 @@ class OrderedParamsCommand(click.Command): parameters. """ - def parse_args(self, ctx: click.Context, args: ty.List[str]): - self._options: ty.List[ty.Tuple[click.Parameter, ty.Any]] = [] + def parse_args(self, ctx: click.Context, args: list[str]): + self._options: list[tuple[click.Parameter, Any]] = [] # run the parser for ourselves to preserve the passed order parser = self.make_parser(ctx) - param_order: ty.List[click.Parameter] + param_order: list[click.Parameter] opts, _, param_order = parser.parse_args(args=list(args)) for param in param_order: # We need the parameter name... so if it's None, let's panic. @@ -186,8 +188,8 @@ def fn(v: str): return fn(value) -def _get_common_renderer_params() -> ty.List[click.Parameter]: - params: ty.List[click.Parameter] = [ +def _get_common_renderer_params() -> list[click.Parameter]: + params: list[click.Parameter] = [ click.Option( ["-p", "--pkg-manager"], type=click.Choice(list(allowed_pkg_managers), case_sensitive=False), @@ -290,9 +292,9 @@ def _create_help_for_template(template: Template) -> str: return h -def _get_params_for_registered_templates() -> ty.List[click.Parameter]: +def _get_params_for_registered_templates() -> list[click.Parameter]: """Return list of click parameters for registered templates.""" - params: ty.List[click.Parameter] = [] + params: list[click.Parameter] = [] names_tmpls = list(registered_templates_items()) names_tmpls.sort(key=lambda r: r[0]) # sort by name for name, tmpl in names_tmpls: @@ -308,7 +310,7 @@ def _params_to_renderer_dict(ctx: click.Context, pkg_manager) -> dict: """Return dictionary compatible with compatible with `_Renderer.from_dict()`.""" renderer_dict = {"pkg_manager": pkg_manager, "instructions": []} cmd = ctx.command - cmd = ty.cast(OrderedParamsCommand, cmd) + cmd = cast(OrderedParamsCommand, cmd) for param, value in cmd._options: d = _get_instruction_for_param(ctx=ctx, param=param, value=value) # TODO: what happens if `d is None`? @@ -319,9 +321,7 @@ def _params_to_renderer_dict(ctx: click.Context, pkg_manager) -> dict: return renderer_dict -def _get_instruction_for_param( - ctx: click.Context, param: click.Parameter, value: ty.Any -): +def _get_instruction_for_param(ctx: click.Context, param: click.Parameter, value: Any): # TODO: clean this up. d = None if param.name == "from_": @@ -415,7 +415,7 @@ def generate(*, template_path): def _base_generate( - ctx: click.Context, renderer: ty.Type[_Renderer], pkg_manager: str, **kwds + ctx: click.Context, renderer: Type[_Renderer], pkg_manager: str, **kwds ): """Function that does all of the work of `generate docker` and `generate singularity`. The difference between those two is the renderer used. @@ -475,14 +475,14 @@ def singularity(ctx: click.Context, pkg_manager: str, **kwds): type=click.File("r"), default=sys.stdin, ) -def genfromjson(*, container_type: str, input: ty.IO): +def genfromjson(*, container_type: str, input: IO): """Generate a container from a ReproEnv JSON file. INPUT is standard input by default or a path to a JSON file. """ d = json_lib.load(input) - renderer: ty.Type[_Renderer] + renderer: Type[_Renderer] if container_type.lower() == "docker": renderer = DockerRenderer elif container_type.lower() == "singularity": diff --git a/neurodocker/cli/minify/_prune.py b/neurodocker/cli/minify/_prune.py index 2419a4e7..533eebc7 100644 --- a/neurodocker/cli/minify/_prune.py +++ b/neurodocker/cli/minify/_prune.py @@ -1,6 +1,6 @@ """Remove all files under a directory but not caught by `reprozip trace`.""" +from __future__ import annotations -import typing as ty from pathlib import Path import yaml @@ -18,8 +18,8 @@ def _in_docker() -> bool: def main( *, - yaml_file: ty.Union[str, Path], - directories_to_prune: ty.Union[ty.List[str], ty.List[Path]], + yaml_file: str | Path, + directories_to_prune: list[str] | list[Path], ): if not _in_docker(): raise RuntimeError( @@ -50,7 +50,7 @@ def main( if not d.is_dir(): raise ValueError(f"Directory does not exist: {d}") - all_files: ty.Set[Path] = set() + all_files: set[Path] = set() for d in directories_to_prune: all_files.update(Path(d).rglob("*")) diff --git a/neurodocker/cli/minify/trace.py b/neurodocker/cli/minify/trace.py index 43cbd500..33234f2b 100644 --- a/neurodocker/cli/minify/trace.py +++ b/neurodocker/cli/minify/trace.py @@ -7,11 +7,13 @@ # TODO: consider implementing custom types for Docker container and paths within a # Docker container. +from __future__ import annotations + import io import logging import tarfile -import typing as ty from pathlib import Path +from typing import Generator, cast import click @@ -36,9 +38,9 @@ def copy_file_to_container( - container: ty.Union[str, docker.models.containers.Container], - src: ty.Union[str, Path], - dest: ty.Union[str, Path], + container: str | docker.models.containers.Container, + src: str | Path, + dest: str | Path, ) -> bool: """Copy `local_filepath` into `container`:`container_path`. @@ -98,10 +100,10 @@ def _get_mounts(container: docker.models.containers.Container) -> dict: @click.option("--yes", is_flag=True, help="Reply yes to all prompts.") @click.argument("command", nargs=-1, required=True) def minify( - container: ty.Union[str, docker.models.containers.Container], - directories_to_prune: ty.Tuple[str], + container: str | docker.models.containers.Container, + directories_to_prune: tuple[str], yes: bool, - command: ty.Tuple[str], + command: tuple[str], ) -> None: """Minify a container. @@ -118,7 +120,7 @@ def minify( "python -c 'a = 1 + 1; print(a)'" """ container = client.containers.get(container) - container = ty.cast(docker.models.containers.Container, container) + container = cast(docker.models.containers.Container, container) cmds = " ".join(f'"{c}"' for c in command) @@ -132,7 +134,7 @@ def minify( # iteration. exec_dict: dict = container.client.api.exec_create(container.id, cmd=trace_cmd) exec_id: str = exec_dict["Id"] - log_gen: ty.Generator[bytes, None, None] = container.client.api.exec_start( + log_gen: Generator[bytes, None, None] = container.client.api.exec_start( exec_id, stream=True ) for log in log_gen: diff --git a/neurodocker/reproenv/renderers.py b/neurodocker/reproenv/renderers.py index c2fb1f6b..1d1ca460 100644 --- a/neurodocker/reproenv/renderers.py +++ b/neurodocker/reproenv/renderers.py @@ -8,7 +8,7 @@ import os import pathlib import types -import typing as ty +from typing import Callable, Mapping, NoReturn, Optional import jinja2 @@ -34,7 +34,7 @@ # template. -def _raise_helper(msg: str) -> ty.NoReturn: +def _raise_helper(msg: str) -> NoReturn: raise RendererError(msg) @@ -43,7 +43,7 @@ def _raise_helper(msg: str) -> ty.NoReturn: # TODO: add a flag that avoids buggy behavior when basing a new container on # one created with ReproEnv. -PathType = ty.Union[str, pathlib.Path, os.PathLike] +PathType = str | pathlib.Path | os.PathLike def _render_string_from_template( @@ -86,7 +86,7 @@ def _render_string_from_template( return source -def _log_instruction(func: ty.Callable): +def _log_instruction(func: Callable): """Decorator that logs instructions passed to a Renderer. This adds the logs to the `_instructions` attribute of the Renderer instance. @@ -131,7 +131,7 @@ def with_logging(self, *args, **kwds): class _Renderer: def __init__( - self, pkg_manager: pkg_managers_type, users: ty.Optional[ty.Set[str]] = None + self, pkg_manager: pkg_managers_type, users: Optional[set[str]] = None ) -> None: if pkg_manager not in allowed_pkg_managers: raise RendererError( @@ -145,7 +145,7 @@ def __init__( # specification to JSON, because if we are not root, we can change to root, # write the file, and return to whichever user we were. self._current_user = "root" - self._instructions: ty.Mapping = { + self._instructions: Mapping = { "pkg_manager": self.pkg_manager, "existing_users": list(self._users), "instructions": [], @@ -178,11 +178,11 @@ def __str__(self) -> str: return f"{masthead}\n\n{image_spec}" @property - def users(self) -> ty.Set[str]: + def users(self) -> set[str]: return self._users @classmethod - def from_dict(cls, d: ty.Mapping) -> _Renderer: + def from_dict(cls, d: Mapping) -> _Renderer: """Instantiate a new renderer from a dictionary of instructions.""" # raise error if invalid _validate_renderer(d) @@ -274,7 +274,7 @@ def add_template( # Add environment (render any jinja templates). if template_method.env: - d: ty.Mapping[str, str] = { + d: Mapping[str, str] = { _render_string_from_template( k, template_method ): _render_string_from_template(v, template_method) @@ -285,7 +285,7 @@ def add_template( # Patch the `template_method.install_dependencies` instance method so it can be # used (ie rendered) in a template and have access to the pkg_manager requested. def install_patch( - inner_self: _BaseInstallationTemplate, pkgs: ty.List[str], opts: str = None + inner_self: _BaseInstallationTemplate, pkgs: list[str], opts: str = None ) -> str: return _install(pkgs=pkgs, pkg_manager=self.pkg_manager) @@ -369,21 +369,21 @@ def arg(self, key: str, value: str = None): def copy( self, - source: ty.Union[PathType, ty.List[PathType]], - destination: ty.Union[PathType, ty.List[PathType]], + source: PathType | list[PathType], + destination: PathType | list[PathType], ) -> _Renderer: raise NotImplementedError() def env(self, **kwds: str) -> _Renderer: raise NotImplementedError() - def entrypoint(self, args: ty.List[str]) -> _Renderer: + def entrypoint(self, args: list[str]) -> _Renderer: raise NotImplementedError() def from_(self, base_image: str) -> _Renderer: raise NotImplementedError() - def install(self, pkgs: ty.List[str], opts: str = None) -> _Renderer: + def install(self, pkgs: list[str], opts: str = None) -> _Renderer: raise NotImplementedError() def label(self, **kwds: str) -> _Renderer: @@ -436,11 +436,9 @@ def _get_instructions(self) -> str: class DockerRenderer(_Renderer): - def __init__( - self, pkg_manager: pkg_managers_type, users: ty.Set[str] = None - ) -> None: + def __init__(self, pkg_manager: pkg_managers_type, users: set[str] = None) -> None: super().__init__(pkg_manager=pkg_manager, users=users) - self._parts: ty.List[str] = [] + self._parts: list[str] = [] def render(self) -> str: """Return the rendered Dockerfile.""" @@ -467,7 +465,7 @@ def arg(self, key: str, value: str = None) -> DockerRenderer: @_log_instruction def copy( self, - source: ty.Union[PathType, ty.List[PathType]], + source: PathType | list[PathType], destination: PathType, from_: str = None, chown: str = None, @@ -494,7 +492,7 @@ def env(self, **kwds: str) -> DockerRenderer: return self @_log_instruction - def entrypoint(self, args: ty.List[str]) -> DockerRenderer: + def entrypoint(self, args: list[str]) -> DockerRenderer: s = 'ENTRYPOINT ["{}"]'.format('", "'.join(args)) self._parts.append(s) return self @@ -510,7 +508,7 @@ def from_(self, base_image: str, as_: str = None) -> DockerRenderer: return self @_log_instruction - def install(self, pkgs: ty.List[str], opts=None) -> DockerRenderer: + def install(self, pkgs: list[str], opts=None) -> DockerRenderer: """Install system packages.""" command = _install(pkgs, pkg_manager=self.pkg_manager, opts=opts) command = _indent_run_instruction(command) @@ -563,18 +561,18 @@ def workdir(self, path: PathType) -> DockerRenderer: class SingularityRenderer(_Renderer): def __init__( - self, pkg_manager: pkg_managers_type, users: ty.Optional[ty.Set[str]] = None + self, pkg_manager: pkg_managers_type, users: Optional[set[str]] = None ) -> None: super().__init__(pkg_manager=pkg_manager, users=users) self._header: _SingularityHeaderType = {} # The '%setup' section is intentionally omitted. - self._files: ty.List[str] = [] - self._environment: ty.List[ty.Tuple[str, str]] = [] - self._post: ty.List[str] = [] + self._files: list[str] = [] + self._environment: list[tuple[str, str]] = [] + self._post: list[str] = [] self._runscript = "" # TODO: is it OK to use a dict here? Labels could be overwritten. - self._labels: ty.Dict[str, str] = {} + self._labels: dict[str, str] = {} def render(self) -> str: s = "" @@ -633,7 +631,7 @@ def arg(self, key: str, value: str = None) -> SingularityRenderer: @_log_instruction def copy( self, - source: ty.Union[PathType, ty.List[PathType]], + source: PathType | list[PathType], destination: PathType, ) -> SingularityRenderer: if not isinstance(source, (list, tuple)): @@ -649,7 +647,7 @@ def env(self, **kwds: str) -> SingularityRenderer: return self @_log_instruction - def entrypoint(self, args: ty.List[str]) -> SingularityRenderer: + def entrypoint(self, args: list[str]) -> SingularityRenderer: self._runscript = " ".join(args) return self @@ -671,7 +669,7 @@ def from_(self, base_image: str) -> SingularityRenderer: return self @_log_instruction - def install(self, pkgs: ty.List[str], opts=None) -> SingularityRenderer: + def install(self, pkgs: list[str], opts=None) -> SingularityRenderer: """Install system packages.""" command = _install(pkgs, pkg_manager=self.pkg_manager, opts=opts) self.run(command) @@ -734,7 +732,7 @@ def _indent_run_instruction(string: str, indent=4) -> str: return "\n".join(out) -def _install(pkgs: ty.List[str], pkg_manager: str, opts: str = None) -> str: +def _install(pkgs: list[str], pkg_manager: str, opts: str = None) -> str: if pkg_manager == "apt": return _apt_install(pkgs, opts) elif pkg_manager == "yum": @@ -744,7 +742,7 @@ def _install(pkgs: ty.List[str], pkg_manager: str, opts: str = None) -> str: raise RendererError(f"Unknown package manager '{pkg_manager}'.") -def _apt_install(pkgs: ty.List[str], opts: str = None, sort=True) -> str: +def _apt_install(pkgs: list[str], opts: str = None, sort=True) -> str: """Return command to install deb packages with `apt-get` (Debian-based distros). `opts` are options passed to `yum install`. Default is "-q --no-install-recommends". @@ -762,7 +760,7 @@ def _apt_install(pkgs: ty.List[str], opts: str = None, sort=True) -> str: return s.strip() -def _apt_install_debs(urls: ty.List[str], opts: str = None, sort=True) -> str: +def _apt_install_debs(urls: list[str], opts: str = None, sort=True) -> str: """Return command to install deb packages with `apt-get` (Debian-based distros). `opts` are options passed to `yum install`. Default is "-q". @@ -786,7 +784,7 @@ def install_one(url: str): return s -def _yum_install(pkgs: ty.List[str], opts: str = None, sort=True) -> str: +def _yum_install(pkgs: list[str], opts: str = None, sort=True) -> str: """Return command to install packages with `yum` (CentOS, Fedora). `opts` are options passed to `yum install`. Default is "-q". diff --git a/neurodocker/reproenv/state.py b/neurodocker/reproenv/state.py index e092b89a..6601c068 100644 --- a/neurodocker/reproenv/state.py +++ b/neurodocker/reproenv/state.py @@ -1,10 +1,11 @@ """Stateful objects in reproenv runtime.""" +from __future__ import annotations import copy import json import os -import typing as ty from pathlib import Path +from typing import ItemsView, KeysView import jsonschema import yaml @@ -26,10 +27,10 @@ _schemas_path = Path(__file__).parent / "schemas" with (_schemas_path / "template.json").open("r") as f: - _TEMPLATE_SCHEMA: ty.Dict = json.load(f) + _TEMPLATE_SCHEMA: dict = json.load(f) with (_schemas_path / "renderer.json").open("r") as f: - _RENDERER_SCHEMA: ty.Dict = json.load(f) + _RENDERER_SCHEMA: dict = json.load(f) def _validate_template(template: TemplateType): @@ -59,7 +60,7 @@ def _validate_renderer(d): class _TemplateRegistry: """Object to hold templates in memory.""" - _templates: ty.Dict[str, TemplateType] = {} + _templates: dict[str, TemplateType] = {} @classmethod def _reset(cls): @@ -69,7 +70,7 @@ def _reset(cls): @classmethod def register( cls, - path_or_template: ty.Union[str, os.PathLike, TemplateType], + path_or_template: str | os.PathLike | TemplateType, name: str = None, ) -> TemplateType: """Register a template. This will overwrite an existing template with the @@ -150,12 +151,12 @@ def get(cls, name: str) -> TemplateType: ) @classmethod - def keys(cls) -> ty.KeysView[str]: + def keys(cls) -> KeysView[str]: """Return names of registered templates.""" return cls._templates.keys() @classmethod - def items(cls) -> ty.ItemsView[str, TemplateType]: + def items(cls) -> ItemsView[str, TemplateType]: return cls._templates.items() diff --git a/neurodocker/reproenv/template.py b/neurodocker/reproenv/template.py index 953720fa..1d365ef6 100644 --- a/neurodocker/reproenv/template.py +++ b/neurodocker/reproenv/template.py @@ -3,7 +3,7 @@ from __future__ import annotations import copy -import typing as ty +from typing import Mapping, Optional, cast from neurodocker.reproenv.exceptions import TemplateKeywordArgumentError from neurodocker.reproenv.state import _validate_template @@ -41,8 +41,8 @@ class Template: def __init__( self, template: TemplateType, - binaries_kwds: ty.Mapping[str, str] = None, - source_kwds: ty.Mapping[str, str] = None, + binaries_kwds: Mapping[str, str] = None, + source_kwds: Mapping[str, str] = None, ): # Validate against JSON schema. Registered templates were already validated at # registration time, but if we do not validate here, then in-memory templates @@ -50,9 +50,9 @@ def __init__( _validate_template(template) self._template = copy.deepcopy(template) - self._binaries: ty.Optional[_BinariesTemplate] = None + self._binaries: Optional[_BinariesTemplate] = None self._binaries_kwds = {} if binaries_kwds is None else binaries_kwds - self._source: ty.Optional[_SourceTemplate] = None + self._source: Optional[_SourceTemplate] = None self._source_kwds = {} if source_kwds is None else source_kwds if "binaries" in self._template: @@ -69,11 +69,11 @@ def name(self) -> str: return self._template["name"] @property - def binaries(self) -> ty.Union[None, _BinariesTemplate]: + def binaries(self) -> None | _BinariesTemplate: return self._binaries @property - def source(self) -> ty.Union[None, _SourceTemplate]: + def source(self) -> None | _SourceTemplate: return self._source @property @@ -104,7 +104,7 @@ class _BaseInstallationTemplate: def __init__( self, - template: ty.Union[_BinariesTemplateType, _SourceTemplateType], + template: _BinariesTemplateType | _SourceTemplateType, **kwds: str, ) -> None: self._template = copy.deepcopy(template) @@ -192,7 +192,7 @@ def template(self): return self._template @property - def env(self) -> ty.Mapping[str, str]: + def env(self) -> Mapping[str, str]: return self._template.get("env", {}) @property @@ -200,29 +200,29 @@ def instructions(self) -> str: return self._template.get("instructions", "") @property - def arguments(self) -> ty.Mapping: + def arguments(self) -> Mapping: return self._template.get("arguments", {}) @property - def required_arguments(self) -> ty.Set[str]: + def required_arguments(self) -> set[str]: args = self.arguments.get("required", None) return set(args) if args is not None else set() @property - def optional_arguments(self) -> ty.Dict[str, str]: + def optional_arguments(self) -> dict[str, str]: args = self.arguments.get("optional", None) return args if args is not None else {} @property - def versions(self) -> ty.Set[str]: + def versions(self) -> set[str]: raise NotImplementedError() - def dependencies(self, pkg_manager: str) -> ty.List[str]: + def dependencies(self, pkg_manager: str) -> list[str]: deps_dict = self._template.get("dependencies", {}) # TODO: not sure why the following line raises a type error in mypy. return deps_dict.get(pkg_manager, []) # type: ignore - def install(self, pkgs: ty.List[str], opts: str = None) -> str: + def install(self, pkgs: list[str], opts: str = None) -> str: raise NotImplementedError( "This method is meant to be patched by renderer objects, so it can be used" " in templates and have access to the pkg_manager being used." @@ -240,15 +240,15 @@ def __init__(self, template: _BinariesTemplateType, **kwds: str): super().__init__(template=template, **kwds) @property - def urls(self) -> ty.Mapping[str, str]: + def urls(self) -> Mapping[str, str]: # TODO: how can the code be changed so this cast is not necessary? - self._template = ty.cast(_BinariesTemplateType, self._template) + self._template = cast(_BinariesTemplateType, self._template) return self._template.get("urls", {}) @property - def versions(self) -> ty.Set[str]: + def versions(self) -> set[str]: # TODO: how can the code be changed so this cast is not necessary? - self._template = ty.cast(_BinariesTemplateType, self._template) + self._template = cast(_BinariesTemplateType, self._template) return set(self.urls.keys()) @@ -257,5 +257,5 @@ def __init__(self, template: _SourceTemplateType, **kwds: str): super().__init__(template=template, **kwds) @property - def versions(self) -> ty.Set[str]: + def versions(self) -> set[str]: return {"ANY"} diff --git a/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py b/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py index b857bca3..b616af46 100644 --- a/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py +++ b/neurodocker/reproenv/tests/test_build_images_from_registered_templates.py @@ -1,7 +1,7 @@ # TODO: add more tests for `from_dict` method. -import typing as ty from pathlib import Path +from typing import cast import pytest @@ -101,8 +101,8 @@ def test_build_using_renderer_instance_methods( _TemplateRegistry._reset() _TemplateRegistry.register(_template_filepath) - pkg_manager = ty.cast(pkg_managers_type, pkg_manager) - method = ty.cast(installation_methods_type, method) + pkg_manager = cast(pkg_managers_type, pkg_manager) + method = cast(installation_methods_type, method) fd_exe = "fdfind" if pkg_manager == "apt" else "fd" diff --git a/neurodocker/reproenv/tests/utils.py b/neurodocker/reproenv/tests/utils.py index b5997f48..d1111150 100644 --- a/neurodocker/reproenv/tests/utils.py +++ b/neurodocker/reproenv/tests/utils.py @@ -1,10 +1,12 @@ +from __future__ import annotations + import contextlib import getpass import os import subprocess -import typing as ty import uuid from pathlib import Path +from typing import Generator import pytest @@ -49,7 +51,7 @@ def _singularity_available(): @contextlib.contextmanager -def build_docker_image(context: Path, remove=False) -> ty.Generator[str, None, None]: +def build_docker_image(context: Path, remove=False) -> Generator[str, None, None]: """Context manager that builds a Docker image and removes it on exit. The argument `remove` is `False` by default because we clean up all images at the @@ -64,7 +66,7 @@ def build_docker_image(context: Path, remove=False) -> ty.Generator[str, None, N if not df.exists(): raise FileNotFoundError(f"Dockerfile not found: {df}") tag = "reproenv-pytest-" + uuid.uuid4().hex - cmd: ty.List[str] = ["docker", "build", "--tag", tag, str(context)] + cmd: list[str] = ["docker", "build", "--tag", tag, str(context)] try: _ = subprocess.check_output(cmd, cwd=context) yield tag @@ -80,9 +82,7 @@ def build_docker_image(context: Path, remove=False) -> ty.Generator[str, None, N @contextlib.contextmanager -def build_singularity_image( - context: Path, remove=True -) -> ty.Generator[str, None, None]: +def build_singularity_image(context: Path, remove=True) -> Generator[str, None, None]: """Context manager that builds a Apptainer image and removes it on exit. If `sudo singularity` is not available, the full path to `apptainer` can be set @@ -101,7 +101,7 @@ def build_singularity_image( user = getpass.getuser() cachedir = Path("/") / "dev" / "shm" / user / "apptainer" singularity = os.environ.get("REPROENV_APPTAINER_PROGRAM", "apptainer") - cmd: ty.List[str] = [ + cmd: list[str] = [ "sudo", f"APPTAINER_CACHEDIR={cachedir}", singularity, @@ -120,9 +120,7 @@ def build_singularity_image( pass -def run_docker_image( - img: str, args: ty.List[str] = None, entrypoint: ty.List[str] = None -): +def run_docker_image(img: str, args: list[str] = None, entrypoint: list[str] = None): """Wrapper for `docker run`. Returns @@ -144,7 +142,7 @@ def run_docker_image( def run_singularity_image( - img: str, args: ty.List[str] = None, entrypoint: ty.List[str] = None + img: str, args: list[str] = None, entrypoint: list[str] = None ): """Wrapper for `singularity run` or `singularity exec`. @@ -155,7 +153,7 @@ def run_singularity_image( """ scmd = "run" if entrypoint is None else "exec" # sudo not required - cmd: ty.List[str] = ["singularity", scmd, "--cleanenv", img] + cmd: list[str] = ["singularity", scmd, "--cleanenv", img] if entrypoint is not None: cmd.extend(entrypoint) if args is not None: diff --git a/neurodocker/reproenv/types.py b/neurodocker/reproenv/types.py index def4c76c..d74e5954 100644 --- a/neurodocker/reproenv/types.py +++ b/neurodocker/reproenv/types.py @@ -1,6 +1,7 @@ """Define types used in ReproEnv.""" +from __future__ import annotations -import typing as ty +from typing import Mapping from mypy_extensions import TypedDict from typing_extensions import Literal @@ -28,23 +29,23 @@ class _InstallationDependenciesType(TypedDict, total=False): `yum`, and Debian and Ubuntu use `apt` and `dpkg`. """ - apt: ty.List[str] - debs: ty.List[str] - yum: ty.List[str] + apt: list[str] + debs: list[str] + yum: list[str] class _TemplateArgumentsType(TypedDict): """Arguments (i.e., variables) that are used in the template.""" - required: ty.List[str] - optional: ty.Mapping[str, str] + required: list[str] + optional: Mapping[str, str] class _BaseTemplateType(TypedDict, total=False): """Keys common to both types of templates: binaries and source.""" arguments: _TemplateArgumentsType - env: ty.Mapping[str, str] + env: Mapping[str, str] dependencies: _InstallationDependenciesType instructions: str @@ -58,7 +59,7 @@ class _SourceTemplateType(_BaseTemplateType): class _BinariesTemplateType(_BaseTemplateType): """Template that defines how to install software from pre-compiled binaries.""" - urls: ty.Mapping[str, str] + urls: Mapping[str, str] class TemplateType(TypedDict, total=False): From d7033f0d1d68a629f8419262c7dd8590b0c7d283 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 06:23:56 -0400 Subject: [PATCH 157/211] pacify mypy --- neurodocker/reproenv/renderers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neurodocker/reproenv/renderers.py b/neurodocker/reproenv/renderers.py index 1d1ca460..2a82c1a2 100644 --- a/neurodocker/reproenv/renderers.py +++ b/neurodocker/reproenv/renderers.py @@ -8,7 +8,7 @@ import os import pathlib import types -from typing import Callable, Mapping, NoReturn, Optional +from typing import Callable, Mapping, NoReturn, Optional, Union import jinja2 @@ -43,7 +43,7 @@ def _raise_helper(msg: str) -> NoReturn: # TODO: add a flag that avoids buggy behavior when basing a new container on # one created with ReproEnv. -PathType = str | pathlib.Path | os.PathLike +PathType = Union[str | pathlib.Path | os.PathLike] def _render_string_from_template( From bcf2114678aa5868aad929d40e7412523d02b34c Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 06:28:01 -0400 Subject: [PATCH 158/211] do not fail fast --- .github/workflows/pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8924c7e8..1976b0e0 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -10,6 +10,7 @@ jobs: strategy: matrix: python-version: ['3.11', '3.10', '3.9', '3.8'] + fail-fast: false steps: - name: Install Apptainer env: From 3cdcc8e1a46a7cfb7dacbc0b3c15dbb204413358 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 06:31:21 -0400 Subject: [PATCH 159/211] fix typo --- neurodocker/reproenv/renderers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neurodocker/reproenv/renderers.py b/neurodocker/reproenv/renderers.py index 2a82c1a2..4217d75a 100644 --- a/neurodocker/reproenv/renderers.py +++ b/neurodocker/reproenv/renderers.py @@ -43,7 +43,7 @@ def _raise_helper(msg: str) -> NoReturn: # TODO: add a flag that avoids buggy behavior when basing a new container on # one created with ReproEnv. -PathType = Union[str | pathlib.Path | os.PathLike] +PathType = Union[str, pathlib.Path, os.PathLike] def _render_string_from_template( From 732bfe2a9a95bde889bfa86f45eb770b1a1c2a08 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 06:40:45 -0400 Subject: [PATCH 160/211] cancel previous runs --- .github/workflows/pull-request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1976b0e0..cb55ac56 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,5 +1,9 @@ name: CI +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: pull_request: branches: [ master ] From 68950b6c6d122fcab7409169ccfbc43418a26bfc Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 06:54:03 -0400 Subject: [PATCH 161/211] split format testing --- .github/dependabot.yml | 9 ++++++ .github/workflows/pull-request.yml | 6 ---- .github/workflows/validate.yml | 50 ++++++++++++++++++++++++++++++ setup.cfg | 1 + 4 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/validate.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..17e26374 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +--- +# Documentation +# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file +version: 2 +updates: +- package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8924c7e8..e30b4ab9 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -32,12 +32,6 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install neurodocker run: python -m pip install --editable .[dev] - - name: Check types - run: mypy --install-types --non-interactive neurodocker - - name: Check style - run: flake8 neurodocker - - name: Check black formatting - run: black --check neurodocker - name: Run python tests run: pytest --numprocesses auto - name: Get code coverage diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 00000000..135d9590 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,50 @@ +name: linters, formatters and type checking + +on: + pull_request: + branches: [ master ] + +jobs: + format: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Check style + run: flake8 neurodocker + + - name: Check black formatting + run: black --check neurodocker + + - name: Run isort + run: isort --diff --check . + + typecheck: + + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ['3.11', '3.10', '3.9', '3.8'] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install neurodocker + run: python -m pip install --editable .[dev] + + - name: Check types + run: mypy --install-types --non-interactive neurodocker diff --git a/setup.cfg b/setup.cfg index 80a24141..96e4bfcc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,6 +41,7 @@ minify = dev = %(minify)s black >= 23.1.0 + isort codecov flake8 mypy From c7a472dcb26ae84d29bd898350f1f1a51b99c121 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 06:56:08 -0400 Subject: [PATCH 162/211] cancel previous runs --- .github/workflows/validate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 135d9590..bb158a8f 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -4,6 +4,10 @@ on: pull_request: branches: [ master ] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: format: From 57f70cfd22a3a6e88aafc6a333a0a83d216be34c Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 06:56:30 -0400 Subject: [PATCH 163/211] cancel previous runs --- .github/workflows/codespell.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 7373affc..96d74124 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -7,6 +7,10 @@ on: pull_request: branches: [master] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read From 5326b34e428b84d2672ee3672e0b0f961562af0b Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 22 Aug 2023 07:56:13 -0400 Subject: [PATCH 164/211] add isort config --- .github/workflows/validate.yml | 2 +- pyproject.toml | 9 +++++++++ setup.py | 3 +-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 pyproject.toml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index bb158a8f..03cdeab6 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -29,7 +29,7 @@ jobs: run: black --check neurodocker - name: Run isort - run: isort --diff --check . + run: isort --diff --check --settings-path pyproject.toml . typecheck: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..6d3d6e6c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,9 @@ +[tool.isort] +combine_as_imports = true +line_length = 88 +profile = "black" +skip_gitignore = true +src_paths = [ + 'neurodocker', + 'docs' +] diff --git a/setup.py b/setup.py index 2bda439a..1a9bb8e1 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,7 @@ """Setup script for neurodocker.""" -from setuptools import setup - import versioneer +from setuptools import setup version = versioneer.get_version() cmdclass = versioneer.get_cmdclass() From 9464f07d5035ff8b1384b244996bce926c4a0945 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:28:35 +0000 Subject: [PATCH 165/211] Bump actions/setup-python from 2 to 4 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/bootstrap.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/validate.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index b3d42d95..c89b8194 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -47,7 +47,7 @@ jobs: token: ${{ secrets.CI_FLOW }} - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.11' diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3becccab..060838f6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: "3.10" - name: Install neurodocker diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index fc1af672..b4fe88df 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -32,7 +32,7 @@ jobs: echo APPTAINER_CACHEDIR=/dev/shm/$(whoami)/singularity >> $GITHUB_ENV - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install neurodocker diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 03cdeab6..8580dea2 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 - name: Install neurodocker run: python -m pip install --editable .[dev] @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} From 66df6b1f54ffcd51a380d78f3d6fdf4587acfae3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:28:40 +0000 Subject: [PATCH 166/211] Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/pull-request.yml | 2 +- .github/workflows/validate.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index fc1af672..66596bcf 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -30,7 +30,7 @@ jobs: # Give reproenv the full path to apptainer, so it still works with `sudo`. echo REPROENV_APPTAINER_PROGRAM=apptainer >> $GITHUB_ENV echo APPTAINER_CACHEDIR=/dev/shm/$(whoami)/singularity >> $GITHUB_ENV - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v2 with: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 03cdeab6..b800d06c 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v2 @@ -40,7 +40,7 @@ jobs: python-version: ['3.11', '3.10', '3.9', '3.8'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v2 From 8762650ec4e48f19544cd1ca1bf6fd8eba226e51 Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Tue, 22 Aug 2023 09:56:20 -0400 Subject: [PATCH 167/211] Create stale.yml workflow to close stale issues This uses the GitHub Action "stale". Documentation is available at https://docs.github.com/en/actions/managing-issues-and-pull-requests/closing-inactive-issues . This file uses the example YAML file in that link. [skip ci] --- .github/workflows /stale.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows /stale.yml diff --git a/.github/workflows /stale.yml b/.github/workflows /stale.yml new file mode 100644 index 00000000..e124aafb --- /dev/null +++ b/.github/workflows /stale.yml @@ -0,0 +1,25 @@ +# CRON job to close inactive issues. +# https://docs.github.com/en/actions/managing-issues-and-pull-requests/closing-inactive-issues + +name: Close inactive issues +on: + schedule: + - cron: "30 1 * * *" + +jobs: + close-issues: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v5 + with: + days-before-issue-stale: 30 + days-before-issue-close: 14 + stale-issue-label: "stale" + stale-issue-message: "This issue is stale because it has been open for 30 days with no activity." + close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale." + days-before-pr-stale: -1 + days-before-pr-close: -1 + repo-token: ${{ secrets.GITHUB_TOKEN }} From 30df09c218bd0257b1dd2c1ddb901d846109342d Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Tue, 22 Aug 2023 09:57:30 -0400 Subject: [PATCH 168/211] Change name of parent directory Previously, the parent directory ended with a space. --- .github/{workflows => workflows}/stale.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => workflows}/stale.yml (100%) diff --git a/.github/workflows /stale.yml b/.github/workflows/stale.yml similarity index 100% rename from .github/workflows /stale.yml rename to .github/workflows/stale.yml From a77bcc19d59b4b5cbf862e873d2dd11a0c83a507 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 24 Aug 2023 22:50:50 -0400 Subject: [PATCH 169/211] remove oldest disro --- .github/workflows/create_workflows.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index e6480514..ce78c275 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -31,10 +31,8 @@ apt_based = [ "ubuntu:22.04", "ubuntu:18.04", - "ubuntu:16.04", "debian:bullseye-slim", "debian:buster-slim", - "debian:stretch-slim", ] yum_based = ["fedora:36", "centos:7"] From 82f950998578075d11becd1b9f581d7b2ad8eda9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 18:46:50 +0000 Subject: [PATCH 170/211] Bump actions/stale from 5 to 8 Bumps [actions/stale](https://github.com/actions/stale) from 5 to 8. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v5...v8) --- updated-dependencies: - dependency-name: actions/stale dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index e124aafb..fbc887ad 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -13,7 +13,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@v5 + - uses: actions/stale@v8 with: days-before-issue-stale: 30 days-before-issue-close: 14 From 65cedc24bcb5b73952c587456ab173ee2a1b5f61 Mon Sep 17 00:00:00 2001 From: Dylan Nielson Date: Mon, 28 Aug 2023 20:27:52 -0400 Subject: [PATCH 171/211] add mamba option --- neurodocker/templates/miniconda.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/neurodocker/templates/miniconda.yaml b/neurodocker/templates/miniconda.yaml index a18fb693..770a33c5 100644 --- a/neurodocker/templates/miniconda.yaml +++ b/neurodocker/templates/miniconda.yaml @@ -31,6 +31,7 @@ binaries: conda_opts: "" pip_opts: "" yaml_file: "" + mamba: "false" instructions: | {% if not self.installed.lower() in ["true", "y", "1"] -%} {{ self.install_dependencies() }} @@ -44,6 +45,10 @@ binaries: {% if self.version == "latest" -%} conda update -yq -nbase conda {% endif -%} + {% if self.mamba == "true" -%} + conda install -yq -nbase conda-libmamba-solver + conda config --set solver libmamba + {% endif -%} # 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 From 169160e777fbf4d6e2833dde84ef5cfab2411c59 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Tue, 29 Aug 2023 00:59:32 +0000 Subject: [PATCH 172/211] set python version for format job --- .github/workflows/validate.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 8f063ecc..a6829ffc 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -18,6 +18,8 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 + with: + python-version: 3.11 - name: Install neurodocker run: python -m pip install --editable .[dev] From a02eb2375d14fb8e5d3c2465bdb84d2cf8a35b88 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 29 Aug 2023 08:08:22 -0400 Subject: [PATCH 173/211] add filter --- .github/workflows/bootstrap.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index c89b8194..452e5fdf 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -14,6 +14,10 @@ concurrency: on: push: branches: [ "master" ] + paths: + - .github/workflows/bootstrap.yml + - .github/workflows/create_workflows.py + - neurodocker/** # Uses the cron schedule for github actions # From 1805439bf6553716f7e45ec36b7c5ad85180267d Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 29 Aug 2023 17:10:11 -0400 Subject: [PATCH 174/211] test build of conda --- .github/workflows/create_workflows.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index ce78c275..3906ec7d 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -73,6 +73,7 @@ "methods": ["binaries", "source"], }, "spm12": {"methods": ["binaries"]}, + "miniconda": {}, } output_dir = Path(__file__).parent @@ -167,6 +168,8 @@ def main(): versions = get_versions_from_neurodocker_template(software_) for i in spec.get("skip_versions", []): versions.remove(i) + if software_ == "miniconda": + versions = ["latest"] if versions is not None and len(versions) > 0: wf["add_version"] = True From 94db0e0eaaf0ade7b554b811d82ddf69b52f986e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 29 Aug 2023 18:23:53 -0400 Subject: [PATCH 175/211] update versions --- .github/workflows/docker_build.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_build.jinja b/.github/workflows/docker_build.jinja index 536a1379..940d5946 100644 --- a/.github/workflows/docker_build.jinja +++ b/.github/workflows/docker_build.jinja @@ -33,9 +33,9 @@ jobs: - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Install neurodocker run: python -m pip install --editable .[dev] From 549eceb4a20960a23a951d9632c43dd9a5a67cff Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 10:57:47 -0400 Subject: [PATCH 176/211] autobuild CLI help --- .github/workflows/docs.yml | 4 +- docs/Makefile | 5 +- docs/generate_cli_help.sh | 11 + docs/user_guide/.gitignore | 1 + docs/user_guide/cli.rst | 511 +---------------------------------- docs/user_guide/cli_auto.rst | 7 - docs/user_guide/index.rst | 1 - 7 files changed, 26 insertions(+), 514 deletions(-) create mode 100644 docs/generate_cli_help.sh create mode 100644 docs/user_guide/.gitignore delete mode 100644 docs/user_guide/cli_auto.rst diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 060838f6..79adb7f4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,9 @@ jobs: - name: Install neurodocker run: python -m pip install --editable .[docs] - name: build docs - run: sphinx-build docs docs-build + run: | + make -C docs cli + sphinx-build docs docs-build - name: Deploy uses: JamesIves/github-pages-deploy-action@v4 with: diff --git a/docs/Makefile b/docs/Makefile index d4bb2cbb..5942c131 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -14,7 +14,10 @@ help: .PHONY: help Makefile +cli: + bash generate_cli_help.sh + # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile +%: Makefile cli @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/generate_cli_help.sh b/docs/generate_cli_help.sh new file mode 100644 index 00000000..9abc6843 --- /dev/null +++ b/docs/generate_cli_help.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +# quick and dirty way to make sure the CLI help is up to date + +echo "Generating CLI help for Neurodocker and its subcommands..." + +neurodocker --help > user_guide/cli_help.txt +neurodocker generate --help > user_guide/generate_cli_help.txt +neurodocker generate docker --help > user_guide/generate_docker_cli_help.txt +neurodocker generate singularity --help > user_guide/generate_singularity_cli_help.txt +neurodocker minify --help > user_guide/minify_cli_help.txt diff --git a/docs/user_guide/.gitignore b/docs/user_guide/.gitignore new file mode 100644 index 00000000..2211df63 --- /dev/null +++ b/docs/user_guide/.gitignore @@ -0,0 +1 @@ +*.txt diff --git a/docs/user_guide/cli.rst b/docs/user_guide/cli.rst index 479480fe..9b4c3667 100644 --- a/docs/user_guide/cli.rst +++ b/docs/user_guide/cli.rst @@ -7,499 +7,25 @@ This program has two subcommands: :code:`generate` and :code:`minify`. neurodocker ----------- - .. code-block:: - - Usage: neurodocker [OPTIONS] COMMAND [ARGS]... - - Generate custom containers, and minify existing containers. - - Options: - --version Show the version and exit. - --help Show this message and exit. - - Commands: - generate Generate a container. - minify Minify a container. +.. literalinclude:: cli_help.txt neurodocker generate ~~~~~~~~~~~~~~~~~~~~ -.. code-block:: - - Usage: neurodocker generate [OPTIONS] COMMAND [ARGS]... +.. literalinclude:: generate_cli_help.txt - Generate a container. - - Options: - --template-path DIRECTORY Path to directories with templates to register - [env var: REPROENV_TEMPLATE_PATH] - - --help Show this message and exit. - - Commands: - docker Generate a Dockerfile. - singularity Generate a Singularity recipe. - -The :code: `neurodocker generate` command has two subcommands: `docker` and `singularity`. Most of the arguments for these subcommands are identical, but please check the details below. +The ``neurodocker generate`` command has two subcommands: `docker` and `singularity`. +Most of the arguments for these subcommands are identical, but please check the details below. neurodocker generate docker ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. code-block:: - - Usage: neurodocker generate docker [OPTIONS] - - Generate a Dockerfile. - - Options: - -p, --pkg-manager [apt|yum] System package manager [required] - -b, --base-image TEXT Base image [required] - --arg KEY=VALUE Build-time variables (do not persist after - container is built) - - --copy TUPLE Copy files into the container. Provide at least - two paths. The last path is always the - destination path in the container. - - --env KEY=VALUE Set persistent environment variables - --entrypoint TUPLE Set entrypoint of the container - --install TUPLE Install packages with system package manager - --label KEY=VALUE Set labels on the container - --run TEXT Run commands in /bin/sh - --run-bash TEXT Run commands in a bash shell - --user TEXT Switch to a different user (create user if it - does not exist) - - --workdir TEXT Set the working directory - --yes Reply yes to all prompts for agreeing to any - alerts that a neurodocker template might have. - The alert messages will still be printed but - no confirmation is necessary from the user. - - --json Output instructions as JSON. This can be used - to generate Dockerfiles or Singularity recipes - with Neurodocker. - - --_header KEY=VALUE Add _header - method=[source] - options for method=source - - --afni KEY=VALUE Add afni - method=[binaries|source] - options for method=binaries - - install_path [default: /opt/afni-{{ self.version }}] - - version [default: latest] - - install_r_pkgs [default: false] - - install_python3 [default: false] - options for method=source - - version [required] - - repo [default: https://github.com/afni/afni.git] - - install_path [default: /opt/afni-{{ self.version }}] - - install_r_pkgs [default: false] - - install_python3 [default: false] - - --ants KEY=VALUE Add ants - method=[binaries|source] - options for method=binaries - - version [required] - version=[2.4.1|2.3.4|2.3.2|2.3.1|2.3.0|2.2.0|2.1.0|2.0.3|2.0.0] - - install_path [default: /opt/ants-{{ self.version }}] - options for method=source - - version [required] - - repo [default: https://github.com/ANTsX/ANTs.git] - - install_path [default: /opt/ants-{{ self.version }}] - - cmake_opts [default: -DCMAKE_INSTALL_PREFIX={{ self.install_path }} -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF] - - make_opts [default: -j1] - - --cat12 KEY=VALUE Add cat12 - method=[binaries] - options for method=binaries - - version [required] - version=[r1933_R2017b] - - install_path [default: /opt/CAT12-{{ self.version }}] - - --convert3d KEY=VALUE Add convert3d - method=[binaries] - options for method=binaries - - version [required] - version=[nightly|1.0.0] - - install_path [default: /opt/convert3d-{{ self.version }}] - - --dcm2niix KEY=VALUE Add dcm2niix - method=[binaries|source] - options for method=binaries - - version [required] - version=[v1.0.20201102|v1.0.20200331|v1.0.20190902|latest] - - install_path [default: /opt/dcm2niix-{{ self.version }}] - options for method=source - - version [required] - - repo [default: https://github.com/rordenlab/dcm2niix] - - install_path [default: /opt/dcm2niix-{{ self.version }}] - - cmake_opts [default: ] - - make_opts [default: -j1] - - --freesurfer KEY=VALUE Add freesurfer - method=[binaries] - options for method=binaries - - version [required] - version=[7.3.1|7.3.0|7.2.0|7.1.1-min|7.1.1|7.1.0|6.0.1|6.0.0-min|6.0.0] - - install_path [default: /opt/freesurfer-{{ self.version }}] - - exclude_paths [default: average/mult-comp-cor - lib/cuda - lib/qt - subjects/V1_average - subjects/bert - subjects/cvs_avg35 - subjects/cvs_avg35_inMNI152 - subjects/fsaverage3 - subjects/fsaverage4 - subjects/fsaverage5 - subjects/fsaverage6 - subjects/fsaverage_sym - trctrain - ] - - --fsl KEY=VALUE Add fsl - method=[binaries] - options for method=binaries - - version [required] - version=[6.0.6.4|6.0.6.3|6.0.6.2|6.0.6.1|6.0.6|6.0.5.2|6.0.5.1|6.0.5|6.0.4|6.0.3|6.0.2|6.0.1|6.0.0|5.0.9|5.0.8|5.0.11|5.0.10] - - install_path [default: /opt/fsl-{{ self.version }}] - - exclude_paths [default: ] - **Note**: FSL is non-free. If you are considering commercial use of FSL, please consult the relevant license(s). - - --jq KEY=VALUE Add jq - method=[binaries|source] - options for method=binaries - - version [required] - version=[1.6|1.5] - options for method=source - - version [required] - - --matlabmcr KEY=VALUE Add matlabmcr - method=[binaries] - options for method=binaries - - version [required] - version=[2021b|2021a|2020b|2020a|2019b|2019a|2018b|2018a|2017b|2017a|2016b|2016a|2015b|2015aSP1|2015a|2014b|2014a|2013b|2013a|2012b|2012a|2010a] - - curl_opts [default: ] - - install_path [default: /opt/MCR-{{ self.version }}] - - --minc KEY=VALUE Add minc - method=[binaries] - options for method=binaries - - version [required] - version=[1.9.18|1.9.17|1.9.16|1.9.15] - - install_path [default: /opt/minc-{{ self.version }}] - - --miniconda KEY=VALUE Add miniconda - method=[binaries] - options for method=binaries - - version [required] - version=[latest|*] - - install_path [default: /opt/miniconda-{{ self.version }}] - - installed [default: false] - - env_name [default: base] - - env_exists [default: true] - - conda_install [default: ] - - pip_install [default: ] - - conda_opts [default: ] - - pip_opts [default: ] - - yaml_file [default: ] - - --mricron KEY=VALUE Add mricron - method=[binaries] - options for method=binaries - - version [required] - version=[1.0.20190902|1.0.20190410|1.0.20181114|1.0.20180614|1.0.20180404|1.0.20171220] - - install_path [default: /opt/mricron-{{ self.version }}] - - --mrtrix3 KEY=VALUE Add mrtrix3 - method=[binaries|source] - options for method=binaries - - version [required] - version=[3.0.2|3.0.1|3.0.0] - - install_path [default: /opt/mrtrix3-{{ self.version }}] - - build_processes [default: 1] - options for method=source - - version [required] - - repo [default: https://github.com/MRtrix3/mrtrix3.git] - - install_path [default: /opt/mrtrix3-{{ self.version }}] - - build_processes [default: ] - - --ndfreeze KEY=VALUE Add ndfreeze - method=[source] - options for method=source - - date [required] - - opts [default: ] - - --neurodebian KEY=VALUE Add neurodebian - method=[binaries] - options for method=binaries - - version [required] - version=[usa-tn|usa-nh|usa-ca|japan|greece|germany-munich|germany-magdeburg|china-zhejiang|china-tsinghua|china-scitech|australia] - - os_codename [required] - - full_or_libre [default: full] - - --niftyreg KEY=VALUE Add niftyreg - method=[source] - options for method=source - - version [required] - - repo [default: https://github.com/KCL-BMEIS/niftyreg] - - install_path [default: /opt/niftyreg-{{ self.version }}] - - cmake_opts [default: -DCMAKE_INSTALL_PREFIX={{ self.install_path }} -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF] - - make_opts [default: -j1] - - --petpvc KEY=VALUE Add petpvc - method=[binaries] - options for method=binaries - - version [required] - version=[1.2.4|1.2.2|1.2.1|1.2.0-b|1.2.0-a|1.1.0|1.0.0] - - install_path [default: /opt/petpvc-{{ self.version }}] - - --spm12 KEY=VALUE Add spm12 - method=[binaries] - options for method=binaries - - version [required] - version=[r7771|r7487|r7219|r6914|r6685|r6472|r6225|dev] - - install_path [default: /opt/spm12-{{ self.version }}] - - matlab_install_path [default: /opt/matlab-compiler-runtime-2010a] - - --vnc KEY=VALUE Add vnc - method=[source] - options for method=source - - passwd [required] - - --help Show this message and exit. +.. literalinclude:: generate_docker_cli_help.txt neurodocker generate singularity ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. code-block:: - - Usage: neurodocker generate singularity [OPTIONS] - - Generate a Singularity recipe. - - Options: - -p, --pkg-manager [apt|yum] System package manager [required] - -b, --base-image TEXT Base image [required] - --arg KEY=VALUE Build-time variables (do not persist after - container is built) - - --copy TUPLE Copy files into the container. Provide at least - two paths. The last path is always the - destination path in the container. - - --env KEY=VALUE Set persistent environment variables - --entrypoint TUPLE Set entrypoint of the container - --install TUPLE Install packages with system package manager - --label KEY=VALUE Set labels on the container - --run TEXT Run commands in /bin/sh - --run-bash TEXT Run commands in a bash shell - --user TEXT Switch to a different user (create user if it - does not exist) - - --workdir TEXT Set the working directory - --yes Reply yes to all prompts for agreeing to any - alerts that a neurodocker template might have. - The alert messages will still be printed but - no confirmation is necessary from the user. - - --json Output instructions as JSON. This can be used - to generate Dockerfiles or Singularity recipes - with Neurodocker. - --_header KEY=VALUE Add _header - method=[source] - options for method=source - - --afni KEY=VALUE Add afni - method=[binaries|source] - options for method=binaries - - install_path [default: /opt/afni-{{ self.version }}] - - version [default: latest] - - install_r_pkgs [default: false] - - install_python3 [default: false] - options for method=source - - version [required] - - repo [default: https://github.com/afni/afni.git] - - install_path [default: /opt/afni-{{ self.version }}] - - install_r_pkgs [default: false] - - install_python3 [default: false] - - --ants KEY=VALUE Add ants - method=[binaries|source] - options for method=binaries - - version [required] - version=[2.4.1|2.3.4|2.3.2|2.3.1|2.3.0|2.2.0|2.1.0|2.0.3|2.0.0] - - install_path [default: /opt/ants-{{ self.version }}] - options for method=source - - version [required] - - repo [default: https://github.com/ANTsX/ANTs.git] - - install_path [default: /opt/ants-{{ self.version }}] - - cmake_opts [default: -DCMAKE_INSTALL_PREFIX={{ self.install_path }} -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF] - - make_opts [default: -j1] - - --cat12 KEY=VALUE Add cat12 - method=[binaries] - options for method=binaries - - version [required] - version=[r1933_R2017b] - - install_path [default: /opt/CAT12-{{ self.version }}] - - - --convert3d KEY=VALUE Add convert3d - method=[binaries] - options for method=binaries - - version [required] - version=[nightly|1.0.0] - - install_path [default: /opt/convert3d-{{ self.version }}] - - --dcm2niix KEY=VALUE Add dcm2niix - method=[binaries|source] - options for method=binaries - - version [required] - version=[v1.0.20201102|v1.0.20200331|v1.0.20190902|latest] - - install_path [default: /opt/dcm2niix-{{ self.version }}] - options for method=source - - version [required] - - repo [default: https://github.com/rordenlab/dcm2niix] - - install_path [default: /opt/dcm2niix-{{ self.version }}] - - cmake_opts [default: ] - - make_opts [default: -j1] - - --freesurfer KEY=VALUE Add freesurfer - method=[binaries] - options for method=binaries - - version [required] - version=[7.3.1|7.3.0|7.2.0|7.1.1-min|7.1.1|7.1.0|6.0.1|6.0.0-min|6.0.0] - - install_path [default: /opt/freesurfer-{{ self.version }}] - - exclude_paths [default: average/mult-comp-cor - lib/cuda - lib/qt - subjects/V1_average - subjects/bert - subjects/cvs_avg35 - subjects/cvs_avg35_inMNI152 - subjects/fsaverage3 - subjects/fsaverage4 - subjects/fsaverage5 - subjects/fsaverage6 - subjects/fsaverage_sym - trctrain - ] - - --fsl KEY=VALUE Add fsl - method=[binaries] - options for method=binaries - - version [required] - version=[6.0.6.4|6.0.6.3|6.0.6.2|6.0.6.1|6.0.6|6.0.5.2|6.0.5.1|6.0.5|6.0.4|6.0.3|6.0.2|6.0.1|6.0.0|5.0.9|5.0.8|5.0.11|5.0.10] - - install_path [default: /opt/fsl-{{ self.version }}] - - exclude_paths [default: ] - **Note**: FSL is non-free. If you are considering commercial use of FSL, please consult the relevant license(s). - - --jq KEY=VALUE Add jq - method=[binaries|source] - options for method=binaries - - version [required] - version=[1.6|1.5] - options for method=source - - version [required] - - --matlabmcr KEY=VALUE Add matlabmcr - method=[binaries] - options for method=binaries - - version [required] - version=[2023a|2021b|2021a|2020b|2020a|2019b|2019a|2018b|2018a|2017b|2017a|2016b|2016a|2015b|2015aSP1|2015a|2014b|2014a|2013b|2013a|2012b|2012a|2010a] - - curl_opts [default: ] - - install_path [default: /opt/MCR-{{ self.version }}] - - --minc KEY=VALUE Add minc - method=[binaries] - options for method=binaries - - version [required] - version=[1.9.18|1.9.17|1.9.16|1.9.15] - - install_path [default: /opt/minc-{{ self.version }}] - - --miniconda KEY=VALUE Add miniconda - method=[binaries] - options for method=binaries - - version [required] - version=[latest|*] - - install_path [default: /opt/miniconda-{{ self.version }}] - - installed [default: false] - - env_name [default: base] - - env_exists [default: true] - - conda_install [default: ] - - pip_install [default: ] - - conda_opts [default: ] - - pip_opts [default: ] - - yaml_file [default: ] - - --mricron KEY=VALUE Add mricron - method=[binaries] - options for method=binaries - - version [required] - version=[1.0.20190902|1.0.20190410|1.0.20181114|1.0.20180614|1.0.20180404|1.0.20171220] - - install_path [default: /opt/mricron-{{ self.version }}] - - --mrtrix3 KEY=VALUE Add mrtrix3 - method=[binaries|source] - options for method=binaries - - version [required] - version=[3.0.2|3.0.1|3.0.0] - - install_path [default: /opt/mrtrix3-{{ self.version }}] - - build_processes [default: 1] - options for method=source - - version [required] - - repo [default: https://github.com/MRtrix3/mrtrix3.git] - - install_path [default: /opt/mrtrix3-{{ self.version }}] - - build_processes [default: ] - - --ndfreeze KEY=VALUE Add ndfreeze - method=[source] - options for method=source - - date [required] - - opts [default: ] - - --neurodebian KEY=VALUE Add neurodebian - method=[binaries] - options for method=binaries - - version [required] - version=[usa-tn|usa-nh|usa-ca|japan|greece|germany-munich|germany-magdeburg|china-zhejiang|china-tsinghua|china-scitech|australia] - - os_codename [required] - - full_or_libre [default: full] - - --niftyreg KEY=VALUE Add niftyreg - method=[source] - options for method=source - - version [required] - - repo [default: https://github.com/KCL-BMEIS/niftyreg] - - install_path [default: /opt/niftyreg-{{ self.version }}] - - cmake_opts [default: -DCMAKE_INSTALL_PREFIX={{ self.install_path }} -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF] - - make_opts [default: -j1] - - -petpvc KEY=VALUE Add petpvc - method=[binaries] - options for method=binaries - - version [required] - version=[1.2.4|1.2.2|1.2.1|1.2.0-b|1.2.0-a|1.1.0|1.0.0] - - install_path [default: /opt/petpvc-{{ self.version }}] - - --spm12 KEY=VALUE Add spm12 - method=[binaries] - options for method=binaries - - version [required] - version=[r7771|r7487|r7219|r6914|r6685|r6472|r6225|dev] - - install_path [default: /opt/spm12-{{ self.version }}] - - matlab_install_path [default: /opt/matlab-compiler-runtime-2010a] - - --vnc KEY=VALUE Add vnc - method=[source] - options for method=source - - passwd [required] - - --help Show this message and exit. - +.. literalinclude:: generate_singularity_cli_help.txt neurodocker minify ~~~~~~~~~~~~~~~~~~ @@ -512,27 +38,4 @@ neurodocker minify pip install neurodocker[minify] - -.. code-block:: - - Usage: neurodocker minify [OPTIONS] COMMAND... - - Minify a container. - - Trace COMMAND... in the container, and remove all files in `--dirs-to- - prune` that were not used by the commands. - - Examples - -------- - docker run --rm -itd --name to-minify python:3.9-slim bash - neurodocker minify \ - --container to-minify \ - --dir /usr/local \ - "python -c 'a = 1 + 1; print(a)'" - - Options: - -c, --container TEXT ID or name of running Docker container [required] - -d, --dir TEXT Directories in container to prune. Data will be lost - in these directories [required] - - --help Show this message and exit. +.. literalinclude:: minify_cli_help.txt diff --git a/docs/user_guide/cli_auto.rst b/docs/user_guide/cli_auto.rst deleted file mode 100644 index 3a6c2e34..00000000 --- a/docs/user_guide/cli_auto.rst +++ /dev/null @@ -1,7 +0,0 @@ -Command-line Interface -====================== - -.. click:: neurodocker.cli.cli:cli - :prog: neurodocker - :nested: full - diff --git a/docs/user_guide/index.rst b/docs/user_guide/index.rst index 83ab6dc0..5c5b372b 100644 --- a/docs/user_guide/index.rst +++ b/docs/user_guide/index.rst @@ -6,7 +6,6 @@ User Guide installation quickstart cli - cli_auto examples common_uses minify From 6bdd58534dffc8dbbbb790a6b7fde0efe37d57f8 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 11:19:31 -0400 Subject: [PATCH 177/211] add links to github and docker --- README.md | 2 +- docs/conf.py | 28 ++++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4eac3505..d5734909 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![build status](https://github.com/ReproNim/neurodocker/actions/workflows/pull-request.yml/badge.svg)](https://github.com/ReproNim/neurodocker/actions/workflows/pull-request.yml) [![docker pulls](https://img.shields.io/docker/pulls/repronim/neurodocker.svg)](https://hub.docker.com/r/repronim/neurodocker/) -[![docker pulls](https://img.shields.io/docker/pulls/kaczmarj/neurodocker.svg)](https://hub.docker.com/r/kaczmarj/neurodocker/) +[![docker pulls](https://img.shields.io/docker/pulls/repronim/neurodocker.svg)](https://hub.docker.com/r/repronim/neurodocker/) [![python versions](https://img.shields.io/pypi/pyversions/neurodocker.svg)](https://pypi.org/project/neurodocker/) [![DOI](https://zenodo.org/badge/88654995.svg)](https://zenodo.org/badge/latestdoi/88654995) diff --git a/docs/conf.py b/docs/conf.py index c6f945f1..311edc11 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -39,14 +39,10 @@ "sphinx.ext.githubpages", "sphinx.ext.intersphinx", "sphinx.ext.coverage", - # "sphinx.ext.mathjax", - # "sphinx.ext.ifconfig", "sphinx.ext.napoleon", "sphinx.ext.todo", "sphinx.ext.viewcode", - # "sphinx.ext.linkcode", "sphinxcontrib.apidoc", - 'sphinx_click', ] # Add any paths that contain templates here, relative to this directory. @@ -64,6 +60,30 @@ # html_theme = "pydata_sphinx_theme" +html_theme_options = { + "use_edit_page_button": True, + "icon_links": [ + { + "name": "GitHub", + "url": "https://github.com/ReproNim/neurodocker", + "icon": "fa-brands fa-github", + }, + { + "name": "Docker Hub", + "url": "https://hub.docker.com/r/repronim/neurodocker", + "icon": "fa-brands fa-docker", + }, + ], +} + + +html_context = { + "github_user": "ReproNim", + "github_repo": "neurodocker", + "github_version": "master", + "doc_path": "docs", +} + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". From 18fe870e1bb05b43bb92cfe55e72a2a55d65b85c Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 11:26:44 -0400 Subject: [PATCH 178/211] remove unused dependency --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 02972c7c..96e4bfcc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -54,7 +54,6 @@ docs = sphinx <7 pydata-sphinx-theme >= 0.13 sphinxcontrib.apidoc >= 0.3 - sphinx-click all = %(minify)s %(dev)s From 26e4981ff1a163582d56ad71a62f83abd8c1874c Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 12:02:40 -0400 Subject: [PATCH 179/211] update doc --- docs/user_guide/common_uses.rst | 8 +-- docs/user_guide/examples.rst | 95 ++++++++++++++++++++------------- docs/user_guide/quickstart.rst | 33 +++++++----- 3 files changed, 82 insertions(+), 54 deletions(-) diff --git a/docs/user_guide/common_uses.rst b/docs/user_guide/common_uses.rst index 7c78550b..83a0dbc2 100644 --- a/docs/user_guide/common_uses.rst +++ b/docs/user_guide/common_uses.rst @@ -31,7 +31,7 @@ This example demonstrates how to build and run an image with Jupyter Notebook. neurodocker generate docker \ --pkg-manager apt \ - --base-image debian:buster-slim \ + --base-image debian:bullseye-slim \ --miniconda \ version=latest \ conda_install="matplotlib notebook numpy pandas seaborn" \ @@ -44,7 +44,9 @@ This example demonstrates how to build and run an image with Jupyter Notebook. # Run the image. The current directory is mounted to the working directory of the # Docker image, so our notebooks are saved to the current directory. - docker run --rm -it --publish 8888:8888 --volume $(pwd):/work notebook \ + docker run --rm -it \ + --publish 8888:8888 \ + --volume $(pwd):/work notebook \ jupyter-notebook --no-browser --ip 0.0.0.0 @@ -57,7 +59,7 @@ This example demonstrates how to create a Docker image with multiple conda envir neurodocker generate docker \ --pkg-manager apt \ - --base-image debian:buster-slim \ + --base-image debian:bullseye-slim \ --miniconda \ version=latest \ env_name=envA \ diff --git a/docs/user_guide/examples.rst b/docs/user_guide/examples.rst index f7b5803f..0ee42c47 100644 --- a/docs/user_guide/examples.rst +++ b/docs/user_guide/examples.rst @@ -48,14 +48,14 @@ Docker neurodocker generate docker \ --pkg-manager apt \ - --base-image debian:buster-slim \ - --fsl version=6.0.4 \ - > fsl604.Dockerfile + --base-image debian:bullseye-slim \ + --fsl version=6.0.7.1 \ + > fsl6071.Dockerfile - docker build --tag fsl:6.0.4 --file fsl604.Dockerfile . + docker build --tag fsl:6.0.7.1 --file fsl6071.Dockerfile . # Run fsl's bet program. - docker run --rm -it fsl:6.0.4 bet + docker run --rm -it fsl:6.0.7.1 bet AFNI ---- @@ -69,7 +69,7 @@ Docker neurodocker generate docker \ --pkg-manager yum \ - --base-image fedora:35 \ + --base-image fedora:36 \ --afni method=binaries version=latest \ > afni-binaries.Dockerfile @@ -82,25 +82,30 @@ This does not install AFNI's R packages. To install relevant R things, use the f neurodocker generate docker \ --pkg-manager yum \ - --base-image fedora:35 \ + --base-image fedora:36 \ --afni method=binaries version=latest install_r_pkgs=true \ > afni-binaries-r.Dockerfile docker build --tag afni:latest-with-r --file afni-binaries-r.Dockerfile . +.. todo:: -One can also build AFNI from source. The code below builds the current master branch. -Beware that this is AFNI's bleeding edge! + Building AFNI from source is currently failing on most tested distributions. -.. code-block:: bash +.. https://github.com/ReproNim/neurodocker/blob/test_docker_build/docs/README.md#afni - neurodocker generate docker \ - --pkg-manager yum \ - --base-image fedora:35 \ - --afni method=source version=master \ - > afni-source.Dockerfile +.. One can also build AFNI from source. The code below builds the current master branch. +.. Beware that this is AFNI's bleeding edge! + +.. .. code-block:: bash + +.. neurodocker generate docker \ +.. --pkg-manager yum \ +.. --base-image fedora:36 \ +.. --afni method=source version=master \ +.. > afni-source.Dockerfile - docker build --tag afni:master --file afni-source.Dockerfile . +.. docker build --tag afni:master --file afni-source.Dockerfile . FreeSurfer ---------- @@ -111,19 +116,25 @@ FreeSurfer Docker ~~~~~~ -The FreeSurfer installation is several gigabytes in size, but sometimes, users just -the pieces for :code:`recon-all`. For this reason, Neurodocker provides a FreeSurfer -minified for :code:`recon-all`. - .. code-block:: bash neurodocker generate docker \ --pkg-manager apt \ - --base-image debian:buster-slim \ - --freesurfer version=7.1.1-min \ - > freesurfer7-min.Dockerfile + --base-image debian:bullseye-slim \ + --freesurfer version=7.4.1 \ + > freesurfer741.Dockerfile + + docker build --tag freesurfer:7.4.1 --file freesurfer741.Dockerfile . + +.. todo:: + + The minified version on Freesurfer currently fails to build on all tested distributions. - docker build --tag freesurfer:7.1.1-min --file freesurfer7-min.Dockerfile . +.. https://github.com/ReproNim/neurodocker/blob/test_docker_build/docs/README.md#freesurfer + +.. The FreeSurfer installation is several gigabytes in size, but sometimes, users just +.. the pieces for :code:`recon-all`. For this reason, Neurodocker provides a FreeSurfer +.. minified for :code:`recon-all`. ANTS ---- @@ -132,51 +143,59 @@ ANTS neurodocker generate docker \ --pkg-manager apt \ - --base-image debian:buster-slim \ - --ants version=2.3.4 \ + --base-image debian:bullseye-slim \ + --ants version=2.4.3 \ > ants-234.Dockerfile - docker build --tag ants:2.3.4 --file ants-234.Dockerfile . + docker build --tag ants:2.4.3 --file ants-243.Dockerfile . + +.. note:: + Building docker images of ANTS from source fails on most tested distributions. +.. https://github.com/ReproNim/neurodocker/blob/test_docker_build/docs/README.md#ants CAT12 --- -CAT12 requires the MCR in the correction version. Miniconda and nipype is optional but recommended to use CAT12 from NiPype. +CAT12 requires the MCR in the correction version. +Miniconda and nipype is optionalbut recommended to use CAT12 from NiPype. .. code-block:: bash neurodocker generate docker \ - --base-image ubuntu:16.04 \ + --base-image ubuntu:22.04 \ --pkg-manager apt \ --mcr 2017b \ - --cat12 version=r1933_R2017b \ + --cat12 version=r2166_R2017b \ --miniconda \ version=latest \ conda_install='python=3.8 traits nipype numpy scipy h5py scikit-image' \ - > cat12-r1933_R2017b.Dockerfile + > cat12-r2166_R2017b.Dockerfile - docker build --tag cat12:r1933_R2017b --file cat12-r1933_R2017b.Dockerfile . + docker build --tag cat12:r2166_R2017b --file cat12-r2166_R2017b.Dockerfile . SPM --- -.. note:: - - Due to the version of the Matlab Compiler Runtime used, SPM12 should be used with - a Debian Stretch base image. +.. Due to the version of the Matlab Compiler Runtime used, +.. SPM12 should be used with a Debian Stretch base image. .. code-block:: bash neurodocker generate docker \ --pkg-manager apt \ - --base-image debian:stretch-slim \ + --base-image centos:7 \ --spm12 version=r7771 \ > spm12-r7771.Dockerfile docker build --tag spm12:r7771 --file spm12-r7771.Dockerfile . +.. note:: + + Building docker images of SPM12 from source fails on most tested distributions. + +.. https://github.com/ReproNim/neurodocker/blob/test_docker_build/docs/README.md#spm12 Miniconda --------- @@ -187,7 +206,7 @@ Docker with new :code:`conda` environment, python packages installed with :code: neurodocker generate docker \ --pkg-manager apt \ - --base-image debian:buster-slim \ + --base-image debian:bullseye-slim \ --miniconda \ version=latest \ env_name=env_scipy \ diff --git a/docs/user_guide/quickstart.rst b/docs/user_guide/quickstart.rst index 3334bace..07a1682e 100644 --- a/docs/user_guide/quickstart.rst +++ b/docs/user_guide/quickstart.rst @@ -20,9 +20,10 @@ This is a file that defines how to build a Docker image. .. code-block:: bash - neurodocker generate docker --pkg-manager apt \ - --base-image neurodebian:buster \ - --ants version=2.3.4 \ + neurodocker generate docker \ + --pkg-manager apt \ + --base-image neurodebian:bullseye \ + --ants version=2.4.3 \ --miniconda version=latest conda_install="nipype notebook" \ --user nonroot @@ -37,9 +38,10 @@ file in an empty directory, and build with :code:`docker build`: mkdir docker-example cd docker-example # saving the output of neurodocker command in a file: Dockerfile - neurodocker generate docker --pkg-manager apt \ - --base-image neurodebian:buster \ - --ants version=2.3.4 \ + neurodocker generate docker \ + --pkg-manager apt \ + --base-image neurodebian:bullseye \ + --ants version=2.4.3 \ --miniconda version=latest conda_install="nipype notebook" \ --user nonroot > Dockerfile # building a new image using the Dockerfile (use --file option if other name is used) @@ -54,7 +56,10 @@ created in :code:`/work` would be gone after the container was stopped. .. code-block:: bash - docker run --rm -it --workdir /work --volume $PWD:/work --publish 8888:8888 \ + docker run --rm -it \ + --workdir /work \ + --volume $PWD:/work \ + --publish 8888:8888 \ nipype-ants jupyter-notebook --ip 0.0.0.0 --port 8888 Feel free to create a new notebook and :code:`import nipype`. @@ -70,9 +75,10 @@ a form of :code:`neurodocker generate` command, `neurodocker generate singulari .. code-block:: bash - neurodocker generate singularity --pkg-manager apt \ - --base-image neurodebian:buster \ - --ants version=2.3.4 \ + neurodocker generate singularity \ + --pkg-manager apt \ + --base-image neurodebian:bullseye\ + --ants version=2.4.3 \ --miniconda version=latest conda_install="nipype notebook" \ --user nonroot @@ -87,9 +93,10 @@ will not be able to run this on a shared computing environment, like a high perf mkdir singularity-example cd singularity-example # saving the output of the Neurodocker command in the Singularity file - neurodocker generate singularity --pkg-manager apt \ - --base-image neurodebian:buster \ - --ants version=2.3.4 \ + neurodocker generate singularity \ + --pkg-manager apt \ + --base-image neurodebian:bullseye\ + --ants version=2.4.3 \ --miniconda version=latest conda_install="nipype notebook" \ --user nonroot > Singularity # building a new image using the Singularity file From f59e71e1d8318e6abc72b706918c3c2a96dd4f1c Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 12:22:00 -0400 Subject: [PATCH 180/211] add tests for some examples --- .github/workflows/test_doc.yml | 28 ++++++++ docs/common_uses/conda_multiple_env.txt | 17 +++++ docs/examples/nipype_tuto.txt | 40 ++++++++++++ docs/user_guide/common_uses.rst | 20 +----- docs/user_guide/examples.rst | 47 +------------ multi-conda-env.Dockerfile | 87 +++++++++++++++++++++++++ 6 files changed, 176 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/test_doc.yml create mode 100644 docs/common_uses/conda_multiple_env.txt create mode 100644 docs/examples/nipype_tuto.txt create mode 100644 multi-conda-env.Dockerfile diff --git a/.github/workflows/test_doc.yml b/.github/workflows/test_doc.yml new file mode 100644 index 00000000..ba1309be --- /dev/null +++ b/.github/workflows/test_doc.yml @@ -0,0 +1,28 @@ +name: test examples + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: [ "master" ] + + schedule: + - cron: 0 0 1 * * + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + test_examples: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + + - name: test common uses + run: bash < docs/common_uses/conda_multiple_env.txt + + - name: test examples + run: bash < docs/examples/nipype_tuto.txt diff --git a/docs/common_uses/conda_multiple_env.txt b/docs/common_uses/conda_multiple_env.txt new file mode 100644 index 00000000..53ad8102 --- /dev/null +++ b/docs/common_uses/conda_multiple_env.txt @@ -0,0 +1,17 @@ +neurodocker generate docker \ + --pkg-manager apt \ + --base-image debian:bullseye-slim \ + --miniconda \ + version=latest \ + env_name=envA \ + env_exists=false \ + conda_install=pandas \ + --miniconda \ + version=latest \ + installed=true \ + env_name=envB \ + env_exists=false \ + conda_install=scipy \ +> multi-conda-env.Dockerfile + +docker build --tag multi-conda-env --file multi-conda-env.Dockerfile . diff --git a/docs/examples/nipype_tuto.txt b/docs/examples/nipype_tuto.txt new file mode 100644 index 00000000..978ce726 --- /dev/null +++ b/docs/examples/nipype_tuto.txt @@ -0,0 +1,40 @@ +neurodocker generate docker \ +--pkg-manager apt \ +--base-image neurodebian:stretch-non-free \ +--arg DEBIAN_FRONTEND=noninteractive \ +--install convert3d ants fsl gcc g++ graphviz tree \ + git-annex-standalone vim emacs-nox nano less ncdu \ + tig git-annex-remote-rclone octave netbase \ +--spm12 version=r7771 \ +--miniconda \ +version=latest \ +conda_install="python=3.8 pytest jupyter jupyterlab jupyter_contrib_nbextensions + traits pandas matplotlib scikit-learn scikit-image seaborn nbformat + nb_conda" \ +pip_install="https://github.com/nipy/nipype/tarball/master + https://github.com/INCF/pybids/tarball/master + nilearn datalad[full] nipy duecredit nbval" \ +--run 'jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main' \ +--run 'mkdir /data && chmod 777 /data && chmod a+s /data' \ +--run 'mkdir /output && chmod 777 /output && chmod a+s /output' \ +--user neuro \ +--run-bash 'cd /data +&& datalad install -r ///workshops/nih-2017/ds000114 +&& cd ds000114 +&& datalad update -r +&& datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/*fingerfootlips*' \ +--run 'curl -fL https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9 -o /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz +&& tar xf /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -C /data/ds000114/derivatives/fmriprep/. +&& rm /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz +&& find /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c -type f -not -name ?mm_T1.nii.gz -not -name ?mm_brainmask.nii.gz -not -name ?mm_tpm*.nii.gz -delete' \ +--copy . "/home/neuro/nipype_tutorial" \ +--user root \ +--run 'chown -R neuro /home/neuro/nipype_tutorial' \ +--run 'rm -rf /opt/conda/pkgs/*' \ +--user neuro \ +--run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' \ +--workdir /home/neuro/nipype_tutorial \ +--entrypoint jupyter-notebook \ +> nipype-tutorial.Dockerfile + +docker build --tag nipype-tutorial . diff --git a/docs/user_guide/common_uses.rst b/docs/user_guide/common_uses.rst index 83a0dbc2..c1ddac31 100644 --- a/docs/user_guide/common_uses.rst +++ b/docs/user_guide/common_uses.rst @@ -55,25 +55,7 @@ Multiple Conda Environments This example demonstrates how to create a Docker image with multiple conda environments. -.. code-block:: bash - - neurodocker generate docker \ - --pkg-manager apt \ - --base-image debian:bullseye-slim \ - --miniconda \ - version=latest \ - env_name=envA \ - env_exists=false \ - conda_install=pandas \ - --miniconda \ - version=latest \ - installed=true \ - env_name=envB \ - env_exists=false \ - conda_install=scipy \ - > multi-conda-env.Dockerfile - - docker build --tag multi-conda-env --file multi-conda-env.Dockerfile . +.. literalinclude:: common_uses/conda_multiple_env.txt One can use the image in the following way: diff --git a/docs/user_guide/examples.rst b/docs/user_guide/examples.rst index 0ee42c47..20dd78f6 100644 --- a/docs/user_guide/examples.rst +++ b/docs/user_guide/examples.rst @@ -159,7 +159,7 @@ CAT12 --- CAT12 requires the MCR in the correction version. -Miniconda and nipype is optionalbut recommended to use CAT12 from NiPype. +Miniconda and nipype is optional but recommended to use CAT12 from NiPype. .. code-block:: bash @@ -170,7 +170,7 @@ Miniconda and nipype is optionalbut recommended to use CAT12 from NiPype. --cat12 version=r2166_R2017b \ --miniconda \ version=latest \ - conda_install='python=3.8 traits nipype numpy scipy h5py scikit-image' \ + conda_install='python=3.11 traits nipype numpy scipy h5py scikit-image' \ > cat12-r2166_R2017b.Dockerfile docker build --tag cat12:r2166_R2017b --file cat12-r2166_R2017b.Dockerfile . @@ -226,45 +226,4 @@ Nipype tutorial Docker ~~~~~~ -.. code-block:: bash - - neurodocker generate docker \ - --pkg-manager apt \ - --base-image neurodebian:stretch-non-free \ - --arg DEBIAN_FRONTEND=noninteractive \ - --install convert3d ants fsl gcc g++ graphviz tree \ - git-annex-standalone vim emacs-nox nano less ncdu \ - tig git-annex-remote-rclone octave netbase \ - --spm12 version=r7771 \ - --miniconda \ - version=latest \ - conda_install="python=3.8 pytest jupyter jupyterlab jupyter_contrib_nbextensions - traits pandas matplotlib scikit-learn scikit-image seaborn nbformat - nb_conda" \ - pip_install="https://github.com/nipy/nipype/tarball/master - https://github.com/INCF/pybids/tarball/master - nilearn datalad[full] nipy duecredit nbval" \ - --run 'jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main' \ - --run 'mkdir /data && chmod 777 /data && chmod a+s /data' \ - --run 'mkdir /output && chmod 777 /output && chmod a+s /output' \ - --user neuro \ - --run-bash 'cd /data - && datalad install -r ///workshops/nih-2017/ds000114 - && cd ds000114 - && datalad update -r - && datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/*fingerfootlips*' \ - --run 'curl -fL https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9 -o /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz - && tar xf /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -C /data/ds000114/derivatives/fmriprep/. - && rm /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz - && find /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c -type f -not -name ?mm_T1.nii.gz -not -name ?mm_brainmask.nii.gz -not -name ?mm_tpm*.nii.gz -delete' \ - --copy . "/home/neuro/nipype_tutorial" \ - --user root \ - --run 'chown -R neuro /home/neuro/nipype_tutorial' \ - --run 'rm -rf /opt/conda/pkgs/*' \ - --user neuro \ - --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' \ - --workdir /home/neuro/nipype_tutorial \ - --entrypoint jupyter-notebook \ - > nipype-tutorial.Dockerfile - - docker build --tag nipype-tutorial . +.. literalinclude:: examples/nipype_tuto.txt diff --git a/multi-conda-env.Dockerfile b/multi-conda-env.Dockerfile new file mode 100644 index 00000000..2c89f033 --- /dev/null +++ b/multi-conda-env.Dockerfile @@ -0,0 +1,87 @@ +# Generated by Neurodocker and Reproenv. + +FROM debian:bullseye-slim +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 create -y --name envA \ + && conda install -y --name envA \ + "pandas" \ + # Clean up + && sync && conda clean --all --yes && sync \ + && rm -rf ~/.cache/pip/* +ENV CONDA_DIR="/opt/miniconda-latest" \ + PATH="/opt/miniconda-latest/bin:$PATH" +RUN conda create -y --name envB \ + && conda install -y --name envB \ + "scipy" \ + # 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": "debian:bullseye-slim" \ + } \ + }, \ + { \ + "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 create -y --name envA\\nconda install -y --name envA \\\\\\n \\"pandas\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "CONDA_DIR": "/opt/miniconda-latest", \ + "PATH": "/opt/miniconda-latest/bin:$PATH" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "conda create -y --name envB\\nconda install -y --name envB \\\\\\n \\"scipy\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ + } \ + } \ + ] \ +}' > /.reproenv.json +# End saving to specification to JSON. From dff3b69a30854c6a0a11b64cfeda6dfd2346c185 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 12:26:23 -0400 Subject: [PATCH 181/211] test on PR --- .github/workflows/test_doc.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_doc.yml b/.github/workflows/test_doc.yml index ba1309be..e96e546c 100644 --- a/.github/workflows/test_doc.yml +++ b/.github/workflows/test_doc.yml @@ -7,6 +7,8 @@ concurrency: on: push: branches: [ "master" ] + pull_request: + branches: [ "master" ] schedule: - cron: 0 0 1 * * From 66d64b85a6375f6aaaa157c8d67597c2055da64a Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 12:30:46 -0400 Subject: [PATCH 182/211] it works better if you install the package you want to test --- .github/workflows/test_doc.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test_doc.yml b/.github/workflows/test_doc.yml index e96e546c..486dcace 100644 --- a/.github/workflows/test_doc.yml +++ b/.github/workflows/test_doc.yml @@ -23,6 +23,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install neurodocker + run: python -m pip install --editable . + - name: test common uses run: bash < docs/common_uses/conda_multiple_env.txt From 191a56c4f9b61721eae39ab777312ee66e846baf Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 12:49:24 -0400 Subject: [PATCH 183/211] it works better if you install python to install a python package --- .github/workflows/test_doc.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test_doc.yml b/.github/workflows/test_doc.yml index 486dcace..6dcf426e 100644 --- a/.github/workflows/test_doc.yml +++ b/.github/workflows/test_doc.yml @@ -23,6 +23,11 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Install neurodocker run: python -m pip install --editable . From d6d4d7e4f662ac0dad76af1475b9b69dba2bf1fa Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 12:52:16 -0400 Subject: [PATCH 184/211] rm test file --- multi-conda-env.Dockerfile | 87 -------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 multi-conda-env.Dockerfile diff --git a/multi-conda-env.Dockerfile b/multi-conda-env.Dockerfile deleted file mode 100644 index 2c89f033..00000000 --- a/multi-conda-env.Dockerfile +++ /dev/null @@ -1,87 +0,0 @@ -# Generated by Neurodocker and Reproenv. - -FROM debian:bullseye-slim -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 create -y --name envA \ - && conda install -y --name envA \ - "pandas" \ - # Clean up - && sync && conda clean --all --yes && sync \ - && rm -rf ~/.cache/pip/* -ENV CONDA_DIR="/opt/miniconda-latest" \ - PATH="/opt/miniconda-latest/bin:$PATH" -RUN conda create -y --name envB \ - && conda install -y --name envB \ - "scipy" \ - # 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": "debian:bullseye-slim" \ - } \ - }, \ - { \ - "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 create -y --name envA\\nconda install -y --name envA \\\\\\n \\"pandas\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "CONDA_DIR": "/opt/miniconda-latest", \ - "PATH": "/opt/miniconda-latest/bin:$PATH" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "conda create -y --name envB\\nconda install -y --name envB \\\\\\n \\"scipy\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \ - } \ - } \ - ] \ -}' > /.reproenv.json -# End saving to specification to JSON. From 0b8d789135197a94476d5f8919c69b4b0c6691d6 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 13:28:33 -0400 Subject: [PATCH 185/211] add possibility to only build a single workflow --- .github/workflows/create_workflows.py | 88 +++++++++++++++++---------- 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 3906ec7d..1933fa8a 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -23,6 +23,7 @@ and on the branch where the workflows are pushed to (currently "test_docker_build"). """ +import argparse from pathlib import Path import yaml # type: ignore @@ -48,34 +49,6 @@ }, """ -software: dict[str, dict[str, list[str]]] = { - "afni": { - "methods": ["binaries", "source"], - "afni_python": ["true", "false"], - }, - "ants": { - "methods": ["binaries", "source"], - }, - "cat12": {"methods": ["binaries"]}, - "convert3d": {"methods": ["binaries"]}, - "dcm2niix": { - "methods": ["binaries", "source"], - }, - "freesurfer": {"methods": []}, - "fsl": { - "methods": ["binaries"], - }, - "matlabmcr": { - "methods": ["binaries"], - }, - "mricron": {"methods": ["binaries"]}, - "mrtrix3": { - "methods": ["binaries", "source"], - }, - "spm12": {"methods": ["binaries"]}, - "miniconda": {}, -} - output_dir = Path(__file__).parent template_folder = Path(__file__).parents[2].joinpath("neurodocker", "templates") @@ -91,6 +64,36 @@ repo = "ReproNim/neurodocker" +def software() -> dict[str, dict[str, list[str]]]: + return { + "afni": { + "methods": ["binaries", "source"], + "afni_python": ["true", "false"], + }, + "ants": { + "methods": ["binaries", "source"], + }, + "cat12": {"methods": ["binaries"]}, + "convert3d": {"methods": ["binaries"]}, + "dcm2niix": { + "methods": ["binaries", "source"], + }, + "freesurfer": {"methods": []}, + "fsl": { + "methods": ["binaries"], + }, + "matlabmcr": { + "methods": ["binaries"], + }, + "mricron": {"methods": ["binaries"]}, + "mrtrix3": { + "methods": ["binaries", "source"], + }, + "spm12": {"methods": ["binaries"]}, + "miniconda": {}, + } + + def create_dashboard_file(): """Create a build dashboard file.""" @@ -109,13 +112,13 @@ def create_dashboard_file(): ) # table of content - for software_, _ in software.items(): + for software_, _ in software().items(): print(f"""- [{software_}](#{software_})""", file=f) print("", file=f) # link to the github actions workflow and image of the build status - for software_, _ in software.items(): + for software_, _ in software().items(): image_url = f"{image_base_url}&only={software_}" print( f"""## {software_} @@ -142,7 +145,7 @@ def stringify(some_list: list[str]) -> str: return "'" + "', '".join(some_list) + "'" -def main(): +def main(software_name="all"): env = Environment( loader=FileSystemLoader(Path(__file__).parent), autoescape=select_autoescape(), @@ -158,7 +161,12 @@ def main(): "all": stringify(apt_based + yum_based), } - for software_, spec in software.items(): + # only keep relevant software + software_to_test = software() + if software_name in software_to_test: + software_to_test = {software_name: software_to_test[software_name]} + + for software_, spec in software_to_test.items(): wf = { "header": "# This is file is automatically generated. Do not edit.", "os": os, @@ -193,4 +201,18 @@ def main(): if __name__ == "__main__": - main() + parser = argparse.ArgumentParser() + + choices = list(software().keys()) + choices.append("all") + + parser.add_argument( + "--software", + required=False, + default="all", + choices=choices, + nargs=1, + ) + args = parser.parse_args() + + main(software_name=args.software[0]) From e1655520239884b61142b0d1e6296accad05a6d0 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 13:44:46 -0400 Subject: [PATCH 186/211] add dispatch options --- .github/workflows/bootstrap.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 452e5fdf..6d9c2f60 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -38,6 +38,12 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + inputs: + software_name: + description: 'software to test' + required: true + default: 'all' + permissions: contents: write actions: write @@ -58,6 +64,10 @@ jobs: - name: Install dependencies run: python -m pip install jinja2 pyyaml + - name: check workflow inputs + run: | + echo "software_name: ${{ inputs.software_name }}" + - name: Create workflows run: | git checkout -b test_docker_build From 6ebca585f56f2b5ad3d38645f69b788924820ea1 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 13:46:36 -0400 Subject: [PATCH 187/211] move step --- .github/workflows/bootstrap.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 6d9c2f60..29e909e9 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -52,6 +52,10 @@ jobs: runs-on: ubuntu-22.04 steps: + - name: check workflow inputs + run: | + echo "software_name: ${{ inputs.software_name }}" + - uses: actions/checkout@v3 with: token: ${{ secrets.CI_FLOW }} @@ -64,10 +68,6 @@ jobs: - name: Install dependencies run: python -m pip install jinja2 pyyaml - - name: check workflow inputs - run: | - echo "software_name: ${{ inputs.software_name }}" - - name: Create workflows run: | git checkout -b test_docker_build From 8153f9fec1b16db959a3ae4b996a373e8c7aaf88 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 13:49:35 -0400 Subject: [PATCH 188/211] set defaults --- .github/workflows/bootstrap.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 29e909e9..7bedf04d 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -54,7 +54,15 @@ jobs: steps: - name: check workflow inputs run: | - echo "software_name: ${{ inputs.software_name }}" + software_name = ${{ inputs.software_name }} + if [ -z "$software_name" ]; then + software_name="all" + fi + if [ "$software_name" = "all" ]; then + echo "testing all software" + else + echo "testing ${software_name}" + fi - uses: actions/checkout@v3 with: From c8c11e269c4df135b9ebd4d6c5a96686c4c33194 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 13:50:45 -0400 Subject: [PATCH 189/211] set defaults --- .github/workflows/bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 7bedf04d..64566982 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -54,7 +54,7 @@ jobs: steps: - name: check workflow inputs run: | - software_name = ${{ inputs.software_name }} + software_name=${{ inputs.software_name }} if [ -z "$software_name" ]; then software_name="all" fi From d8ada1abe9936d9e494bcfd045db3414abdb4961 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 13:52:04 -0400 Subject: [PATCH 190/211] pass value --- .github/workflows/bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 64566982..af8381b3 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -79,7 +79,7 @@ jobs: - name: Create workflows run: | git checkout -b test_docker_build - python .github/workflows/create_workflows.py + python .github/workflows/create_workflows.py ${software_name} ls -l .github/workflows git add . git config --global user.email "no-reply@repronim.org" From 4492453a583e8d56c6c7664c77bfdca287872129 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 14:16:34 -0400 Subject: [PATCH 191/211] fix build command --- docs/examples/nipype_tuto.txt | 70 +++++++++++++++++------------------ 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/docs/examples/nipype_tuto.txt b/docs/examples/nipype_tuto.txt index 978ce726..fef43f8d 100644 --- a/docs/examples/nipype_tuto.txt +++ b/docs/examples/nipype_tuto.txt @@ -1,40 +1,36 @@ neurodocker generate docker \ ---pkg-manager apt \ ---base-image neurodebian:stretch-non-free \ ---arg DEBIAN_FRONTEND=noninteractive \ ---install convert3d ants fsl gcc g++ graphviz tree \ - git-annex-standalone vim emacs-nox nano less ncdu \ - tig git-annex-remote-rclone octave netbase \ ---spm12 version=r7771 \ ---miniconda \ -version=latest \ -conda_install="python=3.8 pytest jupyter jupyterlab jupyter_contrib_nbextensions - traits pandas matplotlib scikit-learn scikit-image seaborn nbformat - nb_conda" \ -pip_install="https://github.com/nipy/nipype/tarball/master - https://github.com/INCF/pybids/tarball/master - nilearn datalad[full] nipy duecredit nbval" \ ---run 'jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main' \ ---run 'mkdir /data && chmod 777 /data && chmod a+s /data' \ ---run 'mkdir /output && chmod 777 /output && chmod a+s /output' \ ---user neuro \ ---run-bash 'cd /data -&& datalad install -r ///workshops/nih-2017/ds000114 -&& cd ds000114 -&& datalad update -r -&& datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/*fingerfootlips*' \ ---run 'curl -fL https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9 -o /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -&& tar xf /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -C /data/ds000114/derivatives/fmriprep/. -&& rm /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -&& find /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c -type f -not -name ?mm_T1.nii.gz -not -name ?mm_brainmask.nii.gz -not -name ?mm_tpm*.nii.gz -delete' \ ---copy . "/home/neuro/nipype_tutorial" \ ---user root \ ---run 'chown -R neuro /home/neuro/nipype_tutorial' \ ---run 'rm -rf /opt/conda/pkgs/*' \ ---user neuro \ ---run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' \ ---workdir /home/neuro/nipype_tutorial \ ---entrypoint jupyter-notebook \ + --pkg-manager apt \ + --base-image neurodebian:stretch-non-free \ + --arg DEBIAN_FRONTEND=noninteractive \ + --install convert3d ants fsl gcc g++ graphviz tree \ + git-annex-standalone vim emacs-nox nano less ncdu \ + tig git-annex-remote-rclone octave netbase \ + --spm12 version=r7771 \ + --miniconda \ + version=latest \ + conda_install="python=3.8 pytest jupyter jupyterlab jupyter_contrib_nbextensions traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \ + pip_install="https://github.com/nipy/nipype/tarball/master https://github.com/INCF/pybids/tarball/master nilearn datalad[full] nipy duecredit nbval" \ + --run 'jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main' \ + --run 'mkdir /data && chmod 777 /data && chmod a+s /data' \ + --run 'mkdir /output && chmod 777 /output && chmod a+s /output' \ + --user neuro \ + --run-bash 'cd /data + && datalad install -r ///workshops/nih-2017/ds000114 + && cd ds000114 + && datalad update -r + && datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/*fingerfootlips*' \ + --run 'curl -fL https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9 -o /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz + && tar xf /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -C /data/ds000114/derivatives/fmriprep/. + && rm /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz + && find /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c -type f -not -name ?mm_T1.nii.gz -not -name ?mm_brainmask.nii.gz -not -name ?mm_tpm*.nii.gz -delete' \ + --copy . "/home/neuro/nipype_tutorial" \ + --user root \ + --run 'chown -R neuro /home/neuro/nipype_tutorial' \ + --run 'rm -rf /opt/conda/pkgs/*' \ + --user neuro \ + --run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' \ + --workdir /home/neuro/nipype_tutorial \ + --entrypoint jupyter-notebook \ > nipype-tutorial.Dockerfile -docker build --tag nipype-tutorial . +docker build --tag nipype-tutorial --file nipype-tutorial.Dockerfile . From 5e0a707b1e4ae9542182bda567609a390b10584e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 20:19:34 +0200 Subject: [PATCH 192/211] Update README.md Co-authored-by: Jakub Kaczmarzyk --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index d5734909..6b5ff122 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![build status](https://github.com/ReproNim/neurodocker/actions/workflows/pull-request.yml/badge.svg)](https://github.com/ReproNim/neurodocker/actions/workflows/pull-request.yml) [![docker pulls](https://img.shields.io/docker/pulls/repronim/neurodocker.svg)](https://hub.docker.com/r/repronim/neurodocker/) -[![docker pulls](https://img.shields.io/docker/pulls/repronim/neurodocker.svg)](https://hub.docker.com/r/repronim/neurodocker/) [![python versions](https://img.shields.io/pypi/pyversions/neurodocker.svg)](https://pypi.org/project/neurodocker/) [![DOI](https://zenodo.org/badge/88654995.svg)](https://zenodo.org/badge/latestdoi/88654995) From 613ccc205f7c2c1ae2797b209bbdea1745fa8fd5 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 14:38:05 -0400 Subject: [PATCH 193/211] try to modernize nipype tuto example --- docs/examples/nipype_tuto.txt | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/docs/examples/nipype_tuto.txt b/docs/examples/nipype_tuto.txt index fef43f8d..92f7f513 100644 --- a/docs/examples/nipype_tuto.txt +++ b/docs/examples/nipype_tuto.txt @@ -1,28 +1,31 @@ neurodocker generate docker \ --pkg-manager apt \ - --base-image neurodebian:stretch-non-free \ - --arg DEBIAN_FRONTEND=noninteractive \ - --install convert3d ants fsl gcc g++ graphviz tree \ + --base-image debian:bullseye-slim \ + --yes \ + --ants version=2.4.3 \ + --fsl version=6.0.7.1 \ + --convert3d version=1.0.0 \ + --install gcc g++ graphviz tree \ git-annex-standalone vim emacs-nox nano less ncdu \ tig git-annex-remote-rclone octave netbase \ --spm12 version=r7771 \ --miniconda \ - version=latest \ - conda_install="python=3.8 pytest jupyter jupyterlab jupyter_contrib_nbextensions traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \ - pip_install="https://github.com/nipy/nipype/tarball/master https://github.com/INCF/pybids/tarball/master nilearn datalad[full] nipy duecredit nbval" \ + version=latest \ + conda_install="python=3.11 nipype pybids pytest jupyter jupyterlab jupyter_contrib_nbextensions traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \ + pip_install="nilearn datalad[full] nipy duecredit nbval" \ --run 'jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main' \ --run 'mkdir /data && chmod 777 /data && chmod a+s /data' \ --run 'mkdir /output && chmod 777 /output && chmod a+s /output' \ --user neuro \ --run-bash 'cd /data - && datalad install -r ///workshops/nih-2017/ds000114 - && cd ds000114 - && datalad update -r - && datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/*fingerfootlips*' \ + && datalad install -r ///workshops/nih-2017/ds000114 + && cd ds000114 + && datalad update -r + && datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/*fingerfootlips*' \ --run 'curl -fL https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9 -o /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz - && tar xf /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -C /data/ds000114/derivatives/fmriprep/. - && rm /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz - && find /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c -type f -not -name ?mm_T1.nii.gz -not -name ?mm_brainmask.nii.gz -not -name ?mm_tpm*.nii.gz -delete' \ + && tar xf /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -C /data/ds000114/derivatives/fmriprep/. + && rm /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz + && find /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c -type f -not -name ?mm_T1.nii.gz -not -name ?mm_brainmask.nii.gz -not -name ?mm_tpm*.nii.gz -delete' \ --copy . "/home/neuro/nipype_tutorial" \ --user root \ --run 'chown -R neuro /home/neuro/nipype_tutorial' \ From 36ce230659d67f02a3c8f23879fb07642c684b37 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 14:44:11 -0400 Subject: [PATCH 194/211] use env var --- .github/workflows/bootstrap.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index af8381b3..002ca492 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -63,6 +63,7 @@ jobs: else echo "testing ${software_name}" fi + export SOFTWARE_NAME=${software_name} - uses: actions/checkout@v3 with: @@ -79,7 +80,7 @@ jobs: - name: Create workflows run: | git checkout -b test_docker_build - python .github/workflows/create_workflows.py ${software_name} + python .github/workflows/create_workflows.py ${SOFTWARE_NAME} ls -l .github/workflows git add . git config --global user.email "no-reply@repronim.org" From 6de86199b4ed51411ecb9dd125b581cbb0fb13e1 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 14:54:38 -0400 Subject: [PATCH 195/211] use local var --- .github/workflows/bootstrap.yml | 24 ++++++++++-------------- .github/workflows/create_workflows.py | 4 ++-- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 002ca492..63f85d69 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -52,19 +52,6 @@ jobs: runs-on: ubuntu-22.04 steps: - - name: check workflow inputs - run: | - software_name=${{ inputs.software_name }} - if [ -z "$software_name" ]; then - software_name="all" - fi - if [ "$software_name" = "all" ]; then - echo "testing all software" - else - echo "testing ${software_name}" - fi - export SOFTWARE_NAME=${software_name} - - uses: actions/checkout@v3 with: token: ${{ secrets.CI_FLOW }} @@ -79,8 +66,17 @@ jobs: - name: Create workflows run: | + software_name=${{ inputs.software_name }} + if [ -z "$software_name" ]; then + software_name="all" + fi + if [ "$software_name" = "all" ]; then + echo "testing all software" + else + echo "testing ${software_name}" + fi git checkout -b test_docker_build - python .github/workflows/create_workflows.py ${SOFTWARE_NAME} + python .github/workflows/create_workflows.py --software_name ${software_name} ls -l .github/workflows git add . git config --global user.email "no-reply@repronim.org" diff --git a/.github/workflows/create_workflows.py b/.github/workflows/create_workflows.py index 1933fa8a..e7d562b5 100644 --- a/.github/workflows/create_workflows.py +++ b/.github/workflows/create_workflows.py @@ -207,7 +207,7 @@ def main(software_name="all"): choices.append("all") parser.add_argument( - "--software", + "--software_name", required=False, default="all", choices=choices, @@ -215,4 +215,4 @@ def main(software_name="all"): ) args = parser.parse_args() - main(software_name=args.software[0]) + main(software_name=args.software_name[0]) From 8fc2add8ab4d9fcf3084f2f1b55231266e63277d Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 14:59:50 -0400 Subject: [PATCH 196/211] update nipype example --- docs/examples/nipype_tuto.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/examples/nipype_tuto.txt b/docs/examples/nipype_tuto.txt index 92f7f513..66c0ef3e 100644 --- a/docs/examples/nipype_tuto.txt +++ b/docs/examples/nipype_tuto.txt @@ -5,10 +5,7 @@ neurodocker generate docker \ --ants version=2.4.3 \ --fsl version=6.0.7.1 \ --convert3d version=1.0.0 \ - --install gcc g++ graphviz tree \ - git-annex-standalone vim emacs-nox nano less ncdu \ - tig git-annex-remote-rclone octave netbase \ - --spm12 version=r7771 \ + --install gcc g++ graphviz tree git-annex vim emacs-nox nano less ncdu tig octave netbase \ --miniconda \ version=latest \ conda_install="python=3.11 nipype pybids pytest jupyter jupyterlab jupyter_contrib_nbextensions traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \ @@ -16,6 +13,7 @@ neurodocker generate docker \ --run 'jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main' \ --run 'mkdir /data && chmod 777 /data && chmod a+s /data' \ --run 'mkdir /output && chmod 777 /output && chmod a+s /output' \ + --spm12 version=r7771 \ --user neuro \ --run-bash 'cd /data && datalad install -r ///workshops/nih-2017/ds000114 From 96098337a34353717b888b519f668110c532c724 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 3 Sep 2023 16:21:04 -0400 Subject: [PATCH 197/211] use mamba and pin some dependencies --- docs/examples/nipype_tuto.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/examples/nipype_tuto.txt b/docs/examples/nipype_tuto.txt index 66c0ef3e..c25e6db0 100644 --- a/docs/examples/nipype_tuto.txt +++ b/docs/examples/nipype_tuto.txt @@ -8,8 +8,9 @@ neurodocker generate docker \ --install gcc g++ graphviz tree git-annex vim emacs-nox nano less ncdu tig octave netbase \ --miniconda \ version=latest \ - conda_install="python=3.11 nipype pybids pytest jupyter jupyterlab jupyter_contrib_nbextensions traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \ - pip_install="nilearn datalad[full] nipy duecredit nbval" \ + mamba=true \ + conda_install="python=3.11 nipype pybids=0.16.3 pytest jupyterlab jupyter_contrib_nbextensions traits scikit-image seaborn nbformat nb_conda" \ + pip_install="nilearn=0.10.1 datalad[full] nipy duecredit nbval" \ --run 'jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main' \ --run 'mkdir /data && chmod 777 /data && chmod a+s /data' \ --run 'mkdir /output && chmod 777 /output && chmod a+s /output' \ From 1ec64227326e35ef87234792b78db957a48acf88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 18:53:25 +0000 Subject: [PATCH 198/211] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/bootstrap.yml | 2 +- .github/workflows/codespell.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/validate.yml | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 63f85d69..fa4f34d5 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -52,7 +52,7 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: token: ${{ secrets.CI_FLOW }} diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 96d74124..48ad5f28 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -21,6 +21,6 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Codespell uses: codespell-project/actions-codespell@v2 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 79adb7f4..fb66bdc5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,7 @@ jobs: build_docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b462f600..bb1b8952 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,7 @@ jobs: pypi-release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index de18a5a3..fb0880a9 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -30,7 +30,7 @@ jobs: # Give reproenv the full path to apptainer, so it still works with `sudo`. echo REPROENV_APPTAINER_PROGRAM=apptainer >> $GITHUB_ENV echo APPTAINER_CACHEDIR=/dev/shm/$(whoami)/singularity >> $GITHUB_ENV - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa55b1f5..fff25414 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Prepare repository # Fetch full git history and tags diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index a6829ffc..afe4801d 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 @@ -42,7 +42,7 @@ jobs: python-version: ['3.11', '3.10', '3.9', '3.8'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 From 7b2501c0219bb1e94625eddb521d27be7f26e4f7 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 5 Sep 2023 00:12:20 +0200 Subject: [PATCH 199/211] [FIX] install the proper dependencies for doc build --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fb66bdc5..0481cdc1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,7 +14,7 @@ jobs: with: python-version: "3.10" - name: Install neurodocker - run: python -m pip install --editable .[docs] + run: python -m pip install --editable .[all] - name: build docs run: | make -C docs cli From b8b5579e183c0cee4fa56ba96d03ff44cba4e3f0 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Tue, 5 Sep 2023 14:58:01 +1000 Subject: [PATCH 200/211] Update examples.rst adding example for dealing with FSL license question in a non-interactive session --- docs/user_guide/examples.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/user_guide/examples.rst b/docs/user_guide/examples.rst index f7b5803f..1333c6d4 100644 --- a/docs/user_guide/examples.rst +++ b/docs/user_guide/examples.rst @@ -52,6 +52,17 @@ Docker --fsl version=6.0.4 \ > fsl604.Dockerfile +# This will ask the following question interactively: FSL is non-free. If you are considering commercial use of FSL, please consult the relevant license(s). Proceed? [y/N] + +# If you are using neurodocker non-interactively, this problem can be avoided using: + + yes | neurodocker generate docker \ + --pkg-manager apt \ + --base-image debian:buster-slim \ + --fsl version=6.0.4 \ + > fsl604.Dockerfile + + docker build --tag fsl:6.0.4 --file fsl604.Dockerfile . # Run fsl's bet program. From 3376e0439db2ea085ba57adadb16fefe5c11e34c Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Tue, 5 Sep 2023 15:02:32 +1000 Subject: [PATCH 201/211] added FSL interactivity note added description for interactive containers as discussed here: https://github.com/ReproNim/neurodocker/issues/475 --- docs/user_guide/installation.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/user_guide/installation.rst b/docs/user_guide/installation.rst index 04090540..a9ab5239 100644 --- a/docs/user_guide/installation.rst +++ b/docs/user_guide/installation.rst @@ -11,6 +11,14 @@ Docker or Singularity. docker run --rm repronim/neurodocker:latest --help +Note: Some tools require an interactive input during installation (e.g. FSL). Running the container interactively will allow to answer this question: + +.. code-block:: bash + + docker run -i --rm + +Alternatively, a singularity container: + .. code-block:: bash singularity run docker://repronim/neurodocker:latest --help From 1e7aed73d1eb70299219406d26b9b62dc9dfcaea Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Wed, 6 Sep 2023 09:16:56 +1000 Subject: [PATCH 202/211] Update docs/user_guide/examples.rst Co-authored-by: Remi Gau --- docs/user_guide/examples.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/user_guide/examples.rst b/docs/user_guide/examples.rst index 1333c6d4..99bebd43 100644 --- a/docs/user_guide/examples.rst +++ b/docs/user_guide/examples.rst @@ -56,9 +56,10 @@ Docker # If you are using neurodocker non-interactively, this problem can be avoided using: - yes | neurodocker generate docker \ + neurodocker generate docker \ --pkg-manager apt \ --base-image debian:buster-slim \ + --yes \ --fsl version=6.0.4 \ > fsl604.Dockerfile From 5689479a3ef68e0210c3c3181d64d3bec7b53015 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 6 Sep 2023 04:06:58 +0200 Subject: [PATCH 203/211] Update stale.yml --- .github/workflows/stale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index fbc887ad..3c5e18b5 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -15,8 +15,8 @@ jobs: steps: - uses: actions/stale@v8 with: - days-before-issue-stale: 30 - days-before-issue-close: 14 + days-before-issue-stale: 60 + days-before-issue-close: 60 stale-issue-label: "stale" stale-issue-message: "This issue is stale because it has been open for 30 days with no activity." close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale." From 18a77161c6126f031935872bf84dd958f7e70ac2 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Mon, 11 Sep 2023 16:49:31 +1000 Subject: [PATCH 204/211] Update installation.rst Mention --yes option here as well and refer to examples --- docs/user_guide/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guide/installation.rst b/docs/user_guide/installation.rst index a9ab5239..4f435786 100644 --- a/docs/user_guide/installation.rst +++ b/docs/user_guide/installation.rst @@ -11,7 +11,7 @@ Docker or Singularity. docker run --rm repronim/neurodocker:latest --help -Note: Some tools require an interactive input during installation (e.g. FSL). Running the container interactively will allow to answer this question: +Note: Some tools require an interactive input during installation (e.g. FSL). This can either be handled using the Neurodocker `--yes` option (see examples -> FSL) or running the container interactively will also allow to answer this question: .. code-block:: bash From fc186230875312380437be66b010a619981413a2 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Mon, 18 Sep 2023 09:41:33 +1000 Subject: [PATCH 205/211] Update examples.rst fix code formatting --- docs/user_guide/examples.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/user_guide/examples.rst b/docs/user_guide/examples.rst index 99bebd43..b3aaadb0 100644 --- a/docs/user_guide/examples.rst +++ b/docs/user_guide/examples.rst @@ -56,6 +56,8 @@ Docker # If you are using neurodocker non-interactively, this problem can be avoided using: +.. code-block:: bash + neurodocker generate docker \ --pkg-manager apt \ --base-image debian:buster-slim \ @@ -63,7 +65,6 @@ Docker --fsl version=6.0.4 \ > fsl604.Dockerfile - docker build --tag fsl:6.0.4 --file fsl604.Dockerfile . # Run fsl's bet program. From d9726853e375e991a0425bf0ee14017a8c50b971 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 17 Sep 2023 19:47:35 -0400 Subject: [PATCH 206/211] more recent mrtrix version --- neurodocker/templates/mrtrix3.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neurodocker/templates/mrtrix3.yaml b/neurodocker/templates/mrtrix3.yaml index 81b02a4a..4d8345d2 100644 --- a/neurodocker/templates/mrtrix3.yaml +++ b/neurodocker/templates/mrtrix3.yaml @@ -22,6 +22,8 @@ binaries: - libpng - libtiff urls: + "3.0.4": https://github.com/MRtrix3/mrtrix3/releases/download/3.0.4/conda-linux-mrtrix3-3.0.4-h2bc3f7f_0.tar.bz2 + "3.0.3": https://github.com/MRtrix3/mrtrix3/releases/download/3.0.3/conda-linux-mrtrix3-3.0.3-h2bc3f7f_0.tar.bz2 "3.0.2": https://github.com/MRtrix3/mrtrix3/releases/download/3.0.2/conda-linux-mrtrix3-3.0.2-h6bb024c_0.tar.bz2 "3.0.1": https://github.com/MRtrix3/mrtrix3/releases/download/3.0.1/conda-linux-mrtrix3-3.0.1-h6bb024c_0.tar.bz2 "3.0.0": https://github.com/MRtrix3/mrtrix3/releases/download/3.0.0/conda-linux-mrtrix3-3.0.0-h6bb024c_0.tar.bz2 @@ -42,7 +44,7 @@ source: optional: repo: https://github.com/MRtrix3/mrtrix3.git install_path: /opt/mrtrix3-{{ self.version }} - build_processes: "" + build_processes: "1" dependencies: apt: - ca-certificates From cdb64201204093fd2cb42f6e4924d2374569ab0f Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 17 Sep 2023 19:59:28 -0400 Subject: [PATCH 207/211] fix typo in dox --- docs/user_guide/examples.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guide/examples.rst b/docs/user_guide/examples.rst index 99bebd43..857a3b2b 100644 --- a/docs/user_guide/examples.rst +++ b/docs/user_guide/examples.rst @@ -153,7 +153,7 @@ ANTS CAT12 ---- +----- CAT12 requires the MCR in the correction version. Miniconda and nipype is optional but recommended to use CAT12 from NiPype. From 0b56acd17a5624d6cca0cf971143643bac2e784e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 17 Sep 2023 20:40:14 -0400 Subject: [PATCH 208/211] comment out nipype example --- docs/user_guide/examples.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/user_guide/examples.rst b/docs/user_guide/examples.rst index 50d58c3b..638f3fff 100644 --- a/docs/user_guide/examples.rst +++ b/docs/user_guide/examples.rst @@ -237,10 +237,10 @@ Docker with new :code:`conda` environment, python packages installed with :code: docker build --tag conda-env --file conda-env.Dockerfile . -Nipype tutorial ---------------- +.. Nipype tutorial +.. --------------- -.. _nipype_tutorial_docker: +.. .. _nipype_tutorial_docker: Docker ~~~~~~ From 9863175ced68c7bf9d2a487aa514c1110dd06244 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 17 Sep 2023 21:01:49 -0400 Subject: [PATCH 209/211] expected failure of nipype tuto --- .github/workflows/test_doc.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_doc.yml b/.github/workflows/test_doc.yml index 6dcf426e..028c8f25 100644 --- a/.github/workflows/test_doc.yml +++ b/.github/workflows/test_doc.yml @@ -34,5 +34,7 @@ jobs: - name: test common uses run: bash < docs/common_uses/conda_multiple_env.txt - - name: test examples + - name: "test nipype_tuto: failure expected" run: bash < docs/examples/nipype_tuto.txt + # do not fail the workflow if the example fails + continue-on-error: true From bd9efcf6e8af4935d9171dc71b9b9970674202b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 18:54:17 +0000 Subject: [PATCH 210/211] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test_doc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_doc.yml b/.github/workflows/test_doc.yml index 028c8f25..3986d80c 100644 --- a/.github/workflows/test_doc.yml +++ b/.github/workflows/test_doc.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 From 4f492e93a4b3d96f9f7a2e7eab5294257cd3a88d Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Thu, 5 Oct 2023 11:19:08 +1000 Subject: [PATCH 211/211] Update fsl.yaml added fsl "6.0.7.1" --- neurodocker/templates/fsl.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/neurodocker/templates/fsl.yaml b/neurodocker/templates/fsl.yaml index 4d9c28dc..8e284842 100644 --- a/neurodocker/templates/fsl.yaml +++ b/neurodocker/templates/fsl.yaml @@ -19,6 +19,7 @@ binaries: install_path: /opt/fsl-{{ self.version }} exclude_paths: "" urls: + "6.0.7.4": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py "6.0.7.1": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py "6.0.6.4": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py "6.0.6.3": https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py