Solum/FeatureBlueprints/GitIntegration

Blueprint: https://blueprints.launchpad.net/solum/+spec/git-integration

Functionality
A deployment unit (DU) is a unit of deployment for the application being deployed. For example, if Solum is configured to use containers for deploying application code, then a DU would refer to a container instance.

Story 1: generate new app (minimal implementation)
As an application developer, I want to push my code to the master branch of my git repository, and have the platform automatically detect the code push and generate a running application (i.e. an assembly) using the new code.

I would be able to specify the application characteristics (AppName, size and number of deployment units, auto scale policies, etc) while deploying my app.

Following are the application characteristics that can be specified (this is an indicative list, not intended to be a comprehensive list).

Application Characteristics

The general workflow for a git based deployment is as follows:

1. Precondition: the user is already registered as an OpenStack user, and has been associated with the Solum service (see the blueprint "user authentication" for details)

2. Register[noun]: registers the new application with Solum (generates a git repository in Solum and associates it with the new app).


 * Inputs: Name (Optional) of the application, if no Name is provided, Solum will generate one
 * Returns: URL of the remote git repository, and the URL associated with the app

3. Git push (deploys and generates a running app). Builds the app binary from source. Git push will use the default application characteristics (per the default values specified in the Application Characteristics table above). The default values can be overridden by specifying the values in an application meta-data file that is stored along with the application source.

While implementing this story, the build step and deploy step will be self-contained steps that can either be invoked together, or separately. This is needed to support "build once, deploy multiple" scenarios, for example when we implement environment support.

Side note: there will be multiple deployment paths supported by Solum. Deployments can happen via All the deployment paths above will converge at the REST API: i.e. all the steps end up calling the REST API where all the business logic for build and deploy resides. All the other deployment mechanisms are "hooks" to do the necessarily pre-processing before calling the REST API. More details on the multiple deployment approaches will be documented in a separate blueprint (TBD).
 * Git (this blueprint)
 * CLI (where register and deploy will be combined to a single CLI operation exposed to the user, that packages code from a directory network accessible from the developer's workstation)
 * IDE Plugins
 * SDK (that calls into the REST API)
 * REST API

Story 2: update app
I would be able to use git push for updating an existing application. The update can include changes to the application code, or changes to the application characteristics (refer table in Story 1 above). I would like the update to happen with zero downtime (or at least near zero time) for my running app.

Story 3: specify git branch
By default, what we implemented in Story 1 will always build from the master branch. As part of this story, I would like to be able to specify a specific branch to use for the build. I should be able to specify the branch in two ways - - specify the branch as part of each deployment request - configure a default branch to be used for each subsequent deployment

Story 4: Auto deploy Yes/No
Auto deploy: I would be able to specify if a git push operation just performs a build, or performs a build+deploy to generate a running application (default behavior will be build+deploy)

Solum will implement Environments/Application Life Cycle management as part of the roadmap. However, implementation of environments is out of scope of this blueprint.

Flow Boundaries
Diagram for component areas and potential abstraction boundaries:



Implementation
[Sequence diagram for Git-Pull workflow] based on discussions during Git workgroup meeting on 02/05/2013