Installing packages on brightRserver

brightRserver R Package Manager


The brightRserver R Package Manager (RPM) is a system designed to automate installation, upgrade and removal of R packages on your brightRserver.

When you install new packages with the brightRserver RPM, by default, it will use the Microsoft R Application Network (MRAN) historic image of CRAN from 2020-04-11. Refer to https://mran.microsoft.com/ for details on MRAN. You can override the preferred CRAN/MRAN mirror or use other installation methods via the devtools package “install” class of commands.

Throughout this section, references to CRAN implicitly mean the system configured option for installation, which by default is MRAN with the date of 2020-04-11.

To pass instructions to the RPM, you must use the SFTP system to upload requests for new CRAN packages or specify devtools specific install commands or request package removal. It is important to note that there is a restricted list of twenty brightRserver system core packages that should not be installed, updated, removed or changed: base64enc, compareDF, DBI, dbx, dplyr, DT, httr, lubridate, readr, reshape2, rhandsontable, RJSONIO, RSQLite, safer, shiny, shinydashboard, shinyjs, shinyWidgets, stringr and tidyr.


Install CRAN Packages


To install CRAN packages, create a file named “requested_packages.brightR”. Place the name of each requested package on a separate line — do not use quotes, commas or any delimiter characters, just the name of the package on each line. For example, here is a sample requested_packages.brightR file contents:

Boom
lars
spelling
questionr
tiff
BoomSpikeSlab
rhandsontable
pixmap
bsts
ordinal


The next step to install your requested packages is to update this file, via SFTP, to /yakdata-admin/libraries/install. The RPM system checks this folder every minute for a request file. If one is found, the brightRserver Editor 1 slot will be stopped and used for automated installation by the RPM. The session in use by Editor 1 should be preserved, but in case an issue arises it is a good practice to alert the Editor 1 user before starting an install request. The Editor 1 slot will be unresponsive while the installation requests are being fulfilled. Ideally, the designated package installation user should be the same person as the Editor slot 1 user, to prevent any work issues.

Once the system starts, the request file you updated will be renamed by the RPM system to the name plus a date and time stamp file extension, like this example “requested_packages.brightR.2020-11-02_16-38-11”. This preserves a history of your install requests and indicates that the system has started the process.

As installation proceeds, you can monitor the packages that have been installed by checking the /yakdata-admin/libraries/packages folder. Packages that ultimately fail to install will appear in the /yakdata-admin/libraries/packages-load-fail folder. Note that while packages are installing, they appear in the /yakdata-admin/libraries/packages folder until their successful installation is confirmed.

All system-generated logs of your installation request, by package, appear in the /yakdata-admin/libraries/install-log folder. They will not appear in this folder until the installation attempt is complete for a particular package. The maximum time allowed for installing a package is ten minutes. Most packages install in one to five minutes, based on our experience at YakData.

Note that packages that require user intervention to install will fail and cannot be installed on brightRserver. Additionally, any package that requires linux server components that are not installed on our brightRserver operating system will also fail.

While the RPM attempts to install all dependencies of your requested CRAN package, some packages do not properly identify their dependencies needed to fully install. YakData has noticed a small subset of packages that therefore require prior explicit package installation before a successful install of the desired package succeeds. Check the install logs for failed installs carefully to see if your desired package may have this situation.


Install via devtools — Packages from Github and Other Sources


Using the devtools package and a valid install command request, you can install packages from Github, an URL or a local install, to name a few options.

To install packages with devtools, create a file named “requested_packages_devtools.brightR”. Place the command of each request on a separate line and on the same line, surrounded by the pound symbol, “#”, specify the simplified name of the expected package. For example, here is a sample requested_packages_devtools.brightR file contents:


# install from github# of the form
# command from devtools parameter(s) #expected package name#

devtools::install_github('cran/archivist') #archivist#
devtools::install_github('ramnathv/htmlwidgets') #htmlwidgets#
devtools::install_github('ramnathv/slidify') #slidify#

# specific version from CRAN/MRAN/etc.
devtools::install_version("forecast", "8.11") #forecast#


It is important that you properly specify the expected package name at the end of each line, enclosed by pound symbols. If you do not specify the name correctly, testing the library will fail and the package will not be available. Check your log for details.

Comments and blank lines are ignored by the system. Any line that does not begin with “devtools:install” or “remove.packages” is also ignored by the system.


Remove Packages from brightRserver


Using the same file from the Github section, “requested_packages_devtools.brightR”, add package removal requests like this:


# Uninstall packages like this
#
remove.packages("package name") #package name#

remove.packages("ufs") #ufs#
remove.packages("slidify") #slidify#


These commands can be mixed with devtools commands, with each command on a separate line. Commands are executed in the order found in the request file. There is a restricted list of twenty brightRserver system core packages that should not be installed, updated, removed or changed: base64enc, compareDF, DBI, dbx, dplyr, DT, httr, lubridate, readr, reshape2, rhandsontable, RJSONIO, RSQLite, safer, shiny, shinydashboard, shinyjs, shinyWidgets, stringr and tidyr.


Sample requested_packages_devtools.brightR


# Upload this sample file to /yakdata-admin/libraries/install
# Which checks every minute for a new install request

# remove some packages before install
remove.packages("slidify") #slidify#
remove.packages("htmlwidgets") #htmlwidgets#
remove.packages("archivist") #archivist#

# install from githubdevtools::install_github('cran/archivist') #archivist#
devtools::install_github('ramnathv/htmlwidgets') #htmlwidgets#
devtools::install_github('ramnathv/slidify') #slidify#

# install specific version from CRAN
devtools::install_version("shinyjs", "1.1") #shinyjs#

# install from local - use folder /yakdata/mypackages for convention
devtools::install_local("/yakdata/my-packages/shinyBS-shinyBS3") #shinyBS#


All packages will install by default using MRAN snapshot system, based on these default options in the R session:

brightRMRAN <- "2020-04-11"
options(repos = c(CRAN=paste0('https://mran.microsoft.com/snapshot/', brightRMRAN)), download.file.method = 'libcurl')

Note that the R version on the brightRserver is:

R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

You can not change or update the R version in use on brightRserver.


Article created: brightRserver Version 1.0.0