Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sf installation not working if user installs #4

Open
eeholmes opened this issue Oct 26, 2024 · 1 comment
Open

sf installation not working if user installs #4

eeholmes opened this issue Oct 26, 2024 · 1 comment

Comments

@eeholmes
Copy link
Contributor

eeholmes commented Oct 26, 2024

Note in the image, sf works fine. This is if the user installs sf.

To replicate

  • Use bring your own image in JupyterHub: ghcr.io/boettiger-lab/repo2docker-r/r2u:latest
  • Open RStudio once in JupyterLab
  • remove sf that is installed in the system library (on image build)
  • install.packages("sf")
  • type library(sf)

Now you get this error so it seems r2u was not used to install sf ? or something else happened.

library(sf)
Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/jovyan/R/x86_64-pc-linux-gnu-library/4.4/sf/libs/sf.so':
  libproj.so.22: cannot open shared object file: No such file or directory

From the terminal (in RStudion or JLab). This happens in the image too even when sf is working (before deleting it).

gdalinfo --version
bash: gdalinfo: command not found
@eeholmes eeholmes reopened this Oct 26, 2024
@eeholmes eeholmes changed the title sf installation not working sf installation not working if user installs Oct 26, 2024
@cboettig
Copy link
Member

thanks for reporting! Right, I don't see a great solution here for non-root installs. If the user can customize install.r, then the Dockerfile will build with root (either via GitHub Actions, or now the binder integration). But a user still can't install binary packages on the fly.

I've just pushed an edit that will allow a user to dynamically install binaries from r-universe. This will cover many more cases, but not all cases. e.g. if the image already has the gdal libraries installed from say, having sf in install.r, then they can dynamically install terra or stars or any of the others that bind gdal libraries.

But if the user tries to install some additional package, say, magick, the binary will install fine but it won't be able to run, because it has to apt-get some dependencies first. I think there's still a win here, in that the user simply has to add the R package to to the install.r script, they don't actually ever need to know about apt get or what specific ubuntu/debian pkg name they need to apt-get. But it's not perfect.

I wonder if it would just be possible to allow root on the Jupyter env. e.g. Codespaces allows root inside it's VMs so users could apt-get, and presumably they did the appropriate security analysis given their infinitely larger and better resourced teams looking at this stuff...

Alternatively one could install R packages from conda, but I feel this doesn't play nice with any of the standard end-user install mechanisms for linux either. (The entire conda model also just feels weird and out of place in a Ubuntu Linux system admin to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants