-
Committer:
Francesco Banconi
-
Date:
2013-09-13 14:41:47 UTC
-
mfrom:
(105.3.13 cancel-deployment)
-
Revision ID:
francesco.banconi@canonical.com-20130913144147-khkwaylemjfsr1vf
GUI server: cancel deployment feature.
Added an API call for cancelling a pending
deployment.
Also updated the bundles module documentation.
For this first implementation, I discussed
with Gary a workaround to avoid scheduled
deployments to be included in the ProcessPool
executor's call queue: a time.sleep call is
added to the queue right after a new deployment.
This way, as described in the code, it is still
possible to cancel a scheduled deployment job
even if it is the first in the queue.
Tests:
run `make unittest` from the root of this branch.
QA:
- bootstrap a juju-core environment;
- deploy the GUI from this branch (`make deploy`);
- switch to the builtin server:
`juju set juju-gui builtin-server=true`;
- ensure the GUI is working well by visiting
https://GUI-ADDRESS .
To test the deployer support and the
"cancel deployment" feature, use the script in
http://pastebin.ubuntu.com/6100815/ e.g.:
- download and save the Python script;
- run it passing the GUI node address as first argument:
`python start-deployer-cancel.py GUI-ADDRESS`.
The script does the following:
1) it logs in to the juju-core API server;
2) it starts/schedules three deployments;
3) it send two invalid Cancel requests;
4) it cancels the second deployment;
5) it shows the deployments status before and
after the deployment deletion.
- if everything is ok, you should see an output like
this: http://pastebin.ubuntu.com/6100861/ ;
- you should also be able to check the deployment
progress from the GUI;
- when the two deployments are completed (it may take
some minutes) you should see wordpress, mysql and
mediawiki correctly deployed and displayed in the
topology view;
- visiting https://GUI-ADDRESS/gui-server-info you
should see something like this:
{
"uptime": 970,
"deployer": [
{"Status": "completed", "DeploymentId": 0, "Time": 1379062144},
{"Status": "cancelled", "DeploymentId": 1, "Time": 1379061766},
{"Status": "completed", "DeploymentId": 2, "Time": 1379062156}
],
"apiversion": "go",
"sandbox": false,
"version": "0.2.0",
"debug": false,
"apiurl": "wss://ec2-50-17-116-51.compute-1.amazonaws.com:17070"
}
That's all, thanks a lot for QAing this branch!
R=rharding, bac
CC=
https://codereview.appspot.com/13549046