nesi / APSIM-HPC

Deploy APSIM (Agricultural Production Systems sIMulator - https://www.apsim.info/) on high performance computing clusters.
https://nesi.github.io/APSIM-HPC/
MIT License
0 stars 0 forks source link

Run a version verification after the container build with `Models` command #11

Closed DininduSenanayake closed 2 months ago

DininduSenanayake commented 2 months ago

Once the container image was built, it will be ideal to verify at the end by running $ apptainer exec apsim-2024.08.7572.0.aimg Models command and match the version printed in APSIM 2024.8.7572.0 with the value assigned to VERSION=${YEAR.MONTH}.${TAG}.0

This is can be incorporated to the same slurm script which build the container image as a post-build step

DininduSenanayake commented 2 months ago

We should be able to extract the version from Models command with

# Verify the built version
BUILT_VERSION=$(apptainer exec ${IMAGE_PATH}/apsim-${APSIM_VERSION}.aimg Models | grep APSIM | awk -F'[ ©]' '{print $2}')

Appears to be working

$ BUILT_VERSION=$(apptainer exec apsim-2024.08.7572.0.aimg Models | grep APSIM | awk -F'[ ©]' '{print $2}')

$ echo $BUILT_VERSION 
2024.8.7572.0
DininduSenanayake commented 2 months ago

Close once https://github.com/DininduSenanayake/APSIM-eri-mahuika/pull/22 is merged