o2r-project / containerit

Package an R workspace and all dependencies as a Docker container
https://o2r.info/containerit/
GNU General Public License v3.0
289 stars 29 forks source link

Adding basic Dockerfile for rstudio #157

Closed vsoch closed 4 years ago

vsoch commented 4 years ago

This pull request will add a Dockerfile to build an rstudio container for easy working with containerit. There should be instructions added to the README too, but it looks like the file says not to be edited so I'll leave that to you.

Note that I changed the recipe generated by containerit to use an rstudio base (to make an interface for the user) and I'm rebuilding and testing now.

Signed-off-by: Vanessa Sochat vsochat@stanford.edu

vsoch commented 4 years ago

Okay just updated to add the missing libraries. The MRAN (by Microsoft) is really interesting - it has a lot of random failures (hence why I did the first recipe that specifies CRAN). Have you seen this in practice? Also, should the CI be working (or perhaps it's the same issue with the mirrors?)

The container recipe here is tested, and works right off the bat! I was able to run containerit and generate the Dockerfile without any issue:

image

If we are able to add a recipe like this and some brief instructions in the README for a Quick Getting Started, this would resolve the issue with having easy steps to install, etc.

nuest commented 4 years ago

@vsoch I'm sorry to hear you spent so much time building the Dockerfile and image - I hope what you learned about MRAN is helpful at some later point in time.

I'm hesitant to merge this PR, since there are already Dockerfiles in the repo, albeit a bit hidden. I totally agree with your idea to mention them more upfront so users can try out the package without installing it.

Would these changes have helped you?

https://github.com/nuest/containerit/commit/1b73a6cf939e5ebfb2bc2d74198288d4108c0094

vsoch commented 4 years ago

Testing now! is there a reason to give the user the geospatial tag to use? Ideally you'd want to have the example point to a base image (with just the minimum dependencies for containerit provided), and the expectation would be the user can bootstrap off of that. I would additionally add a link to the Dockerfile that builds that container, since a more advanced user will want to see what's going on under the hood :)

And with mran ... well.. it met my expectation for something provided by Microsoft! :P runs away :)

Works like a charm! Yes this would have been hugely helpful.

nuest commented 4 years ago

I'm using geospatial because it has RStudio, and containerit uses a number of packages from the geospatial domain for tests and demonstration, because they have various system dependencies and a often hard to install. If a user would want to run the examples from the vignettes involving these packages, then a base R image would not suffice.

nuest commented 4 years ago

But the documentation of a minimal image is a very good point. I've added a minimal file based on your work and a test along with it to make sure it works. This should be good for catching when system dependencies change: https://github.com/o2r-project/containerit/pull/160/commits/775cae51657fd60e1a219508a664e56b43b68f2c