Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page contains a guide for building and using OpenIFS 48r1 at model version 48R1.1 in a linux based container using Docker.

...

Code Block
languagebash
themeMidnight
wget https://sites.ecmwf.int/openifs/openifs-data/scm/48r1/scm_openifs_48r1.1.tar.gz
tar -xzvf scm_openifs_48r1.1.tar.gz

Once OpenIFS 48r1 has been extracted to your <openifs-docker-build-dir> ,  then copy the Dockerfile from the release to <openifs-docker-build-dir> 

Code Block
languagebash
themeMidnight
cp  <openifs-docker-build-dir>/openifs-48r1.1/scripts/docker/gcc-docker-48r1.1/Dockerfile <openifs-docker-build-dir>/.

This cp step is important because the Dockerfile  and the OpenIFS release and SCM package, i.e., openifs-48r1 .1 and scm_openifs, need to be in the same directory to build the container.

...

Code Block
languagebash
themeMidnight
docker build --tag "openifs-48r1.1" . 

Note the trailing '.' to build in the current dir, which is required.

...

Once these repository packages and the python librarie are installed, open-mpi is downloaded and built. Then the openifs user is created and the openifs-48r1.1  directory is copied to the image.

...

Note
  • At the time of writing open-mpi is downloaded and built as part of the image creation. This is quite slow, so in the future we will investigate the use of a standard library
  • If a fresh build is required but an image has already been built, then execute the following command, which is the same as above but with no-cache
Code Block
languagebash
themeMidnight
docker build --no-cache --tag "openifs-48r1.1" .
  • The tag name does not need to be provided but it is useful for identifying images.

...

Code Block
languagebash
themeMidnight
docker images

REPOSITORY          TAG       IMAGE ID       CREATED       SIZE
openifs-48r1.1      latest    f72ea92f010f   5 hours ago   2.15GB

...

Code Block
languagebash
themeMidnight
docker run -it 'openifs-48r1.1'

This command will open an interactive session in the new container, in which the entry directory is the openifs-48r1 .1 directory, e.g.

Code Block
languagebash
themeMidnight
docker run -it 'openifs-48r1.1'

OpenIFS environment variables are:
------------------------------------------------------
OIFS_ARCH=./arch/ecmwf/hpc2020
OIFS_CYCLE=48r1
OIFS_DATA_DIR=/perm/openifs/oifs_data/48r1/48r1
OIFS_EXEC=/home/openifs/openifs-48r1.1/build/bin/ifsMASTER.DP
OIFS_EXPT=/home/openifs/openifs-expt
OIFS_HOME=/home/openifs/openifs-48r1.1
OIFS_LOGFILE=/home/openifs/openifs-48r1.1/oifs_test_log.txt
OIFS_RUN_SCRIPT=/home/openifs/openifs-48r1.1/scripts/exp_3d
OIFS_TEST=/home/openifs/openifs-48r1.1/scripts/build_test


SCM environment variables are:
------------------------------------------------------
SCM_EXEC=/home/openifs/openifs-48r1.1/build/bin/MASTER_scm.DP
SCM_LOGFILE=/home/openifs/openifs-expt/scm_openifs/48r1/scm-projects/ref48r1/scm_run_log.txt
SCM_PROJDIR=/home/openifs/openifs-expt/scm_openifs/48r1/scm-projects
SCM_RUNDIR=/home/openifs/openifs-expt/scm_openifs/48r1/scm-projects/ref48r1
SCM_TEST=/home/openifs/openifs-48r1.1/scripts/scm
SCM_VERSIONDIR=/home/openifs/openifs-expt/scm_openifs/48r1

openifs@d1bd89ccc47f:~/openifs-48r1.1$48r1$ ls
CHANGES  COPYING  NOTICE  arch        ifs-source  oifs-config.edit_me.sh  scripts
CITE     LICENSE  README  bundle.yml  ifs-test    openifs-bundle

...

Code Block
languagebash
themeMidnight
openifs@d1bd89ccc47f:~/openifs-48r1.1$48r1$ $OIFS_TEST/openifs-test.sh -cbt --arch=""

...

  1. List running containers

    Code Block
    languagebash
    themeMidnight
    $ docker ps
    
    CONTAINER ID   IMAGE            COMMAND   CREATED        STATUS         PORTS     NAMES
    d1bd89ccc47f   openifs-48r1.1   "bash"    15 hours ago   Up 5 seconds             beautiful_pasteur

     If no container is running on your system, then only CAPITAL headings are returned with docker ps 

  2. List all containers (running and exited)

    Code Block
    languagebash
    themeMidnight
    $ docker ps -a
    
    CONTAINER ID   IMAGE               COMMAND       CREATED        STATUS                     PORTS     NAMES
    d1bd89ccc47f   openifs-48r1.1      "bash"        15 hours ago   Exited (0) 4 seconds ago             beautiful_pasteur

    Notice that the STATUS  is Exited, rather than Up, as in (1)

...

Code Block
languagebash
themeMidnight
$ docker start -i <Container ID> 
# e.g. 
$ docker ps -a

CONTAINER ID   IMAGE               COMMAND       CREATED        STATUS                     PORTS     NAMES
d1bd89ccc47f   openifs-48r1.1      "bash"        15 hours ago   Exited (0) 4 seconds ago             beautiful_pasteur

$ docker start -i  d1bd89ccc47f

...