<!DOCTYPE module>
<module languages="en" nativeLanguages="en" copyrightHolderName="Appropriate Software Foundation"><title><text><lang type="en">Provide Software</lang></text></title><section><title><text><lang type="en">Home</lang></text></title><text><lang type="en">&lt;p class=&quot;strapline&quot;&gt;service execution management in Python&lt;/p&gt;
</lang></text><split align="center" width="100%" spacing="2" padding="2" textColour="" backgroundColour="" borderWidth="0" borderColour=""><column width="50%" horizontal="left" vertical="top" backgroundColour="" borderWidth="0" borderColour="" cssClass="lcol"><text><lang type="en">== Features ==

Browse through the user stories and system requirements</lang></text><link url="Features.html"><text><lang type="en">»»</lang></text></link></column><column width="50%" horizontal="left" vertical="top" backgroundColour="" borderWidth="0" borderColour="" cssClass="rcol"><text><lang type="en">== Community ==

Meet and chat with others doing application service provision </lang></text><link url="Community.html"><text><lang type="en">»»</lang></text></link></column></split><split align="center" width="100%" spacing="2" padding="2" textColour="" backgroundColour="" borderWidth="0" borderColour=""><column width="50%" horizontal="left" vertical="top" backgroundColour="" borderWidth="0" borderColour="" cssClass="lcol"><text><lang type="en">== Documentation ==

Tutorial introduction, detailed interface documentation, examples of usage</lang></text><link url="Documentation.html"><text><lang type="en">»»</lang></text></link></column><column width="50%" horizontal="left" vertical="top" backgroundColour="" borderWidth="0" borderColour="" cssClass="rcol"><text><lang type="en">== Download ==

Browse source code repository, read project wiki and timeline, download stable releases</lang></text><link url="AboutUs.html"><text><lang type="en">»»</lang></text></link></column></split><text><lang type="en">&lt;br /&gt;

