Platform Team/Infrastructure

< Platform Team
Revision as of 11:50, 4 September 2011 by Alsroot (talk | contribs)

Introduction

The entire workflow that the Platform Team provides for Sugar doers is whirling around three major services:

 

GNU/Linux distributions
Provide Sugar dependencies and, for major distributions, Sugar packages that might be used as-is.

Bazaar
In cases where Sugar is not packaged, or there are no required dependencies, packages will be built on Bazaar. But the major purpose of Bazaar is to be a place to consolidate all the efforts of Sugar doers:

  • hosting released sources (so, there is no need in requesting a shell account to upload files to http://download.sugarlabs.org),
  • being a universal build farm for binary-based projects,
  • supporting QA workflows where Bazaar packages might be branched, tested, and released.

Activity Library
Once Bazaar is in service, the Activity Library will be just a catalog of activities, all downloading will happen from Bazaar.


Tools

To interact with the doer environment from a command line, only the sweets command is needed. See walk-through tutorials for various use cases.

Technologies involved within the doers environment:

  • 0install - The only package management system that is being used ultimately.
    In some sense, 0install + sweets, and related infrastructure might look similar to rpm + yum, and related infrastructure.
  • PackageKit - Is used as a backend for 0install to work with native package management systems.
  • OBS - The source software for Bazaar.
  • AMO - The source software for Activity Library.


Software projects, sweets

All software projects (not just the Sugar related ones) are designated sweets within the doers environment. sweets might be one of several types:

  • aliases to native GNU/Linux packages, which map the same sweet name to the appropriate package name for a particular GNU/Linux distribution (henceforth, aliases),
  • recipe based, i.e., native to sugar environment, projects (henceforth, sweets).

Recipes

This is the starting point for both users' and doers' environments for a particular sweet project. Its major task—specifying how to prepare the code to launch.

Sweets contain a recipe file in the sources directory. Recipes are improved versions of activity.info files with the difference that recipes fully describe the sweet (i.e., like GNU/Linux distribution spec files), and are intended not only for activities.

Recipes contain a variety of metadata about the sweet, including important things like version, dependencies, and sweet_id. The value of a sweet_id is just a short (not unique) name, which is used in various sweet identifiers.

Identifiers and implementations

All sweets are identified by Web URLs:

  • urls for unique identification:
http://sweets.bazaar-hostname/user-account/sweet_id
  • urls to collect all implementations for the same sweet_id:
http://sweets.bazaar-hostname/sweet_id

Where:

  • bazaar-hostname - The Bazaar instance that is being used to host projects.
  • user-account - The account name of the developer on Bazaar.
  • sweet_id - The sweet identifier from the project recipe.

The same unique project identifier might be associated with several sweet implementations from the same doer. An implementation is just a copy of the sweet software in a ready-to-use state, e.g., several versions of the sweet, several binary implementations of the same sweet version built against several environments. Only one implementation will be chosen for a running environment, based on operating system, hardware architecture, GNU/Linux distribution, or user preferences (like running only stable versions).

A second type of sweet identifier is used for collecting sweet implementations from several doers. For example, a doer might tweak an existing project, and share it, and want other people to be aware of its existence as another sweet implementation. The process of choosing the proper implementation to run will be extended by additional options, such as choosing implementations only from a particular doer.

Development implementations

Ready-to-use sweets implementations, i.e., those locally available, might be in two states:

  • read-only implementations, which can only be used,
  • under-development implementations, which might be changed at any time.

In other words, development implementations are just checked-out, sweets sources, placed in one of the default directories, ~/sweets and ~/Activities.

Development implementations have the highest running priority, but that may be changed by the user at any time, just like regular implementations.

Such implementations are a good way for sneakernet sharing of sweets, by just bundling a sweet directory, and extracting it on another machine, as needed.


Sweets tracker

The Sweets tracker is a DBus service that is being used by the sweets command and the Sugar Shell to run sweets, and handle other high-level sweets related procedures.

The reasons for having a DBus service are these:

  • the need to monitor development implementations and not to scan directories every time,
  • to cache 0install internal procedures so to speed up the launch process,
  • to enable background updates, and
  • to support mirroring of 0install implementations so to share already downloaded files within a local network to decrease Internet traffic.


Bazaar

Bazaar is a patched version of OBS. It handles all server-client share related procedures, like hosting sweet sources and implementations. For binary-based sweets, Bazaar is a build farm, as well.

In many cases, Bazaar will be used implicitly:

  • uploading a new version will be called from the sweets commit command,
  • launching will happen just by calling a sweet url.

The only thing required is being registered on Bazaar. For the default http://bazaar.sugarlabs.org instance, that means being registered in the Sugar Labs Central Login system.


Activity Library

In the doers' environment, the Activity Library will be a catalog of sweets. It might be treated as a front-end for Sugar development, where Bazaar is a back-end, and an analog of the current Developer Hub on Activity Library.

A sweet URL is all that is needed to obtain a new Activity Library entity; the rest will be fetched from the sweet at the other end of that URL. At some point, Bazaar might automatically publish announcements of newly created sweet implementations.