Overview

Installing RAIN C&C

Prerequisites

For using RAIN C&C you need the following to have Python 2.7 installed. Earlier versions of Python might work, but have not been tested.

There are also a number of requirements:

  • SQLAlchemy 0.7.3
  • boto 2.1.0
  • python-cloudfiles 1.7.9.1

These can be installed however you which. The easiest way is by downloading the package and use pip to install everything inside reqs.txt.

pip install -r reqs.txt

Downloading RAIN C&C

There are several ways of getting RAIN C&C

  • Download an archive, shown below
  • Clone the repository
  • Install using PIP

Downloading the archive

Go to https://bitbucket.org/andersem/rain-cc/downloads and choose zip, gz or bz2 to the right of the version tagged 1.7.

Installing the downloaded archive

Extract the archive somewhere on the disk where you can access it with python, preferrably place this in your python path.

Configuring the installation

raincc/settings.txt contains settings you might want to change.

root - points to the directory to store RAIN C&C files. The default directory is normally C:\Users\(username)\rainfiles on windows and /home/(username)/rainfiles on Linux.

cloud_accounts - this is where you add cloud provider accounts. The default ones is the lab account from the project, and an undefined account at Amazon S3. The lab account will be available for a limited time. If you want to use RAIN C&C after that, you will have to configure an Amazon S3 account at http://aws.amazon.com.

Using RAIN C&C

The best way of interacting with the RAIN C&C is through the Controller. If you use S3, you will first have to create a bucket at http://aws.amazon.com/console/ for your account for RAIN to be able to store anything.

Uploading files

>>> from Controller import Controller
>>> fileToUpload = open('/path/to/file/')
>>> c = Controller() #will create the folders and the database
>>> c.sendFile(fileToUpload,numOfChunks=8)

To make sure of asynchronousity when downloading big files, the callback will come in form of an added message-row in the database when the upload is complete.

Downloading files

Make sure the file you want to download exists on the server.

>>> from Controller import Controller
>>> c = Controller()
>>> c.getFile('filename')

The file will be stored under rainfiles/received. Callback will be in form of an added message-row in the database when the download is complete.

Deleting files

>>> from Controller import Controller
>>> c = Controller()
>>> c.deleteFile('filename')

Hope you find it of use, please contact the author if anything is unclear.