-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
create docker container #39
Comments
I've added a docker/ folder that contains a dockerfile and readme. It should be improved. |
I am not a docker expert by any means, but the new WASM (https://docs.docker.com/desktop/wasm/) beta makes me think we might leverage this to speed up install/setup time, because as I understand it, the WASM shim is able to run without having to worry about architecture which is something I've encountered with docker in the past. Unfortunately using it drops compatibility with older docker containers. Thoughts? |
This looks neat! Alas, I don't think we can leverage WASM yet because support for R in WASM is currently limited to https://github.com/georgestagg/webR#demo, and while it is possible to install and use R packages in the WASM, the process is extremely difficult at the moment (https://github.com/georgestagg/webR/issues/11). Moreover, there is no support for pandoc in WASM that we can use. |
Ah, true. Well, hopefully as it comes out of beta, things can change. I'd be happy to help with implementing the container. From above, essentially make two containers, one that contains R, pandoc, etc. and another fully featured one with RStudio, yes? |
Building the ContainerSort of. I think building the container is fairly straightforward (at least it will be far less complex than https://github.com/carpentries/lesson-docker because we will be adding packages on top of an existing system instead of trying to shoehorn the jekyll build system in to the RStudio container or vice-versa). Right now the bare-bones Docker setup is https://github.com/carpentries/workbench/blob/d134ed1cb85a09b4a5e95d97597350a86503cec2/docker/Dockerfile, which uses the R-Universe container as a base (though preview is not possible). I believe an equivalent one with RStudio included would be to replace User interaction with the containerThe remaining issue of how to mount volumes, expose ports for previewing, and figure out how to get it to write to the system not as the root user is another matter that is likely solved with One big caveat is how to handle the packages for lessons that use R-markdown. Since {renv} uses a global package cache with symbolic links, all of those symbolic links will be broken inside of the container and thus, while we mount the lesson itself inside of the container, we need to ignore the |
Hi! I am looking into it and would be happy to help :) |
HI @harivyasi, thanks! I've had a busy past few weeks, but next week I'll likely sit down and start on the docker-compose setup. Let me know how you get along, and I'll be happy to add to anything you are working on. |
I have a naive docker + docker-compose setup at alee/python-novice-gapminder@0de50c7 that should work for lessons that don't have the R-markdown issue raised earlier. Adding a secondary bind mount volume that supports a container-local {renv} should be pretty straightforward though by adding another bind mount for Not sure I understand why rstudio support would be needed, is it for the R-markdown lessons? The image name in docker-compose.yml should also be templated for each specific lesson. |
Following on from @alee I've got a working docker image and compose setup for a Workbench lesson. The image used as base is the A hook could be added to the Rprofile to call A couple of issues
|
Note: in sandpaper 0.15.0, you can now use the |
We were not aware of this discussion taking place, but we built a docker image that is working and tested both on linux and mac. You can get the latest versions with: And can be run (from the lesson's base directory) with:
Note: make sure you have the necessary directories before running the container:
Because it is on a bind mount, you can edit the lesson files and see the site updated a few seconds later (at http://localhost:4321/ ). |
Thanks @fherreazcue - I just tried this out and it is working great! I'm using it with a minimalist docker-compose.yml e.g.,
and it works like a charm and much smaller than the 5 GB R images that were being generated earlier 😅 |
There have been calls for the creation of a docker container that folks can use for The Workbench so that they can use something similar to
make docker
.The docker container should be relatively straightforward to implement and we can implement two flavours:
Both of these can be based on containers from the Rocker Project or the base image for the R-Universe project where we can set the
MY_UNIVERSE
environment variable.The text was updated successfully, but these errors were encountered: