-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# multi-stage build: builder | ||
# ========================== | ||
Bootstrap: docker | ||
From: ubuntu:focal | ||
Stage: builder | ||
|
||
%environment | ||
export MPLBACKEND=agg | ||
|
||
%post | ||
# prepare environment | ||
ln -snf /usr/share/zoneinfo/UTC /etc/localtime | ||
echo UTC > /etc/timezone | ||
apt update && apt -y full-upgrade | ||
apt install -y --no-install-recommends git ca-certificates gfortran python3 python3-pip | ||
|
||
# requires users to provide variable ${VER} | ||
git clone --branch v1.0 --recurse-submodules https://github.com/barbagroup/geoclaw-landspill.git | ||
|
||
# install dependencies | ||
cd /geoclaw-landspill && pip3 install -r requirements-build.txt | ||
|
||
# build binary wheel | ||
cd /geoclaw-landspill && python3 setup.py bdist_wheel --build-type RELEASE | ||
|
||
|
||
# multi-stage build: production | ||
# ============================= | ||
Bootstrap: docker | ||
From: ubuntu:focal | ||
Stage: production | ||
|
||
%labels | ||
Author Pi-Yueh Chuang ([email protected]) | ||
Version v1.0 | ||
|
||
# copy data from builder | ||
%files from builder | ||
/geoclaw-landspill/dist /root/dist | ||
/geoclaw-landspill/cases /root/cases | ||
|
||
%post | ||
# move example to a proper location | ||
mv /root/cases /opt/geoclaw-landspill-cases | ||
|
||
# create runtime environment | ||
ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone | ||
apt update && apt -y full-upgrade | ||
apt install -y --no-install-recommends libgfortran5 libgomp1 python3 python3-pip | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# install geoclaw-landspill | ||
echo $(find /root -name "*.whl") | ||
pip3 install $(find /root -name "*.whl") && rm -rf /root/* | ||
|
||
%runscript | ||
exec geoclaw-landspill $@ | ||
|
||
%help | ||
|
||
This help only covers the usage of this Singularity image. For the usage of | ||
geoclaw-landspill package, see https://github.com/barbagroup/geoclaw-landspill | ||
|
||
A Singularity image can be treated as an executable, which is equivalent to | ||
the executable `geoclaw-landspill` from geoclaw-landspill package. Assuming | ||
this Singularity image is called "landspill.sif", for example: | ||
|
||
* To run a simulation: `$ landspill.sif run <path to case>` | ||
* To create a NetCDF file: `$ landspill.sif createnc <path to case>` | ||
* To create quick depth plots: `$ landspill.sif plotdepth <path to case>` | ||
|
||
Alternatively, users can run these subcommands with, for example, | ||
|
||
* To run a simulation: `$ singularity run landspill.sif run <path to case>` | ||
* To create a NetCDF file: `$ singularity run landspill.sif createnc <path to case>` | ||
* To create quick depth plots: `$ singularity run landspill.sif plotdepth <path to case>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,5 @@ | |
from . import data | ||
|
||
# meta | ||
__version__ = "1.0.dev4" | ||
__version__ = "1.0" | ||
__author__ = "Pi-Yueh Chuang <[email protected]>" |