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

New template "r2u" #21

Closed eitsupi closed 1 year ago

eitsupi commented 1 year ago

Close #19

eitsupi commented 1 year ago

While creating this, I noticed that the option to force the platform does not exist in devcontainer.json. (devcontainers/spec#288) If this option is not present, the attempt to build an image from this template on arm macOS will fail.

A less elegant but likely solution that works is to use a Dockerfile.......

Edit: Done in bbc2cb2

eddelbuettel commented 1 year ago

This looks really good and thank you for putting it together!

At this point I know approximately zero about devcontainers so I have some trouble reviewing this. When I looked it over questions that came to my mind where

Methinks I should just nod politely and thank you for this and approve it and get out of the way. Thoughts?

eitsupi commented 1 year ago

Thanks for looking at this!

so does pulling the container in slow things down relatiively speaking?

The Dev Container CLI creates a Dockerfile from devcontainer.json and docker buildx builds an image from that Dockerfile. In other words, using a Dockerfile here should have no effect on build speed. It simply goes against my aesthetics to add a Dockerfile with little content (but far better than a failed build!)

do we really need 'everything on' in the "featuires" matrix (I turned devtools, radian, rmarkdown, ...) off, but I probably need to slowly learn a little more

Good point. This is the result of adjusting to install the same package as the existing r-ver template (https://github.com/rocker-org/devcontainer-templates/tree/main/src/r-ver). In other words, it is a copy of the following section. https://github.com/rocker-org/devcontainer-images/blob/eb515c1e6ad3b751770a66207eba2a629177a8c1/src/r-ver/.devcontainer.json#L12-L20

Since the Dev Container Template simply generates files to the user local workspace, the users can edit the generated json file to enable or disable any options.

pak pops up in test.sh but I don't think we can use pak with apt and bspm so maybe comment that out

pak is installed to install vscDebugger. (It could not be installed using the remotes package at the time, and pak had to be used) https://github.com/rocker-org/devcontainer-features/blob/583387a2831c181905c571b306f3a976affbe5cb/src/r-apt/install.sh#L231

The reason I'm checking with the test is simply because I copied the test script from the r-ver one. There is no deeper meaning.

Methinks I should just nod politely and thank you for this and approve it and get out of the way. Thoughts?

It would be appreciated if you could check the docs (description fields and NOTES.md). (You are of course free to edit them as you wish. It is nighttime in Japan, so I am going to bed now...)

eitsupi commented 1 year ago

Thanks for taking a look at this. I will release it for now and wait for feedback...

grantmcdermott commented 1 year ago

Late to this, but just quickly on the the pak requirement for vscDebugger: I think you should just be able to set the install target to the latest tar.gz GH release—since you know it will be Ubuntu for this template—and set repos to NULL, no? I guess you'd have to install two two dependencies as well, assuming these haven't been installed elsewhere in the process.

install packages(c("R6", "jsonlite"))
install.packages("https://github.com/ManuelHentschel/vscDebugger/releases/download/v0.5.2/vscDebugger_0.5.2.tar.gz", repos = NULL)

Not sure the effort is worth it, but an option nonetheless.

More importantly: Thanks for taking the lead on this @eitsupi!