Wiki

Clone wiki

developer-guide / CoSSMic platform deployment packages

This page describes the package installation and maintenance tool which is used to deploy the CoSSMic platform on raspbian jessie through the installation of two debian packages. There are two versions of the raspbian packages: one for the standard jessie image and the other in case you have modified the standard jessie image in order to extend the SD card lifetime (follow till step 3.5) as described here.

In both cases, you should use this guide to resize the filesystem (first section) and eventually to make some personalizations (second section).

Now you are ready to deploy the platform. First, download the two packages for your specific case via FTP at 193.206.100.155 using the following credentials:

  • username: cossmic
  • password: cossmic..

Once you have logged in, you can find the packages in /Cossmic/deb_packages. Here you will find a guide in PDF, and two directories: one for the extended SD lifetime edited version of Jessie and one for the standard Jessie. The "jessie-standard" directory contains:

  • Standard jessie emoncms deb Package
  • Standard jessie MAS deb Package

The "jessie-extended-lifetime" directory contains:

  • Extended SD lifetime jessie emoncms deb package
  • Extended SD lifetime jessie MAS deb package

In each of the above mentioned directories, you will also find the "source" directory containing a zip file with the sources of the packages.

The PDF guide refers to the extended SD lifetime version of the jessie image, but it applies well to the standard version.

1. Installing the first package

$ rw (only for the extended SD lifetime version)
$ sudo dpkg -i ./emoncms_1.5-1_all.deb
$ sudo emoncms

2. Installing the second package

The parameters of the third step are hostname.domain, neighborhood [konstanz|caserta], household_id, apikey.

$ rw (only for the extended SD lifetime version)
$ sudo dpkg -i ./mas-final_1.5-1_all.deb
$ sudo mas-final cossmic.ce04 caserta 1 73622342b7fd816e07a3b287d80e8b01
$ export PYTHONPATH=$PYTHONPATH:/var/cossmic/mas/spade:/var/cossmic/mas/agents
$ python /var/cossmic/mas/agents/adduser.py cossmic.ce04 actormanager

3. Prepare packages for deployment and for update

The debian packages are prepared following the guidelines provided here:

When software has been updated, an upgrade can be released following the guidelines here: Updating the package

4. Architecture of Debian packages

This description includes operations which allows for the deployment on Jessie image that use ramdisk for saving logs.

In particular the main features which have been considered are:

  1. /root partition is mounte read-only each hour by cron
  2. /temp partition is only 150MB
  3. /var/log is temporary

The first packet include the following filesystem:

  • /etc/cossmic – with some configuration files
  • /tmp/cossmic/virtualdevices and /tmp/cossmic/emoncms – containing the emoncms source code and virtual devies (they will be copied into the web serve root)
  • /var/cossmic/pvprediction – for prediction of energy production

In Figure it is shown the part of the script that addresses first and second item:

script1.png

The third item, that is the temporary log partition, generates some errors during the installation of some software, which need to find their logs files at the start-up. This is the case of redis key-value store. We addressed this issues by adding to the installation script the lines shown in Figure:

scrpit2.png

The second packet contains the following directories to be copied into the filesystem:

  • /var/cossmic/mas – contains CoSSMic Agents and the SPADE2 platform
  • /tmp/cossmic/bin/taskscheduler – Binary files of taskscheduler built for raspberry pi (Jessie)

The next Figure shows the script that asks to the user (during the installation of the packet) the necessary parameters:

  1. hostname.domain – e.g. cossmic.ce04
  2. neighbourhood – e.g Caserta, or Konstanz
  3. household_id
  4. APIKEY (it is optional, but if it is not provided configuration files should be updated manually)

script3.png

Updated