Skip to content

Publish a SCHISM Docker image to run rompy-schism workspaces - #25

Open
rafa-guedes wants to merge 4 commits into
mainfrom
feature/schism-docker-image
Open

rafa-guedes wants to merge 4 commits into
mainfrom
feature/schism-docker-image

Conversation

@rafa-guedes

@rafa-guedes rafa-guedes commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Adds a Docker image to run SCHISM on rompy-schism workspaces, published as ghcr.io/rom-py/schism. It follows the SWAN and XBeach images (ghcr.io/rom-py/swan, ghcr.io/rom-py/xbeach), so users can run a generated model without compiling SCHISM.

The image

docker/Dockerfile builds SCHISM v5.13.0 from its release tarball, verified against the checksum in docker/releases.txt. It uses Ubuntu 24.04, Open MPI and NetCDF, and the compiler settings in docker/schism. The image contains:

Command What it does
schism Hydrodynamics (scribed I/O, out2d_*.nc)
schism_wwm Hydrodynamics coupled with WWM
combine_hotstart7 Merges the per-process hotstart files into one

The image is 390 MB. Running it looks like this:

DockerConfig(image="ghcr.io/rom-py/schism:5.13.0", executable="schism 2", mpiexec="mpirun", cpu=6)

It differs from the docker/schism build that the tests use in these ways:

  • It has no ParMETIS -static flags. They fail against Ubuntu's shared MPI and NetCDF.
  • WWM is built with a serial make. Its Fortran module dependencies are not ordered for -j.
  • SCHISM reports its release. A tarball has no git history, so it is given the version through src/Core/schism_version_user.txt (schism -v prints v5.13.0). Before, it printed develop.
  • It allows more MPI processes than cores (OMPI_MCA_rmaps_base_oversubscribe=1). Scribes mostly wait for output, so cpu=6 on a 4-core machine is normal; mpirun refuses it by default, and rompy's DockerConfig cannot pass --oversubscribe.
  • It contains one release, and it is published.

docker/schism is unchanged.

Testing and publishing

  • docker/test_image.py generates four workspaces from the test data and runs them in the image:
    • 2D tides;
    • 3D tides on the test vgrid.in;
    • tides with ERA5 and WWM driven by the WW3 test spectra;
    • a run writing hotstart files that combine_hotstart7 then merges.
  • SCHISM exits with status 0 even when it aborts, so a run passes only when mirror.out reports a completed run, fatal.error is empty and out2d_1.nc is NetCDF.
  • The hotstart case sets nhot = 1 directly in param.nml, because the Schout check of nhot fails on main. Write the vertical and vegetation parameters to &OPT, where SCHISM reads them #19 fixes that check.
  • .github/workflows/docker.yml builds each release in docker/releases.txt, runs the test, and publishes to ghcr.io/rom-py/schism, with latest on the last release. Pull requests only build and test. It is the rompy-swan workflow with SCHISM names.
  • Locally, all four cases pass with the image built from this branch.

After merging, the ghcr.io/rom-py/schism package has to be made public in the organisation's package settings.

WWM patch

The build applies docker/schism/patches/wwm-boundary-spectra-on-node.patch to the SCHISM source. WWM interpolates WAVEWATCH III boundary spectra to each wave boundary node from the two nearest spectra, weighted by 1/distance. A node exactly on a spectra point gets an infinite weight and no waves. That is common, because meshes often have boundary nodes on round coordinates, as do spectra from a regular grid. With the patch, such a node takes that point's spectrum. The same code is in SCHISM master, so this should also be reported upstream.

docker/Dockerfile builds a SCHISM release with MPI and NetCDF, as
schism (hydrodynamics) and schism_wwm (with WWM), plus combine_hotstart7
to merge the per-process hotstart files. It reuses the compiler settings
of docker/schism. docker/test_image.py runs 2D, 3D, WWM and hotstart
workspaces generated by rompy-schism in the image, checking SCHISM's log
since SCHISM exits with 0 when it aborts. The docker workflow builds each
release in docker/releases.txt, tests it, and publishes it to
ghcr.io/rom-py/schism; pull requests only build and test.
Scribes mostly wait for output, so runs often start more processes than
the machine has cores: 6 on a 4-core laptop for 4 compute processes and
2 scribes. mpirun refuses that by default, and rompy's DockerConfig has
no way to pass --oversubscribe, so the image sets
OMPI_MCA_rmaps_base_oversubscribe=1.
WWM interpolates WAVEWATCH III boundary spectra to each wave boundary
node from the two nearest spectra, weighted by 1/distance. A node
exactly on a spectra point gets an infinite weight and no waves, which
is common: meshes often have boundary nodes on round coordinates, as do
spectra from a regular grid. The patch makes such a node take that
point's spectrum. The same code is in SCHISM master.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants