From 395fe6845576f92e16cf139badfd4e64e28a4696 Mon Sep 17 00:00:00 2001 From: Altan Orhon Date: Tue, 26 Dec 2023 17:38:48 -0800 Subject: [PATCH] Bundling Matlab MCR into base freesurfer image --- .github/workflows/apptainer-image.yml | 3 +- .../Singularity | 34 ------------------- .../Singularity | 9 ++++- 3 files changed, 9 insertions(+), 37 deletions(-) delete mode 100644 def/hyakvnc-freesurfer-matlab-ubuntu22.04/Singularity diff --git a/.github/workflows/apptainer-image.yml b/.github/workflows/apptainer-image.yml index a63d8e3..ce07713 100644 --- a/.github/workflows/apptainer-image.yml +++ b/.github/workflows/apptainer-image.yml @@ -130,12 +130,11 @@ jobs: - name: Build Container run: | set -euxo pipefail - export APPTAINER_CACHE_DIR="${SETUP_DOWNLOADS_DIR}/apptainer-cache" mkdir -p sif pushd "${DEF_DIR}" echo "Building \"${IMAGE_NAME}.sif\"" touch .build-arg-file - apptainer build --warn-unused-build-args --fix-perms --force --build-arg-file .build-arg-file ../../sif/"${IMAGE_NAME}.sif" Singularity || { echo "Failed to build \"${IMAGE_NAME}.sif\""; exit 1; } + apptainer build --warn-unused-build-args --disable-cache --fix-perms --force --build-arg-file .build-arg-file ../../sif/"${IMAGE_NAME}.sif" Singularity || { echo "Failed to build \"${IMAGE_NAME}.sif\""; exit 1; } echo "Built \"${IMAGE_NAME}.sif\"" popd - name: Login and Deploy Container diff --git a/def/hyakvnc-freesurfer-matlab-ubuntu22.04/Singularity b/def/hyakvnc-freesurfer-matlab-ubuntu22.04/Singularity deleted file mode 100644 index 4fe1652..0000000 --- a/def/hyakvnc-freesurfer-matlab-ubuntu22.04/Singularity +++ /dev/null @@ -1,34 +0,0 @@ -Bootstrap: {{BOOTSTRAP_SOURCE}} -From: {{BOOTSTRAP_FROM_REPO}}/{{BOOTSTRAP_FROM_IMAGE}}{{BOOTSTRAP_FROM_SUFFIX}} - -%arguments - BOOTSTRAP_SOURCE=localimage - BOOTSTRAP_FROM_REPO=../../sif - BOOTSTRAP_FROM_IMAGE=hyakvnc-freesurfer-ubuntu22.04 - BOOTSTRAP_FROM_SUFFIX=.sif - SETUP_DOWNLOADS_DIR=../../.setup-downloads - MCR_VERSION=R2014b - APT_CLEANUP=1 - -%help - This is an Apptainer container of Ubuntu 22.04 with Matlab runtimes installed on top of the hyakvnc-freesurfer-ubuntu22.04 container. - -%setup - [ -n "${APPTAINER_ROOTFS:-}" ] && ../../bin/write-apptainer-labels.sh > "${APPTAINER_ROOTFS}/.build_labels" - -%post - set -eux - export DEBIAN_FRONTEND=noninteractive - APT_CLEANUP="{{APT_CLEANUP}}" - - # Update the package list: - apt-get update -y -qq - - # Install MCR dependencies: - apt-get install -y libxt-dev libxext-dev libncurses5 - - # Install MCR: - fs_install_mcr "{{MCR_VERSION}}" - - # Clean up packages: - [ "${APT_CLEANUP:-0}" = 1 ] && apt-get clean -y -qq && rm -rf /var/lib/apt/lists/* diff --git a/def/hyakvnc-freesurfer-ubuntu22.04/Singularity b/def/hyakvnc-freesurfer-ubuntu22.04/Singularity index 1fdc686..214fb20 100644 --- a/def/hyakvnc-freesurfer-ubuntu22.04/Singularity +++ b/def/hyakvnc-freesurfer-ubuntu22.04/Singularity @@ -12,6 +12,7 @@ From: {{BOOTSTRAP_FROM_REPO}}/{{BOOTSTRAP_FROM_IMAGE}}{{BOOTSTRAP_FROM_SUFFIX}} SETUP_DOWNLOADS_DIR=../../.setup-downloads RECON_ALL_CLINICAL_HASH=ecdf46e RECON_ALL_CLINICAL_URL=https://raw.githubusercontent.com/freesurfer/freesurfer/{{RECON_ALL_CLINICAL_HASH}}/recon_all_clinical/recon-all-clinical.sh + MCR_VERSION=R2014b %help This is an Apptainer container of Ubuntu 22.04 with FreeSurfer installed. It is designed to be run on the Hyak cluster at the University of Washington with the hyakvnc script. @@ -53,6 +54,13 @@ This is an Apptainer container of Ubuntu 22.04 with FreeSurfer installed. It is "{{RECON_ALL_CLINICAL_URL}}" || { echo "warning: curl failed!" >&2; exit 1; } chmod a+x /usr/local/freesurfer/{{FREESURFER_VERSION}}/bin/recon-all-clinical.sh + if [[ -n "{{ MCR_VERSION }}" ]; then + # Install MCR dependencies: + apt-get install -y libxt-dev libxext-dev libncurses5 + + # Install MCR: + fs_install_mcr "{{MCR_VERSION}}" + fi # Clean up packages: apt-get clean -y -qq && apt-get -y autoremove && rm -rf /var/lib/apt/lists/* @@ -81,4 +89,3 @@ This is an Apptainer container of Ubuntu 22.04 with FreeSurfer installed. It is edu.uw.hyakvnc.container.resources.recommends.cpus 4 edu.uw.hyakvnc.container.resources.requires.cpus 1 edu.uw.hyakvnc.container.resources.suggests.gpus 1 -