Skip to content
Snippets Groups Projects
Commit 1dfe00b9 authored by Michael Blaschek's avatar Michael Blaschek :bicyclist:
Browse files

WRF bug fixes again

parent 8d6ac902
Branches
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ sandbox: ...@@ -7,6 +7,7 @@ sandbox:
@if [ ! -d ./sandbox.wrf.dev ]; then\ @if [ ! -d ./sandbox.wrf.dev ]; then\
echo Building the WRF sandbox;\ echo Building the WRF sandbox;\
make -C ../.. alma8.base;\ make -C ../.. alma8.base;\
ln -fs ../../containers/alma8.base.sif .;\
sudo singularity build --sandbox sandbox.wrf.dev Singularity.sandbox.dev;\ sudo singularity build --sandbox sandbox.wrf.dev Singularity.sandbox.dev;\
fi fi
@[ -d ./sandbox.wrf.dev ] && echo Exists: WRF Sandbox || true @[ -d ./sandbox.wrf.dev ] && echo Exists: WRF Sandbox || true
...@@ -16,7 +17,7 @@ wrf.dev: ...@@ -16,7 +17,7 @@ wrf.dev:
@if [ ! -f ./wrf.dev.sif ]; then\ @if [ ! -f ./wrf.dev.sif ]; then\
echo Building the WRF dev;\ echo Building the WRF dev;\
make -C ../.. alma8.base;\ make -C ../.. alma8.base;\
ln -s ../../containers/alma8.base.sif .;\ ln -fs ../../containers/alma8.base.sif .;\
sudo singularity build wrf.dev.sif Singularity.dev;\ sudo singularity build wrf.dev.sif Singularity.dev;\
fi fi
@[ -f ./wrf.dev.sif ] && echo Exists: WRF dev || true @[ -f ./wrf.dev.sif ] && echo Exists: WRF dev || true
......
...@@ -9,28 +9,32 @@ baseimage AlmaLinux8 ...@@ -9,28 +9,32 @@ baseimage AlmaLinux8
%apprun downloadwrf %apprun downloadwrf
WRF_VERSION=4.4.1 WRF_VERSION=4.4.1
if [ $# -ne 0 ]; then if [ $# -ne 0 ]; then
WRF_VERSION=1 WRF_VERSION=$1
fi fi
echo "[WRF.dev] Downloading WRF $WRF_VERSION from github:" echo "[WRF.dev] Downloading WRF $WRF_VERSION from github:"
curl -SL -o WRF-${WRF_VERSION}.tar.gz https://github.com/wrf-model/WRF/releases/download/v${WRF_VERSION}/v${WRF_VERSION}.tar.gz curl -SL -o WRF-${WRF_VERSION}.tar.gz https://github.com/wrf-model/WRF/releases/download/v${WRF_VERSION}/v${WRF_VERSION}.tar.gz
%apphelp downloadwrf %apphelp downloadwrf
This will download the WRF source code from GitHub. Use the Version as a commandline argument. [WRF] APP: downloadwrf
curl -SL -o WRF-{WRF_VERSION}.tar.gz https://github.com/wrf-model/WRF/releases/download/v{WRF_VERSION}/v{WRF_VERSION}.tar.gz [WRF] This will download the WRF source code from GitHub. The version can be specified by an argument.
[WRF] run: singularity run --app downloadwrf 4.4.1
[WRF] curl -SL -o WRF-{WRF_VERSION}.tar.gz https://github.com/wrf-model/WRF/releases/download/v{WRF_VERSION}/v{WRF_VERSION}.tar.gz
[WRF]
%apprun downloadwps %apprun downloadwps
WPS_VERSION=4.4 WPS_VERSION=4.4
if [ $# -ne 0 ]; then if [ $# -ne 0 ]; then
WPS_VERSION=1 WPS_VERSION=$1
fi fi
echo "[WRF.dev] Downloading WPS $WPS_VERSION from github:" echo "[WRF.dev] Downloading WPS $WPS_VERSION from github:"
curl -SL -o WPS-${WPS_VERSION}.tar.gz https://github.com/wrf-model/WPS/archive/refs/tags/v${WPS_VERSION}.tar.gz curl -SL -o WPS-${WPS_VERSION}.tar.gz https://github.com/wrf-model/WPS/archive/refs/tags/v${WPS_VERSION}.tar.gz
%apphelp downloadwps %apphelp downloadwps
This will download the WPS source code from GitHub. Use the Version as a commandline argument. [WRF] APP: downloadwps
curl -SL -o WPS-{WPS_VERSION}.tar.gz https://github.com/wrf-model/WPS/archive/refs/tags/v{WPS_VERSION}.tar.gz [WRF] This will download the WPS source code from GitHub. The version can be specified by an argument.
[WRF] run: singularity run --app downloadwps 4.4
[WRF] curl -SL -o WPS-{WPS_VERSION}.tar.gz https://github.com/wrf-model/WPS/archive/refs/tags/v{WPS_VERSION}.tar.gz
[WRF]
%post %post
# Every line will be a layer in the container # Every line will be a layer in the container
...@@ -56,7 +60,7 @@ yum update -y \ ...@@ -56,7 +60,7 @@ yum update -y \
libxml2 libxml2-devel perl-XML-LibXML ImageMagick \ libxml2 libxml2-devel perl-XML-LibXML ImageMagick \
python3 python3-pip python3-devel \ python3 python3-pip python3-devel \
tar bash tcsh time which zlib zlib-devel \ tar bash tcsh time which zlib zlib-devel \
git scl \ git \
gnupg2 \ gnupg2 \
hostname \ hostname \
iproute \ iproute \
...@@ -84,7 +88,6 @@ CNAME=wrf.dev ...@@ -84,7 +88,6 @@ CNAME=wrf.dev
echo "export PS1=\"[IMGW-$CNAME]\w\$ \"" >> /.singularity.d/env/99-zz-custom-env.sh echo "export PS1=\"[IMGW-$CNAME]\w\$ \"" >> /.singularity.d/env/99-zz-custom-env.sh
# not sure why that does not happen as default # not sure why that does not happen as default
echo "export PKG_CONFIG_PATH=/usr/lib64/openmpi/lib/pkgconfig/" >> $SINGULARITY_ENVIRONMENT echo "export PKG_CONFIG_PATH=/usr/lib64/openmpi/lib/pkgconfig/" >> $SINGULARITY_ENVIRONMENT
# add App informaiton to runscript
%environment %environment
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:/usr/lib64:/lib64:/lib export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:/usr/lib64:/lib64:/lib
......
Bootstrap: localimage Bootstrap: localimage
From: ../../containers/alma8.base.sif From: alma8.base.sif
%labels %labels
maintainer IT-IMGW <it.img-wien@univie.ac.at> maintainer IT-IMGW <it.img-wien@univie.ac.at>
......
...@@ -23,9 +23,9 @@ JASPERINC=/usr/include/jasper/ ...@@ -23,9 +23,9 @@ JASPERINC=/usr/include/jasper/
JASPERLIB=/usr/lib64/ JASPERLIB=/usr/lib64/
NETCDF=/usr/lib64/openmpi/ NETCDF=/usr/lib64/openmpi/
mkdir -vp /wrf/WRF /wrf/WPS mkdir -vp /wrf/WRF /wrf/WPS \
cat /wrf/WRF*.tar.gz | tar --no-same-owner --strip-components=1 -zxC /wrf/WRF && cat /wrf/WRF*.tar.gz | tar --no-same-owner --strip-components=1 -zxC /wrf/WRF \
cat /wrf/WPS*.tar.gz | tar --no-same-owner --strip-components=1 -zxC /wrf/WPS && cat /wrf/WPS*.tar.gz | tar --no-same-owner --strip-components=1 -zxC /wrf/WPS
# Build WRF with Option 34 and 1 # Build WRF with Option 34 and 1
cd /wrf/WRF \ cd /wrf/WRF \
...@@ -74,8 +74,8 @@ Stage: final ...@@ -74,8 +74,8 @@ Stage: final
%post %post
# compress # compress
gzip -f /wrf/*.log gzip -f /wrf/*.log
# remove src tree (is insidie sandbox) # remove src tree (is inside sandbox)
rm -rf /wrf/WRF /wrf/WPS # rm -rf /wrf/WRF /wrf/WPS
# Strip the binaries to reduce the size of the image # Strip the binaries to reduce the size of the image
find -L /wrf/* -type f -exec readlink -f '{}' \; | \ find -L /wrf/* -type f -exec readlink -f '{}' \; | \
xargs file -i | \ xargs file -i | \
......
...@@ -18,13 +18,18 @@ if [ $# -gt 0 ]; then ...@@ -18,13 +18,18 @@ if [ $# -gt 0 ]; then
exec "$@" exec "$@"
echo "[WRF] Finished inside the container." echo "[WRF] Finished inside the container."
else else
# Look for apps?
if [ -d /scif/apps ]; then
echo "[WRF] Available Apps: $(ls /scif/apps)"
echo "[WRF] run: singularity run-help --app [] $SINGULARITY_NAME"
fi
# interactive # interactive
echo "[WRF] Welcome inside an IMGW container!"
echo "[WRF] Get help: singularity run-help $SINGULARITY_NAME" echo "[WRF] Get help: singularity run-help $SINGULARITY_NAME"
echo "[WRF] $WRF_VERSION, $WRF_BUILD_TARGET" echo "[WRF] $WRF_VERSION, $WRF_BUILD_TARGET"
echo "[WRF] $WRF_BUILD_TARGET -> /wrf/run" echo "[WRF] $WRF_BUILD_TARGET -> /wrf/run"
echo "[WRF] exe -> /wrf/bin" echo "[WRF] exe -> /wrf/bin"
echo "[WRF] Automatic copy of /wrf/run to current directory: ./$(basename $SINGULARITY_CONTAINER) init" echo "[WRF] Automatic copy of /wrf/run to current directory: ./$SINGULARITY_NAME init"
echo "[WRF] e.g. run real.exe from outside: ./$(basename $SINGULARITY_CONTAINER) real.exe" echo "[WRF] e.g. run real.exe from outside: ./$SINGULARITY_NAME real.exe"
echo "[WRF][INSIDE] Welcome inside an IMGW container!"
exec /.singularity.d/actions/shell "$@" exec /.singularity.d/actions/shell "$@"
fi fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment