Deployment Platform/Sneakernet

Summary

This is one of possible deployment scenarios of Harmonic Distribution.

Background

This page is intended to describe procedures for school servers and end users in Internet-less environment. Using predefined recipes, it should be possible to fully support such deployments.

Targeting environment

The standard targeting environment, final environment might be similar, assumes:

  • Particular deployment, e.g., a school, without Internet access.
  • Lack of technical personal when in most cases only not IT skilled teachers have access to school servers.
  • Lack of dedicated hardware for school servers, server side software will be launched on teacher's XO laptop (XO-1.5 is preferred).
  • School server's client connected to school server XO using Ad-hoc wireless connection.
  • The only way to synchronize school servers with each other and with the master one, is a sneakernet.

Synchronization content

The synchronization content includes all data that needs to be accessible from a school server to support complete life cycle of served clients. These are:

  • Base software updates to proceed unattended upgrade on server and client sides.
  • Unattended configuration for school server and clients.
  • Optional upload to master server of usage statistics.
  • Sugar Network content, intended to cover all other needs.

Objects

What kind of objects involved to the process:

  • Master server
    Main Sugar Network server accessible via the Internet. Each Master server has public API url. This tutorial is using http://api-testing.network.sugarlabs.org to refer to testing Sugar Network Master launched on Sugar Labs server.
  • Node servers
    Local Sugar Network servers that are intended to be distributed versions of the Master. This tutorial assumes that Nodes don't have direct connection to the Master, and the only one way to synchronize data is the Sneakernet.
  • Database media
    Node servers might store database on removable devices (makes sense if Nodes are XO laptops), in that case, such devices should have a magic file, named .sugar-network, in the root directory on removable device. Having this magic file will let Node's software auto detect recently plugged removable device as a Database media to start behaving correspondingly.
  • Synchronization media
    Removable media device, e.g., USB stick or SD card that will be used to transfer Packets between servers. Synchronization media should have a magic file, named .sugar-network-sync, in the root directory. Having this file will let Node's software start synchronization process automatically after plugging media.
  • Synchronization packets
    Regular files that contain synchronization data placed to Synchronization media. Packet files are tarballs with .packet file name suffix.

Recipes

A list of scenarios to follow in the field.

Clone Master

On a box with Internet available, plug Synchronization media. Its mount point will be referred as MOUNTPOINT in text below.

If sugar-network package is installed, run the following command:

sugar-network-sync MOUNTPOINT http://api-testing.network.sugarlabs.org/

Otherwise,

  • place fetched data to MOUNTPOINT with to a file with .packet suffix;
  • create empty file in MOUNTPOINT named as .sugar-network-sync.

Run Node server on Sugar box

This mode is useful when there is no dedicated hardware for school server. In that case, particular XO laptop might be a Node server, e.g., one that teacher has.

  • Prepare Database media. Place the following files to the root of removable device that is intended to be a Database media:
    • .sugar-network file;
    • master file with api-testing.network.sugarlabs.org content, will be Master's GUID;
    • node file with arbitrary string content, will be Node's GUID.
  • On a box that is intended to be a Node server; in Sweets Distribution Control Panel section, enable Behave as a Sugar Network server.. checkbox (will require restarting Sugar Shell).
  • Plug prepared Database media.

In current implementation, the initial process on Node side will take some time (30min on XO-1.5 laptop) to merge synchronization data.

Run clients

  • Make sure that Node server and all clients are in the same local network, e.g., wireless Ad-hoc.
  • Client Sugar boxes should enable Auto discover server in local network radio-box in Sweets Distribution Control Panel section.
  • Client should see Node content as a Network content.

Current implementation is fragile in case of detecting local Node server, if Node content is not available on client side, try to restart Sugar.

Synchronize Node on Sugar box

On a Node box,

  • plug Synchronization media to let Node read input and write output Synchronization packets;
  • wait until Sugar Shell will alert with Synchronization complete.. message;
  • unplug Synchronization media.

On a box that has Internet available,

  • plug Synchronization media;
  • run sugar-network-sync script (placed by Node while synchronizing) from its root and wait until it will finish uploading and downloading Synchronization packet files;
  • then, repeat Node box steps.