Skip to content

Z. DO NOT USE Detailed Installation Overview

Gordon Woodhull edited this page Jun 5, 2015 · 1 revision

Specialized installation instructions

DO NOT USE these instructions as your primary guide!!!

Use the main installation instructions instead.

This page is not up-to-date, but it may contain extra hints if the main instructions do not work for you.

No, really. Stop now. Go here instead.

Introduction

RCloud is currently under heavy development. If you are having trouble setting up RCloud, please raise an issue here.

Installation requirements

The setup instructions below are for a two different set of users. If you simply wish to run RCloud, please have a look at the Users section. However, if you want to hack around the code, please see the section for Developers. The steps below are specific to Ubuntu, but equivalent commands are available for other linux distributions.

Users

This section applies to users. Some of these steps would be applicable to developers as well. If you are a developer, please jump to the Developers section.

1. System Dependencies

RCloud requires R packages Cairo, httr which depend on the following system dependencies

  • libxt-dev
  • libcurl4-gnutls-dev
  • libcairo2-dev

If you are using other Linux systems, the names for the development headers might vary. Please lookup the corresponding names and install them. On Ubuntu, you can simply do

sudo apt-get install libxt-dev libcurl4-openssl-dev libcairo2-dev

to install all system dependencies.

2. Install R

Upgrade to R 3.0, if you already have it. It'll make your life easier, we promise. If you haven't already, please see below

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo echo 'deb http://cran.rstudio.com/bin/linux/ubuntu precise/' >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y r-base-dev

3. Get git

We'll be cloning the sources from GitHub so you need git

sudo apt-get install git

4. Downloading the source code

The source code is available in the GitHub repository, and you can clone it

git clone https://github.com/att/rcloud.git && cd rcloud

5. Setting up a GitHub application

Let's define RCLOUD_BASE_URL as the url where you plan to host RCloud. Also, for the sake of simplicity, let's assume that you are hosting at 127.0.0.1, which is localhost.

RCloud uses gists for storage and GitHub accounts for authentication. Please create a GitHub login if you don't have one, or, a Enterprise GitHub account if your organization uses Enterprise GitHub.

You'll need to create a GitHub application. Go ahead and open the link and click on "Register New Application" on the top right corner.

Please provide the following details in the application registration form

Application Name: RCloud
Homepage URL: http://127.0.0.1:8080/login.html
Callback URL: http://127.0.0.1:8080/login_successful.R

This GitHub application will need to point to the location you will deploy RCloud (RCLOUD_BASE_URL, or in this case 127.0.0.1).

6. Adding configuration files

RCloud uses cookies for You would need to modify/create two configuration files. conf/rcloud.conf is a general configuration file for RCloud.

a. Setting up conf/rcloud.conf

If you would be running the server on localhost(127.0.0.1), this is what you need to do.

$ echo -e 'Cookie.Domain: 127.0.0.1' > ./conf/rcloud.conf

If you have trouble with authentication, make sure your hostname is FQDN (fully qualified domain name) and it matches your external name. You can use hostname -f to check that. The reason is that the cookie domain defaults to the hostname if not otherwise specified. If either of the above is not true, then create conf/rcloud.conf file with

Cookie.Domain: myserver.mydomain

Alternatively, you can set Host: instead with the same effect.

b. Setting up GitHub

Remember the new application you created on GitHub? Well, now it's time for RCloud to know about the GitHub application. Please edit the file conf/rcloud.conf and modify the contents. If you're using github.com, then part of your file will look like this:

github.client.id: your.20.character.client.id
github.client.secret: your.40.character.client.secret
github.base.url: https://github.com/
github.api.url: https://api.github.com/
github.gist.url: https://gist.github.com/

The third and fourth lines are the base URL of the GitHub website and the entry point for the GitHub API (these might differ in Enterprise Github deployments).

7. Starting the RCloud server

If you are still in the folder rcloud, just do

$ ./scripts/fresh_start.sh

This will reinstall the rcloud.support package, recompile the javascript files (if you have node.js and the necessary dependencies installed), kill any old instances of RCloud running, deauthorize all login tokens, and start a new version of RCloud.

8. Authorizing the GitHub app

Then go to http://127.0.0.1:8080/login.R, click login, and authorize access to your account through GitHub.

Developers

Please follow steps 1 & 2 from the Users section. Once the dependencies and R is installed, please follow these additional steps.

3. Installing git and npm

Most developers use git nowadays, but just in case you don't have that on your system, please install it using

$ sudo apt-get install git

The npm version on debian systems is typically older, so you should try installing a later version

$ sudo apt-get install build-essential libssl-dev
$ wget http://nodejs.org/dist/v0.10.15/node-v0.10.15.tar.gz; tar xpf node-v0.10.15.tar.gz; cd node-v0.10.15/
$ ./configure
$ make && make install

4. Checking out the code

The RCloud GitHub repo contains RCloud source code. Simply doing

git clone https://github.com/att/rcloud.git

will download the main source code.

We have added package.json in multiple locations to compile the javascript dependencies. This will install all the node.js dependencies necessary to create the minified javascript files used in RCloud.

npm install htdocs/js
npm install htdocs/lib

After step 4, please continue steps 5,6,7 & 8 as described in the Users section.

9. Starting RCloud

The safest way to install RCloud currently is to simply run the scripts/fresh_start.sh script. This will reinstall the rcloud.support package, recompile the javascript files (if you have node.js and the necessary dependencies installed), kill any old instances of RCloud running, deauthorize all login tokens, and start a new version of RCloud.

When things go wrong

If for some reason, you are facing a weird error message OR have a copy of the older code with a known issue - it's best to switch to the latest copy of everything (source code, R packages).