Skip to content
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

[MRG] Add support for installing different versions of R #772

Merged
merged 8 commits into from
Sep 18, 2019

Conversation

betatim
Copy link
Member

@betatim betatim commented Sep 3, 2019

Closes #661

This uses the instructions from https://cran.r-project.org/bin/linux/ubuntu/README.html to allow users to select a different version of R. We use the runtime.txt to let users specify which version they want via r-3.6-YYYY-MM-DD (selects R 3.6, 3.6.1 to be precise) or r-YYYY-MM-DD (selects the default, currently 3.4).

We can also add support for R 3.5 but I wanted to open the PR before being done. Ideally r-3.4-YYYY-MM-DD should be equivalent to r-YYYY-MM-DD as well.

This is pretty exciting as it adds a frequently requested feature without a lot of new code.

What do people think of using runtime.txt like this? I like it and prefer it over trying to guess a R version from the date or introducing an additional file. Maybe in a second PR we can check if a DESCRIPTION file can specify a R version as well.

It would be good to get some feedback from R packaging experts on https://cran.r-project.org/bin/linux/ubuntu/README.html.

  • R 3.5 support
  • make 3.6 the default
  • tests
  • docs

@betatim betatim changed the title [WIP] Add support for innstalling different versions of R [WIP] Add support for installing different versions of R Sep 3, 2019
@trallard
Copy link
Contributor

trallard commented Sep 4, 2019

Thanks for working on this @betatim

Some thoughts here:

  • It would make more sense to have the latest R version as the "empty one". So that the most recent version of R would be installed by default. This will make it consistent with the Rocker Docker images behaviour (which is what I would expect for example from the Jupyter notebooks stack as well)
  • I quite like the idea of having the R version explicitly declared in the runtime.txt as r-3.6-YYYY-MM-DD this reduces a lot of ambiguity and makes the R version used/requested highly visible
  • I vote in favour of directly supporting 3.5 - I believe a good chunk of R users will either be running on 3.5 or 3.6 (probably more than 3.4) as this is quite old now

@betatim
Copy link
Member Author

betatim commented Sep 4, 2019

It would make more sense to have the latest R version as the "empty one"

I was wondering about that. Right now I went with "nothing should change when we merge this", currently you can't select the R version so after merging this PR if you don't specify anything we stick (unfortunately) with what used to be the only version. This is the "never break users" mantra. I don't actually know how many existing repos would break if we suddenly switch them from 3.4 to 3.6. Is there a way to guess-timate that (without having to go and build a whole bunch of repos)?

For Python we didn't follow this mantra and at some point switched to Python 3.7 as the default. There were a few (but less than expected) people who had problems with their repos not building any more who showed up on twitter/gitter/the forum. What is unknown is how many repos kept building but now produced different results (probably less than those that broke).

I need to check what we do for Julia (no spec -> we update your version or no spec -> we stick to some old version).

@trallard
Copy link
Contributor

trallard commented Sep 4, 2019

This would be particularly hard to guesstimate, but I do not expect a huge number of repos to break if we upgrade to 3.6 right away.
That said I imagine there will be a few (maybe more than a few) repos currently broken as some R packages tend to drop support for old R base versions. Of course there are workarounds to install packages for an older R version.

Something that could be done would be upgrading to 3.6 (as in Python) and perhaps add a FAQ/detailed documentation on the repo2docker and binder pages so that this does not result in loads of issues around the line "my repo worked a week ago and now it's broken"?

@NHDaly
Copy link
Contributor

NHDaly commented Sep 4, 2019 via email

@NHDaly
Copy link
Contributor

NHDaly commented Sep 4, 2019

Now, I don't think we've been updating the version to run the latest Julia,
which probably makes sense. 1.0 is the "long-term supported" version, so I
think continuing to update the default to the latest patch release of 1.0
is reasonable (1.0.4, 1.0.5, etc).

Oh, just kidding, apparently we just use the latest released version of julia as the default:
https://github.com/jupyter/repo2docker/blob/46cd5670e821f210930562a42e2769488bd23149/repo2docker/buildpacks/julia/julia_project.py#L30
🤷‍♂i think that's reasonable too. :) Supposedly, the upgrades are always supposed to be backwards compatible within 1.*, even if downgrades aren't. So this is probably fine as well.

Anyway, hope that's helpful. :)

@choldgraf
Copy link
Member

This seems pretty reasonable to me - it feels like a good piggy-backing of the runtime buildpack. Just to have 👀 on it, one other pattern we could use is something like:

r-VERSION
mran-YYYY-MM-DD

which would be more explicit (although two separate lines) and would disentangle the two pieces of information. I can see "pros" and "cons" with both approaches, but curious what other folks think about this

@willingc willingc added the workflow:wip Work in Progress label Sep 7, 2019
@betatim betatim changed the title [WIP] Add support for installing different versions of R [MRG] Add support for installing different versions of R Sep 8, 2019
@betatim
Copy link
Member Author

betatim commented Sep 8, 2019

This is ready for review now @minrk or @nuest

Copy link
Contributor

@nuest nuest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just have a couple of questions, otherwise the code looks 💯

repo2docker/buildpacks/r.py Show resolved Hide resolved
repo2docker/buildpacks/r.py Outdated Show resolved Hide resolved
@nuest
Copy link
Contributor

nuest commented Sep 8, 2019 via email

@nuest
Copy link
Contributor

nuest commented Sep 8, 2019

LGTM

@betatim
Copy link
Member Author

betatim commented Sep 9, 2019

I updated the documentation to mention R version support. Ready to merge if the bots are happy.

@betatim
Copy link
Member Author

betatim commented Sep 12, 2019

Now with more LooseVersion @minrk

@betatim
Copy link
Member Author

betatim commented Sep 18, 2019

Merging this now. Min's last (in person) comment on this was positive except for the part about not using LooseVersion which is now fixed.

@betatim betatim merged commit bfbec34 into jupyterhub:master Sep 18, 2019
@betatim betatim deleted the custom-r-versions branch September 18, 2019 06:15
markmo pushed a commit to markmo/repo2docker that referenced this pull request Jan 22, 2021
)

[MRG] Add support for installing different versions of R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
workflow:wip Work in Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different versions of R or staying just a point release behind the current version
6 participants