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

request: `r-spatial` container #119

Closed
achubaty opened this issue Apr 14, 2015 · 13 comments

Comments

@achubaty
Copy link

commented Apr 14, 2015

I just started playing around with Docker and rocker (thank you!) and I want to put together a container with a good collection of spatial (i.e., maps) packages. For my use case (package testing and development) I would like r-spatial to be based on r-devel.

I've managed to get a container running locally that I built 'manually' based on r-devel using:

# install system packages
apt-get install -y --no-install-recommends \
    bwidget gsl-bin libgsl0-dev libgdal-dev libgdal1-dev libgeos-dev libgeos++-dev \
    libproj-dev libspatialite-dev libxml2-dev netcdf-bin r-cran-rgl

# need to run R-devel with virtual xserver
xvfb-run Rdevel
# install R packages (could be done from cmd line)
install.packages("devtools")
install.packages("testthat")

library(devtools)
spatial.pkgs <- c("geoR", "mapdata", "maps", "maptools", "ncdf4", "RandomFields", "plotKML",
                  "rgdal", "rgeos", "shapefiles", "sp", "spatstat", "raster", "rts")
lapply(spatial.pkgs, install.packages)
install_github("s-u/fastshp")

Is there interest in creating/maintaining an r-spatial container as part of your rocker project?

@eddelbuettel

This comment has been minimized.

Copy link
Member

commented Apr 14, 2015

Please see a few of the recently closed issues. In general, @cboettig and I have limited time for new containers so I would suggest you make this your project building on top of and extending our containers.

@cboettig

This comment has been minimized.

Copy link
Member

commented Apr 14, 2015

@achubaty I think the idea of an r-spatial container is pretty interesting.

You should really look at the rocker/ropensci container meanwhile, it has many of the spatial packages you mention in place already, and will probably be adding more since that is an active topic area at ropensci right now (in particular, it has the binaries which are sometimes trickier) to install.

In particular, I don't think r-devel is the right image to build this on -- I think it's best to build this kind of thing on the latest R release and not the active dev version. Can you tell me why you'd base this on r-devel?

rocker/ropensci builds on top of rocker/rstudio, so a user can interact with the container through the rstudio-server instance directly, which we find is more beginner-friendly. This is also particularly nice I think for spatial work, since the RStudio team has been doing quite a lot of development with very elegant javascript tools like leaflet that are very nicely integrated into RStudio.

Please take a look at the rocker/opensci Dockerfile, take the image for a spin and let me know how it meets your needs. I could see that moving the spatial packages there into an r-spatial image and then building ropensci off that could help discovery, so it is worth thinking about; but like Dirk says we're trying to keep our maintenance load down to a tight set of well-maintained packages.

@eddelbuettel

This comment has been minimized.

Copy link
Member

commented Apr 14, 2015

👍

Completely forgot about spatial in ropensci. This is a good use case for Docker, but maybe a simpler PR to this exiting container will do?

@achubaty

This comment has been minimized.

Copy link
Author

commented Apr 14, 2015

@cboettig I want RDevel for testing packages prior to CRAN submission. This is also why I didn't consider the rstudio container -- I don't think I need all the extra stuff.

Thank you both for the suggestions. I'll take a closer look at ropensci, and look into building on top of that.

@cboettig

This comment has been minimized.

Copy link
Member

commented Apr 14, 2015

@achubaty For creating an environment for testing a specific package, you might want to take a look at https://github.com/richfitz/dockertest.

It's not going to be possible in general to create a container that has dev version of R for testing, all the dependencies a particular developer needs just for their package, and "no extra stuff" without having a custom image for each user; which is exactly what dockertest creates. You can specify whatever base image you think is appropriate there (e.g. r-devel).

@achubaty

This comment has been minimized.

Copy link
Author

commented Apr 14, 2015

@cboettig I agree that the "one size fits all" won't work, but I was hoping to have an easier starting point with the spatial packages on which to build. Thanks for extra links!

@cboettig

This comment has been minimized.

Copy link
Member

commented Apr 14, 2015

@achubaty yeah, true. I think there's always a trade-off between ease and 'extra stuff'. We've generally aimed the more 'batteries included' images like ropensci at end users (hence the rstudio etc) rather than at package developers. And once an image is ~ 2GB, you can add a lot more R packages and libs for only a small % change in image size ;-). Still trying to get that balance right though so your feedback is always appreciated.

Our images like r-devel and r-devel-san-clang are aimed at making the lives of developers easier, but focus on doing some of the really tricky configuration stuff and assume the developer can handle the more straight forward parts like apt-geting the external dependencies.

@znmeb

This comment has been minimized.

Copy link

commented Apr 15, 2015

It's been a while since I built the Spatial task view on Debian or Ubuntu but IIRC the main Linux dependencies are the gdal libraries and headers, the geos libraries and headers and proj*.

If you want to do it by trial-and-error, you can install apt-file and when a package install fails because it can't find a library or a header, an apt-file search for the file it's looking for will usually give you the package name.

@achubaty

This comment has been minimized.

Copy link
Author

commented Apr 18, 2015

I've gone ahead and made a first attempt:

  • r-spatial-base adds various R spatial/mapping tools to the rocker/r-base container
  • r-spatial-devel adds various R spatial/mapping tools to the rocker/r-devel container

I would greatly appreciate any feedback / suggestions:

  • @eddelbuettel @cboettig In particular, I want to make sure I've referenced your project appropriately and have covered my bases wrt a LICENSE file and any other considerations. Should my spatial rocker files be GPL-2 per your issue 23?
  • @znmeb I think I've covered the bases, and added some additional packages I use.

At this point, I'm happy if this issue can be closed here and I'll take issue/requests/discussion at my github repo: https://github.com/achubaty/rocker-files/issues.

Thank you everyone for your helpful feedback.

@vielmetti

This comment has been minimized.

Copy link

commented May 23, 2015

Thanks for doing this. I have a few lines of map manipulation code that has a lot of dependencies and I've been looking for a way to scale it up - this looks very promising. Thanks again!

@achubaty

This comment has been minimized.

Copy link
Author

commented May 28, 2015

@vielmetti Glad I could help. Please let me know if you encounter any problems: https://github.com/achubaty/rocker-files/issues

@achubaty achubaty closed this Oct 31, 2016

@dlebauer

This comment has been minimized.

Copy link

commented Mar 9, 2017

I just found this and wanted to update for future audience

@achubaty

This comment has been minimized.

Copy link
Author

commented Mar 10, 2017

@dlebauer thanks for the update on the new geospatial images.

FYI Docker Hub changed their links. The images are here:

I've updated my comment above accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.