Skip to content
Snippets Groups Projects
Commit 46049150 authored by Lars Bilke's avatar Lars Bilke
Browse files

[web] Updated container usage docs.

Thanks to M. Binder for reporting issues!
parent 42fb3ed5
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ weight = 1041
## <i class="far fa-exclamation-triangle"></i> General advice
If something goes wrong when running CMake please try again with an **empty** or newly created build-directory! This is very first thing you should try!
If something goes wrong when running CMake please try again with an **empty** or newly created build-directory! This is the very first thing you should try!
Please read the CMake output carefully. Often it will tell you what went wrong.
......
......@@ -18,11 +18,11 @@ weight = 10
### Get a container image
#### Download a release image
#### Option: Download a release image (preferred)
Simply download an image from the [releases]({{< ref "/releases" >}}) page.
#### Create custom image with ogs-container-maker
#### Option: Create custom image with ogs-container-maker
Build images with [ogs-container-maker](https://github.com/ufz/ogs-container-maker) on [Jenkins](https://jenkins.opengeosys.org/job/ufz/job/ogs-container-maker/job/master/build) (login required, ask Lars Bilke for access):
......@@ -33,36 +33,44 @@ It will build all combinations of `format`, `openmpi_versions` and `pm`. When th
### Run OGS inside a Container (called from outside)
```bash
singularity exec ogs-6.2.0-serial.sif ogs some/path/project.prj
singularity exec --app ogs ogs-6.2.2-serial.sif ogs some/path/project.prj
```
This starts the container, mounts your home directory inside the container, passes the current working directory and runs the ogs executable (which is in your home directory which is mounted inside the container) with the passed project file. Everything works as expected and is transparent to the user. When ogs finishes the container stops and you returns to the host system.
This starts the container, mounts your home directory inside the container, passes the current working directory and runs the ogs executable (in your home directory which is mounted inside the container) with the passed project file. Everything works as expected and is transparent to the user. When ogs finishes the container stops and you returns to the host system.
The `--app ogs` selects a pre-defined execution environment in the container (i.e. setting the `PATH` to `/scif/apps/ogs/bin` in which all the executables are located). You could also run without the `--app`-parameter but then you had to specify the full executable path in the container:
```bash
singularity exec ogs-6.2.2-serial.sif /scif/apps/ogs/bin/ogs ...
```
Running a benchmark:
```bash
# Create output directories
mkdir -p _out _out_mpi
# Run serial benchmark
singularity exec ogs-6.2.0-serial.sif ogs -o _out [ogs-sources]/Tests/Data/Mechanics/Linear/disc_with_hole.prj
singularity exec --app ogs ogs-6.2.2-serial.sif ogs -o _out [ogs-sources]/Tests/Data/Mechanics/Linear/disc_with_hole.prj
# Run serial benchmark with output validation (via vtkdiff)
singularity exec ogs-6.2.0-serial.sif ogs -o _out -r [ogs-sources]/Tests/Data/Mechanics/Linear [ogs-sources]/Tests/Data/Mechanics/Linear/disc_with_hole.prj
singularity exec --app ogs ogs-6.2.2-serial.sif ogs -o _out -r [ogs-sources]/Tests/Data/Mechanics/Linear [ogs-sources]/Tests/Data/Mechanics/Linear/disc_with_hole.prj
# Run parallel benchmark with MPI
mpirun -np 4 singularity exec ogs-6.2.0-openmpi-2.1.2.sif ogs -o _out_mpi [ogs-sources]/Tests/Data/Mechanics/Linear/disc_with_hole.prj
mpirun -np 4 singularity exec --app ogs ogs-6.2.2-openmpi-2.1.2.sif ogs -o _out_mpi [ogs-sources]/Tests/Data/Mechanics/Linear/disc_with_hole.prj
```
You can run other contained executables, e.g. `vtkdiff`:
You can run other contained executables as well, e.g. `vtkdiff`:
```bash
singularity exec ogs-6.2.0-serial.sif vtkdiff --help
singularity exec --app ogs ogs-6.2.2-serial.sif vtkdiff --help
```
You can interactively explore the container with `singularity shell` (you can see that you are **in** the container because of the `Singularity [container image file]:...>` prefix of the shell):
```bash
# Shell into container
singularity shell ogs-6.2.0-serial.sif
singularity shell ogs-6.2.2-serial.sif
# List files in the container
Singularity ogs-6.2.0-serial.sif:...> ls /usr/local/ogs/bin
Singularity ogs-6.2.2-serial.sif:...> ls /scif/apps/ogs/bin
... ogs tetgen vtkdiff
# Exit the container and get back to your hosts shell
Singularity ogs-6.2.0-serial.sif:...> exit
Singularity ogs-6.2.2-serial.sif:...> exit
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment