Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3502)

Issue 57820043: Add putcharm support to the GUI server.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 3 months ago by frankban
Modified:
10 years, 3 months ago
Reviewers:
mp+203612, jeff.pihach, gary.poster
Visibility:
Public.

Description

Add putcharm support to the GUI server. Implement a proxy handler propagating requests/responses from the GUI to the real juju-core HTTPS endpoint. Tests: `make unittest`. QA: QA must be done using juju-core trunk. I used revno 2265 for the following. 1) Bootstrap a juju environment, deploy the GUI charm and get the latest GUI sources: juju bootstrap make deploy juju set juju-gui juju-gui-source="https://github.com/juju/juju-gui.git" 2) wait for the GUI to be ready (using `juju debug-log` or `tailf ~/.juju/local/log/unit-juju-gui-0.log` if you bootstrapped a local environment). This step takes a while. 3) Open the GUI with Chrome and log in. Open the network tab of the Chrome JavaScript console and refresh. 4) In the terminal, open and observe the GUI server logs: juju ssh juju-gui/0 sudo tailf /var/log/upstart/guiserver.log 5) Drag and drop a zipped archive of a local charm. Charm files (e.g. metadata.yaml) must be on the zip root. You can use an haproxy archive I used for tests: it is available in http://ubuntuone.com/3FRDrcjSECyHp3xLmMIZLY At this point you should see a 200 response in the gui server logs, and a notification in the GUI itself. Moreover, if you inspect the request from the JavaScript console, you should see a response including info about the charm you just uploaded: if you used haproxy, you should see {"CharmURL":"local:precise/haproxy-0"}. Done!. If you want additional fun, you can now try to execute the following in the Chrome console: app.env.deploy('local:precise/haproxy-0', 'myservice', null, null, 1) Replace "local:precise/haproxy-0" with the charm URL you used. In a couple of seconds you should see the "myservice" box appearing in a pending state. Congratulations, you deployed a local charm from the GUI! :-) 6) Destroy the environment. https://code.launchpad.net/~frankban/charms/precise/juju-gui/http-proxy/+merge/203612 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 8

Patch Set 2 : Add putcharm support to the GUI server. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+342 lines, -12 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M hooks/backend.py View 1 chunk +5 lines, -1 line 0 comments Download
M server-requirements.pip View 1 chunk +4 lines, -2 lines 0 comments Download
M server/guiserver/__init__.py View 1 chunk +10 lines, -3 lines 0 comments Download
M server/guiserver/apps.py View 2 chunks +5 lines, -0 lines 0 comments Download
M server/guiserver/handlers.py View 1 4 chunks +61 lines, -1 line 0 comments Download
M server/guiserver/manage.py View 3 chunks +5 lines, -1 line 0 comments Download
M server/guiserver/tests/helpers.py View 1 chunk +13 lines, -1 line 0 comments Download
M server/guiserver/tests/test_apps.py View 2 chunks +8 lines, -0 lines 0 comments Download
M server/guiserver/tests/test_handlers.py View 2 chunks +132 lines, -0 lines 0 comments Download
M server/guiserver/tests/test_utils.py View 1 3 chunks +66 lines, -0 lines 0 comments Download
M server/guiserver/utils.py View 1 3 chunks +26 lines, -1 line 0 comments Download
M tests/test_backends.py View 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 6
frankban
Please take a look.
10 years, 3 months ago (2014-01-28 18:10:08 UTC) #1
gary.poster
LGTM with various non-blocking comments. Doing QA now. Thank you! https://codereview.appspot.com/57820043/diff/1/server/guiserver/handlers.py File server/guiserver/handlers.py (right): https://codereview.appspot.com/57820043/diff/1/server/guiserver/handlers.py#newcode112 ...
10 years, 3 months ago (2014-01-28 21:45:05 UTC) #2
gary.poster
QA great! Very cool. :-)
10 years, 3 months ago (2014-01-28 21:51:33 UTC) #3
jeff.pihach
LGTM Thanks for the hard work on this branch!
10 years, 3 months ago (2014-01-28 22:01:17 UTC) #4
frankban
Thanks for the reviews Gary and Jeff! Double checked this putCharm implementation works in Firefox ...
10 years, 3 months ago (2014-01-29 11:11:34 UTC) #5
frankban
10 years, 3 months ago (2014-01-29 11:14:17 UTC) #6
*** Submitted:

Add putcharm support to the GUI server.

Implement a proxy handler propagating requests/responses from
the GUI to the real juju-core HTTPS endpoint.

Tests: `make unittest`.

QA:
QA must be done using juju-core trunk.
I used revno 2265 for the following.

1) Bootstrap a juju environment, deploy the GUI charm 
and get the latest GUI sources:
    juju bootstrap
    make deploy
    juju set juju-gui juju-gui-source="https://github.com/juju/juju-gui.git"

2) wait for the GUI to be ready 
(using `juju debug-log` or `tailf ~/.juju/local/log/unit-juju-gui-0.log`
if you bootstrapped a local environment).
This step takes a while.

3) Open the GUI with Chrome and log in. Open the network tab of the
Chrome JavaScript console and refresh.

4) In the terminal, open and observe the GUI server logs:
    juju ssh juju-gui/0 sudo tailf /var/log/upstart/guiserver.log

5) Drag and drop a zipped archive of a local charm. 
Charm files (e.g. metadata.yaml) must be on the zip root.
You can use an haproxy archive I used for tests:
it is available in http://ubuntuone.com/3FRDrcjSECyHp3xLmMIZLY

At this point you should see a 200 response in the gui server logs, 
and a notification in the GUI itself. 
Moreover, if you inspect the request from the JavaScript console,
you should see a response including info about the charm you 
just uploaded: if you used haproxy, you should see 
{"CharmURL":"local:precise/haproxy-0"}.

Done!. If you want additional fun, you can now try to
execute the following in the Chrome console:
    app.env.deploy('local:precise/haproxy-0', 'myservice', null, null, 1)
Replace "local:precise/haproxy-0" with the charm URL you used.

In a couple of seconds you should see the "myservice" box appearing
in a pending state. Congratulations, you deployed a local
charm from the GUI! :-)

6) Destroy the environment.

R=gary.poster, jeff.pihach
CC=
https://codereview.appspot.com/57820043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b