You might think that not being an avid user of either Rstudio or the R programming language in general makes me unqualified to write about them, and you would be 100% correct; but it's my blog, so I'm gonna do it anyway!
Now that we're past my extremely obscure joke in the title related to data viz in R and yak shaving, I will tell you about how I had a lot of fun creating a prepackaged playground on labs.iximiuz.com to follow along with a recent paper presenting a tutorial for visualizing linguistics data using the R package ggplot2.
I'd like to briefly discuss why I did it, and also how, in case you are interested in doing something similar.
Why did I do this?
While I may not be accustomed to using R for...well...anything, really...what I do have loads of experience in is listening to friends in the academic realm talk about how difficult it is to work with.
The dependency management is very difficult, it's nontrivial to upgrade Rstudio to a version that works with the packages that are needed for a given task, and even just setting up working environments on students' personal devices to take part in class work can be a multi-day job.
Imagine it didn't have to be this way...
Imagine that students in a workshop could open up any modern web browser, load the URL, and click one button to have a 100% deterministic working version of Rstudio loaded with all the packages needed for the activity...
Well, imagine no more (and you already knew this was possible if you read my last post), this is possible right now!
The very cool platform on labs.iximiuz.com has playgrounds that can be customized for this exact usecase and shared publicly. I know because I made one. Given the ability to run basically whatever you want in the ephemeral environments there, this is the perfect platform to create on-demand environments pre-configured with almost any software your heart desires.
To borrow a term from the testing and security domains, we can "shift left" and get the user to actually doing the thing they wanna do faster and more effectively. This is devops for education, and I'm here for it!

How did I do this?
Because the Iximiuz platform is basically a free-form sandbox, the most difficult part was figuring out how to run the appropriate code in there. I knew it could be done, I just needed to connect all the fun lego blocks.
I started with the rocker/tidyverse container image, pinned to base R version 4.4.1 (this was originally 4.4.2 since that's the latest, but I updated it after noticing the author specifying in GitHub that the base version of R they used was 4.4.1).
After firing that up locally with:
docker run -it --rm -p 127.0.0.1:8787:8787 -e PASSWORD=rstudio rocker/tidyverse
I had a running version of Rstudio at localhost:8787
. Then it was a matter of just running the commands from the tutorial, seeing what broke and then fixing it by installing stuff via an iteratively growing Dockerfile.
Once that was all set, all I had to do was build the container locally and push to a public GitHub container registry, then add one line to customize a linux playground with Docker pre-installed to run my container.
But that's not all!
There's a super slick feature of the platform where you can basically create a new tab that accesses a port from the running container, and this can be configured to be available on startup.
So the entire flow for the user is
Click "Start" for the playground
Wait for playground to be ready
Click "Rstudio" tab
Log in with the supplied username/password
Start running commands from the tutorial
If you're interested in seeing the complete Dockerfile, that's here.
This is a completely disposable learning environment where the users can have a running start without worrying about any annoying configuration challenges, and when they're done, they can just close the browser tab. They don't even need to know that Docker is a thing!
The yak is fully pre-shaved! The future is wow!
Top comments (0)