From d88976c902c3fc56939a02751d8ca545b6183e34 Mon Sep 17 00:00:00 2001 From: Eduardo Moscatelli de Souza <5752216+SouzaEM@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:31:33 -0300 Subject: [PATCH] Point to a firedrake image that works for us. Create a separate directory for Apptainer related files --- apptainer/README.md | 37 +++++++++++++++++++++++++++++++++++++ docker/Dockerfile | 2 +- docker/README.md | 38 -------------------------------------- 3 files changed, 38 insertions(+), 39 deletions(-) create mode 100644 apptainer/README.md diff --git a/apptainer/README.md b/apptainer/README.md new file mode 100644 index 00000000..deb535be --- /dev/null +++ b/apptainer/README.md @@ -0,0 +1,37 @@ +## Apptainer images + +Apptainer is a container platform designed to run complex applications on HPC clusters. The steps below were tested in Ubuntu 24.04.1 LTS. + +### Installing Apptainer + +Apptainer may be installed with the following instructions (there are issues with previous versions in Ubuntu 24): +```` +sudo apt update +sudo apt install -y wget +cd /tmp +wget https://github.com/apptainer/apptainer/releases/download/v1.3.6/apptainer_1.3.6_amd64.deb +sudo apt install -y ./apptainer_1.3.6_amd64.deb +```` + +### Building Apptainer images + +In spyro, the Apptainer image is based on the [Docker image](../docker/). Converting from Docker to Apptainer is more productive because Apptainer does not support image layers by design. Then, it is necessary to rerun all the instructions of the definition file when creating Apptainer images even when just one instruction is added for testing purposes. +```` +export IMAGE_ID=$(sudo docker images -q devtag:1.0) +sudo docker save $IMAGE_ID -o devimg.tar +sudo chown $USER:$USER devimg.tar +apptainer build devimg.sif docker-archive://devimg.tar +```` + +### Running Apptainer images + +To execute the image in interactive mode: +```` +apptainer shell --bind /tmp/cache-${USER}:/home/firedrake/firedrake/.cache -e devimg.sif +```` + +To execute the image in batch mode: +```` +mkdir /tmp/cache-${USER} +apptainer run --bind /tmp/cache-${USER}:/home/firedrake/firedrake/.cache -e devimg.sif ./workshop_script.sh +```` \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 6a51d3e0..1f14c1fd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM firedrakeproject/firedrake:2024-12 AS spyro_base +FROM firedrakeproject/firedrake:2024-09 AS spyro_base USER root RUN apt-get update \ diff --git a/docker/README.md b/docker/README.md index 1a89854f..384ac6b3 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,41 +1,3 @@ -## Apptainer images - -Apptainer is a container platform designed to run complex applications on HPC clusters. The steps below were tested in Ubuntu 24.04.1 LTS. - -### Installing Apptainer - -Apptainer may be installed with the following instructions (there are issues with previous versions in Ubuntu 24): -```` -sudo apt update -sudo apt install -y wget -cd /tmp -wget https://github.com/apptainer/apptainer/releases/download/v1.3.6/apptainer_1.3.6_amd64.deb -sudo apt install -y ./apptainer_1.3.6_amd64.deb -```` - -### Building Apptainer images - -In spyro, the Apptainer image is based on the Docker image built below. Converting from Docker to Apptainer is more productive because Apptainer does not support image layers by design. Then, it is necessary to rerun all the instructions of the definition file when creating Apptainer images even when just one instruction is added for testing purposes. -```` -export IMAGE_ID=$(sudo docker images -q devtag:1.0) -sudo docker save $IMAGE_ID -o devimg.tar -sudo chown $USER:$USER devimg.tar -apptainer build devimg.sif docker-archive://devimg.tar -```` - -### Running Apptainer images - -To execute the image in interactive mode: -```` -apptainer shell --bind /tmp/cache-${USER}:/home/firedrake/firedrake/.cache -e devimg.sif -```` - -To execute the image in batch mode: -```` -mkdir /tmp/cache-${USER} -apptainer run --bind /tmp/cache-${USER}:/home/firedrake/firedrake/.cache -e devimg.sif ./workshop_script.sh -```` - ## Docker images This directory presents a Dockerfile to provide images for release (user installation), and development/testing. The release image comes with the corresponding spyro version installed, while the development/testing image use the current spyro checkout. The latest spyro version is not installed in the development/testing image to avoid ambiguities during use.