OpenCPU Release 1.0.4

October 17, 2013
By

(This article was first published on OpenCPU, and kindly contributed to R-bloggers)

OpenCPU version 1.0.4 was released to CRAN and Launchpad this week. This release brings some bug fixes/improvements and no breaking changes so you can safely upgrade your 1.0.x installations. Upgrade an existing OpenCPU cloud server using:

sudo apt-get update


Or to install the latest version of the OpenCPU local single-user server in R:

update.packages(ask=FALSE)
install.packages("opencpu", repos="http://cran.r-project.org")


New in this release

One improvement in this release is the capturing of output from the package installation process. This is surprisingly difficult in R, but thanks to some helpful tips on r-devel, we found a way to implement it. This makes it much easier to diagnose the problem if a certain package fails to install on OpenCPU.

For example: as described in the API manual section on libraries, the /ocpu/cran/, /ocpu/bioc/ and /ocpu/github/ APIs represent remote libraries: when a client calls a package in any of these libraries for the first time, the OpenCPU server will attempt to install the current version of the corresponding package on the fly (if not already available), before processing the request. In a previous post we described how this allows anyone on the internet to use your R package without even installing R.

However, sometimes the installation of a package fails, for example because of a missing dependency or version conflict. To make it easier to diagnose the problem, the OpenCPU server now returns the output from the package installation process for failed installations. For example, here are two packages that fail to install, and now we know why :–)

Loading these pages can take a couple of seconds because we have to wait for the installation process to complete. However once a package installation has succeeded it is stored for 24 hours so that the next request/user will be able to use it instantaneously.

About Local and Remote libraries

It is important to note that the above only applies to the mentioned remote libraries. Package in any of the local libraries such as /ocpu/library/ are already installed on the server. When running your own OpenCPU server, it is preferable to install your package on the server in the usual ways and call it via the local library API. The remote libraries are mostly intended to allow anyone to share and use arbitrary packages on public OpenCPU servers.