InseeFrLab / images-datascience

Collection of Docker images to build the data science catalog of the Onyxia project
MIT License
24 stars 22 forks source link

Enhance the r-datascience with the latest GDAL version #215

Closed fBedecarrats closed 2 months ago

fBedecarrats commented 2 months ago

Hello there! With @duboisl-afd, we would need to build a datascience image with a more recent GDAL version (r-datascience currently ships with GDAL 3.4.1 and we would need >3.8). I see that this is possible with rocker by adding RUN /rocker_scripts/experimental/install_dev_osgeo.sh to the base r-datascience script (explained here: https://github.com/rocker-org/rocker-versioned2/issues/695). However, I can't remember how we should do this: fork https://github.com/InseeFrLab/images-datascience/blob/main/r-datascience/Dockerfile and then build an image in Docker Hub and reference it from the pod? Any guidance or link to some documentation explaining the process would be super helpful (sorry if it's somewhere and I could not find it).

duboisl-afd commented 2 months ago

@avouacr advised me to try this and so far it's working!

sudo apt-get autoremove gdal-bin libgdal-dev libgeos-dev libproj-dev 
Rscript -e "remove.packages('sf')"
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev libsqlite0-dev
Rscript -e "install.packages('sf', type = 'source', repos = 'https://cran.r-project.org/')"
fBedecarrats commented 2 months ago

This is great! Thanks @avouacr ! @duboisl-afd , if you want to avoid manually entering these commands on RStudio terminal every time, you can insert a slightly modified version in an init script like this: https://github.com/BETSAKA/Tools/blob/main/init_scripts/latest_gdal.sh Then inside your pod, you point to it like this: image And you click on "Save configuration" before clicking on "Launch", so the config will always appear on the right panel in SSP Cloud/My services menu image Note that the url of the init script must be the "raw" version (the link you obtain after clicking on "raw" in github), in this case: https://raw.githubusercontent.com/BETSAKA/Tools/main/init_scripts/latest_gdal.sh