Giter Club home page Giter Club logo

containers's Introduction

Container definition files

These files define containers useful for RTE+RRTMGP and other projects.

At present these mostly define minimal Docker containers providing stable environments for continuous integration.They may be built without a context, e.g.

docker build - < Dockerfile-nvidia-netcdf-minimal

Docker

We start with images that are effectively Ubuntu OS base images, then add FORTRAN compiler dependencies for Intel and Nvidia -- ifort and nvfortran, respectively. These are separate images, and we use them as bases for the netCDF library installation. Finally, we add the Python libraries necessary for RTE-RRTMGP continuous integration, then push the images to a publicly available repository on DockerHub. We use tags to indicate which compiler is used in the resulting images.

For the ifort image:

docker build . -t minimal-compiler:ifort -f Dockerfile-ifort-minimal
docker build . -t add-netcdf:ifort -f Dockerfile-add-netcdf --build-arg COMPILER=ifort
docker build . -t add-python:ifort -f Dockerfile-add-python --build-arg COMPILER=ifort
docker build . -t rte-rrtmgp-ci:ifort -f Dockerfile-finalize --build-arg COMPILER=ifort
docker tag rte-rrtmgp-ci:ifort earthsystemradiation/rte-rrtmgp-ci:ifort
docker push earthsystemradiation/rte-rrtmgp-ci:ifort

And for nvfortran:

docker build . -t minimal-compiler:nvfortran -f Dockerfile-nvfortran-minimal # authentication error for some reason
docker pull nvcr.io/nvidia/nvhpc:21.1-devel-cuda11.2-ubuntu20.04 # worked fine
docker build . -t minimal-compiler:nvfortran -f Dockerfile-nvfortran-minimal
docker build . -t add-netcdf:nvfortran -f Dockerfile-add-netcdf --build-arg COMPILER=nvfortran
docker build . -t add-python:nvfortran -f Dockerfile-add-python --build-arg COMPILER=nvfortran
docker build . -t rte-rrtmgp-ci:nvfortran -f Dockerfile-finalize --build-arg COMPILER=nvfortran
docker tag rte-rrtmgp-ci:nvfortran earthsystemradiation/rte-rrtmgp-ci:nvfortran
docker push earthsystemradiation/rte-rrtmgp-ci:nvfortran

To elaborate on the common steps in these processes:

  1. Build local starter image: using direction from a compiler-dependent Dockerfile (-f Dockerfile-*-minimal) in the current working directory (build .), build an image with the OS and compiler requirements, then tag it as -t minimal-compiler:$COMPILER ($COMPILER either ifort or nvfortran).
  2. Build local netCDF image: using direction from Dockerfile-add-netcdf in the current working directory (build .), build an image on top of the starter, then tag it as -t add-netcdf:$COMPILER ($COMPILER either ifort or nvfortran).
  3. Build Python image: using direction from Dockerfile-add-python in the current working directory (build .), build an image on top of the netCDF image, then tag it as -t add-python:$COMPILER ($COMPILER either ifort or nvfortran).
  4. Build final CI image: using direction from Dockerfile-finalize in the current working directory (build .), build an image on top of the Python image that will be used in RTE+RRTMGP Continuous Integration (CI), then tag it as -t rte-rrtmgp-ci:$COMPILER ($COMPILER either ifort or nvfortran).
  5. Tag for and push to public repository: tag the local images from Step 3 with their counterparts in the earthsystemradion DockerHub repository, again separating by compiler, then push to the repository

Local builds can be bypassed by replacing local image names in the build with the DockerHub repository names, e.g.:

docker build . -t earthsystemradiation/rte-rrtmgp-ci:ifort -f Dockerfile-add-python --build-arg COMPILER=ifort

Since rte-rrtmgp-ci is dependent on the starter and netCDF images, there is likely no reason to push either to DockerHub. The local names of these two images are used in Dockerfile-add-netcdf and Dockerfile-add-python.

Docker Compose

Alternatively, users can use docker-compose to build the images and run the containers. Docker Compose reads build and run parameters from a YAML file. For RTE-RRTMGP Continuous Integration, rte-rrtmgp-ci.yml is the configuration file with the "service stack." Images can be built with:

docker-compose -f rte-rrtmgp-ci.yml build

The previous command will build all images. For specific images, users can provide their service name after the build option. Currently, the services correspond to the builds that were done separately with each docker build command and are named:

  1. min-ifort
  2. min-nvfortran
  3. nc-ifort
  4. nc-nvfortran
  5. py-ifort
  6. py-nvfortran
  7. ci-ifort
  8. ci-nvfortran

Note that images 3-8 depend on previous services, but Docker Compose only has a depends_on option for running the services (i.e., running the container) so one either has to build the images at the beginning of the chain or already have them in their local image repository.

Again, docker-compose can be used to run services as well, but the service stack will need more additions before anything of substance can be performed.

containers's People

Contributors

dependabot[bot] avatar pernak18 avatar robertpincus avatar skosukhin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.