From d024283c8c1295cacead7f4b8c7b36c7ca090fb9 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Jan 2023 18:03:28 +0100 Subject: [PATCH 01/22] use neurodocker to create Dockerfile --- Dockerfile | 146 +++++++++++++++++++++++++++++++++++++++++++++-------- Makefile | 8 +++ 2 files changed, 132 insertions(+), 22 deletions(-) create mode 100644 Makefile diff --git a/Dockerfile b/Dockerfile index 1858c20..97c70e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,124 @@ -FROM bids/base_validator - -RUN apt-get update && \ - apt-get install -y curl && \ - curl -sSL http://neuro.debian.net/lists/trusty.us-ca.full >> /etc/apt/sources.list.d/neurodebian.sources.list && \ - apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9 && \ - apt-get update && \ - apt-get remove -y curl && \ - apt-get install -y fsl-core=5.0.9-3~nd14.04+1 && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - - -# Configure environment -ENV FSLDIR=/usr/share/fsl/5.0 -ENV FSLOUTPUTTYPE=NIFTI_GZ -ENV PATH=/usr/lib/fsl/5.0:$PATH -ENV FSLMULTIFILEQUIT=TRUE -ENV POSSUMDIR=/usr/share/fsl/5.0 -ENV LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH -ENV FSLTCLSH=/usr/bin/tclsh -ENV FSLWISH=/usr/bin/wish -ENV FSLOUTPUTTYPE=NIFTI_GZ +# Generated by: Neurodocker version 0.7.0+0.gdc97516.dirty +# Latest release: Neurodocker version 0.9.1 +# Timestamp: 2023/01/01 17:02:22 UTC +# +# Thank you for using Neurodocker. If you discover any issues +# or ways to improve this software, please submit an issue or +# pull request on our GitHub repository: +# +# https://github.com/ReproNim/neurodocker + +FROM debian:buster-slim + +USER root + +ARG DEBIAN_FRONTEND="noninteractive" + +ENV LANG="en_US.UTF-8" \ + LC_ALL="en_US.UTF-8" \ + ND_ENTRYPOINT="/neurodocker/startup.sh" +RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \ + && apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + apt-utils \ + bzip2 \ + ca-certificates \ + curl \ + locales \ + unzip \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ + && dpkg-reconfigure --frontend=noninteractive locales \ + && update-locale LANG="en_US.UTF-8" \ + && chmod 777 /opt && chmod a+s /opt \ + && mkdir -p /neurodocker \ + && if [ ! -f "$ND_ENTRYPOINT" ]; then \ + echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \ + && echo 'set -e' >> "$ND_ENTRYPOINT" \ + && echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" \ + && echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \ + fi \ + && chmod -R 777 /neurodocker && chmod a+s /neurodocker + +ENTRYPOINT ["/neurodocker/startup.sh"] + +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + nodejs \ + npm \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +ENV FSLDIR="/opt/fsl-6.0.3" \ + PATH="/opt/fsl-6.0.3/bin:$PATH" \ + FSLOUTPUTTYPE="NIFTI_GZ" \ + FSLMULTIFILEQUIT="TRUE" \ + FSLTCLSH="/opt/fsl-6.0.3/bin/fsltclsh" \ + FSLWISH="/opt/fsl-6.0.3/bin/fslwish" \ + FSLLOCKDIR="" \ + FSLMACHINELIST="" \ + FSLREMOTECALL="" \ + FSLGECUDAQ="cuda.q" +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + bc \ + dc \ + file \ + libfontconfig1 \ + libfreetype6 \ + libgl1-mesa-dev \ + libgl1-mesa-dri \ + libglu1-mesa-dev \ + libgomp1 \ + libice6 \ + libxcursor1 \ + libxft2 \ + libxinerama1 \ + libxrandr2 \ + libxrender1 \ + libxt6 \ + sudo \ + wget \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && echo "Downloading FSL ..." \ + && mkdir -p /opt/fsl-6.0.3 \ + && curl -fsSL --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \ + | tar -xz -C /opt/fsl-6.0.3 --strip-components 1 \ + && sed -i '$iecho Some packages in this Docker container are non-free' $ND_ENTRYPOINT \ + && sed -i '$iecho If you are considering commercial use of this container, please consult the relevant license:' $ND_ENTRYPOINT \ + && sed -i '$iecho https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence' $ND_ENTRYPOINT \ + && sed -i '$isource $FSLDIR/etc/fslconf/fsl.sh' $ND_ENTRYPOINT \ + && echo "Installing FSL conda environment ..." \ + && bash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3 + +RUN bash -c 'node -v && npm -v && npm install -g bids-validator' + +RUN echo '{ \ + \n "pkg_manager": "apt", \ + \n "instructions": [ \ + \n [ \ + \n "base", \ + \n "debian:buster-slim" \ + \n ], \ + \n [ \ + \n "install", \ + \n [ \ + \n "nodejs", \ + \n "npm" \ + \n ] \ + \n ], \ + \n [ \ + \n "fsl", \ + \n { \ + \n "method": "binaries", \ + \n "version": "6.0.3" \ + \n } \ + \n ], \ + \n [ \ + \n "run_bash", \ + \n "node -v && npm -v && npm install -g bids-validator" \ + \n ] \ + \n ] \ + \n}' > /neurodocker/neurodocker_specs.json diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13f388f --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +.PHONY: Dockerfile + +Dockerfile: + docker run --rm kaczmarj/neurodocker:0.7.0 generate docker \ + --base debian:buster-slim --pkg-manager apt \ + --install nodejs npm \ + --fsl method=binaries version=6.0.3 \ + --run-bash "node -v && npm -v && npm install -g bids-validator"> Dockerfile From cdf6476fd06406eaf7efd62fc8c4d8c67a7139c7 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Jan 2023 23:27:10 +0100 Subject: [PATCH 02/22] set up new circle ci config --- .circleci/config.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 2 +- circle.yml | 28 --------------------- 3 files changed, 59 insertions(+), 29 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..1c8df27 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,58 @@ +version: 2.1 +jobs: + build: + machine: + # https://circleci.com/developer/machine/image/ubuntu-2204 + image: ubuntu-2204:2022.10.2 + steps: + - checkout + - run: + name: build docker image + command: | + if [[ -e ~/docker/image.tar ]]; then + docker load -i ~/docker/image.tar; + fi + docker build -t bids/${CIRCLE_PROJECT_REPONAME}:latest . + mkdir -p ~/docker + docker save "bids/${CIRCLE_PROJECT_REPONAME}:latest" > ~/docker/image.tar + - persist_to_workspace: + root: /home/circleci + paths: + - docker/image.tar + + deploy: + #docker: + #- image: circleci/buildpack-deps:stretch + machine: + image: ubuntu-2204:2022.10.2 + steps: + - attach_workspace: + at: /tmp/workspace + #- setup_remote_docker + - run: docker load -i /tmp/workspace/docker/image.tar + - run: + command: | + if [[ -n "$DOCKER_PASS" ]]; then + echo "${DOCKER_PASS}" | docker login -u ${DOCKER_USER} --password-stdin && \ + docker push bids/${CIRCLE_PROJECT_REPONAME}:latest + if [[ -n "${CIRCLE_TAG}" ]]; then + docker tag bids/${CIRCLE_PROJECT_REPONAME} bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG + docker push bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG; + fi + fi + +workflows: + build_deploy: + jobs: + - build: + filters: + tags: + only: /.*/ + - deploy: + requires: + - build + filters: + tags: + only: /.*/ + +# VS Code Extension Version: 1.5.1 diff --git a/Dockerfile b/Dockerfile index 97c70e2..f0abcc1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Generated by: Neurodocker version 0.7.0+0.gdc97516.dirty # Latest release: Neurodocker version 0.9.1 -# Timestamp: 2023/01/01 17:02:22 UTC +# Timestamp: 2023/01/01 17:25:00 UTC # # Thank you for using Neurodocker. If you discover any issues # or ways to improve this software, please submit an issue or diff --git a/circle.yml b/circle.yml deleted file mode 100644 index c8fafc6..0000000 --- a/circle.yml +++ /dev/null @@ -1,28 +0,0 @@ -machine: - services: - - docker #don't use 1.10 - caching is broken - -dependencies: - cache_directories: - - "~/docker" - - override: - - if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi - - docker build -t bids/${CIRCLE_PROJECT_REPONAME} . : - timeout: 21600 - - mkdir -p ~/docker; docker save "bids/${CIRCLE_PROJECT_REPONAME}" > ~/docker/image.tar - -test: - override: - # print version - - echo "pass" - -deployment: - hub: - owner: BIDS-Apps - tag: /.*/ - commands: - - if [[ -n "$DOCKER_PASS" ]]; then docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS && docker push bids/${CIRCLE_PROJECT_REPONAME}:latest; fi : - timeout: 21600 - - if [[ -n "$DOCKER_PASS" ]]; then docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS && docker tag bids/${CIRCLE_PROJECT_REPONAME} bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG && docker push bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG; fi : - timeout: 21600 From 91734873d93092603c2f2d776c01e6eceaa828c3 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Jan 2023 23:30:19 +0100 Subject: [PATCH 03/22] remove commented code --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c8df27..3b949ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,14 +21,12 @@ jobs: - docker/image.tar deploy: - #docker: - #- image: circleci/buildpack-deps:stretch machine: image: ubuntu-2204:2022.10.2 steps: - attach_workspace: at: /tmp/workspace - #- setup_remote_docker + - setup_remote_docker - run: docker load -i /tmp/workspace/docker/image.tar - run: command: | From d1758065fe0188d7a2129254b456aff27ff40dd0 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 2 Jan 2023 20:43:12 +0100 Subject: [PATCH 04/22] use same config as for base validator --- .circleci/config.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3b949ca..2337c8f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,8 +26,8 @@ jobs: steps: - attach_workspace: at: /tmp/workspace - - setup_remote_docker - run: docker load -i /tmp/workspace/docker/image.tar + # DOCKER_PASS and DOCKER_USER are defined as CircleCI env variables (check circleci project in web form) - run: command: | if [[ -n "$DOCKER_PASS" ]]; then @@ -44,13 +44,12 @@ workflows: jobs: - build: filters: - tags: - only: /.*/ + branches: + only: master - deploy: requires: - build filters: - tags: - only: /.*/ + branches: + only: master -# VS Code Extension Version: 1.5.1 From ff98e793e7ad84001faad94694bcff16094799ce Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 2 Jan 2023 20:45:19 +0100 Subject: [PATCH 05/22] change base image --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f0abcc1..9e6191f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ # # https://github.com/ReproNim/neurodocker -FROM debian:buster-slim +FROM ubuntu:jammy-20221130 USER root @@ -100,7 +100,7 @@ RUN echo '{ \ \n "instructions": [ \ \n [ \ \n "base", \ - \n "debian:buster-slim" \ + \n "ubuntu:jammy-20221130" \ \n ], \ \n [ \ \n "install", \ From adc17221bbcefa95a9121f859b6ba64612b1dbd8 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 2 Jan 2023 22:30:32 +0100 Subject: [PATCH 06/22] use precommit --- .circleci/config.yml | 76 ++++++++++++++++++++--------------------- .pre-commit-config.yaml | 22 ++++++++++++ Dockerfile | 4 +-- 3 files changed, 62 insertions(+), 40 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index 2337c8f..736d0b7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,55 +1,55 @@ +--- version: 2.1 jobs: build: machine: - # https://circleci.com/developer/machine/image/ubuntu-2204 + # https://circleci.com/developer/machine/image/ubuntu-2204 image: ubuntu-2204:2022.10.2 steps: - - checkout - - run: - name: build docker image - command: | - if [[ -e ~/docker/image.tar ]]; then - docker load -i ~/docker/image.tar; - fi - docker build -t bids/${CIRCLE_PROJECT_REPONAME}:latest . - mkdir -p ~/docker - docker save "bids/${CIRCLE_PROJECT_REPONAME}:latest" > ~/docker/image.tar - - persist_to_workspace: - root: /home/circleci - paths: - - docker/image.tar + - checkout + - run: + name: build docker image + command: | + if [[ -e ~/docker/image.tar ]]; then + docker load -i ~/docker/image.tar; + fi + docker build -t bids/${CIRCLE_PROJECT_REPONAME}:latest . + mkdir -p ~/docker + docker save "bids/${CIRCLE_PROJECT_REPONAME}:latest" > ~/docker/image.tar + - persist_to_workspace: + root: /home/circleci + paths: + - docker/image.tar deploy: machine: image: ubuntu-2204:2022.10.2 steps: - - attach_workspace: - at: /tmp/workspace - - run: docker load -i /tmp/workspace/docker/image.tar + - attach_workspace: + at: /tmp/workspace + - run: docker load -i /tmp/workspace/docker/image.tar # DOCKER_PASS and DOCKER_USER are defined as CircleCI env variables (check circleci project in web form) - - run: - command: | - if [[ -n "$DOCKER_PASS" ]]; then - echo "${DOCKER_PASS}" | docker login -u ${DOCKER_USER} --password-stdin && \ - docker push bids/${CIRCLE_PROJECT_REPONAME}:latest - if [[ -n "${CIRCLE_TAG}" ]]; then - docker tag bids/${CIRCLE_PROJECT_REPONAME} bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG - docker push bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG; - fi + - run: + command: | + if [[ -n "$DOCKER_PASS" ]]; then + echo "${DOCKER_PASS}" | docker login -u ${DOCKER_USER} --password-stdin && \ + docker push bids/${CIRCLE_PROJECT_REPONAME}:latest + if [[ -n "${CIRCLE_TAG}" ]]; then + docker tag bids/${CIRCLE_PROJECT_REPONAME} bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG + docker push bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG; fi + fi workflows: build_deploy: jobs: - - build: - filters: - branches: - only: master - - deploy: - requires: - - build - filters: - branches: - only: master - + - build: + filters: + branches: + only: master + - deploy: + requires: + - build + filters: + branches: + only: master diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..4c441db --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,22 @@ +--- +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks + +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-json + - id: check-ast + - id: check-added-large-files + - id: check-case-conflict + + +- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt + rev: 0.2.2 + hooks: + - id: yamlfmt + args: [--mapping, '2', --sequence, '2', --offset, '0'] diff --git a/Dockerfile b/Dockerfile index 9e6191f..1e192b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ # Generated by: Neurodocker version 0.7.0+0.gdc97516.dirty # Latest release: Neurodocker version 0.9.1 # Timestamp: 2023/01/01 17:25:00 UTC -# +# # Thank you for using Neurodocker. If you discover any issues # or ways to improve this software, please submit an issue or # pull request on our GitHub repository: -# +# # https://github.com/ReproNim/neurodocker FROM ubuntu:jammy-20221130 From 074f6ca8e8458979da037eecf7dea916880b7aba Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 3 Jan 2023 11:25:53 +0100 Subject: [PATCH 07/22] update precommit --- .hadolint.yaml | 8 ++++++++ .pre-commit-config.yaml | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .hadolint.yaml diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..11615c4 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,8 @@ +--- +ignored: +- DL3002 +- DL3008 +- DL3059 +- DL4006 +- SC2016 +- SC2028 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c441db..239c619 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,9 +10,9 @@ repos: - id: end-of-file-fixer - id: check-yaml - id: check-json - - id: check-ast - id: check-added-large-files - id: check-case-conflict + - id: check-merge-conflict - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt @@ -20,3 +20,14 @@ repos: hooks: - id: yamlfmt args: [--mapping, '2', --sequence, '2', --offset, '0'] + + +- repo: https://github.com/hadolint/hadolint + rev: v2.12.0 + hooks: + - id: hadolint-docker + name: Lint Dockerfiles + description: Runs hadolint Docker image to lint Dockerfiles + language: docker_image + types: [dockerfile] + entry: ghcr.io/hadolint/hadolint hadolint From 59f3047dde593850061a694a7c4237fb63e23465 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 3 Jan 2023 14:14:24 +0100 Subject: [PATCH 08/22] use neurodocker 0.7.0 to generate recipe --- .hadolint.yaml | 2 +- .pre-commit-config.yaml | 3 +++ Dockerfile | 27 ++++----------------------- Makefile | 10 +++++----- 4 files changed, 13 insertions(+), 29 deletions(-) diff --git a/.hadolint.yaml b/.hadolint.yaml index 11615c4..e955994 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,8 +1,8 @@ --- ignored: - DL3002 +- DL3006 - DL3008 -- DL3059 - DL4006 - SC2016 - SC2028 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 239c619..c010886 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,3 +31,6 @@ repos: language: docker_image types: [dockerfile] entry: ghcr.io/hadolint/hadolint hadolint + +ci: + skip: [hadolint-docker] diff --git a/Dockerfile b/Dockerfile index 1e192b6..3e504eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ +# [NEURODOCKER 2023-01-03 13:13:12,715 WARNING]: A newer version (0.9.1) of ReproNim/neurodocker is available. You are using 0.7.0+0.gdc97516.dirty # Generated by: Neurodocker version 0.7.0+0.gdc97516.dirty # Latest release: Neurodocker version 0.9.1 -# Timestamp: 2023/01/01 17:25:00 UTC +# Timestamp: 2023/01/03 13:13:12 UTC # # Thank you for using Neurodocker. If you discover any issues # or ways to improve this software, please submit an issue or @@ -8,7 +9,7 @@ # # https://github.com/ReproNim/neurodocker -FROM ubuntu:jammy-20221130 +FROM bids/base_validator USER root @@ -43,13 +44,6 @@ RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \ ENTRYPOINT ["/neurodocker/startup.sh"] -RUN apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - nodejs \ - npm \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - ENV FSLDIR="/opt/fsl-6.0.3" \ PATH="/opt/fsl-6.0.3/bin:$PATH" \ FSLOUTPUTTYPE="NIFTI_GZ" \ @@ -93,21 +87,12 @@ RUN apt-get update -qq \ && echo "Installing FSL conda environment ..." \ && bash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3 -RUN bash -c 'node -v && npm -v && npm install -g bids-validator' - RUN echo '{ \ \n "pkg_manager": "apt", \ \n "instructions": [ \ \n [ \ \n "base", \ - \n "ubuntu:jammy-20221130" \ - \n ], \ - \n [ \ - \n "install", \ - \n [ \ - \n "nodejs", \ - \n "npm" \ - \n ] \ + \n "bids/base_validator" \ \n ], \ \n [ \ \n "fsl", \ @@ -115,10 +100,6 @@ RUN echo '{ \ \n "method": "binaries", \ \n "version": "6.0.3" \ \n } \ - \n ], \ - \n [ \ - \n "run_bash", \ - \n "node -v && npm -v && npm install -g bids-validator" \ \n ] \ \n ] \ \n}' > /neurodocker/neurodocker_specs.json diff --git a/Makefile b/Makefile index 13f388f..baf1b62 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ .PHONY: Dockerfile Dockerfile: - docker run --rm kaczmarj/neurodocker:0.7.0 generate docker \ - --base debian:buster-slim --pkg-manager apt \ - --install nodejs npm \ - --fsl method=binaries version=6.0.3 \ - --run-bash "node -v && npm -v && npm install -g bids-validator"> Dockerfile + docker run --rm -it kaczmarj/neurodocker:0.7.0 \ + generate docker \ + --base bids/base_validator \ + --pkg-manager apt \ + --fsl method=binaries version=6.0.3 > Dockerfile From 97e94aca03d9e04799c310a24491593490f30e18 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 3 Jan 2023 19:44:56 +0100 Subject: [PATCH 09/22] try building with neurodocker 0.9.0 recipe --- Dockerfile | 109 +++++++++++++++++++++-------------------------------- Makefile | 4 +- 2 files changed, 45 insertions(+), 68 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e504eb..f6a367b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,49 +1,6 @@ -# [NEURODOCKER 2023-01-03 13:13:12,715 WARNING]: A newer version (0.9.1) of ReproNim/neurodocker is available. You are using 0.7.0+0.gdc97516.dirty -# Generated by: Neurodocker version 0.7.0+0.gdc97516.dirty -# Latest release: Neurodocker version 0.9.1 -# Timestamp: 2023/01/03 13:13:12 UTC -# -# Thank you for using Neurodocker. If you discover any issues -# or ways to improve this software, please submit an issue or -# pull request on our GitHub repository: -# -# https://github.com/ReproNim/neurodocker +# Generated by Neurodocker and Reproenv. FROM bids/base_validator - -USER root - -ARG DEBIAN_FRONTEND="noninteractive" - -ENV LANG="en_US.UTF-8" \ - LC_ALL="en_US.UTF-8" \ - ND_ENTRYPOINT="/neurodocker/startup.sh" -RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \ - && apt-get update -qq \ - && apt-get install -y -q --no-install-recommends \ - apt-utils \ - bzip2 \ - ca-certificates \ - curl \ - locales \ - unzip \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ - && dpkg-reconfigure --frontend=noninteractive locales \ - && update-locale LANG="en_US.UTF-8" \ - && chmod 777 /opt && chmod a+s /opt \ - && mkdir -p /neurodocker \ - && if [ ! -f "$ND_ENTRYPOINT" ]; then \ - echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \ - && echo 'set -e' >> "$ND_ENTRYPOINT" \ - && echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" \ - && echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \ - fi \ - && chmod -R 777 /neurodocker && chmod a+s /neurodocker - -ENTRYPOINT ["/neurodocker/startup.sh"] - ENV FSLDIR="/opt/fsl-6.0.3" \ PATH="/opt/fsl-6.0.3/bin:$PATH" \ FSLOUTPUTTYPE="NIFTI_GZ" \ @@ -57,6 +14,8 @@ ENV FSLDIR="/opt/fsl-6.0.3" \ RUN apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ bc \ + ca-certificates \ + curl \ dc \ file \ libfontconfig1 \ @@ -66,40 +25,58 @@ RUN apt-get update -qq \ libglu1-mesa-dev \ libgomp1 \ libice6 \ + libopenblas-base \ libxcursor1 \ libxft2 \ libxinerama1 \ libxrandr2 \ libxrender1 \ libxt6 \ + nano \ sudo \ wget \ - && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FSL ..." \ && mkdir -p /opt/fsl-6.0.3 \ - && curl -fsSL --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \ + && curl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \ | tar -xz -C /opt/fsl-6.0.3 --strip-components 1 \ - && sed -i '$iecho Some packages in this Docker container are non-free' $ND_ENTRYPOINT \ - && sed -i '$iecho If you are considering commercial use of this container, please consult the relevant license:' $ND_ENTRYPOINT \ - && sed -i '$iecho https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence' $ND_ENTRYPOINT \ - && sed -i '$isource $FSLDIR/etc/fslconf/fsl.sh' $ND_ENTRYPOINT \ && echo "Installing FSL conda environment ..." \ && bash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3 -RUN echo '{ \ - \n "pkg_manager": "apt", \ - \n "instructions": [ \ - \n [ \ - \n "base", \ - \n "bids/base_validator" \ - \n ], \ - \n [ \ - \n "fsl", \ - \n { \ - \n "method": "binaries", \ - \n "version": "6.0.3" \ - \n } \ - \n ] \ - \n ] \ - \n}' > /neurodocker/neurodocker_specs.json +# Save specification to JSON. +RUN printf '{ \ + "pkg_manager": "apt", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "bids/base_validator" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "FSLDIR": "/opt/fsl-6.0.3", \ + "PATH": "/opt/fsl-6.0.3/bin:$PATH", \ + "FSLOUTPUTTYPE": "NIFTI_GZ", \ + "FSLMULTIFILEQUIT": "TRUE", \ + "FSLTCLSH": "/opt/fsl-6.0.3/bin/fsltclsh", \ + "FSLWISH": "/opt/fsl-6.0.3/bin/fslwish", \ + "FSLLOCKDIR": "", \ + "FSLMACHINELIST": "", \ + "FSLREMOTECALL": "", \ + "FSLGECUDAQ": "cuda.q" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n dc \\\\\\n file \\\\\\n libfontconfig1 \\\\\\n libfreetype6 \\\\\\n libgl1-mesa-dev \\\\\\n libgl1-mesa-dri \\\\\\n libglu1-mesa-dev \\\\\\n libgomp1 \\\\\\n libice6 \\\\\\n libopenblas-base \\\\\\n libxcursor1 \\\\\\n libxft2 \\\\\\n libxinerama1 \\\\\\n libxrandr2 \\\\\\n libxrender1 \\\\\\n libxt6 \\\\\\n nano \\\\\\n sudo \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FSL ...\\"\\nmkdir -p /opt/fsl-6.0.3\\ncurl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \\\\\\n| tar -xz -C /opt/fsl-6.0.3 --strip-components 1 \\necho \\"Installing FSL conda environment ...\\"\\nbash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3" \ + } \ + } \ + ] \ +}' > /.reproenv.json +# End saving to specification to JSON. diff --git a/Makefile b/Makefile index baf1b62..19483a1 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ .PHONY: Dockerfile Dockerfile: - docker run --rm -it kaczmarj/neurodocker:0.7.0 \ + docker run --rm -i kaczmarj/neurodocker:0.9.1 \ generate docker \ - --base bids/base_validator \ + --base-image bids/base_validator \ --pkg-manager apt \ --fsl method=binaries version=6.0.3 > Dockerfile From c7637d10e0f5143bc22ff25db8b8a35eb5cab2d7 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 4 Jan 2023 18:35:36 +0100 Subject: [PATCH 10/22] try another install --- Dockerfile | 46 ++++------------------------------------------ 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/Dockerfile b/Dockerfile index f6a367b..f1147fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,45 +38,7 @@ RUN apt-get update -qq \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FSL ..." \ && mkdir -p /opt/fsl-6.0.3 \ - && curl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \ - | tar -xz -C /opt/fsl-6.0.3 --strip-components 1 \ - && echo "Installing FSL conda environment ..." \ - && bash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3 - -# Save specification to JSON. -RUN printf '{ \ - "pkg_manager": "apt", \ - "existing_users": [ \ - "root" \ - ], \ - "instructions": [ \ - { \ - "name": "from_", \ - "kwds": { \ - "base_image": "bids/base_validator" \ - } \ - }, \ - { \ - "name": "env", \ - "kwds": { \ - "FSLDIR": "/opt/fsl-6.0.3", \ - "PATH": "/opt/fsl-6.0.3/bin:$PATH", \ - "FSLOUTPUTTYPE": "NIFTI_GZ", \ - "FSLMULTIFILEQUIT": "TRUE", \ - "FSLTCLSH": "/opt/fsl-6.0.3/bin/fsltclsh", \ - "FSLWISH": "/opt/fsl-6.0.3/bin/fslwish", \ - "FSLLOCKDIR": "", \ - "FSLMACHINELIST": "", \ - "FSLREMOTECALL": "", \ - "FSLGECUDAQ": "cuda.q" \ - } \ - }, \ - { \ - "name": "run", \ - "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n dc \\\\\\n file \\\\\\n libfontconfig1 \\\\\\n libfreetype6 \\\\\\n libgl1-mesa-dev \\\\\\n libgl1-mesa-dri \\\\\\n libglu1-mesa-dev \\\\\\n libgomp1 \\\\\\n libice6 \\\\\\n libopenblas-base \\\\\\n libxcursor1 \\\\\\n libxft2 \\\\\\n libxinerama1 \\\\\\n libxrandr2 \\\\\\n libxrender1 \\\\\\n libxt6 \\\\\\n nano \\\\\\n sudo \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FSL ...\\"\\nmkdir -p /opt/fsl-6.0.3\\ncurl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \\\\\\n| tar -xz -C /opt/fsl-6.0.3 --strip-components 1 \\necho \\"Installing FSL conda environment ...\\"\\nbash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3" \ - } \ - } \ - ] \ -}' > /.reproenv.json -# End saving to specification to JSON. + && wget -q http://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py \ + && chmod 775 fslinstaller.py \ + && python3 /fslinstaller.py -d /opt/fsl-6.0.3 -V 6.0.3 && \ + && rm -f /fslinstaller.py From 72ce700a3d94dec91fb0503a8ac4dc5e916af366 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 4 Jan 2023 18:36:52 +0100 Subject: [PATCH 11/22] fix typo --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f1147fc..9066c4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,5 +40,5 @@ RUN apt-get update -qq \ && mkdir -p /opt/fsl-6.0.3 \ && wget -q http://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py \ && chmod 775 fslinstaller.py \ - && python3 /fslinstaller.py -d /opt/fsl-6.0.3 -V 6.0.3 && \ + && python3 /fslinstaller.py -d /opt/fsl-6.0.3 -V 6.0.3 \ && rm -f /fslinstaller.py From 9a1f8d0c99d547622a716dfe095815d53b29139d Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 4 Jan 2023 18:38:13 +0100 Subject: [PATCH 12/22] update deploy --- .circleci/config.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 736d0b7..4ab2fec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,12 +32,19 @@ jobs: - run: command: | if [[ -n "$DOCKER_PASS" ]]; then - echo "${DOCKER_PASS}" | docker login -u ${DOCKER_USER} --password-stdin && \ - docker push bids/${CIRCLE_PROJECT_REPONAME}:latest + repo_name=`echo ${CIRCLE_PROJECT_REPONAME} | tr '[:upper:]' '[:lower:]'` + echo "${DOCKER_PASS}" | docker login -u ${DOCKER_USER} --password-stdin + echo "Pushing to DockerHub bids/${repo_name}:unstable" + docker tag bids/${repo_name} bids/${repo_name}:unstable + docker push bids/${repo_name}:unstable if [[ -n "${CIRCLE_TAG}" ]]; then - docker tag bids/${CIRCLE_PROJECT_REPONAME} bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG - docker push bids/${CIRCLE_PROJECT_REPONAME}:$CIRCLE_TAG; + echo "Pushing to DockerHub bids/${repo_name}:${CIRCLE_TAG}" + docker push bids/${repo_name}:latest + docker tag bids/${repo_name} bids/${repo_name}:${CIRCLE_TAG} + docker push bids/${repo_name}:${CIRCLE_TAG}; fi + else + echo "No DOCKER_PASS, skipping push to DockerHub" fi workflows: From 5e997d377e0d118120a63378d13671e36603e989 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 4 Jan 2023 18:41:51 +0100 Subject: [PATCH 13/22] fsl version 6.0.6 --- Dockerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9066c4f..5ae947d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ # Generated by Neurodocker and Reproenv. FROM bids/base_validator -ENV FSLDIR="/opt/fsl-6.0.3" \ - PATH="/opt/fsl-6.0.3/bin:$PATH" \ +ENV FSLDIR="/opt/fsl-6.0.6" \ + PATH="/opt/fsl-6.0.6/bin:$PATH" \ FSLOUTPUTTYPE="NIFTI_GZ" \ FSLMULTIFILEQUIT="TRUE" \ - FSLTCLSH="/opt/fsl-6.0.3/bin/fsltclsh" \ - FSLWISH="/opt/fsl-6.0.3/bin/fslwish" \ + FSLTCLSH="/opt/fsl-6.0.6/bin/fsltclsh" \ + FSLWISH="/opt/fsl-6.0.6/bin/fslwish" \ FSLLOCKDIR="" \ FSLMACHINELIST="" \ FSLREMOTECALL="" \ @@ -37,8 +37,9 @@ RUN apt-get update -qq \ wget \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FSL ..." \ - && mkdir -p /opt/fsl-6.0.3 \ + && mkdir -p /opt/fsl-6.0.6 \ && wget -q http://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py \ && chmod 775 fslinstaller.py \ - && python3 /fslinstaller.py -d /opt/fsl-6.0.3 -V 6.0.3 \ - && rm -f /fslinstaller.py + && python3 /fslinstaller.py -d /opt/fsl-6.0.6 -V 6.0.6 \ + && rm -f /fslinstaller.py \ + && which immv || ( echo "FSLPython not properly configured; re-running" && rm -rf /opt/fsl/fslpython && /opt/fsl/etc/fslconf/fslpython_install.sh -f /opt/fsl || ( cat /tmp/fslpython*/fslpython_miniconda_installer.log && exit 1 ) ) From 96748977999ba4758fcc819badd8edb4682bb009 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 4 Jan 2023 18:44:04 +0100 Subject: [PATCH 14/22] let installer create dir --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5ae947d..110ca18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,6 @@ RUN apt-get update -qq \ wget \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FSL ..." \ - && mkdir -p /opt/fsl-6.0.6 \ && wget -q http://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py \ && chmod 775 fslinstaller.py \ && python3 /fslinstaller.py -d /opt/fsl-6.0.6 -V 6.0.6 \ From 4487a27a4528fdefe2c7d8575294e9ac25366d86 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 4 Jan 2023 18:58:43 +0100 Subject: [PATCH 15/22] try using centralised script for building docker --- .circleci/config.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4ab2fec..a9db728 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,12 +10,14 @@ jobs: - run: name: build docker image command: | - if [[ -e ~/docker/image.tar ]]; then - docker load -i ~/docker/image.tar; - fi - docker build -t bids/${CIRCLE_PROJECT_REPONAME}:latest . - mkdir -p ~/docker - docker save "bids/${CIRCLE_PROJECT_REPONAME}:latest" > ~/docker/image.tar + # if [[ -e ~/docker/image.tar ]]; then + # docker load -i ~/docker/image.tar; + # fi + # docker build -t bids/${CIRCLE_PROJECT_REPONAME}:latest . + # mkdir -p ~/docker + # docker save "bids/${CIRCLE_PROJECT_REPONAME}:latest" > ~/docker/image.tar + wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/build_docker.sh + bash build_docker.sh - persist_to_workspace: root: /home/circleci paths: @@ -60,3 +62,5 @@ workflows: filters: branches: only: master + +# VS Code Extension Version: 1.5.1 From d92c5a45224303bc5f3cdb6bced9a32c2ee9e294 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 4 Jan 2023 19:27:31 +0100 Subject: [PATCH 16/22] add name to step --- .circleci/config.yml | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a9db728..d3e312f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,12 +10,6 @@ jobs: - run: name: build docker image command: | - # if [[ -e ~/docker/image.tar ]]; then - # docker load -i ~/docker/image.tar; - # fi - # docker build -t bids/${CIRCLE_PROJECT_REPONAME}:latest . - # mkdir -p ~/docker - # docker save "bids/${CIRCLE_PROJECT_REPONAME}:latest" > ~/docker/image.tar wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/build_docker.sh bash build_docker.sh - persist_to_workspace: @@ -30,24 +24,11 @@ jobs: - attach_workspace: at: /tmp/workspace - run: docker load -i /tmp/workspace/docker/image.tar - # DOCKER_PASS and DOCKER_USER are defined as CircleCI env variables (check circleci project in web form) - run: + name: push to dockerhub command: | - if [[ -n "$DOCKER_PASS" ]]; then - repo_name=`echo ${CIRCLE_PROJECT_REPONAME} | tr '[:upper:]' '[:lower:]'` - echo "${DOCKER_PASS}" | docker login -u ${DOCKER_USER} --password-stdin - echo "Pushing to DockerHub bids/${repo_name}:unstable" - docker tag bids/${repo_name} bids/${repo_name}:unstable - docker push bids/${repo_name}:unstable - if [[ -n "${CIRCLE_TAG}" ]]; then - echo "Pushing to DockerHub bids/${repo_name}:${CIRCLE_TAG}" - docker push bids/${repo_name}:latest - docker tag bids/${repo_name} bids/${repo_name}:${CIRCLE_TAG} - docker push bids/${repo_name}:${CIRCLE_TAG}; - fi - else - echo "No DOCKER_PASS, skipping push to DockerHub" - fi + wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/push_docker.sh + bash push_docker.sh workflows: build_deploy: From 3286b760ef89301ab8a881fe23f33745a5706e81 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 6 Jan 2023 21:00:52 +0100 Subject: [PATCH 17/22] reformat config --- .circleci/config.yml | 58 +++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d3e312f..395b056 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,42 +6,40 @@ jobs: # https://circleci.com/developer/machine/image/ubuntu-2204 image: ubuntu-2204:2022.10.2 steps: - - checkout - - run: - name: build docker image - command: | - wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/build_docker.sh - bash build_docker.sh - - persist_to_workspace: - root: /home/circleci - paths: - - docker/image.tar + - checkout + - run: + name: build docker image + command: | + wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/build_docker.sh + bash build_docker.sh + - persist_to_workspace: + root: /home/circleci + paths: + - docker/image.tar deploy: machine: image: ubuntu-2204:2022.10.2 steps: - - attach_workspace: - at: /tmp/workspace - - run: docker load -i /tmp/workspace/docker/image.tar - - run: - name: push to dockerhub - command: | - wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/push_docker.sh - bash push_docker.sh + - attach_workspace: + at: /tmp/workspace + - run: docker load -i /tmp/workspace/docker/image.tar + - run: + name: push to dockerhub + command: | + wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/push_docker.sh + bash push_docker.sh workflows: build_deploy: jobs: - - build: - filters: - branches: - only: master - - deploy: - requires: - - build - filters: - branches: - only: master - -# VS Code Extension Version: 1.5.1 + - build: + filters: + branches: + only: master + - deploy: + requires: + - build + filters: + branches: + only: master From 2d75779876cc3fba9da1a55de2e046684c001b63 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 13:27:18 +0100 Subject: [PATCH 18/22] 'precommit --- .circleci/config.yml | 56 ++++++++++++++++++++++---------------------- .hadolint.yaml | 1 + Dockerfile | 2 +- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 395b056..ed2bda3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,40 +6,40 @@ jobs: # https://circleci.com/developer/machine/image/ubuntu-2204 image: ubuntu-2204:2022.10.2 steps: - - checkout - - run: - name: build docker image - command: | - wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/build_docker.sh - bash build_docker.sh - - persist_to_workspace: - root: /home/circleci - paths: - - docker/image.tar + - checkout + - run: + name: build docker image + command: | + wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/build_docker.sh + bash build_docker.sh + - persist_to_workspace: + root: /home/circleci + paths: + - docker/image.tar deploy: machine: image: ubuntu-2204:2022.10.2 steps: - - attach_workspace: - at: /tmp/workspace - - run: docker load -i /tmp/workspace/docker/image.tar - - run: - name: push to dockerhub - command: | - wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/push_docker.sh - bash push_docker.sh + - attach_workspace: + at: /tmp/workspace + - run: docker load -i /tmp/workspace/docker/image.tar + - run: + name: push to dockerhub + command: | + wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/circleci/push_docker.sh + bash push_docker.sh workflows: build_deploy: jobs: - - build: - filters: - branches: - only: master - - deploy: - requires: - - build - filters: - branches: - only: master + - build: + filters: + branches: + only: master + - deploy: + requires: + - build + filters: + branches: + only: master diff --git a/.hadolint.yaml b/.hadolint.yaml index e955994..1fedaef 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -4,5 +4,6 @@ ignored: - DL3006 - DL3008 - DL4006 +- SC2015 - SC2016 - SC2028 diff --git a/Dockerfile b/Dockerfile index 110ca18..8307846 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,4 +41,4 @@ RUN apt-get update -qq \ && chmod 775 fslinstaller.py \ && python3 /fslinstaller.py -d /opt/fsl-6.0.6 -V 6.0.6 \ && rm -f /fslinstaller.py \ - && which immv || ( echo "FSLPython not properly configured; re-running" && rm -rf /opt/fsl/fslpython && /opt/fsl/etc/fslconf/fslpython_install.sh -f /opt/fsl || ( cat /tmp/fslpython*/fslpython_miniconda_installer.log && exit 1 ) ) + && which immv || ( echo "FSLPython not properly configured; re-running" && rm -rf /opt/fsl/fslpython && /opt/fsl/etc/fslconf/fslpython_install.sh -f /opt/fsl || ( cat /tmp/fslpython*/fslpython_miniconda_installer.log && exit 1 ) ) From 737413241f657e886ce8f1ba1a36707472f6b8e7 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 7 Jan 2023 13:56:51 +0100 Subject: [PATCH 19/22] add context Committed via https://github.com/asottile/all-repos --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed2bda3..d46a2ad 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,6 +38,8 @@ workflows: branches: only: master - deploy: + context: + - dockerhub requires: - build filters: From fd058eb4dd35e43129d7d2907e940a24ac55170e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 8 Jan 2023 03:02:35 +0100 Subject: [PATCH 20/22] say yes to all prompts when building docker --- Dockerfile | 56 +++++++++++++++++++++++++++++++++++++++++++++--------- Makefile | 3 ++- 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8307846..26cf124 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ # Generated by Neurodocker and Reproenv. FROM bids/base_validator -ENV FSLDIR="/opt/fsl-6.0.6" \ - PATH="/opt/fsl-6.0.6/bin:$PATH" \ +ENV FSLDIR="/opt/fsl-6.0.0" \ + PATH="/opt/fsl-6.0.0/bin:$PATH" \ FSLOUTPUTTYPE="NIFTI_GZ" \ FSLMULTIFILEQUIT="TRUE" \ - FSLTCLSH="/opt/fsl-6.0.6/bin/fsltclsh" \ - FSLWISH="/opt/fsl-6.0.6/bin/fslwish" \ + FSLTCLSH="/opt/fsl-6.0.0/bin/fsltclsh" \ + FSLWISH="/opt/fsl-6.0.0/bin/fslwish" \ FSLLOCKDIR="" \ FSLMACHINELIST="" \ FSLREMOTECALL="" \ @@ -37,8 +37,46 @@ RUN apt-get update -qq \ wget \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FSL ..." \ - && wget -q http://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py \ - && chmod 775 fslinstaller.py \ - && python3 /fslinstaller.py -d /opt/fsl-6.0.6 -V 6.0.6 \ - && rm -f /fslinstaller.py \ - && which immv || ( echo "FSLPython not properly configured; re-running" && rm -rf /opt/fsl/fslpython && /opt/fsl/etc/fslconf/fslpython_install.sh -f /opt/fsl || ( cat /tmp/fslpython*/fslpython_miniconda_installer.log && exit 1 ) ) + && mkdir -p /opt/fsl-6.0.0 \ + && curl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.0-centos6_64.tar.gz \ + | tar -xz -C /opt/fsl-6.0.0 --strip-components 1 \ + && echo "Installing FSL conda environment ..." \ + && bash /opt/fsl-6.0.0/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.0 + +# Save specification to JSON. +RUN printf '{ \ + "pkg_manager": "apt", \ + "existing_users": [ \ + "root" \ + ], \ + "instructions": [ \ + { \ + "name": "from_", \ + "kwds": { \ + "base_image": "bids/base_validator" \ + } \ + }, \ + { \ + "name": "env", \ + "kwds": { \ + "FSLDIR": "/opt/fsl-6.0.0", \ + "PATH": "/opt/fsl-6.0.0/bin:$PATH", \ + "FSLOUTPUTTYPE": "NIFTI_GZ", \ + "FSLMULTIFILEQUIT": "TRUE", \ + "FSLTCLSH": "/opt/fsl-6.0.0/bin/fsltclsh", \ + "FSLWISH": "/opt/fsl-6.0.0/bin/fslwish", \ + "FSLLOCKDIR": "", \ + "FSLMACHINELIST": "", \ + "FSLREMOTECALL": "", \ + "FSLGECUDAQ": "cuda.q" \ + } \ + }, \ + { \ + "name": "run", \ + "kwds": { \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n dc \\\\\\n file \\\\\\n libfontconfig1 \\\\\\n libfreetype6 \\\\\\n libgl1-mesa-dev \\\\\\n libgl1-mesa-dri \\\\\\n libglu1-mesa-dev \\\\\\n libgomp1 \\\\\\n libice6 \\\\\\n libopenblas-base \\\\\\n libxcursor1 \\\\\\n libxft2 \\\\\\n libxinerama1 \\\\\\n libxrandr2 \\\\\\n libxrender1 \\\\\\n libxt6 \\\\\\n nano \\\\\\n sudo \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FSL ...\\"\\nmkdir -p /opt/fsl-6.0.0\\ncurl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.0-centos6_64.tar.gz \\\\\\n| tar -xz -C /opt/fsl-6.0.0 --strip-components 1 \\necho \\"Installing FSL conda environment ...\\"\\nbash /opt/fsl-6.0.0/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.0" \ + } \ + } \ + ] \ +}' > /.reproenv.json +# End saving to specification to JSON. diff --git a/Makefile b/Makefile index 19483a1..3c82784 100644 --- a/Makefile +++ b/Makefile @@ -5,4 +5,5 @@ Dockerfile: generate docker \ --base-image bids/base_validator \ --pkg-manager apt \ - --fsl method=binaries version=6.0.3 > Dockerfile + --yes \ + --fsl method=binaries version=6.0.0 > Dockerfile From f1742ff27055704943bdfb2882f4c0220596fff1 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 8 Jan 2023 03:19:22 +0100 Subject: [PATCH 21/22] use fsl 6.0.3 --- Dockerfile | 26 +++++++++++++------------- Makefile | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 26cf124..f6a367b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ # Generated by Neurodocker and Reproenv. FROM bids/base_validator -ENV FSLDIR="/opt/fsl-6.0.0" \ - PATH="/opt/fsl-6.0.0/bin:$PATH" \ +ENV FSLDIR="/opt/fsl-6.0.3" \ + PATH="/opt/fsl-6.0.3/bin:$PATH" \ FSLOUTPUTTYPE="NIFTI_GZ" \ FSLMULTIFILEQUIT="TRUE" \ - FSLTCLSH="/opt/fsl-6.0.0/bin/fsltclsh" \ - FSLWISH="/opt/fsl-6.0.0/bin/fslwish" \ + FSLTCLSH="/opt/fsl-6.0.3/bin/fsltclsh" \ + FSLWISH="/opt/fsl-6.0.3/bin/fslwish" \ FSLLOCKDIR="" \ FSLMACHINELIST="" \ FSLREMOTECALL="" \ @@ -37,11 +37,11 @@ RUN apt-get update -qq \ wget \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FSL ..." \ - && mkdir -p /opt/fsl-6.0.0 \ - && curl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.0-centos6_64.tar.gz \ - | tar -xz -C /opt/fsl-6.0.0 --strip-components 1 \ + && mkdir -p /opt/fsl-6.0.3 \ + && curl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \ + | tar -xz -C /opt/fsl-6.0.3 --strip-components 1 \ && echo "Installing FSL conda environment ..." \ - && bash /opt/fsl-6.0.0/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.0 + && bash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3 # Save specification to JSON. RUN printf '{ \ @@ -59,12 +59,12 @@ RUN printf '{ \ { \ "name": "env", \ "kwds": { \ - "FSLDIR": "/opt/fsl-6.0.0", \ - "PATH": "/opt/fsl-6.0.0/bin:$PATH", \ + "FSLDIR": "/opt/fsl-6.0.3", \ + "PATH": "/opt/fsl-6.0.3/bin:$PATH", \ "FSLOUTPUTTYPE": "NIFTI_GZ", \ "FSLMULTIFILEQUIT": "TRUE", \ - "FSLTCLSH": "/opt/fsl-6.0.0/bin/fsltclsh", \ - "FSLWISH": "/opt/fsl-6.0.0/bin/fslwish", \ + "FSLTCLSH": "/opt/fsl-6.0.3/bin/fsltclsh", \ + "FSLWISH": "/opt/fsl-6.0.3/bin/fslwish", \ "FSLLOCKDIR": "", \ "FSLMACHINELIST": "", \ "FSLREMOTECALL": "", \ @@ -74,7 +74,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n dc \\\\\\n file \\\\\\n libfontconfig1 \\\\\\n libfreetype6 \\\\\\n libgl1-mesa-dev \\\\\\n libgl1-mesa-dri \\\\\\n libglu1-mesa-dev \\\\\\n libgomp1 \\\\\\n libice6 \\\\\\n libopenblas-base \\\\\\n libxcursor1 \\\\\\n libxft2 \\\\\\n libxinerama1 \\\\\\n libxrandr2 \\\\\\n libxrender1 \\\\\\n libxt6 \\\\\\n nano \\\\\\n sudo \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FSL ...\\"\\nmkdir -p /opt/fsl-6.0.0\\ncurl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.0-centos6_64.tar.gz \\\\\\n| tar -xz -C /opt/fsl-6.0.0 --strip-components 1 \\necho \\"Installing FSL conda environment ...\\"\\nbash /opt/fsl-6.0.0/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.0" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n dc \\\\\\n file \\\\\\n libfontconfig1 \\\\\\n libfreetype6 \\\\\\n libgl1-mesa-dev \\\\\\n libgl1-mesa-dri \\\\\\n libglu1-mesa-dev \\\\\\n libgomp1 \\\\\\n libice6 \\\\\\n libopenblas-base \\\\\\n libxcursor1 \\\\\\n libxft2 \\\\\\n libxinerama1 \\\\\\n libxrandr2 \\\\\\n libxrender1 \\\\\\n libxt6 \\\\\\n nano \\\\\\n sudo \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FSL ...\\"\\nmkdir -p /opt/fsl-6.0.3\\ncurl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \\\\\\n| tar -xz -C /opt/fsl-6.0.3 --strip-components 1 \\necho \\"Installing FSL conda environment ...\\"\\nbash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3" \ } \ } \ ] \ diff --git a/Makefile b/Makefile index 3c82784..13095f4 100644 --- a/Makefile +++ b/Makefile @@ -6,4 +6,4 @@ Dockerfile: --base-image bids/base_validator \ --pkg-manager apt \ --yes \ - --fsl method=binaries version=6.0.0 > Dockerfile + --fsl method=binaries version=6.0.3 > Dockerfile From 6e49c761fd73556cea097efc396e7f5c8bd53405 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 8 Jan 2023 04:49:12 +0100 Subject: [PATCH 22/22] downgrade to version 6.0.1 --- Dockerfile | 30 +++++++++++++++++------------- Makefile | 2 +- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index f6a367b..97aacac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ # Generated by Neurodocker and Reproenv. FROM bids/base_validator -ENV FSLDIR="/opt/fsl-6.0.3" \ - PATH="/opt/fsl-6.0.3/bin:$PATH" \ +ENV FSLDIR="/opt/fsl-6.0.1" \ + PATH="/opt/fsl-6.0.1/bin:$PATH" \ FSLOUTPUTTYPE="NIFTI_GZ" \ FSLMULTIFILEQUIT="TRUE" \ - FSLTCLSH="/opt/fsl-6.0.3/bin/fsltclsh" \ - FSLWISH="/opt/fsl-6.0.3/bin/fslwish" \ + FSLTCLSH="/opt/fsl-6.0.1/bin/fsltclsh" \ + FSLWISH="/opt/fsl-6.0.1/bin/fslwish" \ FSLLOCKDIR="" \ FSLMACHINELIST="" \ FSLREMOTECALL="" \ @@ -37,11 +37,15 @@ RUN apt-get update -qq \ wget \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FSL ..." \ - && mkdir -p /opt/fsl-6.0.3 \ - && curl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \ - | tar -xz -C /opt/fsl-6.0.3 --strip-components 1 \ + && mkdir -p /opt/fsl-6.0.1 \ + && curl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.1-centos6_64.tar.gz \ + | tar -xz -C /opt/fsl-6.0.1 --strip-components 1 \ && echo "Installing FSL conda environment ..." \ - && bash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3 + && bash /opt/fsl-6.0.1/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.1 \ + && echo "Downgrading deprecation module per https://github.com/kaczmarj/neurodocker/issues/271#issuecomment-514523420" \ + && /opt/fsl-6.0.1/fslpython/bin/conda install -n fslpython -c conda-forge -y deprecation==1.* \ + && echo "Removing bundled with FSLeyes libz likely incompatible with the one from OS" \ + && rm -f /opt/fsl-6.0.1/bin/FSLeyes/libz.so.1 # Save specification to JSON. RUN printf '{ \ @@ -59,12 +63,12 @@ RUN printf '{ \ { \ "name": "env", \ "kwds": { \ - "FSLDIR": "/opt/fsl-6.0.3", \ - "PATH": "/opt/fsl-6.0.3/bin:$PATH", \ + "FSLDIR": "/opt/fsl-6.0.1", \ + "PATH": "/opt/fsl-6.0.1/bin:$PATH", \ "FSLOUTPUTTYPE": "NIFTI_GZ", \ "FSLMULTIFILEQUIT": "TRUE", \ - "FSLTCLSH": "/opt/fsl-6.0.3/bin/fsltclsh", \ - "FSLWISH": "/opt/fsl-6.0.3/bin/fslwish", \ + "FSLTCLSH": "/opt/fsl-6.0.1/bin/fsltclsh", \ + "FSLWISH": "/opt/fsl-6.0.1/bin/fslwish", \ "FSLLOCKDIR": "", \ "FSLMACHINELIST": "", \ "FSLREMOTECALL": "", \ @@ -74,7 +78,7 @@ RUN printf '{ \ { \ "name": "run", \ "kwds": { \ - "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n dc \\\\\\n file \\\\\\n libfontconfig1 \\\\\\n libfreetype6 \\\\\\n libgl1-mesa-dev \\\\\\n libgl1-mesa-dri \\\\\\n libglu1-mesa-dev \\\\\\n libgomp1 \\\\\\n libice6 \\\\\\n libopenblas-base \\\\\\n libxcursor1 \\\\\\n libxft2 \\\\\\n libxinerama1 \\\\\\n libxrandr2 \\\\\\n libxrender1 \\\\\\n libxt6 \\\\\\n nano \\\\\\n sudo \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FSL ...\\"\\nmkdir -p /opt/fsl-6.0.3\\ncurl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \\\\\\n| tar -xz -C /opt/fsl-6.0.3 --strip-components 1 \\necho \\"Installing FSL conda environment ...\\"\\nbash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3" \ + "command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bc \\\\\\n ca-certificates \\\\\\n curl \\\\\\n dc \\\\\\n file \\\\\\n libfontconfig1 \\\\\\n libfreetype6 \\\\\\n libgl1-mesa-dev \\\\\\n libgl1-mesa-dri \\\\\\n libglu1-mesa-dev \\\\\\n libgomp1 \\\\\\n libice6 \\\\\\n libopenblas-base \\\\\\n libxcursor1 \\\\\\n libxft2 \\\\\\n libxinerama1 \\\\\\n libxrandr2 \\\\\\n libxrender1 \\\\\\n libxt6 \\\\\\n nano \\\\\\n sudo \\\\\\n wget\\nrm -rf /var/lib/apt/lists/*\\necho \\"Downloading FSL ...\\"\\nmkdir -p /opt/fsl-6.0.1\\ncurl -fL https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.1-centos6_64.tar.gz \\\\\\n| tar -xz -C /opt/fsl-6.0.1 --strip-components 1 \\necho \\"Installing FSL conda environment ...\\"\\nbash /opt/fsl-6.0.1/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.1\\necho \\"Downgrading deprecation module per https://github.com/kaczmarj/neurodocker/issues/271#issuecomment-514523420\\"\\n/opt/fsl-6.0.1/fslpython/bin/conda install -n fslpython -c conda-forge -y deprecation==1.*\\necho \\"Removing bundled with FSLeyes libz likely incompatible with the one from OS\\"\\nrm -f /opt/fsl-6.0.1/bin/FSLeyes/libz.so.1" \ } \ } \ ] \ diff --git a/Makefile b/Makefile index 13095f4..953324c 100644 --- a/Makefile +++ b/Makefile @@ -6,4 +6,4 @@ Dockerfile: --base-image bids/base_validator \ --pkg-manager apt \ --yes \ - --fsl method=binaries version=6.0.3 > Dockerfile + --fsl method=binaries version=6.0.1 > Dockerfile