Skip to content

Commit

Permalink
Point to a firedrake image that works for us. Create a separate direc…
Browse files Browse the repository at this point in the history
…tory for Apptainer related files
  • Loading branch information
SouzaEM committed Dec 19, 2024
1 parent 6bf3fc7 commit d88976c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 39 deletions.
37 changes: 37 additions & 0 deletions apptainer/README.md
Original file line number Diff line number Diff line change
@@ -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
````
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
38 changes: 0 additions & 38 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit d88976c

Please sign in to comment.