rocker-org / devcontainer-templates

Dev Container Templates to use Rocker based Dev Containers. Useful Templates for using R in GitHub Codespaces, etc.
https://rocker-project.org/images/devcontainer/templates.html
MIT License
23 stars 4 forks source link

A template for using r2u? #19

Closed eitsupi closed 1 year ago

eitsupi commented 1 year ago

I am wondering if it is worth adding something like https://github.com/grantmcdermott/codespaces-r2u as a Template.

I didn't see the need to make it a Template since this would only add the r-apt Feature to ubuntu, but things like vscode-R settings are not included in the Feature so there may be value in being able to copy this from the beginning.

Note: The platform must be enforced to amd64 as arm64 is not supported.

@grantmcdermott Any thoughts?

eddelbuettel commented 1 year ago

I'd be in favor, but I am not without bias here. For what it is worth I did a quick try this afternoon using

  "ghcr.io/rocker-org/devcontainer-features/r-apt:0": {
    // See: https://github.com/rocker-org/devcontainer-features/blob/main/src/r-apt/README.md#options
    "vscodeRSupport": "full",
    "installBspm": true,
    "installRadian": false,
    "installDevTools": false,
    "installRMarkdown": false,
    "installVscDebugger": false,
    "useTesting": false
    }

Initial start is still not as fast as I'd would wish for but that is just a one-off cost. Works otherwise and is lovely. (I also turned the obnoxious linter off.)

grantmcdermott commented 1 year ago

Strongly in favour.

Specifically, I think this covers a core use case for R DevContainers: provisioning a fully fledged, but still light(ish)weight R environment that Just Works. You empower the user to decide how they want to modify/extend their container after it's built, without having to guess and preempt what they want beforehand.

If I may, I would also suggest adding a simple (Codespaces?) example to the Rocker website. The current docs are certainly helpful if you already know what DevContainers are and why they are cool. But they don't really give novices much an of idea why they are so useful/interesting.

+1 on the linter, although I have my own idiosyncratic preferences here. (Team = for assignment for one!)

grantmcdermott commented 1 year ago

PS. Might be worth thinking of a sister r2u+RStudio template, as that's come up a few times on social media since I posted my example repo.

eitsupi commented 1 year ago

Ok, thanks both. Let's add it. This is an easy task.

If I may, I would also suggest adding a simple (Codespaces?) example to the Rocker website. The current docs are certainly helpful if you already know what DevContainers are and why they are cool. But they don't really give novices much an of idea why they are so useful/interesting.

Do you mean something like these? https://github.com/microsoft/vscode-remote-try-node https://github.com/microsoft/vscode-remote-try-python

Of course it is possible, but I doubt I have the bandwidth.......

PS. Might be worth thinking of a sister r2u+RStudio template, as that's come up a few times on social media since I posted my example repo.

To do so, we must first create a Dev Container Feature to configure RStudio Server. See rocker-org/devcontainer-features#71

eitsupi commented 1 year ago

I have opened a PR #21

eitsupi commented 1 year ago

If I may, I would also suggest adding a simple (Codespaces?) example to the Rocker website. The current docs are certainly helpful if you already know what DevContainers are and why they are cool. But they don't really give novices much an of idea why they are so useful/interesting.

I created a simple repository https://github.com/eitsupi/devcontainer-try-r

@grantmcdermott @eddelbuettel @cboettig What do you think? Is it worth transferring to this organization?

I honestly don't have the energy to write a lengthy tutorial......

eddelbuettel commented 1 year ago

I kinda did, in a narrower r2u context, as a README.md in this directory for r2u, which I thend also turned into this vignette for r2u and the basis for this blogpost (and tweet & toot). It is all r2u, so not rig or rstudio or pak or ... here. Also outside the org. I suppose we want something for rocker but the website is already so sprawling and the spread of containers is already hard to follow. :crying_cat_face:

eitsupi commented 1 year ago

@eddelbuettel Looks great!

One thing I learned is that GitHub has the ability to generate badges for Codespaces. https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/setting-up-your-repository/facilitating-quick-creation-and-resumption-of-codespaces#creating-a-link-to-the-codespace-creation-page-for-your-repository

eddelbuettel commented 1 year ago

I guess it depends a little on 'what people really want'.

@grantmcdermott and I were happy to poke around and promote 'easy ways to run R and all its packages in the cloud', that is an r2u use case. I am not sure if 'kids these days' still want rstudio or not (beginners likely do) and how viable leaning on the cloud instances and their 32gb storage is to, say, survive a course for a term.

grantmcdermott commented 1 year ago

Late to this, but looks great @eitsupi! The badges are a nice touch.

I agree with @eddelbuettel that the Rocker website has become a bit sprawling. Still, I personally think there is value in adding your example(s) to the official docs. (At least, the Template repo could be made to look like this, no?) I may yet be proven wrong but I think there will be a lot of interest in this sort of thing once the universities get back from summer vacation and teaching starts back up again.

Like everyone else, I'm also pressed for time. However, I'll have a think on what an intro tutorial might look like beyond the examples here and on Dirk's blog. Both are already a big improvement on what was there before (thanks for indulging my suggestions).