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

apptainer triggers the warning "source: /.singularity.d/env/90-environment.sh:13:9: invalid var name" #6

Closed DininduSenanayake closed 2 months ago

DininduSenanayake commented 2 months ago

How to produce the warining

$ apptainer shell apsim-2024.05.7470.0.aimg 
source: /.singularity.d/env/90-environment.sh:13:9: invalid var name
Apptainer> 

This is likely to be a case due to following being under %environment and not and %arguments

%environment
    export YEAR.MONTH=2024.08
    export TAG=7572
    export VERSION=${YEAR.MONTH}.${TAG}.0

as /.singularity.d/env/90-environment.sh contains the environment variables

Apptainer> cat /.singularity.d/env/90-environment.sh

#!/bin/sh
# Copyright (c) Contributors to the Apptainer project, established as
#   Apptainer a Series of LF Projects LLC.
#   For website terms of use, trademark policy, privacy policy and other
#   project policies see https://lfprojects.org/policies
# Copyright (c) 2018-2021, Sylabs Inc. All rights reserved.
# This software is licensed under a 3-clause BSD license. Please consult
# https://github.com/apptainer/apptainer/blob/main/LICENSE.md regarding your
# rights to use or distribute this software.

# Custom environment shell code should follow

    export YEAR.MONTH=2024.05
    export TAG=7470
    export VERSION=${YEAR.MONTH}.${TAG}.0

    # Set the R environment variables if needed
    export R_LIBS_USER=/usr/local/lib/R/site-library
DininduSenanayake commented 2 months ago

This is fixed in https://github.com/DininduSenanayake/APSIM-eri-mahuika/commit/f810f61314803f466c6db2de6743be6c899592b0

$ module load Apptainer

$ apptainer shell apsim-2024.08.7572.0.aimg 
Apptainer>