Git (or bzr etc). based deployment of user application

Registered by Marius B. Kotsbak

Notes about missing parts for revision control based deployment of user applications.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Marius B. Kotsbak
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Curtis Hovey

Whiteboard

Current state (AFAIK):

* There are basic charm wrappers for popular development platforms like
Node: http://jujucharms.com/charms/precise/node-app
Rails: http://jujucharms.com/charms/precise/rails
 They support cloning a git repository once at deploy time

* Problems:
  * No support for authentication to the repository (e.g. by SSH key). Documentation uses public github hosting, while in reality it will often be a protected repository
   - A workaround for Github is to generate Oauth login key to be used or make a machine dummy user at Github to use.
  - For accessing a git repository in the same cloud, how would that work? Does nodes have ssh client keys that could be used to authencitate them?

  * No support for updating the application. Setting the branch is no workaround, as unchanged configuration items are not triggering the hooks. LP: #1130092.
     - Proposal: add a config parameter "revid" that the user can set to a revision ID or tag to change the deployment to. Maybe we can just use the "app_branch" option and let the user enter any revision (SHA1/tags) to deploy.

  * No support for auto updating application to the latest branch content automatically (using github or other repository)

  * The problem above causes another one; you risk nodes running different version of the application, as the code is only fetched at installation of the nodes.

  * It should be possible to clone the repository once in the cloud and distribute from there to all nodes. Currently all application nodes clones from a potential remote location (incurring delay and possibly extra cost of data transfer)
  * No restart functionality (?)

Proposed new charms:

Github-gateway
----------------------

  * Has a relation to all of the app charm wrappers
  * Caches the content of a remote Github repository.
  * Handles authentication to Github (use machine key?)
  * Listen for commit notifications using https://help.github.com/articles/post-receive-hooks and notifies the app-charms about it

Extending Gitolite charm (http://jujucharms.com/~marcoceppi/precise/gitolite)
---------------------------------

* Add a relation from the app charm wrappers to Gitolite
* Add notification from git receive hooks to the app charms to let them know that they might want to update to the latest version (should maybe be configurable)

Notification issue
-----------------------

The most obvious would be to use "relation-set" from github-gateway (http hook) or gotolite-charm (git hook) to signal something like "master:[SHA1]". It seems that it is not possible, since it happens outside any hooks:

https://bugs.launchpad.net/juju/+bug/891868

A workaround would be to make a new notification protocol that is set up during the establishing of the relation and use that one to communicate new revisions.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.