...
...
While this page focuses on the containerised installation, the details presented can be used as a recipe for the underlying dependencies required to install and run OpenIFS 48r1 on a linux system.
Note |
---|
If you have access to ATOS hpc2020 and are planning to run OpenIFS on that system please refer to OpenIFS 48r1 - Getting Started (ATOS hpc2020). |
Contents:
Table of Contents |
---|
Creation of a docker build directory
...
...
language | bash |
---|---|
theme | Midnight |
...
...
Note |
---|
|
Once OpenIFS 48r1 has been extracted to your <openifs-docker-build-dir>
, then copy the Dockerfile
from the release to <openifs-docker-build-dir>
...
...
...
...
...
...
...
...
...
...
...
This cp
step is important because the Dockerfile
and the OpenIFS release, i.e., openifs-48r1.1
, need to be in the same directory to build the container (see the openifs-48r1.1/scripts/docker/gcc-docker-48r1.1/Dockerfile
)
Build the OpenIFS docker image
The following command builds the docker image
Code Block | ||||
---|---|---|---|---|
| ||||
docker build --tag "openifs-48r1.1" . |
Note the trailing '.' to build in the current dir, which is required.
...
...
...
...
...
...
...
Once these packages are installed, open-mpi
is downloaded and built, the openifs
user is created and the openifs-48r1.1
directory is copied to the image.
On a Macbook pro (M1) the initial build of the container, takes about 5 minutes. If you decide to change the Dockerfile
following a build, you can just execute the same command and, depending on what you change, subsequent builds can be a lot quicker.
Note | |||||||
---|---|---|---|---|---|---|---|
|
Running OpenIFS-test using the docker image
Once a build has completed, the image can be checked by typing docker images
, e.g.,
Code Block | ||||
---|---|---|---|---|
| ||||
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
openifs-48r1.1 latest f72ea92f010f 5 hours ago 2.15GB |
And the container can be run using the following
Code Block | ||||
---|---|---|---|---|
| ||||
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 | ||||
---|---|---|---|---|
| ||||
docker run -it 'openifs-48r1.1'
OpenIFS environment variables are:
------------------------------------------------------
OIFS_CYCLE=48r1
OIFS_DATA_DIR=/perm/openifs/oifs_data/48r1/48r1
OIFS_HOME=/home/openifs/openifs-48r1.1
OIFS_LOGFILE=/home/openifs/openifs-48r1.1/oifs_test_log.txt
openifs@d1bd89ccc47f:~/openifs-48r1.1$ ls
CHANGES COPYING NOTICE arch ifs-source oifs-config.edit_me.sh scripts
CITE LICENSE README bundle.yml ifs-test openifs-bundle |
Note |
---|
|
...
...
openifs@d1bd89ccc47f:~/openifs-48r1.1$ ./scripts/openifs-test.sh -cbt -s docker
where :
-c
will clean the directory (not necessary for a fresh image or new container)
-b
will configure the bundle and build OpenIFS, i.e.,
- the OpenIFS double and single precision master executables (ifsMASTER.DP and ifsMASTER.SP, respectively) , which are used to run 3-D OpenIFS. The executables are located in
$OIFS_HOME/build/bin
. - the double and single precision Single Column Model (SCM) executables (MASTER_scm.DP and MASTER_scm.SP, respectively), which are used to run the SCM derived from OpenIFS. The executables are located in
$OIFS_HOME/build/bin
.
-t will run the ifs-test
- 21 3-D OpenIFS forecast-only tests with and without chemistry
- 1 SCM test (based on TWP-ICE)
-s docker
defines the system as docker, which makes the script use the correct build commands
On a Macbook pro (M1) the build of OpenIFS, takes about 10 minutes, while successful completion of ifstest takes just over 3 minutes.
...
...
...
...
...
...
...
...
This will restart the container but it is important to note that there will be no data or changes retained from when the container has been used in the past.
Exiting the container
- The container can be exited by typing
exit
from the active container. - A container can be stopped from a terminal on the host system
- Once exited all data and changes made within the container will be lost. Hence, if necessary, it is important to
- Push any code changes back to a repo
- If data is required either set-up a data volume or copy the data back to a local machine, using
docker cp
...