Skip to content

Commit

Permalink
Apptainer: doc
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jun 17, 2024
1 parent 5c3a58c commit dcf97cf
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 6 deletions.
13 changes: 10 additions & 3 deletions doc/apptainer/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Install Fluidsim from source in a Apptainer container
# Install Fluidsim from source in an Apptainer container

The directory `fluidsim/doc/apptainer` contains what is needed to run Fluidsim with Apptainer.

## Build the image locally on a node

From the host:

```sh
mkdir ~/apptainer
cd ~/apptainer
wget https://foss.heptapod.net/fluiddyn/fluidsim/-/raw/topic/default/apptainer/doc/apptainer/image-fluidsim.def
apptainer build image-fluidsim.sif image-fluidsim.def
```

Expand All @@ -11,12 +18,12 @@ apptainer build image-fluidsim.sif image-fluidsim.def
From the host:

```sh
mkdir -p ~/apptainer_dir/home
cd ~/apptainer
apptainer shell --no-home image-fluidsim.sif
```

From the container:

```sh
export HOME=$HOME/apptainer_dir/home
...
```
32 changes: 32 additions & 0 deletions doc/apptainer/hgrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[ui]
# TODO: correct this line.
username=user_apptainer
editor=nano
# another alternative
# editor=emacs -nw -Q
tweakdefaults = True
ignore = ~/.hgignore

[alias]
lg = log -G
up = up -v

[extensions]
hgext.extdiff =
# only to use Mercurial with GitHub and Gitlab
hggit =
# specific extension for FluidDyn dev
hgfluiddyn =
# more advanced extensions (really useful for FluidDyn dev)
churn =
shelve =
rebase =
absorb =
evolve =
topic =

[extdiff]
cmd.meld =

# [subrepos]
# git:allowed = true
11 changes: 8 additions & 3 deletions doc/apptainer/image-fluidsim.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ From: python:3.11

%post
apt-get -y update
apt-get -y install mercurial git less meld
apt-get -y install mercurial git less meld nano

apt-get install -y --no-install-recommends \
libfftw3-dev libfftw3-mpi-dev openmpi-bin libhdf5-openmpi-dev libopenblas-dev
Expand All @@ -17,11 +17,16 @@ From: python:3.11
pipx install pdm
pipx install nox

wget https://foss.heptapod.net/fluiddyn/fluidsim/-/raw/topic/default/apptainer/doc/apptainer/hgrc -O ~/hgrc

%startscript
mkdir -p home

%environment
export LC_ALL=C
export PATH=/root/.local/bin:$PATH

# %runscript
export HOME=$HOME/apptainer/home
export HGRCPATH=/root/hgrc

%labels
Author Pierre Augier
9 changes: 9 additions & 0 deletions doc/build-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,15 @@ export MESONPY_EDITABLE_VERBOSE=1
See
https://meson-python.readthedocs.io/en/latest/how-to-guides/editable-installs.html#verbose-mode

## Installation with Apptainer

```{toctree}
---
maxdepth: 1
---
apptainer/README.md
```

[conda-forge]: https://conda-forge.org/
[evolve]: https://www.mercurial-scm.org/doc/evolution/
[mercurial]: https://www.mercurial-scm.org/
Expand Down

0 comments on commit dcf97cf

Please sign in to comment.