Difference between revisions of "Platform Team/Package Management System"

From Sugar Labs
Jump to navigation Jump to search
(Actualize text)
Line 5: Line 5:
 
== Zero Sugar Distribution ==
 
== Zero Sugar Distribution ==
  
Zero Sugar provides a method that is transparent for users and convenient for doers to deploy software across varying platforms as well as across Sugar releases. Zero Sugar is mainly targeted to support a direct, doer-to-user interaction model, i.e., shortcut the chain of transfer of doer-to-distributor-to-user (still, Zero Sugar could be [[#Distributors|beneficial]] for distributors, since it unifies the deployment workflow).
+
Zero Sugar provides a method that is transparent for users and convenient for doers to deploy software across varying platforms as well as across Sugar releases. Zero Sugar is mainly targeted to support a direct, doer-to-user interaction model, i.e., shortcut the chain of transfer of doer-to-distributor-to-user (still, Zero Sugar could be [[#Distributors|beneficial]] for distributors, since it unifies the deployment workflow).
  
 
== Benefits ==
 
== Benefits ==
Line 38: Line 38:
 
* [[Activity Team/Zero Sugar/0sugar|0sugar]], the main tool, everything happens via the {{Code|0sugar}} command.
 
* [[Activity Team/Zero Sugar/0sugar|0sugar]], the main tool, everything happens via the {{Code|0sugar}} command.
 
* [http://0install.net/ 0install] decentralized deployment infrastructure.
 
* [http://0install.net/ 0install] decentralized deployment infrastructure.
* [http://build.opensuse.org/ OBS], openSUSE Build Service, build farms and repository of native packages for the GNU/Linux distributions and architectures that OBS [http://wiki.opensuse.org/openSUSE:Build_Service_supported_build_targets supports].
+
* [http://build.opensuse.org/ OBS], openSUSE Build Service, that is patched to accomplish Zero Sugar needs. OBS will be hosted on SugarLabs servers and accessible from http://refinery.sugarlabs.org site. It will be a central place for all files related procedures like hosting various files, building binary-based activities, provide GNU/Linux distribution repositories for centralized Sugar distributions.
 
* [http://www.packagekit.org/ PackageKit] to install software from native packaging systems.
 
* [http://www.packagekit.org/ PackageKit] to install software from native packaging systems.
* [http://download.sugarlabs.org/ Sugar Labs]'s resources to host various files.
 
  
 
=== Identification ===
 
=== Identification ===
Line 60: Line 59:
 
** more efficient disk-storage usage e.g remove less frequently used activities to save space for new ones.
 
** more efficient disk-storage usage e.g remove less frequently used activities to save space for new ones.
  
=== Spec file ===
+
=== Recipe file ===
  
The process departing point is a [[Activity Team/Zero Sugar/0sugar.info Specification|spec file]] which is used within Zero Sugar to accomplish two major tasks:
+
The process departing point is a [[Activity Team/Zero Sugar/0sugar.info Specification|recipe file]] which is used within Zero Sugar to accomplish the major task - how to prepare the code to launch.
  
* how to prepare the code to launch,
+
The Zero Sugar recipe file is an all-sufficient entity. With only the file and {{Code|0sugar}} tool, it is possible to prepare the code necessary to launch in various environments like the major rpm/deb-based GNU/Linux distributions or just launch locally.
* how to share the code.
 
 
 
The Zero Sugar spec file is an all-sufficient entity. With only the spec file and tools like {{Code|0sugar}} and {{Code|0distro}}, it is possible to prepare the code necessary to launch in various environments like the major rpm/deb-based GNU/Linux distributions or just launch locally.
 
  
 
=== Prepare the code ===
 
=== Prepare the code ===
Line 73: Line 69:
 
The preparation step can be trivial, unless the code requires a building stage. Building might occur:
 
The preparation step can be trivial, unless the code requires a building stage. Building might occur:
 
* on the developer's workstation, to deploy to environments similar to the developer's,
 
* on the developer's workstation, to deploy to environments similar to the developer's,
* on OBS, to build for the GNU/Linux distributions that OBS supports, or
+
* on http://refinery.sugarlabs.org, to build for the GNU/Linux distributions that are supported by Refinery Team, or
 
* building might happen on the user's side, if other methods don't work.
 
* building might happen on the user's side, if other methods don't work.
  
Line 79: Line 75:
  
 
Sharing step might be:
 
Sharing step might be:
* ''local'', if code needs to be run only in the doer's environment.<br>Zero Sugar spec file will be handled as a regular {{Code|activity.info}} file.
+
* ''local'', if code needs to be run only in the doer's environment.<br>Zero Sugar recipe file will be handled as a regular {{Code|activity.info}} file.
 
* ''peer-to-peer'', direct sharing between doer and users.
 
* ''peer-to-peer'', direct sharing between doer and users.
 
** Code can be launched if on-line users in the Neighborhood View have a copy of shared code, i.e., the doer only needs to be on-line to let other people launch his code.
 
** Code can be launched if on-line users in the Neighborhood View have a copy of shared code, i.e., the doer only needs to be on-line to let other people launch his code.
Line 85: Line 81:
 
* ''client-server'', doer needs to upload code to the server, and users will download it.<br>The particular method might be different:
 
* ''client-server'', doer needs to upload code to the server, and users will download it.<br>The particular method might be different:
 
** via the 0install infrastructure,
 
** via the 0install infrastructure,
** via OBS repositories with native packages,
+
** via http://refinery.sugarlabs.org repositories with native packages,
 
** by uploading bundles to servers like ASLO.
 
** by uploading bundles to servers like ASLO.
 
* ''distributor'', most likely similar to ''client-server'', but different from the doer's point of view, since only the distributor is responsible for a particular distribution method.
 
* ''distributor'', most likely similar to ''client-server'', but different from the doer's point of view, since only the distributor is responsible for a particular distribution method.
Line 93: Line 89:
 
The regular workflow within Zero Sugar, in the case of coding a Python-based activity, will look like the following:
 
The regular workflow within Zero Sugar, in the case of coding a Python-based activity, will look like the following:
  
* Create activity [[Activity_Team/Zero_Sugar/0sugar.info_Specification#Python_activity|spec file]].
+
* Create new project and package on http://refinery.sugarlabs.org.
 +
* Create activity [[Activity_Team/Zero_Sugar/0sugar.info_Specification#Python_activity|recipe file]].
 
* Code the activity.
 
* Code the activity.
 
* Try current code in Sugar just by selecting an icon in the activities list.
 
* Try current code in Sugar just by selecting an icon in the activities list.
* When a milestone is achieved, call:
+
* When a milestone is achieved, call {{Code|0sugar dist commit}} to create sources tarballs and send them to http://refinery.sugarlabs.org.
** {{Code|0sugar dist}} to create sources tarball
+
* After that, activity will be accessible for direct usage (via 0install) and for distributors that are eager to deploy it (via native packages).
** {{Code|0sugar commit}} to let Sugar know that the activity can be shared in peer-to-peer mode between on-line users
 
* If doer wants to support server-client sharing model for a broad audience of users:
 
** choose the server to host 0install files (it could be [[Sysadmin/Shell_account_request|sunjammer.sugarlabs.org]] or any other server to rsync files to),
 
** call, {{Code|0sugar publish}} to publish 0install files
 
* If doer wants to support OBS based sugar distributions or users that prefer activities from native packages:
 
** create a project on OBS,
 
** call {{Code|0sugar push <obs-project>}}
 
* options for distributors:
 
** If it is an OBS-based distribution, there is no need for any packaging-related work at all, just link/branch the activity to your distribution project.
 
** Use the activity spec file and {{Code|0distro}} command to build native packages on non-OBS build farms. Most likely, the resulting packages will not conform to all the requirements for inclusion in an official repository, but this feature could still be useful when strong packaging rules are not required, e.g., in various Sugar/edu derivates like Trisquel-edu, SoaS or USR.
 
** Having a link to sources tarball on the page, package is identified by, and information about dependencies from the spec file, create a regular package for any particular GNU/Linux distribution.
 
  
 
== Documentation ==
 
== Documentation ==

Revision as of 15:59, 8 August 2010

Pencil.png NOTICE:  This page is a draft in active flux...
Please contribute to these contents and discuss issues on the discussion page.


Zero Sugar Distribution

Zero Sugar provides a method that is transparent for users and convenient for doers to deploy software across varying platforms as well as across Sugar releases. Zero Sugar is mainly targeted to support a direct, doer-to-user interaction model, i.e., shortcut the chain of transfer of doer-to-distributor-to-user (still, Zero Sugar could be beneficial for distributors, since it unifies the deployment workflow).

Benefits

How Zero Sugar might be useful depending upon your point of view:

See also other use cases.

Users

Users can run Sugar effortlessly in multiple environments (machine architectures, GNU/Linux distributions, etc.). And since Sugar also stimulates users to be doers, there can be tons of handmade software in the field (mostly duplicates and reinvented wheels, but this is the nature of learning with Sugar—one tries some software, realizes some missing or additional feature, modifies or mimics some code, learns something new, and eventually produces a new creation). It is becoming critical to provide an easy and robust launching scheme for all these pieces of code, without writing long HOWTOs somewhere on a wiki, like "Please, if you are on Ubuntu, install these packages before starting my activity...".

Relying only on a particular distributor, i.e., using activities only from one distributor's channel, makes Sugar less useful or universal. Zero Sugar provides the most convenient and direct deployment method possible between the author of a piece of code and its users.

Doers

Authors of code are always interested in supporting as large an audience of users as possible. And since people can use Sugar in different environments, it is critical to provide an instrument that permits an activity to run on all Sugar platforms. In the case of Python-based activities, the existing practice of just zipping the activity code into .xo files works pretty well. But for arbitrary scripting languages, such as Ruby, that are not part of the Sugar Platform, for binary based activities and for activities that have dependencies that are not included in the Sugar Platform, there is the problem of providing the user with the necessary code.

Zero Sugar tries to solve all the possible issues that prevent activity launching in an heterogeneous Sugar environment.

Also, if you have some development idea in mind, you can start pushing it through the Sucrose release queue to get it into an upcoming (though maybe not the nearest) release. However, since the release process is binary—either your feature is included or not—Zero Sugar offers more flexibility for everyone. For example:

  • some features are of arguable general benefit; Zero Sugar would allow interested end users to efficiently test (and even deploy) such features;
  • some feature are only stable in limited environments; Zero Sugar would allow deployment in limited environments without the risk of destabilizing the rest of Sugar.

Distributors

The Sugar Platform cannot grow endlessly, e.g., installing Sugar from packages should not fetch half of all available packages including several UI toolkits, several programming languages, etc. So, components like Qt or Ruby are (at least at present) not in the Sugar Platform list. But with Zero Sugar, activities could still use such dependencies by installing them from native packaging systems on demand, and without bundling their binaries.

How it works at a glance

Instruments and services that are used within Zero Sugar:

  • 0sugar, the main tool, everything happens via the 0sugar command.
  • 0install decentralized deployment infrastructure.
  • OBS, openSUSE Build Service, that is patched to accomplish Zero Sugar needs. OBS will be hosted on SugarLabs servers and accessible from http://refinery.sugarlabs.org site. It will be a central place for all files related procedures like hosting various files, building binary-based activities, provide GNU/Linux distribution repositories for centralized Sugar distributions.
  • PackageKit to install software from native packaging systems.

Identification

Every Zero Sugar package is identified by a Web url like GCompris. The file, url points to, is regular 0install feed (in other words, 0install package) that contains metadata about package itself and all its implementations.

Implementations are Web links to tarballs. Packages are split into implementations to:

  • let user launch not only last version e.g. package can contain implementations for several branches or/and stabilities,
  • split binary implementations per OS and platform,
  • split implementations per language,
  • support forks.

Zero Sugar natively supports forks (better name?) that could be regular forks or just results of doers' experiments i.e. without intension to push changes to an upstream. Forks are regular Zero packages and identified by unique Web url but linked to an upstream package (by mentioning upstream url in feed-for metadata field). So, having an upstream activity http://go.sugarlabs.org/Record, http://A.doer.org/My_Record from doer A and http://B.doer.org/My_Record from doer B, user C will have Record implementations from three sources.

Having urls as Zero packaging ids, it will be possible to:

  • Launch activity in any supported environment just by passing activity url to sugar-activity command.
  • Shell's activities list items might not be tied to activity implementation. Useful for:
    • creating activity catalogs without downloading implementations,
    • more efficient disk-storage usage e.g remove less frequently used activities to save space for new ones.

Recipe file

The process departing point is a recipe file which is used within Zero Sugar to accomplish the major task - how to prepare the code to launch.

The Zero Sugar recipe file is an all-sufficient entity. With only the file and 0sugar tool, it is possible to prepare the code necessary to launch in various environments like the major rpm/deb-based GNU/Linux distributions or just launch locally.

Prepare the code

The preparation step can be trivial, unless the code requires a building stage. Building might occur:

  • on the developer's workstation, to deploy to environments similar to the developer's,
  • on http://refinery.sugarlabs.org, to build for the GNU/Linux distributions that are supported by Refinery Team, or
  • building might happen on the user's side, if other methods don't work.

Share the code

Sharing step might be:

  • local, if code needs to be run only in the doer's environment.
    Zero Sugar recipe file will be handled as a regular activity.info file.
  • peer-to-peer, direct sharing between doer and users.
    • Code can be launched if on-line users in the Neighborhood View have a copy of shared code, i.e., the doer only needs to be on-line to let other people launch his code.
    • Just by transfering a bundle with the code, e.g., using .xo bundles.
  • client-server, doer needs to upload code to the server, and users will download it.
    The particular method might be different:
  • distributor, most likely similar to client-server, but different from the doer's point of view, since only the distributor is responsible for a particular distribution method.

Regular workflow

The regular workflow within Zero Sugar, in the case of coding a Python-based activity, will look like the following:

  • Create new project and package on http://refinery.sugarlabs.org.
  • Create activity recipe file.
  • Code the activity.
  • Try current code in Sugar just by selecting an icon in the activities list.
  • When a milestone is achieved, call 0sugar dist commit to create sources tarballs and send them to http://refinery.sugarlabs.org.
  • After that, activity will be accessible for direct usage (via 0install) and for distributors that are eager to deploy it (via native packages).

Documentation

Start your exploration of Zero Sugar beginning with these resources:

  • How Zero Sugar looks from the Sugar Activity developer point of view
  • How Zero Sugar looks from the 0install point of view
  • How Zero Sugar looks from the GNU/Linux distribution packaging point of view

See Packaging Guide for detailed instructions and Zero Sugar example use cases .