Platform Team/Infrastructure

< Platform Team
Revision as of 02:58, 24 February 2011 by Alsroot (talk | contribs)

An overview of Sugar doers environment implementation.

Tools

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

Involved technologies within doers environment:

  • 0install the only package management system which is being used on high level.
    In some meaning, 0install + sweets and related infrastructure might look similar to rpm + yum and related infrastructure.
  • PackageKit as a backend for 0install to work with native package management systems.
  • OBS as the source for Bazaar.
  • AMO as the source for Activity Library.

Software projects, sweets

Software projects (not only Sugar related) are named sweets within doers environment and might be one of several types:

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

Recipes

This is the departing point for both, users and doers, environments for the particular sweet project. It is intended to accomplish the major task - how to prepare the code to launch.

Sweets contain recipe file in 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 do) and intended not only for activities.

Recipes contain various metadata about the sweet, including important ones like version, dependencies and sweet_id. The value of sweet_id is just a short (not unique) name which is being 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, Bazaar instance which is being used to host projects
  • user-account, account name of the developer on Bazaar
  • sweet_id, sweet identifier from the project recipe

The same unique identifier might be associated with several sweet implementations from the same doer. Implementation is just a copy of the sweet in 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 in running environment basing on operating system, hardware architecture, GNU/Linux distribution or user preferences (like running only stable versions).

The reason to have second type of sweet identifiers is collecting sweet implementations from several doers. For example, doer might tweak existed project and share it, other people will be aware of existence of another sweet implementations. The process of choosing the proper implementation to run will be extended by additional options like choosing implementations only from particular doer.

Development implementations

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

  • read-only implementations that might be only used,
  • under development implementations that might be changed at anytime.

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

Development implementations have the highest running priority but it might be changed by user at any time since these are regular implementations.

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

Sweets tracker

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

The reasons to have DBus service are:

  • need to monitor development implementations to not scan directories every time,
  • cache 0install internal procedures to speed up launch process,
  • background updates,
  • support mirroring of 0install implementations to share already downloaded files within 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 implementation. For binary based sweets, Bazaar is a build farm as well.

In many cases Bazaar will be used implicitly:

  • uploading new version will be called from sweets commit command,
  • launch will happen just by mentioning sweet url.

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

Activity Library

In doers environment, Activity Library will be a catalog of sweets. It might be treated as a frontend of Sugar development, when Bazaar is a backend and an analog of the current Developer Hub on Activity Library.

The only sweet URL is needed to add new Activity Library entity, the rest will be fetched from the sweet. Also Bazaar might automatically publish information of newly created sweet implementations.