EcoExtreML / STEMMUS_SCOPE

Integrated code of SCOPE and STEMMUS
https://EcoExtreML.github.io/STEMMUS_SCOPE
GNU General Public License v3.0
15 stars 6 forks source link

Documentation on how to " Run the model with Docker" #267

Open yijianzeng opened 1 month ago

yijianzeng commented 1 month ago

@SarahAlidoost Dear Sarah, I was trying to use the workflow you developed to 'Run the model with Docker'. What i managed so far is the following:

PS C:\Users\yijian> docker pull ghcr.io/ecoextreml/stemmus_scope:latest
>> pwd
latest: Pulling from ecoextreml/stemmus_scope
4dac9f5215e8: Download complete
4f4fb700ef54: Download complete
511858ed31b9: Download complete
0b2fdd2bb55b: Download complete
5e822b74ebaa: Download complete
bd43c4e1840b: Download complete
113c6ad47548: Download complete
Digest: sha256:8ea0d981c783f9e04a6ad8fccb4a0964a95ddc07f29f3f7a7ed95bc1f415b176
Status: Downloaded newer image for ghcr.io/ecoextreml/stemmus_scope:latest
ghcr.io/ecoextreml/stemmus_scope:latest

Path
----
C:\Users\yijian

And then this is exactly where i start to have no clues to continue ... ...

yijianzeng commented 1 month ago

@SarahAlidoost Perhaps to be a bit more specific, see below the error message

C:\Users\yijian>docker run -v C:\Users\yijian\STEMMUS_SCOPE\input -v C:\Users\yijian\STEMMUS_SCOPE\output -it ghcr.io/ecoextreml/stemmus_scope:latest

Finished command. Select BMI mode: initialize "C:\Users\yijian\STEMMUS_SCOPE\AR-SLu_2024-01-25-0911_config.txt"
Reading config from C:\Users\yijian\STEMMUS_SCOPE\AR-SLu_2024-01-25-0911_config.txt
Error using textscan
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in io.read_config (line 4)

Error in STEMMUS_SCOPE (line 42)

Error in run (line 91)

Error in STEMMUS_SCOPE_exe (line 54)

MATLAB:FileIO:InvalidFid

Most probably the configuration file in the example run should not be used by Docker version, since the soil property, plumber2 etc. are not uploaded to the zenodo, but simply saved to mat file?

BSchilperoort commented 1 month ago

Hi Yijian, you're getting an error here because the config file is not in one of the mounted directories. STEMMUS_SCOPE cannot find the file.

Also, you did not use the correct syntax for a bind mount.

This might work:

docker run -v C:\Users\yijian\STEMMUS_SCOPE:C:\Users\yijian\STEMMUS_SCOPE -it ghcr.io/ecoextreml/stemmus_scope:latest

but I am not sure about how the Windows paths work with the mounting syntax (: and \ characters...).

yijianzeng commented 1 month ago

Thanks a lot, Bart, we will try under Linux system then.

The main reason for trying it out at Windows is a trial to have a wider user audience, most of the students are still not familier with terminal and the linux system in general. :-)

BSchilperoort commented 1 month ago

Thanks a lot, Bart, we will try under Linux system then.

Windows should work as well, but I am just not sure about the syntax, perhaps ' or " characters are needed.

yijianzeng commented 1 month ago

Hi Bart, the Zenodo example dataset does not include the 'Soil Property' folder and 'PLUMBER2' folder, instead, only one site "AR-SLu" data is used here as an example. It is to note that the soil property data is included in the 'soil_parameters.mat', and the meto forcing form 'AR_Slu' are those *.dat files as in the Zenodo example dataset.

I noticed that the Docker image is quite large, I am not sure if that is due to Matlab or if you also put the 'Soil Property' and 'PLUMBER2' data folder into the container?

BSchilperoort commented 1 month ago

the Zenodo example dataset does not include the 'Soil Property' folder and 'PLUMBER2' folder, instead, only one site "AR-SLu" data is used here as an example.

If the config file works with the most recent version of STEMMUS_SCOPE, it should work with the container.

I noticed that the Docker image is quite large, I am not sure if that is due to Matlab or if you also put the 'Soil Property' and 'PLUMBER2' data folder into the container?

The Docker image is large because Matlab Runtime is enormous, ~10 GB on my machine. All of Matlab Runtime has to be included to be able to run the STEMMUS_SCOPE model. With Matlab there is no good way around this.