You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
setup-r-dependencies - Why not leverage de repo options ? It fails if we want to use this action in a Github Enterprise with our own repository mirroring
#918
Open
marandet opened this issue
Sep 5, 2024
· 1 comment
I am using these actions in a on-premise Github Enterprise installation.
We are using our own package-manager that is configured to mirror several kind of repositories (from Docker artefacts and OS-Distributions to languages-specific libraries, including CRAN).
The point is that all of this is within our internal network so that we do not allow our github runner to have access to the internet.
I successfully run the setup-r action, leveraging the RSPM environment variable and the extra-repositories option in order to point to our Artifactory.
I also add a step in order to write the options.repos value within the Rprofile configuration file.
But the installation of the pak package still fails.
A clear and concise description of what the bug is.
And the following error occurs in the Run r-lib/actions/setup-r-dependencies@v2 step, in the Run # Install pak substep.
Run # Install pak
# Install pak
echo "::group::Install pak"
if which sudo >/dev/null; then SUDO="sudo -E --preserve-env=PATH env"; else SUDO=""; fi
$SUDO R -q -e 'dir.create(Sys.getenv("R_LIB_FOR_PAK"), recursive = TRUE, showWarnings = FALSE)'
$SUDO R -q -e 'install.packages("pak", lib = Sys.getenv("R_LIB_FOR_PAK"), repos = sprintf("https://r-lib.github.io/p/pak/%s/%s/%s/%s", "stable", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
echo "::endgroup::"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
GITHUB_PAT: ***
R_KEEP_PKG_SOURCE: yes
R_LIBS_USER: /home/runner/_work/_temp/Library
TZ: UTC
_R_CHECK_SYSTEM_CLOCK_: FALSE
NOT_CRAN: true
RSPM: https://artifactory-URL/ubuntu/dists/jammy/
RENV_CONFIG_REPOS_OVERRIDE: https://artifactory-URL/ubuntu/dists/jammy/
R_LIB_FOR_PAK: /opt/R/4.4.1/lib/R/site-library
Install pak
> dir.create(Sys.getenv("R_LIB_FOR_PAK"), recursive = TRUE, showWarnings = FALSE)
>
>
> install.packages("pak", lib = Sys.getenv("R_LIB_FOR_PAK"), repos = sprintf("https://r-lib.github.io/p/pak/%s/%s/%s/%s", "stable", .Platform$pkgType, R.Version()$os, R.Version()$arch))
Warning: Warning: unable to access index for repository https://r-lib.github.io/p/pak/stable/source/linux-gnu/x86_[64](https://github-on-prem-URL/MyORG/MyREPO/actions/runs/7782/job/13135#step:6:67)/src/contrib:
cannot open URL 'https://r-lib.github.io/p/pak/stable/source/linux-gnu/x86_64/src/contrib/PACKAGES'
Warning message:
package 'pak' is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
>
>
Expected behavior
The installation of every package should leverage the options.repos configuration.
Additional context
I guess that the problem is in this specific line of code
This is not a bug, it is a requirement. setup-r-dependencies requires access to GitHub Pages currently.
A workaround is to do these before using setup-r-dependencies:
set the R_LIB_FOR_PAK environment variable to point to a package library
manually install pak there
set pak-version: none for setup-r-dependencies.
It is best to install pak into a different library than the one you use for your regular packages, in case some of those also required pak and need a different version.
Describe the bug
I am using these actions in a on-premise Github Enterprise installation.
We are using our own package-manager that is configured to mirror several kind of repositories (from Docker artefacts and OS-Distributions to languages-specific libraries, including CRAN).
The point is that all of this is within our internal network so that we do not allow our github runner to have access to the internet.
I successfully run the setup-r action, leveraging the RSPM environment variable and the extra-repositories option in order to point to our Artifactory.
I also add a step in order to write the options.repos value within the Rprofile configuration file.
But the installation of the pak package still fails.
A clear and concise description of what the bug is.
To Reproduce
Here is an example of my use-case :
And the following error occurs in the Run r-lib/actions/setup-r-dependencies@v2 step, in the Run # Install pak substep.
Expected behavior
The installation of every package should leverage the options.repos configuration.
Additional context
I guess that the problem is in this specific line of code
actions/setup-r-dependencies/action.yaml
Line 110 in e6be4b3
The text was updated successfully, but these errors were encountered: