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.3.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ogscm-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 3f5ed8759fa5a3c0defbf26f0c1384375d6ee045d44b68a4973b66c1186b354a
MD5 a6dd9e3671b03e1c6d092757a9deda24
BLAKE2b-256 d9cf9753654912c794d34e91ac7055604257f5ae130b3a3da9917683a0a55a43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ogscm-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1f440af7a9eff96d40b1eac0c7fe1af952bcafac42e61ac337934e3e51463f4c
MD5 82f4911001bcfe5d8a52ce1e5c6654f1
BLAKE2b-256 cda1738314dcfc15569aaf07d9df49d6c3634d39f40f3ccf784c9f37a03276ba

See more details on using hashes here.

Supported by

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