From db1f1c5ddaad71d18cf8ecf2079b1c7d5beaf3a9 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 12 Apr 2024 14:16:59 -0400 Subject: [PATCH 01/28] Use HTTPS --- neurodocker/templates/neurodebian.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/neurodocker/templates/neurodebian.yaml b/neurodocker/templates/neurodebian.yaml index 64b9f749..6e0dcd33 100644 --- a/neurodocker/templates/neurodebian.yaml +++ b/neurodocker/templates/neurodebian.yaml @@ -2,20 +2,20 @@ # Instructions to add NeuroDebian repositories. name: neurodebian -url: http://neuro.debian.net +url: https://neuro.debian.net binaries: urls: - australia: http://neuro.debian.net/lists/{{ self.os_codename }}.au.{{ self.full_or_libre }} - china-tsinghua: http://neuro.debian.net/lists/{{ self.os_codename }}.cn-bj1.{{ self.full_or_libre }} - china-scitech: http://neuro.debian.net/lists/{{ self.os_codename }}.cn-bj2.{{ self.full_or_libre }} - china-zhejiang: http://neuro.debian.net/lists/{{ self.os_codename }}.cn-zj.{{ self.full_or_libre }} - germany-munich: http://neuro.debian.net/lists/{{ self.os_codename }}.de-m.{{ self.full_or_libre }} - germany-magdeburg: http://neuro.debian.net/lists/{{ self.os_codename }}.de-md.{{ self.full_or_libre }} - greece: http://neuro.debian.net/lists/{{ self.os_codename }}.gr.{{ self.full_or_libre }} - japan: http://neuro.debian.net/lists/{{ self.os_codename }}.jp.{{ self.full_or_libre }} - usa-ca: http://neuro.debian.net/lists/{{ self.os_codename }}.us-ca.{{ self.full_or_libre }} - usa-nh: http://neuro.debian.net/lists/{{ self.os_codename }}.us-nh.{{ self.full_or_libre }} - usa-tn: http://neuro.debian.net/lists/{{ self.os_codename }}.us-tn.{{ self.full_or_libre }} + australia: https://neuro.debian.net/lists/{{ self.os_codename }}.au.{{ self.full_or_libre }} + china-tsinghua: https://neuro.debian.net/lists/{{ self.os_codename }}.cn-bj1.{{ self.full_or_libre }} + china-scitech: https://neuro.debian.net/lists/{{ self.os_codename }}.cn-bj2.{{ self.full_or_libre }} + china-zhejiang: https://neuro.debian.net/lists/{{ self.os_codename }}.cn-zj.{{ self.full_or_libre }} + germany-munich: https://neuro.debian.net/lists/{{ self.os_codename }}.de-m.{{ self.full_or_libre }} + germany-magdeburg: https://neuro.debian.net/lists/{{ self.os_codename }}.de-md.{{ self.full_or_libre }} + greece: https://neuro.debian.net/lists/{{ self.os_codename }}.gr.{{ self.full_or_libre }} + japan: https://neuro.debian.net/lists/{{ self.os_codename }}.jp.{{ self.full_or_libre }} + usa-ca: https://neuro.debian.net/lists/{{ self.os_codename }}.us-ca.{{ self.full_or_libre }} + usa-nh: https://neuro.debian.net/lists/{{ self.os_codename }}.us-nh.{{ self.full_or_libre }} + usa-tn: https://neuro.debian.net/lists/{{ self.os_codename }}.us-tn.{{ self.full_or_libre }} arguments: required: - version From 8791645d474fcb3237701dcc4957d01a28799d0e Mon Sep 17 00:00:00 2001 From: Remi-Gau <6961185+Remi-Gau@users.noreply.github.com> Date: Mon, 15 Apr 2024 03:39:33 +0000 Subject: [PATCH 02/28] pre-commit hooks auto-update --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8de77afd..86a63a3b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: args: [--profile, black] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.3.0 + rev: 24.4.0 hooks: - id: black From df2934fc16e41b7b7d17297b0437c88a948aeacf Mon Sep 17 00:00:00 2001 From: Remi-Gau <6961185+Remi-Gau@users.noreply.github.com> Date: Mon, 29 Apr 2024 00:20:27 +0000 Subject: [PATCH 03/28] pre-commit hooks auto-update --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 86a63a3b..59860a4d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: args: [--profile, black] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.0 + rev: 24.4.2 hooks: - id: black @@ -52,7 +52,7 @@ repos: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.9.0 + rev: v1.10.0 hooks: - id: mypy additional_dependencies: [types-all] From 8d2d36573933dc86d18483a31a53b2768848d722 Mon Sep 17 00:00:00 2001 From: Steffen Bollmann Date: Mon, 29 Apr 2024 05:08:46 +0000 Subject: [PATCH 04/28] make scripts executable after build --- neurodocker/templates/ants.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/neurodocker/templates/ants.yaml b/neurodocker/templates/ants.yaml index a73fc0a0..5eeee948 100644 --- a/neurodocker/templates/ants.yaml +++ b/neurodocker/templates/ants.yaml @@ -100,3 +100,4 @@ source: mv ../Scripts/* {{ self.install_path }} ; \ fi rm -rf /tmp/ants + chmod a+rx {{ self.install_path }} -R From 965d0f09bfc075597599d64b8111c3a6bc00a7f2 Mon Sep 17 00:00:00 2001 From: Remi-Gau <6961185+Remi-Gau@users.noreply.github.com> Date: Mon, 27 May 2024 00:21:40 +0000 Subject: [PATCH 05/28] pre-commit hooks auto-update --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 59860a4d..45212384 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: - id: mixed-line-ending - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell additional_dependencies: From 43f1cb8c7c6fe80c7430444f9abf4fc7d6b037ae Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 11 Jun 2024 18:34:01 -0400 Subject: [PATCH 06/28] Upgrade intuit to 11.1.6 (most recent) Closes #606 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 11904dbf..974c9154 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: - master env: - AUTO_VERSION: v10.37.6 + AUTO_VERSION: v11.1.6 jobs: auto-release: From 77cb740e0b524f8cdb8597907472aab13cec9866 Mon Sep 17 00:00:00 2001 From: Repronim Bot Date: Tue, 11 Jun 2024 22:35:57 +0000 Subject: [PATCH 07/28] Update CHANGELOG.md [skip ci] --- CHANGELOG.md | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31d3beb3..be07fda4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,92 @@ +# 1.0.0 (Tue Jun 11 2024) + +#### 💥 Breaking Change + +- Bump actions/checkout from 3 to 4 [#582](https://github.com/ReproNim/neurodocker/pull/582) ([@dependabot[bot]](https://github.com/dependabot[bot])) +- Bump actions/checkout from 3 to 4 [#573](https://github.com/ReproNim/neurodocker/pull/573) ([@dependabot[bot]](https://github.com/dependabot[bot])) +- Bump actions/stale from 5 to 8 [#560](https://github.com/ReproNim/neurodocker/pull/560) ([@dependabot[bot]](https://github.com/dependabot[bot])) +- Bump actions/checkout from 2 to 3 [#557](https://github.com/ReproNim/neurodocker/pull/557) ([@dependabot[bot]](https://github.com/dependabot[bot])) +- Bump actions/setup-python from 2 to 4 [#556](https://github.com/ReproNim/neurodocker/pull/556) ([@dependabot[bot]](https://github.com/dependabot[bot])) + +#### 🐛 Bug Fix + +- [BOT] update pre-commit hooks [#616](https://github.com/ReproNim/neurodocker/pull/616) ([@Remi-Gau](https://github.com/Remi-Gau) [@github-actions[bot]](https://github.com/github-actions[bot])) +- [BOT] update pre-commit hooks [#614](https://github.com/ReproNim/neurodocker/pull/614) ([@Remi-Gau](https://github.com/Remi-Gau) [@github-actions[bot]](https://github.com/github-actions[bot])) +- make scripts executable after build [#615](https://github.com/ReproNim/neurodocker/pull/615) ([@stebo85](https://github.com/stebo85)) +- [BOT] update pre-commit hooks [#613](https://github.com/ReproNim/neurodocker/pull/613) ([@Remi-Gau](https://github.com/Remi-Gau) [@github-actions[bot]](https://github.com/github-actions[bot])) +- Use HTTPS for NeuroDebian APT listing urls [#612](https://github.com/ReproNim/neurodocker/pull/612) ([@TheChymera](https://github.com/TheChymera)) +- [BOT] update pre-commit hooks [#610](https://github.com/ReproNim/neurodocker/pull/610) ([@Remi-Gau](https://github.com/Remi-Gau) [@github-actions[bot]](https://github.com/github-actions[bot])) +- [FIX] Update branch in update_precommit_hooks.yml [#609](https://github.com/ReproNim/neurodocker/pull/609) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [ENH] package with hatchling and switch to pyproject.toml [#607](https://github.com/ReproNim/neurodocker/pull/607) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [MAINT] update linting config and CI [#604](https://github.com/ReproNim/neurodocker/pull/604) ([@Remi-Gau](https://github.com/Remi-Gau)) +- fixed flake8 errors from #597 [#598](https://github.com/ReproNim/neurodocker/pull/598) ([@Vbitz](https://github.com/Vbitz)) +- Added "--add" command line option to add tar files as docker layers. [#597](https://github.com/ReproNim/neurodocker/pull/597) ([@Vbitz](https://github.com/Vbitz)) +- added versions to Library PATH [#593](https://github.com/ReproNim/neurodocker/pull/593) ([@stebo85](https://github.com/stebo85)) +- update matlabmcr [#592](https://github.com/ReproNim/neurodocker/pull/592) ([@stebo85](https://github.com/stebo85)) +- [FIX] add url bids validator [#591](https://github.com/ReproNim/neurodocker/pull/591) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [DOC] add list of supported softwares [#587](https://github.com/ReproNim/neurodocker/pull/587) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [ENH] add templates bids_validator [#586](https://github.com/ReproNim/neurodocker/pull/586) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [MAINT] test build jq [#589](https://github.com/ReproNim/neurodocker/pull/589) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [ENH] test on python 3.12 [#588](https://github.com/ReproNim/neurodocker/pull/588) ([@Remi-Gau](https://github.com/Remi-Gau)) +- Update fsl.yaml [#583](https://github.com/ReproNim/neurodocker/pull/583) ([@stebo85](https://github.com/stebo85)) +- [DOC] update doc [#569](https://github.com/ReproNim/neurodocker/pull/569) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [ENH] implement more recent mrtrix version [#579](https://github.com/ReproNim/neurodocker/pull/579) ([@Remi-Gau](https://github.com/Remi-Gau)) +- Update examples.rst [#578](https://github.com/ReproNim/neurodocker/pull/578) ([@stebo85](https://github.com/stebo85)) +- added FSL interactivity note [#576](https://github.com/ReproNim/neurodocker/pull/576) ([@stebo85](https://github.com/stebo85)) +- Include FSL license auto-yes example [#575](https://github.com/ReproNim/neurodocker/pull/575) ([@stebo85](https://github.com/stebo85)) +- [MAINT] Update stale.yml [#577](https://github.com/ReproNim/neurodocker/pull/577) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [FIX] install the proper dependencies for doc build [#574](https://github.com/ReproNim/neurodocker/pull/574) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [DOC] auto doc main CLI [#463](https://github.com/ReproNim/neurodocker/pull/463) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [FIX] use local var for software name in bootstrap workflow [#572](https://github.com/ReproNim/neurodocker/pull/572) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [FIX] use env variable in bootstrap workflow [#571](https://github.com/ReproNim/neurodocker/pull/571) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [INFRA] add possibility to only build a single workflow [#570](https://github.com/ReproNim/neurodocker/pull/570) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [MAINT] test build of conda as part of the bootstrap workflow [#566](https://github.com/ReproNim/neurodocker/pull/566) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [MAINT] minimize file changes that can trigger the bootstrap workflow [#564](https://github.com/ReproNim/neurodocker/pull/564) ([@Remi-Gau](https://github.com/Remi-Gau)) +- set python version for format job [#563](https://github.com/ReproNim/neurodocker/pull/563) ([@stebo85](https://github.com/stebo85)) +- Add mamba option to miniconda [#562](https://github.com/ReproNim/neurodocker/pull/562) ([@Shotgunosine](https://github.com/Shotgunosine)) +- [MAINT] remove oldest distro in automated build testing [#559](https://github.com/ReproNim/neurodocker/pull/559) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [MAINT] split format checking and testing in CI [#554](https://github.com/ReproNim/neurodocker/pull/554) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [MAINT] Simplify type annotations [#551](https://github.com/ReproNim/neurodocker/pull/551) ([@Remi-Gau](https://github.com/Remi-Gau)) +- apply isort and all pre-commit hooks [#549](https://github.com/ReproNim/neurodocker/pull/549) ([@Remi-Gau](https://github.com/Remi-Gau)) +- Mcr bug [#471](https://github.com/ReproNim/neurodocker/pull/471) ([@stebo85](https://github.com/stebo85)) +- Add codespell: config, pre-commit, workflow + 1 typo fixed [#544](https://github.com/ReproNim/neurodocker/pull/544) ([@yarikoptic](https://github.com/yarikoptic) [@stebo85](https://github.com/stebo85)) +- added freesurfer 7.3.2 [#547](https://github.com/ReproNim/neurodocker/pull/547) ([@stebo85](https://github.com/stebo85)) +- add fsl 6.0.7.1 [#543](https://github.com/ReproNim/neurodocker/pull/543) ([@stebo85](https://github.com/stebo85)) +- added freesurfer 7.4.1 [#542](https://github.com/ReproNim/neurodocker/pull/542) ([@hjbockholt](https://github.com/hjbockholt)) +- Fixing my update for mcr2023a [#540](https://github.com/ReproNim/neurodocker/pull/540) ([@dnkennedy](https://github.com/dnkennedy)) +- Update matlabmcr.yaml [#539](https://github.com/ReproNim/neurodocker/pull/539) ([@dnkennedy](https://github.com/dnkennedy)) +- Update years to have full range of years of the project [#534](https://github.com/ReproNim/neurodocker/pull/534) ([@yarikoptic](https://github.com/yarikoptic)) +- Update cat [#533](https://github.com/ReproNim/neurodocker/pull/533) ([@stebo85](https://github.com/stebo85)) + +#### ⚠️ Pushed to `master` + +- Change name of parent directory ([@kaczmarj](https://github.com/kaczmarj)) + +#### 🏠 Internal + +- Upgrade intuit auto to 11.1.6 (most recent) [#617](https://github.com/ReproNim/neurodocker/pull/617) ([@yarikoptic](https://github.com/yarikoptic)) + +#### 🔩 Dependency Updates + +- Bump actions/setup-python from 4 to 5 [#594](https://github.com/ReproNim/neurodocker/pull/594) ([@dependabot[bot]](https://github.com/dependabot[bot])) +- Bump actions/stale from 8 to 9 [#595](https://github.com/ReproNim/neurodocker/pull/595) ([@dependabot[bot]](https://github.com/dependabot[bot])) + +#### Authors: 11 + +- [@dependabot[bot]](https://github.com/dependabot[bot]) +- [@github-actions[bot]](https://github.com/github-actions[bot]) +- David Kennedy ([@dnkennedy](https://github.com/dnkennedy)) +- Dylan Nielson ([@Shotgunosine](https://github.com/Shotgunosine)) +- H. Jeremy Bockholt ([@hjbockholt](https://github.com/hjbockholt)) +- Horea Christian ([@TheChymera](https://github.com/TheChymera)) +- Jakub Kaczmarzyk ([@kaczmarj](https://github.com/kaczmarj)) +- Joshua Scarsbrook ([@Vbitz](https://github.com/Vbitz)) +- Remi Gau ([@Remi-Gau](https://github.com/Remi-Gau)) +- Steffen Bollmann ([@stebo85](https://github.com/stebo85)) +- Yaroslav Halchenko ([@yarikoptic](https://github.com/yarikoptic)) + +--- + # 0.9.5 (Fri May 12 2023) #### 🐛 Bug Fix From 8956d117711a614d37420e6d670d1eb8cd7db365 Mon Sep 17 00:00:00 2001 From: Remi-Gau <6961185+Remi-Gau@users.noreply.github.com> Date: Mon, 17 Jun 2024 00:22:25 +0000 Subject: [PATCH 08/28] pre-commit hooks auto-update --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 45212384..ab2b94c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,7 +47,7 @@ repos: args: [--autofix, --indent, '4'] - repo: https://github.com/pycqa/flake8 - rev: 7.0.0 + rev: 7.1.0 hooks: - id: flake8 From 05726dd49681cbd8f476cd0d3c2abb255b089b96 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sat, 22 Jun 2024 11:10:40 +0900 Subject: [PATCH 09/28] Fix typo of "softwares" --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be07fda4..6bf65625 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ - added versions to Library PATH [#593](https://github.com/ReproNim/neurodocker/pull/593) ([@stebo85](https://github.com/stebo85)) - update matlabmcr [#592](https://github.com/ReproNim/neurodocker/pull/592) ([@stebo85](https://github.com/stebo85)) - [FIX] add url bids validator [#591](https://github.com/ReproNim/neurodocker/pull/591) ([@Remi-Gau](https://github.com/Remi-Gau)) -- [DOC] add list of supported softwares [#587](https://github.com/ReproNim/neurodocker/pull/587) ([@Remi-Gau](https://github.com/Remi-Gau)) +- [DOC] add list of supported software [#587](https://github.com/ReproNim/neurodocker/pull/587) ([@Remi-Gau](https://github.com/Remi-Gau)) - [ENH] add templates bids_validator [#586](https://github.com/ReproNim/neurodocker/pull/586) ([@Remi-Gau](https://github.com/Remi-Gau)) - [MAINT] test build jq [#589](https://github.com/ReproNim/neurodocker/pull/589) ([@Remi-Gau](https://github.com/Remi-Gau)) - [ENH] test on python 3.12 [#588](https://github.com/ReproNim/neurodocker/pull/588) ([@Remi-Gau](https://github.com/Remi-Gau)) From 2b83d018daf4d58f44f7d44550e0724e7ee43cf3 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Fri, 21 Jun 2024 17:42:26 -0700 Subject: [PATCH 10/28] FIX add default header and entrypoint to docker and singularity files --- neurodocker/cli/generate.py | 10 ++++++++++ .../templates/{_header.yaml => _default.yaml} | 16 ++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) rename neurodocker/templates/{_header.yaml => _default.yaml} (69%) diff --git a/neurodocker/cli/generate.py b/neurodocker/cli/generate.py index 26267923..94271e54 100644 --- a/neurodocker/cli/generate.py +++ b/neurodocker/cli/generate.py @@ -327,6 +327,16 @@ def _params_to_renderer_dict(ctx: click.Context, pkg_manager) -> dict: renderer_dict["instructions"].append(d) if not renderer_dict["instructions"]: ctx.fail("not enough instructions to generate a container specification") + # Add header to the instructions, after the base image. + renderer_dict["instructions"].insert( + 1, {"name": "_default", "kwds": {}} + ) + # Use default entrypoint if user did not specify one. + if "entrypoint" not in [param.name for param, _ in cmd._options]: + renderer_dict["instructions"].append( + {"name": "entrypoint", "kwds": {"args": ["/neurodocker/startup.sh"]}} + ) + return renderer_dict diff --git a/neurodocker/templates/_header.yaml b/neurodocker/templates/_default.yaml similarity index 69% rename from neurodocker/templates/_header.yaml rename to neurodocker/templates/_default.yaml index 6a09a4bb..98a401ff 100644 --- a/neurodocker/templates/_header.yaml +++ b/neurodocker/templates/_default.yaml @@ -4,7 +4,7 @@ # TODO: read this about locales http://jaredmarkell.com/docker-and-locales/ -name: _header +name: _default url: n/a # Not actually source, but we do not want to provide URLs. source: @@ -28,14 +28,14 @@ source: LC_ALL: en_US.UTF-8 ND_ENTRYPOINT: /neurodocker/startup.sh instructions: | - export ND_ENTRYPOINT="{{ _header._env['ND_ENTRYPOINT'] }}" - {{ _header.install_dependencies() }} - {%- if _header.pkg_manager == "apt" %} - sed -i -e 's/# {{ _header._env['LC_ALL'] }} UTF-8/{{ _header._env['LC_ALL'] }} UTF-8/' /etc/locale.gen + export ND_ENTRYPOINT="{{ self.env['ND_ENTRYPOINT'] }}" + {{ self.install_dependencies() }} + {%- if self.pkg_manager == "apt" %} + sed -i -e 's/# {{ self.env['LC_ALL'] }} UTF-8/{{ self.env['LC_ALL'] }} UTF-8/' /etc/locale.gen dpkg-reconfigure --frontend=noninteractive locales - update-locale LANG="{{ _header._env['LANG'] }}" - {%- elif _header.pkg_manager == "yum" %} - localedef -i {{ _header._env['LC_ALL'].split('.')[0] }} -f {{ _header._env['LC_ALL'].split('.')[1] }} {{ _header._env['LC_ALL'] }} + update-locale LANG="{{ self.env['LANG'] }}" + {%- elif self.pkg_manager == "yum" %} + localedef -i {{ self.env['LC_ALL'].split('.')[0] }} -f {{ self.env['LC_ALL'].split('.')[1] }} {{ self.env['LC_ALL'] }} {%- endif %} chmod 777 /opt && chmod a+s /opt mkdir -p /neurodocker From cfe24df2fcde257833f45e3bfecf9411fb4f5c33 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Fri, 21 Jun 2024 18:19:30 -0700 Subject: [PATCH 11/28] FIX check if the _default template is available --- neurodocker/cli/generate.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/neurodocker/cli/generate.py b/neurodocker/cli/generate.py index 94271e54..1a7c2024 100644 --- a/neurodocker/cli/generate.py +++ b/neurodocker/cli/generate.py @@ -327,15 +327,17 @@ def _params_to_renderer_dict(ctx: click.Context, pkg_manager) -> dict: renderer_dict["instructions"].append(d) if not renderer_dict["instructions"]: ctx.fail("not enough instructions to generate a container specification") - # Add header to the instructions, after the base image. - renderer_dict["instructions"].insert( - 1, {"name": "_default", "kwds": {}} - ) - # Use default entrypoint if user did not specify one. - if "entrypoint" not in [param.name for param, _ in cmd._options]: - renderer_dict["instructions"].append( - {"name": "entrypoint", "kwds": {"args": ["/neurodocker/startup.sh"]}} + + if "_default" in registered_templates(): + # Add header to the instructions, after the base image. + renderer_dict["instructions"].insert( + 1, {"name": "_default", "kwds": {}} ) + # Use default entrypoint if user did not specify one. + if "entrypoint" not in [param.name for param, _ in cmd._options]: + renderer_dict["instructions"].append( + {"name": "entrypoint", "kwds": {"args": ["/neurodocker/startup.sh"]}} + ) return renderer_dict From 45e89bd9e9bf13a686008761ba22e87541ac7ec3 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Fri, 21 Jun 2024 18:24:24 -0700 Subject: [PATCH 12/28] Move logic of default template to _base_generate --- neurodocker/cli/generate.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/neurodocker/cli/generate.py b/neurodocker/cli/generate.py index 1a7c2024..449ad2cd 100644 --- a/neurodocker/cli/generate.py +++ b/neurodocker/cli/generate.py @@ -327,18 +327,6 @@ def _params_to_renderer_dict(ctx: click.Context, pkg_manager) -> dict: renderer_dict["instructions"].append(d) if not renderer_dict["instructions"]: ctx.fail("not enough instructions to generate a container specification") - - if "_default" in registered_templates(): - # Add header to the instructions, after the base image. - renderer_dict["instructions"].insert( - 1, {"name": "_default", "kwds": {}} - ) - # Use default entrypoint if user did not specify one. - if "entrypoint" not in [param.name for param, _ in cmd._options]: - renderer_dict["instructions"].append( - {"name": "entrypoint", "kwds": {"args": ["/neurodocker/startup.sh"]}} - ) - return renderer_dict @@ -450,6 +438,20 @@ def _base_generate( `generate singularity`. The difference between those two is the renderer used. """ renderer_dict = _params_to_renderer_dict(ctx=ctx, pkg_manager=pkg_manager) + + # Make sure to add default instructions if they are available among the templates + if "_default" in registered_templates(): + # Add header to the instructions, after the base image. + renderer_dict["instructions"].insert( + 1, {"name": "_default", "kwds": {}} + ) + # Use default entrypoint if user did not specify one. + instruction_names = [instr["name"] for instr in renderer_dict["instructions"]] + if "entrypoint" not in instruction_names: + renderer_dict["instructions"].append( + {"name": "entrypoint", "kwds": {"args": ["/neurodocker/startup.sh"]}} + ) + r = renderer.from_dict(renderer_dict) # Print the instructions in JSON if that's what the user wants. From 7695af489722fc4e0b25da0f5f8793a07ac387b6 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Fri, 21 Jun 2024 18:33:03 -0700 Subject: [PATCH 13/28] Make pre-commit happy --- .codespellrc | 2 ++ neurodocker/cli/generate.py | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..51788ab1 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,2 @@ +[codespell] +ignore-words-list = softwares,didi diff --git a/neurodocker/cli/generate.py b/neurodocker/cli/generate.py index 449ad2cd..5ec0bb90 100644 --- a/neurodocker/cli/generate.py +++ b/neurodocker/cli/generate.py @@ -442,9 +442,7 @@ def _base_generate( # Make sure to add default instructions if they are available among the templates if "_default" in registered_templates(): # Add header to the instructions, after the base image. - renderer_dict["instructions"].insert( - 1, {"name": "_default", "kwds": {}} - ) + renderer_dict["instructions"].insert(1, {"name": "_default", "kwds": {}}) # Use default entrypoint if user did not specify one. instruction_names = [instr["name"] for instr in renderer_dict["instructions"]] if "entrypoint" not in instruction_names: From 8c60e283fe43d802a49838caabfb37bdc1974f39 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Fri, 21 Jun 2024 19:43:23 -0700 Subject: [PATCH 14/28] Remove .codespellrc --- .codespellrc | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc deleted file mode 100644 index 51788ab1..00000000 --- a/.codespellrc +++ /dev/null @@ -1,2 +0,0 @@ -[codespell] -ignore-words-list = softwares,didi From ed33d65ef1d07af80d63ce728e1f42c5fd5026d4 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Fri, 21 Jun 2024 16:07:12 -0700 Subject: [PATCH 15/28] FIX remove comment from freesurfer env line --- 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 9c2ee47b..65ef1f99 100644 --- a/neurodocker/templates/freesurfer.yaml +++ b/neurodocker/templates/freesurfer.yaml @@ -71,7 +71,7 @@ binaries: # default freesurfer options FS_OVERRIDE: '0' FIX_VERTEX_AREA: '' - FSF_OUTPUT_FORMAT: nii.gz# mni env requirements + FSF_OUTPUT_FORMAT: nii.gz # mni environment requirements MINC_BIN_DIR: '{{ self.install_path }}/mni/bin' MINC_LIB_DIR: '{{ self.install_path }}/mni/lib' From 89418cc186e6f50bd9c7c16d55c56c22d32159b3 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Sat, 22 Jun 2024 12:06:52 -0700 Subject: [PATCH 16/28] FIX strip-components 2 for freesurfer 7.4.1 --- 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 9c2ee47b..97464da2 100644 --- a/neurodocker/templates/freesurfer.yaml +++ b/neurodocker/templates/freesurfer.yaml @@ -84,7 +84,7 @@ binaries: echo "Downloading FreeSurfer ..." mkdir -p {{ self.install_path }} curl -fL {{ self.urls[self.version] }} \ - | tar -xz -C {{ self.install_path }} --owner root --group root --no-same-owner --strip-components 1 {% if self.exclude_paths -%}\ + | tar -xz -C {{ self.install_path }} --owner root --group root --no-same-owner --strip-components {% if self.version in ("7.4.1") %}2{% else %}1{% endif %} {% if self.exclude_paths -%}\ {%- for exclude_path in self.exclude_paths.split() %} {% if not loop.last -%} --exclude='{{ exclude_path }}' \ From 15c53006d02758c9f78b7bc1f8d23ffc74baa76e Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Sat, 22 Jun 2024 14:29:12 -0700 Subject: [PATCH 17/28] FIX do not show _default template in CLI help --- neurodocker/cli/generate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/neurodocker/cli/generate.py b/neurodocker/cli/generate.py index 5ec0bb90..d670d319 100644 --- a/neurodocker/cli/generate.py +++ b/neurodocker/cli/generate.py @@ -307,6 +307,8 @@ def _get_params_for_registered_templates() -> 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: + if name.startswith("_"): # Templates starting with _ are private + continue hlp = _create_help_for_template(Template(tmpl)) param = OptionEatAll( [f"--{name.lower()}"], type=KeyValuePair(), multiple=True, help=hlp From 96aa41596efbcbfe9fa57fd301dde49b61f4a2da Mon Sep 17 00:00:00 2001 From: Remi-Gau <6961185+Remi-Gau@users.noreply.github.com> Date: Mon, 1 Jul 2024 02:59:20 +0000 Subject: [PATCH 18/28] pre-commit hooks auto-update --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab2b94c4..3b6a23cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,7 +52,7 @@ repos: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.0 + rev: v1.10.1 hooks: - id: mypy additional_dependencies: [types-all] From 3a75c2a9c58be5640a66f1135e2e651bff8fb01c Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Thu, 4 Jul 2024 17:45:27 -0700 Subject: [PATCH 19/28] TST check we have the default header and entrypoint --- neurodocker/cli/tests/test_cli.py | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/neurodocker/cli/tests/test_cli.py b/neurodocker/cli/tests/test_cli.py index ba54339e..d22bd10d 100644 --- a/neurodocker/cli/tests/test_cli.py +++ b/neurodocker/cli/tests/test_cli.py @@ -177,3 +177,43 @@ def test_render_registered(cmd: str, pkg_manager: str): assert result.exit_code == 0, result.output assert "jq-1.5/jq-linux64" in result.output assert "jq-1.6/jq-linux64" in result.output + + +# Test that we add the default header and default/custom entrypoints +@pytest.mark.parametrize("cmd", _cmds) +@pytest.mark.parametrize("pkg_manager", ["apt", "yum"]) +@pytest.mark.parametrize("entrypoint", ["default", "custom"]) +def test_default_header_and_entrypoint(cmd: str, pkg_manager: str, entrypoint: str): + runner = CliRunner() + cmd_ = [ + cmd, + "--base-image", + "debian:buster", + "--pkg-manager", + pkg_manager, + ] + if entrypoint == "custom": + cmd_.extend(["--entrypoint", "I", "decide"]) + result = runner.invoke(generate, cmd_) + assert result.exit_code == 0, result.output + + if cmd == "docker": + assert ( + 'ND_ENTRYPOINT="/neurodocker/startup.sh"\n' + 'RUN export ND_ENTRYPOINT="/neurodocker/startup.sh"' + ) in result.output + + if entrypoint == "default": + assert '\nENTRYPOINT ["/neurodocker/startup.sh"]\n' in result.output + else: + assert '\nENTRYPOINT ["I", "decide"]\n' in result.output + else: + assert ( + '\nexport ND_ENTRYPOINT="/neurodocker/startup.sh"\n\n' + '%post\nexport ND_ENTRYPOINT="/neurodocker/startup.sh"\n' + ) in result.output + + if entrypoint == "default": + assert '%runscript\n/neurodocker/startup.sh\n' in result.output + else: + assert '%runscript\nI decide\n' in result.output \ No newline at end of file From 4e312683d1c1fa796c6056308e85fc096b9a5979 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Thu, 4 Jul 2024 17:50:54 -0700 Subject: [PATCH 20/28] FIX changes by black --- neurodocker/cli/tests/test_cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neurodocker/cli/tests/test_cli.py b/neurodocker/cli/tests/test_cli.py index d22bd10d..88dcf475 100644 --- a/neurodocker/cli/tests/test_cli.py +++ b/neurodocker/cli/tests/test_cli.py @@ -214,6 +214,6 @@ def test_default_header_and_entrypoint(cmd: str, pkg_manager: str, entrypoint: s ) in result.output if entrypoint == "default": - assert '%runscript\n/neurodocker/startup.sh\n' in result.output + assert "%runscript\n/neurodocker/startup.sh\n" in result.output else: - assert '%runscript\nI decide\n' in result.output \ No newline at end of file + assert "%runscript\nI decide\n" in result.output From 2dc1f11cc8d6131e89fccbebc11f086d02f1782f Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Fri, 5 Jul 2024 15:51:37 -0700 Subject: [PATCH 21/28] Use --transform instead of --strip-components --- 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 97464da2..6f0167f0 100644 --- a/neurodocker/templates/freesurfer.yaml +++ b/neurodocker/templates/freesurfer.yaml @@ -84,7 +84,7 @@ binaries: echo "Downloading FreeSurfer ..." mkdir -p {{ self.install_path }} curl -fL {{ self.urls[self.version] }} \ - | tar -xz -C {{ self.install_path }} --owner root --group root --no-same-owner --strip-components {% if self.version in ("7.4.1") %}2{% else %}1{% endif %} {% if self.exclude_paths -%}\ + | tar -xz -C {{ self.install_path }} --owner root --group root --no-same-owner --transform='s,freesurfer/,,' {% if self.exclude_paths -%}\ {%- for exclude_path in self.exclude_paths.split() %} {% if not loop.last -%} --exclude='{{ exclude_path }}' \ From 4bf8ee0c92450953ff90547cb51c671ee221d40a Mon Sep 17 00:00:00 2001 From: Repronim Bot Date: Sat, 6 Jul 2024 19:24:25 +0000 Subject: [PATCH 22/28] Update CHANGELOG.md [skip ci] --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bf65625..8d92c4fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +# 1.0.1 (Sat Jul 06 2024) + +#### 🐛 Bug Fix + +- FIX use --transform in freesurfer's template to generalize across freesurfer versions to strip leading `freesurfer/` folder [#626](https://github.com/ReproNim/neurodocker/pull/626) ([@mvdoc](https://github.com/mvdoc)) +- FIX remove comment from freesurfer env line [#622](https://github.com/ReproNim/neurodocker/pull/622) ([@mvdoc](https://github.com/mvdoc)) +- FIX add default header and entrypoint to docker and singularity files [#623](https://github.com/ReproNim/neurodocker/pull/623) ([@mvdoc](https://github.com/mvdoc)) +- [BOT] update pre-commit hooks [#627](https://github.com/ReproNim/neurodocker/pull/627) ([@Remi-Gau](https://github.com/Remi-Gau) [@github-actions[bot]](https://github.com/github-actions[bot])) +- Fix typo of "softwares" [#624](https://github.com/ReproNim/neurodocker/pull/624) ([@yarikoptic](https://github.com/yarikoptic)) +- [BOT] update pre-commit hooks [#621](https://github.com/ReproNim/neurodocker/pull/621) ([@Remi-Gau](https://github.com/Remi-Gau) [@github-actions[bot]](https://github.com/github-actions[bot])) + +#### Authors: 4 + +- [@github-actions[bot]](https://github.com/github-actions[bot]) +- Matteo Visconti di Oleggio Castello ([@mvdoc](https://github.com/mvdoc)) +- Remi Gau ([@Remi-Gau](https://github.com/Remi-Gau)) +- Yaroslav Halchenko ([@yarikoptic](https://github.com/yarikoptic)) + +--- + # 1.0.0 (Tue Jun 11 2024) #### 💥 Breaking Change From fc575976708e7d50aba1cddbfe01547eaf7be483 Mon Sep 17 00:00:00 2001 From: Remi-Gau <6961185+Remi-Gau@users.noreply.github.com> Date: Mon, 15 Jul 2024 01:32:25 +0000 Subject: [PATCH 23/28] pre-commit hooks auto-update --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3b6a23cd..6eb1d081 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: args: [--mapping, '4', --sequence, '4', --offset, '0'] - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.13.0 + rev: v2.14.0 hooks: - id: pretty-format-toml args: [--autofix, --indent, '4'] From fec985cf4184799a86dd4cbe2d62434aefab0b07 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 15 Jul 2024 08:11:46 +0200 Subject: [PATCH 24/28] Fix typo in CHANGELOG.md to pacify codespell --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d92c4fc..d5315ed6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ - FIX remove comment from freesurfer env line [#622](https://github.com/ReproNim/neurodocker/pull/622) ([@mvdoc](https://github.com/mvdoc)) - FIX add default header and entrypoint to docker and singularity files [#623](https://github.com/ReproNim/neurodocker/pull/623) ([@mvdoc](https://github.com/mvdoc)) - [BOT] update pre-commit hooks [#627](https://github.com/ReproNim/neurodocker/pull/627) ([@Remi-Gau](https://github.com/Remi-Gau) [@github-actions[bot]](https://github.com/github-actions[bot])) -- Fix typo of "softwares" [#624](https://github.com/ReproNim/neurodocker/pull/624) ([@yarikoptic](https://github.com/yarikoptic)) +- Fix typo of "software" [#624](https://github.com/ReproNim/neurodocker/pull/624) ([@yarikoptic](https://github.com/yarikoptic)) - [BOT] update pre-commit hooks [#621](https://github.com/ReproNim/neurodocker/pull/621) ([@Remi-Gau](https://github.com/Remi-Gau) [@github-actions[bot]](https://github.com/github-actions[bot])) #### Authors: 4 From d3e479d695bff7e076e720d03797040bdbcb67de Mon Sep 17 00:00:00 2001 From: Remi-Gau <6961185+Remi-Gau@users.noreply.github.com> Date: Mon, 22 Jul 2024 00:23:06 +0000 Subject: [PATCH 25/28] pre-commit hooks auto-update --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6eb1d081..bbe8d968 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,7 +52,7 @@ repos: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.1 + rev: v1.11.0 hooks: - id: mypy additional_dependencies: [types-all] From 94c4b6a4723135603297c997344a749797b5d513 Mon Sep 17 00:00:00 2001 From: Remi-Gau <6961185+Remi-Gau@users.noreply.github.com> Date: Mon, 5 Aug 2024 00:23:19 +0000 Subject: [PATCH 26/28] pre-commit hooks auto-update --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bbe8d968..c8ddf9d7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,12 +47,12 @@ repos: args: [--autofix, --indent, '4'] - repo: https://github.com/pycqa/flake8 - rev: 7.1.0 + rev: 7.1.1 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.0 + rev: v1.11.1 hooks: - id: mypy additional_dependencies: [types-all] From ee7b5b16fad755a67f115afc0c026e1966b2838b Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 6 Aug 2024 09:36:26 +0200 Subject: [PATCH 27/28] drop types all --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c8ddf9d7..76f84bd3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,6 +55,6 @@ repos: rev: v1.11.1 hooks: - id: mypy - additional_dependencies: [types-all] + additional_dependencies: [types-PyYAML, types-Jinja2, types-click] files: neurodocker args: [--config-file, pyproject.toml, --install-types] From 2dea5ead413d95fd1771d64aa541167041424db9 Mon Sep 17 00:00:00 2001 From: Remi-Gau <6961185+Remi-Gau@users.noreply.github.com> Date: Mon, 12 Aug 2024 00:23:21 +0000 Subject: [PATCH 28/28] pre-commit hooks auto-update --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 76f84bd3..7cf179ab 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: args: [--profile, black] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black