nextsimhub / nextsimdg

neXtSIM_DG : next generation sea-ice model with DG
https://nextsim-dg.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
10 stars 13 forks source link

Docker ci build #507

Closed TomMelt closed 5 months ago

TomMelt commented 6 months ago

Nextsim CI **now with added Docker**

This PR mainly pertains to the ubuntu build of the code.

Previously the CI workflow built nextsim using a GitHub VM instance that would apt install basic dependencies required for the build process.

However, with the addition of xios (#496 ) this is no longer a tractable solution. Furthermore, it would take ~15 mins just to build xios before then going on to build nextsim.

Now I have created a Dockerfile and associated pre-built image (currently on my Dockerhub: tommelt/nextsimdg-dev-env:with-xios) which contains all the prerequisites to build and test the code for our typical CI workflow.

In theory it could also be repurposed by developers as a dev environment (although I personally don't love this).

more about the dockerfile

The Dockerfile is based on a spack environment file (spack.yaml) was generated originally using the following command:

spack containerize > Dockerfile

However, I needed to make some manual adjustments to the Dockerfile (necessary for installing xios and some other dependencies).

Dockerfiles/Dockerfile is the one that was used to generate the docker image tommelt/nextsimdg-dev-env:with-xios.

The image is 2.41GB and contains all prerequisites for MPI and XIOS. When uploaded to dockerhub (docker push tommelt/nextsimdg-dev-env:with-xios) it is compressed to 625.97 MB.

benefits of Docker in CI

Changes to the parallel (MPI) test naming convention

To Do: