R Scripts Deployment

R Scripts System Requirements

License Requirements

This feature is available with the core APM application; no specific license is required.

Additional Components Required

In addition to the basic APM system architecture, your system must also contain the following additional components:
  • R Server: A machine on which the R Server software is installed. The software requirements of this server are determined by the third-party distributor of the software.
The APM testing environment uses the following:
  • Rserve 1.8-11 with R V4.3.1 running in Docker containers on Linux servers

Deploy R Scripts for the First Time

Before You Begin

After you have installed and configured the basic APM system architecture, including the R server, you will need to perform some configuration steps specifically for R Scripts.

The following table outlines the steps that you must complete to deploy and configure this module for the first time. These instructions assume that you have completed the steps for deploying the basic system architecture.

These tasks may be completed by multiple people in your organization. We recommend, however, that the tasks be completed in the order in which they are listed.

Results

StepTaskNotes
1Ensure that your R Server is configured according to the R Scripts system requirements. For more information, refer to Install Rserver and R.This step is required.
2In APM, specify the R Server credentials.This step is required.

Install Rserve and R

About Rserve

Rserve is an open-source package that enables TCP/IP connections to R. Details about the Rserve package can be found at http://rforge.net/Rserve/.
Note: APM supports only two forms of Rserve authentication (refer to https://github.com/s-u/Rserve/wiki/Security):
  • No authentication
  • Plaintext password authentication

Install Rserve and R

Rserve and R can be installed on either Windows or Linux platforms; however, Linux is recommended.

Important: To ensure that the date and time values are handled as expected, the time zone of the Docker container running Rserve must be set to UTC.

GE Vernova has tested Rserve 1.8.13 with R V4.4.0 running in a Docker container, using the images provided by the Rocker project (https://www.rocker-project.org/) as base images. The following sample Docker files can be used to build suitable containers:

SAMPLE MINIMAL DOCKERFILE:
FROM rocker/r-ver:4.4.0 
# install Rserve 
RUN install2.r --error \ 
    -r https://cran.rstudio.com \ 
    Rserve && \ 
    rm -rf /tmp/downloaded_packages/ /tmp/*.rds 

ENTRYPOINT R -e "Rserve::run.Rserve()" 
SAMPLE DOCKERFILE WITH SOME PACKAGES PRE-INSTALLED:
FROM rocker/r-ver:4.4.0
# install tidyverse 
RUN /rocker_scripts/install_tidyverse.sh 

# install tidymodels 
RUN install2.r --error --skipinstalled tidymodels && \ 
    rm -rf /tmp/downloaded_packages 

# install RcppArmadillo 
RUN install2.r --error \ 
    -r https://cran.rstudio.com \ 
    RcppArmadillo && \ 
    rm -rf /tmp/downloaded_packages/ /tmp/*.rds 

# install WeibullR 
RUN install2.r --error \ 
    -r http://R-Forge.R-project.org \ 
    WeibullR && \ 
    rm -rf /tmp/downloaded_packages/ /tmp/*.rds 

# install survival 
RUN install2.r --error \ 
    -r https://cran.rstudio.com \ 
    survival && \ 
    rm -rf /tmp/downloaded_packages/ /tmp/*.rds 

# install Rserve 
RUN install2.r --error \ 
    -r https://cran.rstudio.com \ 
    Rserve && \ 
    rm -rf /tmp/downloaded_packages/ /tmp/*.rds 

ENTRYPOINT R -e "Rserve::run.Rserve()" 

Specify R Server Credentials

Before You Begin

You must be a Super User or member of the MI Configuration Role security group to modify the R Server credentials.

Procedure

  1. In the Applications menu, navigate to ADMIN > Operations Manager > Connections.
    The Connections page appears.
  2. Select R Server.
    The R Server workspace appears.
  3. In the R Server Version box, specify Rserve.
  4. In the Server Address box, enter the address of the R Server (for example, rserve18.myapm.com).
  5. ).
  6. In the User Name and Password boxes, enter the user name and password that you want to use for the R Server connection.
  7. Select Save.
    The R Server credentials are saved.
  8. Select Perform Connection Test to confirm that the connection is valid.