StatCan / aaw

Documentation for the Advanced Analytics Workspace Platform
https://statcan.github.io/aaw/
Other
68 stars 12 forks source link

Issue with installing certain geospatial packages in R on notebook server #1132

Open mladd052 opened 2 years ago

mladd052 commented 2 years ago

Describe the bug

The issue is installing certain geospatial packages in R such as sf and others. For this issue I will just focus on the issue with the sf package. Once that is working I can test the installation of the other packages. I tried running conda install r-sf before but that did not solve the issue. I ran conda install r-raster for the raster package before but not sure if the same approach works for sf.

Environment info

Namespace: matthew-ladd

Notebook/server: ml-working

Steps to reproduce

I connect to my JupyterLab notebook and in the terminal window start R. I run my R script which checks if certain geospatial packages are installed and loads them. If they are not installed, the script will install them. The first package is sf and the output I get is shown below.

Expected behaviour

I expect that the sf package should be installed along with the dependencies (if not already installed) when running my script.

Output from R console

source("geoprocessing_v2.r") Loading required package: sf also installing the dependency ‘units’ trying URL 'http://jfrog-platform-artifactory-ha.jfrog-system:8081/artifactory/dev-cran-remote/src/contrib/units_0.8-0.tar.gz' Content type 'application/x-gzip' length 866695 bytes (846 KB)

downloaded 846 KB trying URL 'http://jfrog-platform-artifactory-ha.jfrog-system:8081/artifactory/dev-cran-remote/src/contrib/sf_1.0-7.tar.gz' Content type 'application/x-gzip' length 3529597 bytes (3.4 MB)

downloaded 3.4 MB

Additional context

I found some info on the error above at https://stackoverflow.com/questions/61234169/how-to-solve-error-libudunits2-a-not-found-when-installing-udunits2-in-r-3

Also, the other geospatial packages that my script will check for are rgdal, raster, terra and ncdf4, so once sf is installed I can test the installation of these packages.

chuckbelisle commented 2 years ago

Reviewed ticket and prioritized it to next sprint. Will offer a solution at that time.

Jose-Matsuda commented 2 years ago

(Will be updating this comment as information becomes clear to me) Initially I was afraid that this could be a little bit bigger than a small because in my exploration I found this older issue where we uninstalled libpdffox-java https://github.com/StatCan/aaw-kubeflow-containers/issues/249#issuecomment-834808115 due to a vulnerability.

This appears to have been resolved as when I trivy image localimage then the CVE does not appear. I will try seeing what Matthew provided above, as these packages are gis specific. The total size of this image is 9.42 GB (an additional 500 Mb)

I did find this might be more minimal but I will see how much the image size increases. The size of this image is 8.94 Gb (40 Mb bigger than regular)

I got this image but sf does not appear when I run installed.packages()

chuckbelisle commented 1 year ago

@mladd052 as Jose mentioned, the issue has been resolved. Could you please confirm?