Skip to content

feat: cron job for ensuring KWB computers have access to "stable" KWB-R packages #6

Description

@mrustl

Takeaways after discussing with @ItAtKwb for 2 hours what can be improved after the flusshygiene cron-job crash after updating KWB`s linux server to R 4.0.1 and realizing the messy R library installation workflow (2 cron job, one by @ItAtKwb and @wseis use different R libraries !!!) we ended up with some centralisation approach, which will not rule out all further issues but may be harmonize the "general" deployment at KWB of R packages.

The idea is that we provide an R script that can be used by @ItAtKwb to run a daily cron job on Linux/Windows servers so that:

  • Linux library: "/usr/lib/R/site-library"
  • KWB network drive (e.g.) : "//servername/kwbran/..." (preferably using "//servername" instead of "R:/")

always contain the latest version of R packages (always) on the "master" branch precompiled for both "linux" and "windows" and the latest KWB R release (currently: 4.01).
For Windows @ItAtKwb proposed to adapt the .libPaths() variable .Renvironment file (could be "rolled" out by Marcus.

@hsonne what do you think????

Below a first incomplete and buggy first version how this could look like:

pkg_dependencies <- c("devtools", "remotes", "withr") 

install.packages(pkg_dependencies)

remotes::install_github("KWB-R/kwb.pkgstatus", upgrade = "always")


non_r_packages <- kwb.pkgstatus::get_non_r_packages()

gh_repos <- kwb.pkgstatus::get_github_repos()

gh_r_packages <- gh_repos[!gh_repos %in% non_r_packages]



install <- function(p) {
  remotes::install_github(p, upgrade = 'always', auth_token = devtools::github_pat(quiet = TRUE))
}

withr::with_libpaths("C:/Users/mrustl/Documents/testlib", install.packages(c("devtools", "remotes")))
withr::with_libpaths("C:/Users/mrustl/Documents/testlib", code = {
                     lapply(gh_r_packages$full_name[1:2], install)
                     })


For linux the known system dependencies for package installation are described here:
https://github.com/KWB-R/pkgmeta/blob/master/.travis.yml#L9

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or requestquestionFurther information is requested

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions