fairagro/M4.4_UC6_ARC

uc6_csmTools: Containerize

Closed this issue · 2 comments

Use some kind of reproducible container as environment

For the sake of reproducibility i added an optional devcontainer file which installs all requirements on container creation and compiles the DSSAT program. This can be done using install_dssat.sh.
For the system requirements there is also a install_requirements.sh - i dont know how this is handled in R usually but i think on linux all R packages come without their system requirements!?

There now also is a Dockerfile with documentation in README on how to use it.
fairagro/uc6_csmTools@bea7f7c

See lines:
https://github.com/fairagro/uc6_csmTools/blob/bea7f7c4f6ad1759b273378dcb27276d98a55887/README.md?plain=1#L19-L51

Installation

The package uses renv for package management. To install all required packages call

renv::restore()

from an R command prompt. Linux users may need to execute install_requirements.sh to install required apt packages. If you need to >install DSSAT there is a install_dssat.sh to clone and build the package on Linux. Windows Users can just use DSSATs installer.

Warning

Currently the pipeline does not work with the latest DSSAT Version 4.8.2.12 ...

To install the csmTools package exexute

remotes::install_local(".")

or

remotes::install_github("fairagro/uc6_csmTools")

in an R command prompt

If you use Visual Studio Code you can just load the Devcontainer to have an already set up development enviroment.

Test script

A test script allows to run the entire pipeline, from raw data to simulation output, on the example data.

Rscript inst/etl_pipeline_example.R 

You can also run the pipeline using Docker and the provided Dockerfile and later on copy files with docker cp.

docker build . -t uc6_image
docker run uc6_image --name uc6_container
docker start uc6_container
docker cp uc6_container:/uc6_csmTools/Rplots.pdf ./Rplots.pdf