rstudio / rstudio-docker-products

Docker images for RStudio Professional Products
https://hub.docker.com/u/rstudio
MIT License
66 stars 55 forks source link

Fix static reference to OS #482

Open colearendt opened 1 year ago

colearendt commented 1 year ago

https://github.com/rstudio/rstudio-docker-products/blob/ff278dbeaa93503c3ab61024374e78e3cb993b49/connect/rstudio-connect.gcfg#L36-L40

We now build multiple operating system images 🤦 We either need separate config files or to replace these contents dynamically at build time 😬

Example errors suggesting binary compatibility issues:

INFO     connect_logger:api.py:346 2023/02/22 21:48:47.194198210 Error in dyn.load(file, DLLpath = DLLpath, ...) :
INFO     connect_logger:api.py:346 2023/02/22 21:48:47.194256043   unable to load shared object '/opt/rstudio-connect/mnt/packrat/4.1.0/v2/library/stringi/bb5fb5d604d737e9aef19b49afd2d415/stringi/libs/stringi.so':
INFO     connect_logger:api.py:346 2023/02/22 21:48:47.194400710   libicui18n.so.60: cannot open shared object file: No such file or directory
INFO     connect_logger:api.py:346 2023/02/22 21:48:47.194587918 Calls: local ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load

# or 

version `GLIBC_2.29' not found (required by /opt/rstudio-connect/mnt/packrat/4.1.0/v2/library/sass/144a489ede7f2c264ee3454cd45fdb3a/sass/libs/sass.so)
colearendt commented 1 year ago

Workaround in the short term could be to mount your own config or use environment variables (have not tested yet):

docker run -it --rm --privileged -e RSC_LICENSE -e CONNECT_RPACKAGEREPOSITORY_CRAN_URL=https://packagemanager.rstudio.com/cran/__linux__/jammy/latest -e CONNECT_RPACKAGEREPOSITORY_RSPM_URL=https://packagemanager.rstudio.com/cran/__linux__/jammy/latest ghcr.io/rstudio/rstudio-connect:jammy

https://docs.posit.co/connect/admin/appendix/configuration/#environment-variables

michaelmayer2 commented 1 year ago

For the actual fix and to keep things flexible you could use the slightly "hackish" approach in https://github.com/sol-eng/aws-parallelcluster-rsw/blob/main/scripts/run.R#L20-L26 to dynamically generate the URL's for RSPM and CRAN.

heath-posit commented 1 year ago

The Jammy Workbench image also has this issue. It pulls in this reference to the Bionic Package binary repos: https://github.com/rstudio/rstudio-docker-products/blob/dev/workbench/conf/repos.conf

Should we open a new issue? Or do you all think this should be tracked here?

ianpittwood commented 1 year ago

@heath-r I noticed that issue as well. We temporarily fixed it here: https://github.com/rstudio/rstudio-docker-products/pull/544/files#diff-4cf2a53720e9f918e2ad0de11b58abc4f48f64dcd09f3eef4ef36a4ff4caf90bR1

I imagine it should be merged soon and then we can fully implement some dynamic way to do it in the future.

colearendt commented 1 year ago

We should probably evaluate if Connect's new feature related to dynamic repos handle this issue for Connect