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