The ''Provide'' system is a ''[http://appropriatesoftware.net/domainmodel/Home.html DomainModel]'' application which supports deploying software applications as services, and migrating production services safely and seamlessly through an indefinite series of software application releases.
</lang></text></section><section><title><text><lang type="en">Features</lang></text></title><text><lang type="en">== Purpose of the Product ==

To name a standard set of steps, or operations, with which the work of providing software application services can be largely automated.

=== Desire for Named Operations ===

Because the work of application service provision responds to new releases of the provided software applications, much of the work is occasional and irregular.

Close manual administration is error prone because it's hard manually to keep track of where everything is and what everything has been called. Even worse, because of the extended nature of the activity, when you come back to it you can always think of better ways of doing things, and it can be hard to maintain a standard (and simplifying) scheme for naming things, laying things out, setting things up, and moving things on.

Therefore, we wanted to name a standard set of steps, or operations, with which the work of providing application services can be entirely automated. We wanted to be able to direct repeatable sequences with a set of canned scripts, without any loss of underlying control over the deployment, and without any constraints on the variation between applications. The sequences would help the service provider effect state transitions with minimal key strokes.

* acquire instructions for new release
* take in new release for testing 
* examine results of functional tests
* visit acceptance testing service
* put new release into production
* reject release

== Scope of the Work ==

The ''Provide'' system supports the user stories below.

* Acquire instructions for deployment of provided software application as a service.
* Prepare space for deploying a particular software system as an application service.
* Establish a purpose designation for a software application service.
* Acquire a particular version of a software application.
* Deploy software application for functional testing. 
* Deploy software application for acceptance testing. 
* Deploy software application for production usage.  
* Initialize deployed software application with default domain data.
* Initialize deployed software application with dumped domain data.
* Designate software application service with a purpose.
* Show which application service is designated for a particular purpose.
* Dump domain data from an application service.
* Acquire instructions for migrating domain data from one version to another.
* Migrate domain data dump between two different software service versions.
* Designate application service as down for maintenance.
* List application service provision entities.
* Remove domain data dump from a service.
* Remove software application service.
* Remove distribution of software application release.  
* Remove application service provision system.

The tutorial on the Documentation page describes how to use the ''Provide'' system.

== Scope of the System ==

There is, pretty much, one ''Provide'' command for each user story listed above. Refer to the ''Provide'' user tutorial on the Documentation page for detailed information.</lang></text></section><section><title><text><lang type="en">Community</lang></text></title><text><lang type="en">&lt;br /&gt;

The ''Provide'' community is open and if you find this site interesting you are welcome to join us.

== Software Club ==

The ''[http:/foundation/DevelopmentClub.html Appropriate Development Club]'' supports service execution management. 

== Project Mailing Lists ==

If you would like to get actively involved in the ''Provide'' community, please join the [http://appropriatesoftware.net/mailman/listinfo/provide-dev developer's mailing list] and introduce yourself briefly.

If you just want to hear about project plans, related news, and new releases please join the [http://appropriatesoftware.net/mailman/listinfo/provide-user user's mailing list].

== Wiki and Source Code Repository ==

The ''Provide'' project is hosted on  our KForge service, which provides various software services such as [http://kforge.appropriatesoftware.net/project/provide/services/ a Subversion repository and a Trac project].</lang></text></section><section><title><text><lang type="en">Documentation</lang></text></title><text><lang type="en">&lt;br /&gt;

There are three pieces of documentation for ''Provide'' users.

A tutorial introduces new users to the ''Provide'' system. A few examples of real world deployments of the ''Provide'' system are provided. We are also beginning to describe the ''Provide'' plugin API, used to insert adapters for provided applications.

You can download and install ''Provide'' from the Download page.

== Tutorial ==

The ''Provide'' system is currently a command line tool for application service provision. Commands have been developed to support stepping through the work described on the Features page.

=== Acquire Instructions For New Release ===

Before any application service can be provided, instructions for downloading and deploying the application must be acquired.

The following command makes available within your ''Provide'' user environment a set of scripts tailored for the new release.

 provide scripts &lt;app&gt; &lt;version&gt;

A set of standard sequences of ''Provide'' commands configured for a particular software application release will be downloaded and installed locally.

You can tab-complete (from &quot;provide-&quot;) in your terminal to see which scripts are installed. 

These scripts contain standard patterns of ''Provide'' commands, configured with all the right versions, download locations, and data migration plans for a particular release.

There are only a small number of patterns, and it's much simpler to invoke the sequences by name (as a script) than it is to figure out and type correctly all the steps and the parameters that are involved in a sequence for a given release.

Let's look at how the scripts fit into the work. Then, we can look at the commands involved in each script.

=== Acquire New Release ===

The work of acquiring a new release involves deciding to download and install a released version of a software application.

If the application has not been provided before, the application provision will need to be initialised:

 provide-&lt;app&gt;-init

Storage-space for the application is established, along with a set of &quot;purposes&quot; with which deployed services will be aliased into URL-space.

Once the application provision has been initialised, the new release can be acquired:

 provide-&lt;app&gt;-&lt;ver&gt;-init

The released files are downloaded, and stored locally on disk.

=== Evaluate Results of Functional Tests ===

This work involves checking whether the release passes automated functional testing.

If the application is being deployed for the first time, deploy with default domain data:

 provide-&lt;app&gt;-&lt;ver&gt;-accept

Otherwise, deploy with migrated domain data:

 provide-&lt;app&gt;-&lt;ver&gt;-accept-from-&lt;prev&gt;

The release will be deployed for functional testing, and the tests will be run automatically. If the functional tests fail, the script will terminate. At this point, a decision is normally made to remove the release (see below) and feedback to the developers.

Otherwise, the release will be immediately deployed for acceptance testing. 

If all goes well, the acceptance testing purpose will be switched to alias the new acceptance testing service.

=== Remove Release ===

This work involves removing everything to do with the release.

Remove release:

 provide-&lt;app&gt;-&lt;ver&gt;-remove

Removing the release in this way will remove all the services, downloaded code, everything to do with the release. All changed service purposes will be switched back to alias the old version services.

The release can now be fixed and updated, and the previous steps repeated as if for the first time.

=== Evaluate Acceptance Testing Service ===

This work involves actually using the software application as a production service, but in a different location from the actual production service location.

Just visit the acceptance testing location for this application, and check everything is okay.

If the acceptance testing service is unacceptable, a decision is made to remove the release (see above). So far, nothing has have happened to disturb any current production service, and the whole routine can be repeated many times without any production downtime.

If the acceptance testing service is acceptable, a decision can be made to put the release into production. It is advisable to schedule a maintenance window for production cut-over, just in case anything bad happens (which is very unlikely because all the steps have by now been rehearsed).

=== Cutover Production Service ===

This work involves repeating the deployment of the acceptance testing service, but this time in the name of &quot;production&quot; rather than &quot;acceptance testing&quot;.

If the application is being deployed for the first time, deploy the release with default domain data:

 provide-&lt;app&gt;-&lt;ver&gt;-production

Otherwise, deploy the release with migrated domain data:

 provide-&lt;app&gt;-&lt;ver&gt;-production-from-&lt;prev&gt;

If all goes well, the production service purpose will be switched to alias the new production service.

It's always worth verifying that the upgraded production service appears to be working. Just visit the production service location for this application, and check everything is okay.

If the new version production service is unacceptable, a decision is made to remove the release (see above). Both the production and acceptance testing purposes will be switched back to alias old version services. Again, it is always worth checking the old services are being served again.

== Commands Involved in the Sequences ==

Of course, the commands can all be run individually to generate exactly the same results. The scripts merely provide a highly repeatable cycle.

=== Initialise Provision ===

Firstly, the application provision is established. Secondly, the purpose designations are established.

==== Establish Application Provision ====

The application provision is named after the software application that is provided.

 provide provision &lt;app&gt; &lt;url&gt;

The named application will be distributed at the given resource location.

==== Establish Purpose Designation ====

It is common to establish 'production', 'accept', and 'test' purposes. The same command is used once for each purpose.

 provide purpose &lt;app&gt; test
 provide purpose &lt;app&gt; accept
 provide purpose &lt;app&gt; production

Purpose designations provide an invariant point of reference and access for users across successive releases of the application.

=== Acquire Release ===

This sequence involves acquiring the release, any explicit dependencies, and the prepared migration plans.

==== Acquire System ====

 provide release &lt;app&gt; &lt;ver&gt;

Downloads and saves in a standard place a release of the application.

==== Acquire Dependency ====

 provide depends &lt;app&gt; &lt;ver&gt; &lt;dependency&gt;

Downloads and saves in a standard place a release of a dependency of the release.

==== Acquire Migration Plan ====

 provide plan &lt;app&gt; &lt;ver&gt; &lt;path&gt;

Downloads and saves in a standard place the released migration plan, used for moving domain data between different model versions.

=== Deploy Release for Acceptance Testing and Production Usage ===

These sequences involve deploying the downloaded software in various ways.

After creating a new service, either run the tests ('test' service), or commission the service with default or migrated domain data ('accept' and 'production' services).

Finish up by designating the new services for the applicable purpose.

==== Create New Service ====

Deploy the software to create a service.

 provide deploy &lt;app&gt; &lt;ver&gt; &lt;service&gt;

Unpacks, installs, configures, and tweaks files from both downloaded distribution and explicit dependencies to a standard location named after the given service name.

==== Run Tests ====

Instead of commissioning a deployment with default or migrated data, you can run the application's automated test suite and see if this version of the application system functions on the host platform.

 provide test &lt;app&gt; &lt;ver&gt; &lt;service&gt;

It is usual not to use a service for acceptance testing or production usage after the automatic tests have been run against it.

==== Commission with Default Domain Data ====

The first time the application is deployed it will need to be initialized in the default 'out-of-the-box' state.

 provide commission &lt;app&gt; &lt;ver&gt; &lt;service&gt;

Setting up with default domain data is the way to start using the application. Once the application has been in production, to maintain continuity of service to users, it will be necessary for subsequent releases to be loaded with migrated data (see below).

==== Commission with Migrated Domain Data ====

To migrate domain data between services, simply dump, then move and load the domain data into new service. The operation uses one of the acquired migration plans (see above) according to the releases involved.

 provide datadump &lt;app&gt; &lt;ver1&gt; &lt;service1&gt; &lt;dump1&gt;

Exports the domain data as a JSON string, and writes it to a text file.

 provide datamove &lt;app&gt;  &lt;ver1&gt; &lt;service1&gt; &lt;dump1&gt;  &lt;ver2&gt; &lt;service2&gt; &lt;dump2&gt;

Reads the dump file, loads and transforms the domain data, and writes the result to a second text file.

 provide dataload &lt;app&gt; &lt;app&gt; &lt;service2&gt; &lt;dump2&gt;

Reads the dump file, and imports the domain data from the JSON string.

==== Designate Deployed Application For Purpose ===

When it's time to cut-over a purpose to a new version of the provided application, the thing is to designate the new service for that purpose. In the standard sequences, this is done firstly for the acceptance service, so the version can be used by acceptance testers without any change to the production service. Later, when acceptance testing is complete, the new production service is designated as the production purpose and users seamlessly continue to use the service.

 provide designate &lt;app&gt; &lt;ver&gt; &lt;service&gt; &lt;purpose&gt;

Switches the purpose to use a particular deployment.

==== Link Release to a Service ====

Some times one provided application will depend on another. For example, KForge expects Trac to be installed. Provide can deploy Trac and KForge, and link Trac to KForge so KForge has its Trac.

 provide link &lt;depapp&gt; &lt;depver&gt; &lt;depservice&gt; &lt;app&gt; &lt;ver&gt;

=== Clean Up ===

==== Remove Dump, Service, Release ====

There is a sequence for removing things. This is particularly useful when acceptance testing has failed. The software system can be adjusted, the release updated, and the application service provision process restarted from the 'initialize version' sequence many times without distracting from the software development work.

 provide rmdump &lt;app&gt; &lt;ver&gt; &lt;service&gt; &lt;dump&gt;

Deletes domain data dump.

 provide rmservice &lt;app&gt; &lt;ver&gt; &lt;service&gt;

Deletes application service (and all its data dumps).

 provide rmrelease &lt;app&gt; &lt;ver&gt;

Deletes application version (and all its deployed services).

==== Remove Provision ====

 provide rmprovision &lt;app&gt;

Deletes application provision (and all its established versions).

=== Other Useful Commands ===

==== Help ====

The ''Provide'' system can print brief help messages.

 provide help [command]

Prints a usage message about the named command.

==== What's Been Installed? ====

The provisions that have been declared can be listed. Also, their releases and the services which have been deployed from these releases can also be listed.

 provide provisionlist

Lists application service provisions.

 provide releaselist &lt;app&gt;

Lists the installed releases of named application service provision.

 provide servicelist &lt;app&gt; &lt;ver&gt;

Lists services that have been deployed using a given release.

==== Which Service Is Used By This Purpose? ====

Sometimes you forget, of all the different deployed services, which is actually in production.

 provide which &lt;app&gt; &lt;purpose&gt;

Prints the version and service name designated for that purpose.

==== Where are the Application Files? ====

It's important to be able to get directly to the installed application files.

 provide path &lt;app&gt; &lt;ver&gt; &lt;service&gt;

Prints the file system path to the root of the application installation. What's here depends on the application system, and the corresponding ''Provide'' plugin.


== Examples ==

=== UK's Medical Research Council ===

The Cognition and Brain Sciences unit of the Medical Research Council use ''Provide'' to maintain their ''&lt;nowiki&gt;ScanBooker&lt;/nowiki&gt;'' deployment.

=== Appropriate Software Services ===

Many application services of appropriatesoftware.net are maintained using ''Provide''.

== API Documentation ==

=== Plugin API ===

Each provided application must have a corresponding ''Provide'' plugin, which acts as an adapter between ''Provide'' and the provided application. The software for the ''Provide'' plugin must be installed into the ''Provide'' installation before the application provision is declared.

When loaded, an application plugin will listen to ''Provide'' domain model events, and selectively take application-specific actions in response to relevant ''Provide'' domain model state transitions.

There is a ''Provide'' plugin base class, from which all the application plugins derive. There is also a ''domainmodel'' base class, from which all ''domainmodel'' applications derive. In future, other base classes may exist for other shapes of software application.

The ''Provide'' plugin base class declares empty methods that are called by its event handlers. Plugin developers are responsible for making sure their plugin has implementations of these methods that are suitable for the plugged in application. 

* Todo: More about plugin methods.

Please refer to the source code (which is very readable) for full details.</lang></text></section><section><title><text><lang type="en">Download</lang></text></title><text><lang type="en">&lt;br /&gt;

You can download the ''Provide'' system below.

== Install Guide ==

You can read the [http://kforge.appropriatesoftware.net/provide/trac#DeployingProvide installation instructions] to learn about the installer.

== Python Package Index ==

Provide is distributed through the Python Package Index.

* [http://pypi.python.org/pypi/provide Python Package Index page]

== Softpedia Page ==

Provide is also distributed through the Softpedia site.

* [http://linux.softpedia.com/get/Programming/Libraries/provide-52265.shtml Softpedia page]

== Latest Stable ==

* [http://appropriatesoftware.net/provide/docs/provide-provide-0.7 Download Provide 0.7 Installer]

* [http://appropriatesoftware.net/provide/docs/provide-0.7.tar.gz Download Provide 0.7 Source]

== Latest Development (0.8) ==

* [http://appropriatesoftware.net/provide/docs/provide-provide-0.8 Download Provide 0.8 Installer]

* [http://appropriatesoftware.net/provide/docs/provide-0.8.tar.gz Download Provide 0.8 Source]

== Older Versions ==

Older versions of the ''Provide'' system are [http://appropriatesoftware.net/provide/docs/ still available].
</lang></text></section><section><title><text><lang type="en">About Us</lang></text></title><text><lang type="en">&lt;br&gt;

The ''Provide'' system emerged fairly rapidly from agile software development work undertaken by the [http://appropriatesoftware.net/foundation/Foundation.html Appropriate Software Foundation] to help deploy software applications for acceptance testing and production in a trivial and therefore frequently repeatable manner.

== Contact Us ==

Please contact us by joining the mailing lists on the Community page, or by contacting the [http://appropriatesoftware.net/foundation/AboutUs.html Appropriate Software Foundation] directly.


</lang></text></section></module>
