diff --git a/.circleci/config.yml b/.circleci/config.yml index 49edb3d..58af617 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,20 +52,6 @@ build: &build jobs: - build_FSL: - environment: - VERSION_TAG: "TAG_FSL" - IMG_NAME: "qsirecon-fsl" - BUILD_FILE: "Dockerfile_FSLconda" - <<: *build - - build_FreeSurfer: - environment: - VERSION_TAG: "TAG_FREESURFER" - IMG_NAME: "qsirecon-freesurfer" - BUILD_FILE: "Dockerfile_FreeSurfer" - <<: *build - build_3Tissue: environment: VERSION_TAG: "TAG_3TISSUE" @@ -142,38 +128,16 @@ jobs: version: docker24 - run: - name: Build with FSL and push + name: Build and push no_output_timeout: 5h command: | if [[ -n "$CIRCLE_TAG" ]]; then source setup_build.sh - do_build build_fsl - docker login -u $DOCKER_USER -p $DOCKER_PASS + do_build + docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_TOKEN docker push pennlinc/qsirecon_build:$CIRCLE_TAG fi - build_nofsl: - environment: - TZ: "/usr/share/zoneinfo/America/New_York" - docker: - - image: cimg/base:2020.09 - working_directory: /tmp/src/qsirecon_build - steps: - - checkout - - setup_remote_docker: - version: docker24 - - - run: - name: Build without FSL and push - no_output_timeout: 5h - command: | - if [[ -n "$CIRCLE_TAG" ]]; then - source setup_build.sh - do_build no_fsl - docker login -u $DOCKER_USER -p $DOCKER_PASS - docker push pennlinc/qsirecon_build:${CIRCLE_TAG}-nofsl - fi - deployable: docker: - image: busybox:latest @@ -184,16 +148,6 @@ workflows: version: 2 build_test_deploy: jobs: - - build_FSL: - filters: - tags: - only: /.*/ - - - build_FreeSurfer: - filters: - tags: - only: /.*/ - - build_3Tissue: filters: tags: @@ -240,8 +194,6 @@ workflows: - deployable: requires: - - build_FSL - - build_FreeSurfer - build_3Tissue - build_MRtrix3 - build_DSIStudio @@ -260,10 +212,3 @@ workflows: filters: tags: only: /.*/ - - - build_nofsl: - requires: - - deployable - filters: - tags: - only: /.*/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 994a9fa..68cad0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,3 @@ -ARG TAG_FSL -ARG TAG_FREESURFER ARG TAG_ANTS ARG TAG_MRTRIX3 ARG TAG_3TISSUE @@ -9,13 +7,7 @@ ARG TAG_AFNI ARG TAG_TORTOISE ARG TAG_TORTOISECUDA -# TO include FSL set --build-arg FSL_BUILD=build_fsl -# To skip it set --build-arg FSL_BUILD=no_fsl -ARG FSL_BUILD - # COPY can't handle variables, so here we go -FROM pennlinc/qsirecon-fsl:${TAG_FSL} as build_fsl -FROM pennlinc/qsirecon-freesurfer:${TAG_FREESURFER} as build_freesurfer FROM pennlinc/qsirecon-ants:${TAG_ANTS} as build_ants FROM pennlinc/qsirecon-mrtrix3:${TAG_MRTRIX3} as build_mrtrix3 FROM pennlinc/qsirecon-3tissue:${TAG_3TISSUE} as build_3tissue @@ -27,26 +19,7 @@ FROM pennlinc/qsirecon-drbuddicuda:${TAG_TORTOISE} as build_tortoisecuda FROM pennlinc/atlaspack:0.1.0 as atlaspack FROM nvidia/cuda:11.1.1-runtime-ubuntu18.04 as ubuntu -# Make a dummy fsl image containing no FSL -FROM ubuntu as no_fsl -RUN mkdir -p /opt/conda/envs/fslqsirecon/bin \ - && touch /opt/conda/envs/fslqsirecon/bin/eddy_cuda10.2 - -FROM ${FSL_BUILD} as this-fsl - FROM ubuntu -## FSL -COPY --from=this-fsl /opt/conda/envs/fslqsirecon /opt/conda/envs/fslqsirecon -ENV FSLDIR="/opt/conda/envs/fslqsirecon" \ - FSLOUTPUTTYPE="NIFTI_GZ" \ - FSLMULTIFILEQUIT="TRUE" \ - FSLLOCKDIR="" \ - FSLMACHINELIST="" \ - FSLREMOTECALL="" \ - FSLGECUDAQ="cuda.q" \ - PATH="/opt/conda/envs/fslqsirecon/bin:$PATH" \ - FSL_DEPS="libquadmath0" \ - FSL_BUILD="${FSL_BUILD}" ## ANTs COPY --from=build_ants /opt/ants /opt/ants @@ -70,28 +43,6 @@ COPY --from=build_3tissue /opt/3Tissue /opt/3Tissue ENV PATH="$PATH:/opt/mrtrix3-latest/bin:/opt/3Tissue/bin" \ MRTRIX3_DEPS="bzip2 ca-certificates curl libpng16-16 libblas3 liblapack3" -## Freesurfer -COPY --from=build_freesurfer /opt/freesurfer /opt/freesurfer -# Simulate SetUpFreeSurfer.sh -ENV FSL_DIR="/opt/conda/envs/fslqsirecon" \ - OS="Linux" \ - FS_OVERRIDE=0 \ - FIX_VERTEX_AREA="" \ - FSF_OUTPUT_FORMAT="nii.gz" \ - FREESURFER_HOME="/opt/freesurfer" -ENV SUBJECTS_DIR="$FREESURFER_HOME/subjects" \ - FUNCTIONALS_DIR="$FREESURFER_HOME/sessions" \ - MNI_DIR="$FREESURFER_HOME/mni" \ - LOCAL_DIR="$FREESURFER_HOME/local" \ - MINC_BIN_DIR="$FREESURFER_HOME/mni/bin" \ - MINC_LIB_DIR="$FREESURFER_HOME/mni/lib" \ - MNI_DATAPATH="$FREESURFER_HOME/mni/data" -ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \ - MNI_PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \ - PATH="$FREESURFER_HOME/bin:$FSFAST_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH" \ - FREESURFER_DEPS="bc ca-certificates curl libgomp1 libxmu6 libxt6 tcsh perl" -RUN chmod a+rx /opt/freesurfer/bin/mri_synthseg /opt/freesurfer/bin/mri_synthstrip - ## AFNI COPY --from=build_afni /opt/afni-latest /opt/afni-latest ENV PATH="$PATH:/opt/afni-latest" \ @@ -106,7 +57,7 @@ COPY --from=build_tortoisecuda /src/TORTOISEV4/bin/*cuda /src/TORTOISEV4/bin/ ENV PATH="$PATH:/src/TORTOISEV4/bin" \ TORTOISE_DEPS="fftw3" - # Create a shared $HOME directory +# Create a shared $HOME directory RUN useradd -m -s /bin/bash -G users qsirecon WORKDIR /home/qsirecon diff --git a/Dockerfile_AFNI b/Dockerfile_AFNI index a11e11c..3c636f6 100644 --- a/Dockerfile_AFNI +++ b/Dockerfile_AFNI @@ -53,18 +53,4 @@ RUN apt-get update -qq \ --exclude "linux_openmp_64/meica.libs" \ # Keep only what we use \ && find /opt/afni-latest -type f -not \( \ - -name "3drefit" -or \ - -name "3dcalc" -or \ - -name "3dresample" -or \ - -name "3dFWHMx" -or \ - -name "3dAutobox" -or \ - -name "3dSkullStrip" -or \ - -name "3dAutomask" -or \ - -name "3dWarp" -or \ - -name "3dTcat" -or \ - -name "3dTstat" -or \ - -name "3dQwarp" -or \ - -name "3dSeg" -or \ - -name "3dZeropad" -or \ - -name "3dTsplit4D" -or \ - -name "3dvolreg" \) -delete + -name "3dAutomask" \) -delete diff --git a/Dockerfile_FSLconda b/Dockerfile_FSLconda deleted file mode 100644 index 28698d9..0000000 --- a/Dockerfile_FSLconda +++ /dev/null @@ -1,20 +0,0 @@ -FROM nvidia/cuda:11.2.2-devel-ubuntu18.04 -ARG TAG_ANTS - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - wget \ - bzip2 - -WORKDIR / -RUN echo "2024.02.06" -RUN curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba - -ENV MAMBA_ROOT_PREFIX="/opt/conda" \ -MAMBA_NO_LOW_SPEED_LIMIT=1 -COPY fsl.yml /tmp/fsl.yml -WORKDIR /tmp -RUN micromamba create -y -f /tmp/fsl.yml -RUN micromamba clean -y -a diff --git a/Dockerfile_FreeSurfer b/Dockerfile_FreeSurfer deleted file mode 100644 index 586c496..0000000 --- a/Dockerfile_FreeSurfer +++ /dev/null @@ -1,36 +0,0 @@ -FROM freesurfer/freesurfer:7.3.1 as freesurfer -FROM ubuntu:18.04 -ARG TAG_ANTS - -COPY --from=freesurfer \ - /usr/local/freesurfer/bin/mri_rigid_register \ - /opt/freesurfer/bin/mri_rigid_register - -COPY --from=freesurfer \ - /usr/local/freesurfer/bin/mri_robust_register \ - /opt/freesurfer/bin/mri_robust_register - -COPY --from=freesurfer \ - /usr/local/freesurfer/bin/mri_robust_template \ - /opt/freesurfer/bin/mri_robust_template - -COPY --from=freesurfer \ - /usr/local/freesurfer/bin/lta_convert \ - /opt/freesurfer/bin/lta_convert - -COPY --from=freesurfer \ - /usr/local/freesurfer/bin/lta_diff \ - /opt/freesurfer/bin/lta_diff - - -COPY --from=freesurfer \ - /usr/local/freesurfer/python/scripts/mri_synthseg \ - /opt/freesurfer/bin/mri_synthseg - -COPY --from=freesurfer \ - /usr/local/freesurfer/models \ - /opt/freesurfer/models - -COPY --from=freesurfer \ - /usr/local/freesurfer/python/scripts/mri_synthstrip \ - /opt/freesurfer/bin/mri_synthstrip diff --git a/fsl.yml b/fsl.yml deleted file mode 100644 index 323705c..0000000 --- a/fsl.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: fslqsirecon -channels: - - https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/ - - conda-forge -dependencies: - # From manifest.json for 6.0.7.9 - - fsl-bet2=2111.7 - - fsl-flirt=2111.2 - - fsl-fast4=2111.3 - - fsl-fugue=2201.4 - - fsl-mcflirt 2111.0 - - fsl-miscmaths=2203.2 - - fsl-mist=2111.5 - - fsl-topup=2203.2 - - fsl-eddy=2401.2 - - fsl-eddy_qc=v1.2.3 - - fsl-eddy-cuda-10.2=2401.2 \ No newline at end of file diff --git a/setup_build.sh b/setup_build.sh index 20134c1..d67e8c1 100644 --- a/setup_build.sh +++ b/setup_build.sh @@ -8,8 +8,6 @@ fi export BUILD_TAG # Versions of the components -export TAG_FSL=24.4.24 -export TAG_FREESURFER=23.3.0 export TAG_ANTS=24.4.24 export TAG_MRTRIX3=24.4.24 export TAG_3TISSUE=24.4.24 @@ -23,8 +21,6 @@ echo "Settings:" echo "----------" echo "" echo "BUILD_TAG=${BUILD_TAG}" -echo "TAG_FSL=${TAG_FSL}" -echo "TAG_FREESURFER=${TAG_FREESURFER}" echo "TAG_ANTS=${TAG_ANTS}" echo "TAG_MRTRIX3=${TAG_MRTRIX3}" echo "TAG_3TISSUE=${TAG_3TISSUE}" @@ -37,19 +33,12 @@ echo "TAG_TORTOISECUDA=${TAG_TORTOISECUDA}" do_build() { - INCLUDE_FSL=$1 - THIS_TAG=${BUILD_TAG} - if [ "${INCLUDE_FSL}" == "no_fsl" ]; then - THIS_TAG=${BUILD_TAG}-nofsl - fi DOCKER_BUILDKIT=1 \ BUILDKIT_PROGRESS=plain \ docker build -t \ pennlinc/qsirecon_build:${THIS_TAG} \ - --build-arg TAG_FSL=${TAG_FSL} \ - --build-arg TAG_FREESURFER=${TAG_FREESURFER} \ --build-arg TAG_ANTS=${TAG_ANTS} \ --build-arg TAG_MRTRIX3=${TAG_MRTRIX3} \ --build-arg TAG_3TISSUE=${TAG_3TISSUE} \ @@ -57,8 +46,7 @@ do_build() { --build-arg TAG_MICROMAMBA=${TAG_MICROMAMBA} \ --build-arg TAG_AFNI=${TAG_AFNI} \ --build-arg TAG_TORTOISE=${TAG_TORTOISE} \ - --build-arg TAG_TORTOISECUDA=${TAG_TORTOISECUDA} \ - --build-arg FSL_BUILD=${INCLUDE_FSL} \ + --build-arg TAG_TORTOISECUDA=${TAG_TORTOISECUDA} . }