Site icon R-bloggers

OpenCPU 2.1 Release: Scalable R Services

[This article was first published on OpenCPU, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

OpenCPU provides a mature and robust system for hosting R based services. The server exposes a simple HTTP API for calling R functions, scripts and managing data. The Cloud Server is completely free and scales up to many concurrent users. This provides a reliable foundation for intergrating R into any environment.

The 2.1 branch is the new major release of OpenCPU. The changes in this version are mostly internal, and make the server a bit lighter and faster. The built-in CI system has switched to the lightweight remotes package for installing packages from GitHub. Moreover the opencpu-server package has been tweaked to work better inside docker. Also we now target R 3.5 on server installations.

The user facing features are unchanged; see the opencpu 2.0 announcement post for a brief overview.

Upgrading

The version 2.1.0 is available from CRAN, Launchpad, Dockerhub, OBS and the server archive.

The recommended platform for running the server is Ubuntu 18.04 or 16.04, which can be installed directly from the PPA. For Fedora and CentOS you can download installers from the server achive. All binaries from the archive have been built on dockerhub and depend on the current version of R from Fedora / EPEL.

The easiest way to get started is by deploying your packages on the public cloud server by enabling the opencpu webhook in your GitHub repository.

Docker

Another easy way to get started is using docker, which also runs on Windows these days. Images based on various platforms are published on dockerhub The opencpu/rstudio image is recommended for development: it runs both opencpu-server and rstudio-server which are very powerful together.

# Run server as executable
docker run --name mybox -t -p 80:80 opencpu/rstudio

# OR: if port 80 is taken use port 8004
docker run --name mybox -t -p 8004:8004 opencpu/rstudio

Now simply open http://localhost/ocpu/ and http://localhost/rstudio/ in your browser! Login via rstudio with user: opencpu (passwd: opencpu) to build and install packages.

To connect to a running container (e.g. for installing system libraries) get a root shell:

# Replace 'mybox' with the container name or id
docker exec -i -t mybox /bin/bash

Use the opencpu/base image for deployments. Also see the docker readme.

To leave a comment for the author, please follow the link and comment on their blog: OpenCPU.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.