Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Aug 1, 2024
1 parent a8c7ddb commit 9291271
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 40 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 1 addition & 28 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.simg

tests/data/raw
tests/data/MoAEpilot
84 changes: 84 additions & 0 deletions Dockerfile_1
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 0 additions & 1 deletion Singularity.def

This file was deleted.

1 change: 1 addition & 0 deletions Singularity.def
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/annex/objects/MD5E-s6255--ac5590f5bdfc1188a9692c0eea2b36e5.def
1 change: 0 additions & 1 deletion Singularity_MCR.def

This file was deleted.

1 change: 1 addition & 0 deletions Singularity_MCR.def
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/annex/objects/MD5E-s16982--97fcbeaf066ad61012381ffe82b98551.def
14 changes: 5 additions & 9 deletions code/main
Original file line number Diff line number Diff line change
@@ -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" ]
Expand 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
5 changes: 5 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9291271

Please sign in to comment.