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

add R base and tirdyr to Apptainer #1

Closed DininduSenanayake closed 2 months ago

DininduSenanayake commented 3 months ago

Creating the apsimx file requires tidyr . Since the Models executable is within the container itself, it is easier to include the required R-base and the R package within the container to avoid excessive external filesystem binding.

DininduSenanayake commented 3 months ago

This was introduced in https://github.com/DininduSenanayake/APSIM-eri-mahuika/commit/c049a1dfdada871

Ignore the LC locale warning for the moment. I will add this in https://github.com/DininduSenanayake/APSIM-eri-mahuika/issues/2

$ apptainer shell APSIM-2024.07.7558.0.aimg 
Apptainer> R

R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_COLLATE failed, using "C" 
3: Setting LC_TIME failed, using "C" 
4: Setting LC_MESSAGES failed, using "C" 
5: Setting LC_MONETARY failed, using "C" 
6: Setting LC_PAPER failed, using "C" 
7: Setting LC_MEASUREMENT failed, using "C" 
> library(tidyr)
> 
Ollehar commented 3 months ago

Creating the apsimx file requires tidyr . Since the Models executable is within the container itself, it is easier to include the required R-base and the R package within the container to avoid excessive external filesystem binding.

R base is tricky to remove if we want to use the current script, tidyr however, can be made redundant by changing line 4 (makes the code slightly less readable but identical in function)

DininduSenanayake commented 2 months ago

Dependencies are included in the new def file alongside the correct LOCALEs https://github.com/DininduSenanayake/APSIM-eri-mahuika/blob/main/1-apptainer-build/Apptainer.def