Skip to main content

OGS Container Maker

Project description

OGS Container Maker

General usage

Installation

virtualenv ~/.venv/ogs-container-maker
source ~/.venv/ogs-container-maker/bin/activate
pip install --upgrade requests hpccm

Generate container definition

hpccm --recipe recipes/ogs-builder.py > Dockerfile
hpccm --recipe recipes/ogs-builder.py --format singularity > Singularity

# With user options, Use : instead of = in cmake_args!
hpccm --recipe recipes/ogs-builder.py --format singularity \
    --userarg ompi=2.1.3 cmake_args="-DOGS_BUILD_PROCESSES:GroundwaterFlow"

Build image

docker build -t ogs-ompi-2.1.3 -f Dockerfile .
sudo singularity build ogs-ompi-2.1.3.sif Singularity

Convert Docker image to Singularity image:

mkdir _out
docker run -v /var/run/docker.sock:/var/run/docker.sock \
    -v $PWD/_out:/output --privileged -t --rm \
    singularityware/docker2singularity ogs-ompi-2.1.3

Run

docker run --it --rm ogs-ompi-2.1.3
# in container:
ogs --version
singularity shell ogs-ompi-2.1.3.sif
# in container:
ogs --version
# OR directly run from host
singularity exec ogs-ompi-2.1.3.sif ogs local/path/to/square_1e0.prj

Using the combinatorial builder

Creates Docker definition files with different OpenMPI implementations and OpenGeoSys parallel configuration (from the current master), builds the docker images and converts them to Singularity images:

python build.py --ogs ufz/ogs@master --ompi 2.1.2 3.1.2 --build --convert

Check help for more options:

$ python build --help
usage: build.py [-h] [--recipe RECIPE] [--out OUT] [--print]
                [--format {docker,singularity} {docker,singularity}]
                [--pm [{system,conan} [{system,conan} ...]]]
                [--ompi [OMPI [OMPI ...]]] [--ogs [OGS [OGS ...]]]
                [--cmake_args [CMAKE_ARGS [CMAKE_ARGS ...]]] [--build]
                [--upload] [--convert] [--runtime-only]

Generate container image definitions.

optional arguments:
  -h, --help            show this help message and exit
  --recipe RECIPE       HPCCM recipe (default: recipes/ogs-builder.py)
  --out OUT             Output directory (default: _out)
  --print, -P           Print the definition to stdout (default: False)

Combinatorial options:
  All combinations of the given options will be generated

  --format {docker,singularity} {docker,singularity}
  --pm [{system,conan} [{system,conan} ...]]
                        Package manager to install third-party dependencies
                        (default: ['conan'])
  --ompi [OMPI [OMPI ...]]
                        OpenMPI version, e.g. 2.1.1, 2.1.5, 3.0.1, 3.1.2
                        (default: ['off'])
  --ogs [OGS [OGS ...]]
                        OGS GitHub repo in the form 'user/repo@branch' or
                        'off' to disable OGS building (default:
                        ['ufz/ogs@master'])
  --cmake_args [CMAKE_ARGS [CMAKE_ARGS ...]]
                        CMake argument sets have to be quoted and **must**
                        start with a space. e.g. --cmake_args ' -DFIRST=TRUE
                        -DFOO=BAR' ' -DSECOND=TRUE' (default: )

Image build options:
  --build, -B           Build the images from the definition files (default:
                        False)
  --upload, -U          Upload Docker image to registry (default: False)
  --convert, -C         Convert Docker image to Singularity image (default:
                        False)
  --runtime-only, -R    Generate multi-stage Dockerfiles for small runtime
                        images (default: False)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ogscm-0.0.2.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ogscm-0.0.2-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file ogscm-0.0.2.tar.gz.

File metadata

  • Download URL: ogscm-0.0.2.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for ogscm-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3c00a51de2c131f30126adca8d75d23492ff6c9aa94f6f93e807744609ecfe2e
MD5 08081af040404ec4f2748decdc95e517
BLAKE2b-256 f022e3127d2e93d118741ff0096e204c02a348d5b08deccf4cbfa35e851bdd52

See more details on using hashes here.

File details

Details for the file ogscm-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ogscm-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for ogscm-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3c21b626dc405084d0525aa63a80731196515e839319100df94837cba119f9e6
MD5 b1e77d91fc402152c3e543c3f7d6004a
BLAKE2b-256 3d7eeb3c0a76683a3223f19c1e43863f9499bf88a618c5a6dde3b24f4d98d736

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page