Virtual-environments: Add R CLI tools

Created on 11 Jul 2020  Â·  10Comments  Â·  Source: actions/virtual-environments

Tool information

  • Tool name: R
  • Tool license: GNU
  • Add or update? Add
  • Desired version: latest 3.x and 4.x versions
  • Approximate size: 150MB
  • If this is an add request:

    • Brief description of tool: R is a language and environment for statistical computing and graphics. R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, …) and graphical techniques, and is highly extensible.

    • URL for tool's homepage: https://www.r-project.org/

Area for Triage:
Scripting and command line

Question, Bug, or Feature?:
Feature

Virtual environments affected

  • [x] macOS 10.15
  • [x] Ubuntu 16.04 LTS
  • [x] Ubuntu 18.04 LTS
  • [x] Ubuntu 20.04 LTS
  • [x] Windows Server 2016 R2
  • [x] Windows Server 2019

Can this tool be installed during the build?
Yes, though specifying specific versions can be tricky across platforms. Basic installations are:

### Windows
choco install R.Project
choco install rtools

### Ubuntu
sudo apt-get install -y r-base

### macOS
brew install r

Tool installation time in runtime
Windows: ~4 minutes
Ubuntu: ~1 minute
macOS: ~1 minute

Are you willing to submit a PR?
No

cc @margaretmeehan @jeremydelacruz

Scripting and command line Ubuntu Windows macOS awaiting-deployment enhancement

Most helpful comment

Is there any chance of reconsidering this? The versions of R available via the platform package managers are generally quite old, so they are often not useful in CI settings.

In addition the version of R installed by homebrew is not generally the best for macOS, rather installing the CRAN binary from the cask would be preferred, e.g. brew cask install r. There are some details on why this is preferred at https://rstats.wtf/set-up-an-r-dev-environment.html#what-about-homebrew.

Having an existing R on the PATH causes our setup-r action to avoid installing R, which breaks builds relying on it.

It seems there are more than 4000 workflows using this action (https://github.com/search?q=path%3A.github+%22setup-r%22&ref=opensearch), so this is a fairly severe issue.

We will change the action to unconditionally install R and workaround this issue. But generally I think it would be better for the R community not to have any R version installed by default on the images.

Update: I have changed the setup-r action so that it works again with these pre-installed versions of R, but I still think the R community would be better off not having them installed.

All 10 comments

Hello, thank you for your request.
We have added this issue to our backlog and will handle it soon

There is also an action that installs a requested R version, and it is cross platform: https://github.com/r-lib/actions/tree/master/setup-r#setup-r

Is there any chance of reconsidering this? The versions of R available via the platform package managers are generally quite old, so they are often not useful in CI settings.

In addition the version of R installed by homebrew is not generally the best for macOS, rather installing the CRAN binary from the cask would be preferred, e.g. brew cask install r. There are some details on why this is preferred at https://rstats.wtf/set-up-an-r-dev-environment.html#what-about-homebrew.

Having an existing R on the PATH causes our setup-r action to avoid installing R, which breaks builds relying on it.

It seems there are more than 4000 workflows using this action (https://github.com/search?q=path%3A.github+%22setup-r%22&ref=opensearch), so this is a fairly severe issue.

We will change the action to unconditionally install R and workaround this issue. But generally I think it would be better for the R community not to have any R version installed by default on the images.

Update: I have changed the setup-r action so that it works again with these pre-installed versions of R, but I still think the R community would be better off not having them installed.

Hello @jimhester , thank you for your feedback.
We are trying to use package managers as much as possible because they provide easiest and convenient way to install tools and usually they provide actual versions of software.
If it is wrong for R, we definitely should reconsider it.

  • Windows: looks like choco provide actual version so I think it is okay to continue using it
  • MacOS: we will switch to brew cask install r
  • Ubuntu: looks like apt-get provide very outdated version 3.x, what is your suggestion for Ubuntu installation?

https://cloud.r-project.org/bin/linux/ubuntu/README has instructions on obtaining newer R releases on ubuntu, perhaps that could be used here.

But really I think it would also be better to not include R at all in the images.

Hello, I'm excited to see that this is being added to the images!

I wanted to ask a few questions about this. Will multiple versions of R be installed on each build agent? What would the available R versions be? If multiple versions are to be installed, will they be available in the hosted tool cache?

Thanks!

cc @fnocera @margaretmeehan

Hello @jeremydelacruz , currently, we don't have plans to support multiple versions due to maintenance concerns.
Our images are updated on weekly basis and contain the latest version always.

If your use-case requires to use multiple versions and freeze old versions, I suggest to look at setup-r.

FWIW the setup-r action could benefit from R versions being available in the hosted tool cache. We use tool-cache in the code, but because the R versions are not hosted on GitHub there is no real benefit to it. If we could host them there then likely builds would become faster than they already are.

Hello, thank you for your response. Changes were added to all images and R version 4.0.2 is available. Feel free to raise additional threads if any.

Thanks so much for adding to all images so quickly, it is much appreciated! @dmitry-shibanov @maxim-lobanov

Was this page helpful?
0 / 5 - 0 ratings

Related issues

motss picture motss  Â·  3Comments

Poolitzer picture Poolitzer  Â·  4Comments

ethomson picture ethomson  Â·  4Comments

shogo82148 picture shogo82148  Â·  3Comments

jayaddison picture jayaddison  Â·  3Comments