From 92912714c00b1cb39c51361b27eae1c13b1d2d81 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 1 Aug 2024 11:57:20 +0200 Subject: [PATCH] typo --- .gitattributes | 3 +- .github/workflows/docker.yml | 29 +------------ .gitignore | 3 ++ Dockerfile_1 | 84 ++++++++++++++++++++++++++++++++++++ Singularity.def | 2 +- Singularity_MCR.def | 2 +- code/main | 14 +++--- makefile | 5 +++ 8 files changed, 102 insertions(+), 40 deletions(-) create mode 100644 Dockerfile_1 mode change 120000 => 100644 Singularity.def mode change 120000 => 100644 Singularity_MCR.def create mode 100644 makefile diff --git a/.gitattributes b/.gitattributes index 79223c1..9427c04 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,4 +2,5 @@ **/.git* annex.largefiles=nothing CHANGELOG.md annex.largefiles=nothing README.md annex.largefiles=nothing -.github annex.largefiles=nothing +.github/**/*.yml annex.largefiles=nothing +*.def annex.largefiles=nothing diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c0ff7cc..a52cacc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,28 +1 @@ ---- -name: docker build - -on: - push: - branches: [master] - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - - build: - strategy: - matrix: - image: [dockerfile_MCR, Dockerfile] - fail-fast: false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Build the Docker image - run: | - docker build . --file ${{ matrix.image }} --tag cat12 - docker images +/annex/objects/MD5E-s908--d79893dc28bfcb54aa92dd21c567641a.yml diff --git a/.gitignore b/.gitignore index b1c9591..b867ad4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ .simg + +tests/data/raw +tests/data/MoAEpilot diff --git a/Dockerfile_1 b/Dockerfile_1 new file mode 100644 index 0000000..278841d --- /dev/null +++ b/Dockerfile_1 @@ -0,0 +1,84 @@ +# Generated by Neurodocker and Reproenv. + +FROM ubuntu:22.04 +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 \ + && 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 +ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/opt/MCR-2017b/v93/runtime/glnxa64:/opt/MCR-2017b/v93/bin/glnxa64:/opt/MCR-2017b/v93/sys/os/glnxa64:/opt/MCR-2017b/v93/extern/bin/glnxa64" \ + MATLABCMD="/opt/MCR-2017b/v93/toolbox/matlab" \ + XAPPLRESDIR="/opt//opt/MCR-2017b/v93/x11/app-defaults" \ + MCRROOT="/opt/MCR-2017b/v93" +RUN export TMPDIR="$(mktemp -d)" \ + && apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + bc \ + curl \ + dbus-x11 \ + libncurses5 \ + libxext6 \ + libxmu6 \ + libxpm-dev \ + libxt6 \ + openjdk-8-jre \ + unzip \ + && rm -rf /var/lib/apt/lists/* \ + && echo "Downloading MATLAB Compiler Runtime ..." \ + && curl -o "$TMPDIR/mcr.zip" https://ssd.mathworks.com/supportfiles/downloads/R2017b/deployment_files/R2017b/installers/glnxa64/MCR_R2017b_glnxa64_installer.zip \ + && unzip -q "$TMPDIR/mcr.zip" -d "$TMPDIR/mcrtmp" \ + && "$TMPDIR/mcrtmp/install" -destinationFolder /opt/MCR-2017b -mode silent -agreeToLicense yes \ + && rm -rf "$TMPDIR" \ + && unset TMPDIR +ENV CAT_VERSION=".8.1_r2042_R2017b" +ENV FORCE_SPMMCR="1" \ + SPM_HTML_BROWSER="0" \ + MCR_INHIBIT_CTF_LOCK="1" \ + SPMROOT="/opt/CAT12${CAT_VERSION}" \ + PATH="/opt/CAT12${CAT_VERSION}:$PATH" \ + STANDALONE="/opt/CAT12${CAT_VERSION}/standalone" +RUN apt-get update -qq \ + && apt-get install -y -q --no-install-recommends \ + ca-certificates \ + curl \ + unzip \ + && rm -rf /var/lib/apt/lists/* \ + # Install cat12 + && echo "Downloading standalone CAT12 ..." \ + && curl -fL -o /tmp/cat12.zip http://www.neuro.uni-jena.de/cat12/CAT12${CAT_VERSION}_MCR_Linux.zip \ + && unzip -q /tmp/cat12.zip -d /tmp \ + && rm -rf /tmp/cat12.zip \ + && mkdir -p /opt/CAT12${CAT_VERSION} \ + && mv /tmp/*${CAT_VERSION}*/* /opt/CAT12${CAT_VERSION}/ \ + && chmod -R 777 /opt/CAT12${CAT_VERSION} \ + # Test + && /opt/CAT12${CAT_VERSION}/spm12 function exit + +# transfer code and set permission +RUN mkdir -p /code +COPY ./code /code +RUN ls /code && find /code -type f -print0 | xargs -0 chmod +r + +WORKDIR ${STANDALONE} + +ENTRYPOINT ["/code/main"] diff --git a/Singularity.def b/Singularity.def deleted file mode 120000 index 56b2a97..0000000 --- a/Singularity.def +++ /dev/null @@ -1 +0,0 @@ -.git/annex/objects/8Q/98/MD5E-s6255--ac5590f5bdfc1188a9692c0eea2b36e5.def/MD5E-s6255--ac5590f5bdfc1188a9692c0eea2b36e5.def \ No newline at end of file diff --git a/Singularity.def b/Singularity.def new file mode 100644 index 0000000..f3c6887 --- /dev/null +++ b/Singularity.def @@ -0,0 +1 @@ +/annex/objects/MD5E-s6255--ac5590f5bdfc1188a9692c0eea2b36e5.def diff --git a/Singularity_MCR.def b/Singularity_MCR.def deleted file mode 120000 index 44c89d7..0000000 --- a/Singularity_MCR.def +++ /dev/null @@ -1 +0,0 @@ -.git/annex/objects/2v/V7/MD5E-s16982--97fcbeaf066ad61012381ffe82b98551.def/MD5E-s16982--97fcbeaf066ad61012381ffe82b98551.def \ No newline at end of file diff --git a/Singularity_MCR.def b/Singularity_MCR.def new file mode 100644 index 0000000..595cb09 --- /dev/null +++ b/Singularity_MCR.def @@ -0,0 +1 @@ +/annex/objects/MD5E-s16982--97fcbeaf066ad61012381ffe82b98551.def diff --git a/code/main b/code/main index cdb9e7a..c3c6189 100755 --- a/code/main +++ b/code/main @@ -1,18 +1,15 @@ #!/bin/bash -# Help +# Copy or view batch files +# Help if [ "$#" = 0 ] then echo "ERROR: No arguments passed." - cat /.singularity.d/runscript.help + exec ${STANDALONE}/cat_standalone.sh exit 1 fi -# Copy or view batch files - -STANDALONE="/opt/spm12/toolbox/cat12/standalone" - if [ "$1" = "copy" ] then if [ "$2" = "all" ] @@ -37,13 +34,12 @@ then cat ${STANDALONE}/"$2" exit 0 else - echo "ERROR: batch file $2 not found. Available batch files are:" + echo "ERROR: batch file '$2' not found. Available batch files are:" find ${STANDALONE} -name "*.m" -printf "%f\n" exit 1 fi fi # Run CAT - NOW=$(date +%s) -exec /code/cat_standalone.sh "$@" 2>&1 |tee cat_$NOW.log +exec ${STANDALONE}/cat_standalone.sh "$@" 2>&1 | tee cat_$NOW.log diff --git a/makefile b/makefile new file mode 100644 index 0000000..df73771 --- /dev/null +++ b/makefile @@ -0,0 +1,5 @@ +tests/data/MoAEpilot: + mkdir -p tests/data + curl -fL -o moae.zip https://www.fil.ion.ucl.ac.uk/spm/download/data/MoAEpilot/MoAEpilot.bids.zip + unzip -q moae.zip -d tests/data + rm -f moae.zip