juju is devops distilled
Go Python Shell PHP Makefile PowerShell
Switch branches/tags
Clone or download
jujubot Merge pull request #8939 from wallyworld/upgradeseries-iaas-only

## Description of change

When setting up the uniter remote watcher, only hook up the upgradeseries watcher on IAAS models.

As a driveby, move a couple of storage watcher vars left in the wrong place.

## QA steps

Ensure CAAS deployments work again.
Latest commit b51ee21 Jul 16, 2018
Failed to load latest commit information.
acceptancetests added new test assess_caas_deploy_charms Jun 13, 2018
agent go fmt Jul 12, 2018
api Merge pull request #8864 from ExternalReality/ensure_upgrade_series_h… Jul 13, 2018
apiserver Merge pull request #8864 from ExternalReality/ensure_upgrade_series_h… Jul 13, 2018
caas Tweak the error handling when creating a storage class Jul 16, 2018
cert cert: drop bogus DNSName in Verify Dec 18, 2017
charmstore Introduce charmstore-url config. Jul 9, 2018
cloud Expand File Path Jul 9, 2018
cloudconfig Merge 2.4 branch. Changes include: Jun 26, 2018
cmd Merge pull request #8932 from anastasiamac/controller-uuid-rename Jul 16, 2018
component/all Use the collections package for sets almost everywhere. May 16, 2018
constraints Gofmt static analysis linter Jun 7, 2018
container Merge branch 'develop' into lxd-provider-apply-constraints Jul 12, 2018
controller Introduce charmstore-url config. Jul 9, 2018
core Merge pull request #8864 from ExternalReality/ensure_upgrade_series_h… Jul 13, 2018
doc misspell linter addition May 11, 2018
downloader Merge develop branch Oct 18, 2016
environs Merge 2.4 into 2.5 Jul 12, 2018
etc/bash_completion.d Switch to classic snap Feb 7, 2017
feature Rename feature flag to match intended command name. Jun 6, 2018
featuretests unskip because 1610993 has expired and was not seen for a while... Jun 22, 2018
generate misspell linter addition May 11, 2018
instance Addition unconvert linter May 11, 2018
juju Add storage provider registry to CAAS models Jun 18, 2018
jujuclient Adding a unit test to test permissions Jun 19, 2018
logfwd Changes after review from juju/utils. Nov 10, 2016
migration Gofmt static analysis linter Jun 7, 2018
mongo Gofmt static analysis linter Jun 7, 2018
network Restores (version of) comment regarding MAC address uniqueness when g… Jun 21, 2018
patches Merge 2.3 into 2.4 Jun 28, 2018
payload More rename of service to application, mainly in state May 29, 2018
permission Delete dead/unused code Jun 13, 2017
provider Merge pull request #8920 from SimonRichardson/default-region Jul 12, 2018
pubsub Add features to controller config, and sharedServerContext for api se… Apr 17, 2018
resource Introduce charmstore-url config. Jul 9, 2018
rpc misspell linter addition May 11, 2018
scripts Merge pull request #8851 from SimonRichardson/gofmt-simplify Jun 25, 2018
service updates based on pr comments Jun 21, 2018
snap Inc version to 2.5-beta1 Jun 7, 2018
state Merge pull request #8864 from ExternalReality/ensure_upgrade_series_h… Jul 13, 2018
status More rename of service to application, mainly in state May 29, 2018
storage Update juju filesystem state from k8s Jul 5, 2018
testcharms made facade Annotations available to CAAS model to enable bundle depl… Jul 9, 2018
testing Migrate storage docs to use hostid not machineid Jul 6, 2018
tools Remove old lxdclient Jul 10, 2018
upgrades Merge 2.4 into 2.5 Jul 12, 2018
utils Use the new proxy package. May 16, 2018
version Inc version to 2.5-beta1 Jun 7, 2018
watcher Moves old lxdclient/utils functionality to container/lxd. Jul 9, 2018
worker upgradeseries is only applicable for IAAS models Jul 16, 2018
wrench Use the new juju/os repo for os and series. May 23, 2018
.gitignore Kelvin: added .gitignore file for acceptancetests - mostly for py stuff Apr 27, 2018
CONTRIBUTING.md Update contrib with missing step Jun 12, 2018
FAQ.txt Update the old FAQ text Jun 14, 2018
ISSUE_TEMPLATE.md Adding issues and pull request templates for the project. Jan 9, 2017
LICENCE AGPL v3 License Mar 27, 2015
Makefile Revert "Check why CI fails" Jul 12, 2018
PULL_REQUEST_TEMPLATE.md Update PR template to clarify what to provide. Jun 28, 2018
README.md Kelvin: updated golang PPA name Apr 15, 2018
dependencies.tsv Merge pull request #8864 from ExternalReality/ensure_upgrade_series_h… Jul 13, 2018
dependencies_test.go Check for white space in dependencies.tsv Jun 2, 2015
doc.go Adapt imports, metadata, and tests for the github move Jun 3, 2014



