juju gui #25

Supports: precise
Add to new model


Web GUI for Juju

Juju GUI Charm

This charm makes it easy to deploy a Juju GUI into an existing environment.

Supported Browsers

The Juju GUI supports recent releases of the Chrome, Chromium and Firefox web

Demo and Staging Servers

The Juju GUI runs the Juju Charm Store on
jujucharms.com. From there, you can browse charms,
try the GUI, and build an example environment to export for use elsewhere.

A staging server is also available,
running the latest and greatest version.

Deploying the Juju GUI

Deploying the Juju GUI is accomplished using Juju itself.

You need a configured and bootstrapped Juju environment: see the Juju docs
about getting started,
and then run the usual bootstrap command.

juju bootstrap

Next, you simply need to deploy the charm and expose it. (See also "Deploying
with Jitsu" below, for another option.)

juju deploy juju-gui
juju expose juju-gui

Finally, you need to identify the GUI's URL. It can take a few minutes for the
GUI to be built and to start; this command will let you see when it is ready
to go by giving you regular status updates:

watch juju status

Eventually, at the end of the status you will see something that looks like

    charm: cs:precise/juju-gui-7
    exposed: true
    relations: {}
        agent-state: started
        machine: 1
        - 80/tcp
        - 443/tcp
        public-address: ec2-www-xxx-yyy-zzz.compute-1.amazonaws.com

That means you can go to the public-address in my browser via HTTPS
(https://ec2-www-xxx-yyy-zzz.compute-1.amazonaws.com/ in this example), and
start configuring the rest of Juju with the GUI. You should see a similar
web address. Accessing the GUI via HTTP will redirect to using HTTPS.

By default, the deployment uses self-signed certificates. The browser will ask
you to accept a security exception once.

You will see a login form with the username fixed to "user-admin" (for juju-
core) or "admin" (for pyjuju). The password is the same as your Juju
environment's admin-secret, found in ~/.juju/environments.yaml.

Deploying behind a firewall

When using the default options the charm uses the network connection only for
installing Deb packages from the default Ubuntu repositories. For this reason
the charm can be deployed behind a firewall in the usual way:

juju deploy juju-gui

There are situations and customizations in which the charm needs to connect to

  • juju-gui-source is set to "stable" or "trunk": in this cases the charm pulls
    the latest stable or development release from Launchpad;
  • juju-gui-source is set to a branch (e.g. "lp:juju-gui"): in this case the
    charm retrieves a checkout of the specified branch from Launchpad, and adds
    an external Launchpad PPA to install build dependencies;
  • juju-gui-source is set to a specific version number not available in the
    local store (i.e. in the releases directory of the deployed charm): in this
    case the release is downloaded from Launchpad;
  • builtin-server is set to false: in this case the charm adds an external
    Launchpad PPA to install the legacy server dependencies.

If, for any reason, you need to use the legacy server, it is still possible to
deploy behind a firewall configuring the charm to pull the GUI release from a
location you specify.

For both Juju Core and PyJuju, you must simply do the following steps. Note
that PyJuju must do these steps, plus another set described further below.

The config variable juju-gui-source allows a url: prefix which understands
both http:// and file:// protocols. We will use this to load a local copy
of the GUI source.

  1. Download the latest release of the Juju GUI Source from the Launchpad
    downloads page
    and save it to a
    location that will be accessible to the unit either via filesystem or HTTP.
  2. Set the config variable to that location using a command such as

    juju set juju-gui juju-gui-source=url:...

    where the ellipsis after the url: is your http:// or file:// URI. This
    may also be done during the deploy step using --config.

  3. If you had already tried to deploy the GUI and received an install error due
    to not being able to retrieve the source, you may also need to retry the unit
    with the following command (using the unit the GUI is deployed on):

    juju resolved --retry juju-gui/0

These steps are sufficient for Juju Core. If you are using PyJuju, you need to
do another set of steps in addition.

  1. Use bzr to branch lp:~hazmat/juju/rapi-rollup locally ("bzr branch
    lp:~hazmat/juju/rapi-rollup") and copy the branch to the gui service machine.

  2. Use "juju set juju-gui juju-api-branch=PATH_TO_LOCAL_BZR_BRANCH" (where the
    path is not a file:// URI).

  3. Retry as described in the step 3 above (juju resolved --retry juju-gui/0).

Upgrading the charm behind a firewall

When a new version of Juju GUI is released, the charm is updated to include the
new release in the local releases repository. Assuming the new version is
1.0.1, after upgrading the charm, it is possible to also upgrade to the newer
Juju GUI release by running the following:

juju set juju-gui-source=1.0.1

In this case the new version will be found in the local repository and
therefore the charm will not attempt to connect to Launchpad.

Deploying to a chosen machine

The instructions above cause you to use a separate machine to work with the
GUI. If you'd like to reduce your machine footprint (and perhaps your costs),
you can colocate the GUI with the Juju bootstrap node.

This approach might change in the future (possibly with the Juju shipped with
Ubuntu 13.10), so be warned.

The instructions differ depending on the Juju implementation.


Replace "juju deploy cs:precise/juju-gui" from the previous
instructions with this:

juju deploy --force-machine 0 cs:precise/juju-gui


Colocation support is not included by default in the pyjuju implementation; to
activate it, you will need to install Jitsu:

sudo apt-get install juju-jitsu

and then replace "juju deploy cs:precise/juju-gui" from the previous
instructions with this:

jitsu deploy-to 0 cs:precise/juju-gui

Contacting the Developers

If you run into problems with the charm, please feel free to contact us on the
Juju mailing list, or on
Freenode's IRC network on #juju. We're not always around (working hours in
Europe and North America are your best bets), but if you send us a mail or
ping "jujugui" we will eventually get back to you.

If you want to help develop the charm, please see the charm's HACKING.md.


(boolean) Enable the built-in server, disabling both haproxy and Apache. This is a temporary option: the built-in server will be the only server in the future.
(string) Set the GUI server log level. Possible values are debug, info, warning and error. The log file is placed in /var/log/upstart/guiserver.log.
(string) The URL of the charm catalog site ("charmworld") from which charm catalog data will be drawn.
(string) The log file where stdout and stderr should be sent for all commands that are run by charm hooks.
(string) What the default viewmode for the charmbrowser should be. Possible options are: - 'sidebar' (default): the charmwbrowser will appear as a sidebar. This is also known as build mode. - 'fullscreen': the charmbrowser will appear in full screen, hiding the canvas. This is also known as browse mode. - 'minimized': the charmbrowser will be minimized by default, and hidden.
(string) The Google Analytics key to use. Set to blank to disable analytics. The team developing the Juju GUI benefits from understanding how different deployments use the tool. By keeping the default key value, anonymized usage data is reported back using Google Analytics. The type of data collected includes the charms that are deployed and the number of units per service. Use of analytics is optional but we hope you will allow us to improve our tool based on your experience.
(string) The Juju API Bazaar branch (implementing the WebSocket server). Since juju-core includes the WebSocket API server out of the box, this option is ignored if the charm is deployed using juju-core.
(boolean) Whether or not the console should be enabled for the browser.
(boolean) Run Juju GUI in debug mode, serving the uncompressed GUI source files.
(string) Where to install Juju GUI from. Possible values the following. - 'local' (default): The latest local release will be deployed. Releases are stored in the releases directory of this charm. - 'stable': The latest release from the "stable" series will be deployed. - 'trunk': The latest release from the "trunk" series will be deployed. Please note that this is not a build of the current Juju GUI trunk. For that functionality, use "lp:juju-gui", as described below. - a stable version (e.g '0.1.0'): The specified stable version will be deployed. A suitable release is looked up in the local releases repository (see the "local" choice above). If not found locally, the release will be downloaded from Launchpad. - a trunk version (e.g '0.1.0+build.1'): The specified trunk version will be deployed. A suitable release is looked up in the local releases repository (see the "local" choice above). If not found locally, the release will be downloaded from Launchpad. - a Bazaar branch (e.g. 'lp:juju-gui'): A release will be created and deployed from the specified Bazaar branch. "http://"" prefixed branches work as well. It is also possible to include the specific branch revision, e.g. "lp:juju-gui:42" will checkout revno 42. - a "url:"" prefixed url: The release found at the given URL (ex: url:http://... or url:file://...) will be deployed.
(string) The help text shown to the user on the login screen.
The password is the admin-secret from the Juju environment. This can often be found by looking in ~/.juju/environments.yaml.
(string) Used by the nrpe-external-master subordinate charm. A string that will be prepended to instance name to set the host name in nagios. So for instance the hostname would be something like: juju-myservice-0 If you are running multiple environments with the same services in them this allows you to differentiate between them.
(string) If given, the password to use for the environment to immediately connect. Do not set unless you understand and accept the risks.
(boolean) Whether or not the GUI is in read-only mode. Note that read-only mode is advisory, and enforced only in the client. If someone can access the websocket and has the password, they can send commands over the websocket to mutate the environment.
(string) The charm depends on several software packages that are not packaged in Ubuntu. In order to ensure that only versions known to work with our charm are used, there is a single PPA where all packages are kept. The juju-gui-charmers team supports 'stable' and 'devel' versions. Only stable should be used for production. For enterprise deployments that do not allow access to resources outside of their control, the location can be any specification as long as it is recognizable by 'add-apt-repository'.
(boolean) Run using an in-memory sandbox rather than a real (or even improv) Juju backend. Sandbox is a client side construct running entirely in the client. Sandbox does not currently support imported environment simulation and is exclusive to the staging: true configuration. If staging is true it will be used in preference to sandbox at this time.
(boolean) Set to false to serve the GUI over an insecure HTTP connection. Do not set unless you understand and accept the risks.
(boolean) Whether or not the GUI unit tests are exposed. If this option is enabled, unit tests can be run in the browser by visiting the URL "https://[Juju GUI address]/test/".
(boolean) There are deployment modes for Juju GUI which are not intended as regular use mode. In these cases, login/logout are disabled and instead there is a link to juju.ubuntu.com
(string) The contents of the certificate file to be used in SSL connections to the GUI. Both ssl-cert-contents and ssl-key-contents must be provided. If not, cetificates will be automatically generated.
(string) The path to the directory where the SSL certificates are stored.
(string) The contents of the private key file to be used in SSL connections to the GUI. Both ssl-cert-contents and ssl-key-contents must be provided. If not, cetificates will be automatically generated.
(boolean) Connect the Juju GUI to the staging backend (i.e. a simulated Juju environment). Currently juju-core does not support the staging backend. For this reason, an error is raised if this option is enabled in a juju-core environment.
(string) The environment JSON export used by the staging server. This option can be used to change the topology of the simulated Juju environment. Possible values are 'sample' and 'large'. Currently juju-core does not support the staging backend. For this reason, this option is ignored if the charm is deployed using juju-core.