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

Use rocker/geospatial:dev-osgeo as basis for qgis image #37

Closed
Robinlovelace opened this issue Apr 26, 2023 · 9 comments · Fixed by #39
Closed

Use rocker/geospatial:dev-osgeo as basis for qgis image #37

Robinlovelace opened this issue Apr 26, 2023 · 9 comments · Fixed by #39

Comments

@Robinlovelace
Copy link
Contributor

I hit issues with sf installation but this can be worked around following guidance from the Rocker maintainers here: rocker-org/rocker-versioned2#631

@Robinlovelace
Copy link
Contributor Author

After changes above getting the following error on

docker build qgis
  25 | >>> RUN pip3 install qgis-plugin-manager
  26 |     # to enable the qgis-plugin-manager, add the corresponding path to PATH
  27 |     ENV PATH="/home/rstudio/.local/bin:$PATH"
ERROR: failed to solve: process "/bin/sh -c pip3 install qgis-plugin-manager" did not complete successfully: exit code: 127

@benz0li
Copy link

benz0li commented May 21, 2023

@Robinlovelace FYI b-data's JupyterLab docker stacks provide something similar:

ℹ️ I am referencing this repository in the README's of the above mentioned projects.

What makes these project different:

  1. Multi-arch: linux/amd64, linux/arm64/v8
  2. Base image: Debian instead of Ubuntu
  3. IDE: code-server next to JupyterLab
  4. Just Python – no Conda / Mamba

@Robinlovelace
Copy link
Contributor Author

Thanks for the heads-up @benz0li, and for the cross-references to this repo. In terms of this issue, it should be fixed by #39. Regarding the 4 points you mention above, all sound good, especially code-server. As a fan of VS Code, and keeping things simple, I plan to give it a go!

@Robinlovelace
Copy link
Contributor Author

Giving it a go with:

docker run -it --rm \
  -p 8888:8888 \
  -u root \
  -v "${PWD}/jupyterlab-jovyan":/home/jovyan \
  -e NB_UID=$(id -u) \
  -e NB_GID=$(id -g) \
  -e CHOWN_HOME=yes \
  -e CHOWN_HOME_OPTS='-R' \
  glcr.b-data.ch/jupyterlab/r/geospatial

@benz0li
Copy link

benz0li commented May 21, 2023

Please be aware of

Create home directory

Create an empty directory using docker:

docker run --rm \
  -v "${PWD}/jupyterlab-jovyan":/dummy \
  alpine chown 1000:100 /dummy

It will be bind mounted as the JupyterLab user's home directory and automatically populated on first run.

ℹ️ You may also give it a go at https://demo.jupyter.b-data.ch.

Robinlovelace added a commit to geocompx/geocompr that referenced this issue May 21, 2023
github-actions bot pushed a commit to geocompx/geocompr that referenced this issue May 21, 2023
@benz0li
Copy link

benz0li commented May 22, 2023

@Robinlovelace I have extended the JupyterLab R docker stack build chain to base → tidyverse → verse → geospatial → qgisprocess.
👉 There is now image glcr.b-data.ch/jupyterlab/r/qgisprocess, which is also available at https://demo.jupyter.b-data.ch.

@Robinlovelace
Copy link
Contributor Author

Good stuff, thanks @benz0li! Can you try reproducing the contents of chapter 10 on GIS in this image? Will be a good test: https://r.geocompx.org/gis.html

cc @jannes-m FYI who is working to update that chapter in geocompx/geocompr#968 so things may change.

@benz0li
Copy link

benz0li commented May 22, 2023

Can you try reproducing the contents of chapter 10 on GIS in this image?

After installing some additional packages, I could reproduce the contents of geocompr/10-gis.Rmd.


Because of ariya/phantomjs#15449, one needs to execute

Sys.setenv(QT_QPA_PLATFORM = "phantom")
Sys.setenv(OPENSSL_CONF = "/dev/null")

on newer Linux distros before a mapview::mapshot in order to avoid errors. The output does not look the same as geocompr/figures/09_shortest_route.png, though.
ℹ️ mapview::mapview works just fine.


> webshot::install_phantomjs()
[...]
HTTP request sent, awaiting response... 200 OK
Length: 23415665 (22M) [application/octet-stream]
Saving to:phantomjs-2.1.1-linux-x86_64.tar.bz2phantomjs-2.1.1-linux-x86_64.tar 100%[=========================================================>]  22.33M  38.5MB/s    in 0.6s    

2023-05-22 13:47:58 (38.5 MB/s) -phantomjs-2.1.1-linux-x86_64.tar.bz2saved [23415665/23415665]

phantomjs has been installed to /home/benz0li/bin
$ which phantomjs
/home/benz0li/bin/phantomjs
$ QT_QPA_PLATFORM=phantom OPENSSL_CONF=/dev/null phantomjs --version
2.1.1

@Robinlovelace
Copy link
Contributor Author

Fantastic, thanks for testing @benz0li!

https://github.com/rstudio/webshot2 may be better than webshot, the former does not need PhantomJS. Worth switching to that? Possibly...

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