juju is devops distilled.

Juju enables you to use Charms to deploy your application architectures to EC2, OpenStack, Azure, GCE, your data center, and even your own Ubuntu based laptop. Moving between models is simple giving you the flexibility to switch hosts whenever you want — for free.

For more information, see the docs.

Getting started

juju is written in Go (http://golang.org), a modern, compiled, statically typed, concurrent language. This document describes how to build juju from source.

If you are looking for binary releases of juju, they are available in the snap store

snap install juju --classic

Installing Go

Juju's source code currently depends on Go 1.10. One of the easiest ways to install golang is from a snap. You may need to first install the snap client. Installing the golang snap package is then as easy as

snap install go --channel=1.10/stable --classic

You can read about the "classic" confinement policy here

If you want to use apt, then you can add the Golang Gophers PPA and then install by running the following

sudo add-apt-repository ppa:gophers/archive
sudo apt-get update
sudo apt install golang-1.10

Alternatively, you can always follow the official binary installation instructions

Setting GOPATH

When working with the source of Go programs, you should define a path within your home directory (or other workspace) which will be your GOPATH. GOPATH is similar to Java's CLASSPATH or Python's ~/.local. GOPATH is documented online at http://golang.org/pkg/go/build/ and inside the go tool itself

go help gopath

Various conventions exist for naming the location of your GOPATH, but it should exist, and be writable by you. For example

export GOPATH=${HOME}/work
mkdir $GOPATH

will define and create $HOME/work as your local GOPATH. The go tool itself will create three subdirectories inside your GOPATH when required; src, pkg and bin, which hold the source of Go programs, compiled packages and compiled binaries, respectively.

Setting GOPATH correctly is critical when developing Go programs. Set and export it as part of your login script.

Add $GOPATH/bin to your PATH, so you can run the go programs you install:


Getting juju

The easiest way to get the source for juju is to use the go get command.

go get -d -v github.com/juju/juju/...

This command will checkout the source of juju and inspect it for any unmet Go package dependencies, downloading those as well. go get will also build and install juju and its dependencies. To checkout without installing, use the -d flag. More details on the go get flags are available using

go help get

At this point you will have the git local repository of the juju source at $GOPATH/src/github.com/juju/juju. The source for any dependent packages will also be available inside $GOPATH. You can use git pull --rebase, or the less convenient go get -u github.com/juju/juju/... to update the source from time to time. If you want to know more about contributing to juju, please read the CONTRIBUTING companion to this file.

Installing prerequisites

Making use of Makefile

The juju repository contains a Makefile, which is the preferred way to install dependencies and other features. It is advisable, when installing juju from source, to look at the Makefile, located in $GOPATH/src/github.com/juju/juju/Makefile.


Juju needs some dependencies in order to be installed and the preferred way to collect the necessary packages is to use the provided Makefile. The target godeps will download the go packages listed in dependencies.tsv. The following bash code will install the dependencies.

cd $GOPATH/src/github.com/juju/juju
export JUJU_MAKE_GODEPS=true
make godeps

Runtime Dependencies

You can use make install-dependencies or, if you prefer to install them manually, check the Makefile target.

This will add some PPAs to ensure that you can install the required golang and mongodb-server versions for precise onwards, in addition to the other dependencies.

Build Dependencies

Before you can build Juju, see Dependency management section of CONTRIBUTING to ensure you have build dependencies setup.

Building juju

go install -v github.com/juju/juju/...

Will build juju and install the binary commands into $GOPATH/bin. It is likely if you have just completed the previous step to get the juju source, the install process will produce no output, as the final executables are up-to-date.

If you do see any errors, there is a good chance they are due to changes in juju's dependencies. See the Dependency management section of CONTRIBUTING for more information on getting the dependencies right.

Using juju

After following the steps above you will have the juju client installed in GOPATH/bin/juju. You should ensure that this version of juju appears earlier in your path than any packaged versions of juju, or older Python juju commands. You can verify this using

which juju

You should be able to bootstrap a local model now with the following:

juju bootstrap localhost

Installing bash completion for juju

make install-etc

Will install Bash completion for juju cli to /etc/bash_completion.d/juju. It does dynamic completion for commands requiring service, unit or machine names (like e.g. juju status , juju ssh , juju terminate-machine <machine#>, etc), by parsing cached juju status output for speedup. It also does command flags completion by parsing juju help ... output.

Building Juju as a Snap Package


Make sure your snapcraft version is >= 2.26. Run snapcraft at the root of the repository. A snap will build.

Current State

Classic mode.

Known Issues

None. The snap shares your current credentials and environments as expected with a debian installed version.

Needed for confinement

To enable strict mode, the following bugs need to be resolved, and the snap updated accordingly.