Merge master into embedded-gui. #5036

Merged
merged 137 commits into from Apr 7, 2016

Conversation

Projects
None yet
Member

frankban commented Apr 7, 2016

wallyworld and others added some commits Mar 14, 2016

Create a testing certificate rather than runtime
Our test suite was generating at least 3 certificates at runtime, which
takes several seconds each time. Just generate one and leave it in the
file as a testing certificate.
Add direct tests of EnsureImageExists
We weren't able to directly put lxd.Client.CopyImage into an interface
because it needs the exact lxd.Client object. But if we wrap it a bit
deeper we can actually do some testing on the logic inside of
EnsureImageExists. It is a Stub (mock) sort of test which is fairly tied
to the specifics, but we really do want to test things like "what do we
do if we fail to connect to a Remote", and "what if the remote doesn't
have the Alias".

This doesn't change any functionality (that will be coming in later
patches), but does make it possible to test things.
lxd container type: configure and use lxdbr0
lxdbr0 is replacing lxcbr0, and isn't very useful in its default
configuration. Let's configure it so that it is more useful (note that this
just mirrors the configuration of lxcbr0 as it is today, presumably we'll
want to do something more advanced later)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd container type: use ZFS by default
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: bump lxd api version
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxdbr0 intialization: handle cases where config has been edited
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd container type: fix typo
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd container type: use full `ip addr show` output in tests
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
agent: add an lxd bridge configuration option and use it
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd container type: add test for current host's network
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #4952 from bogdanteleaga/feature-juju-run-action
Feature juju run action merge master

Merge latest blessed master into feature-juju-run-action

(Review request: http://reviews.vapour.ws/r/4390/)
lp1538303: Retry with EOF error from API Open
During bootstrap, we may get EOF or upgrade in
progress errors while juju is still coming up.
We would retry when we got those errors from
the blocks.List call, but it is also possible
to get an EOF error from the Login (apiOpen).

Those should be retried as well.

This is a forward port of:
#4247
Merge pull request #4954 from bogdanteleaga/juju-run-actions-final
juju run through actions

This is gonna come in as one big PR, since the separate branches were split for review readability and simply won't build on their own.

Reviews here:
http://reviews.vapour.ws/r/4286/
http://reviews.vapour.ws/r/4291/
http://reviews.vapour.ws/r/4294/
http://reviews.vapour.ws/r/4313/
http://reviews.vapour.ws/r/4344/

(Review request: http://reviews.vapour.ws/r/4392/)
Merge pull request #4971 from bogdanteleaga/fix-small-print
remove debug statement

I forgot a debugging println in.

(Review request: http://reviews.vapour.ws/r/4410/)
Merge pull request #4972 from bogdanteleaga/juju-run-actions-final
juju-run fix tests and tweak output

Fix one test on windows by also modifying code to be saner.

Also slightly tweaked CLI output to show action messages.

(Review request: http://reviews.vapour.ws/r/4411/)
all: update to latest juju/testing
Remove deprecated CleanupSuite.AddSuiteCleanup method.
Merge pull request #4977 from davecheney/remove-add-suit
all: update to latest juju/testing

Remove deprecated CleanupSuite.AddSuiteCleanup method.

(Review request: http://reviews.vapour.ws/r/4417/)
lxd container type: go fmt
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Add meter status to juju status tabular format.
Only show the section if meter status is set on one or more workloads.
Merge pull request #4988 from bogdanteleaga/feature-juju-run-action
Feature juju run action merge master

Merge latest master into the feature branch to solve 2 minor merge conflicts that wouldn't let us merge it back in master.

(Review request: http://reviews.vapour.ws/r/4428/)
Merge pull request #4986 from cmars/tabular-meter-status
Add meter status to juju status tabular format.

Only show the section if meter status is set on one or more workloads.

(Review request: http://reviews.vapour.ws/r/4426/)

davecheney and others added some commits Apr 5, 2016

Merge pull request #4992 from axw/excise-rsyslog
all: excise (most) rsyslog config

We remove the rsyslog-ca-key config, and
stop installing rsyslog-gnutls. We leave
rsyslog-ca-cert, as it will be used later
to forward log entries to an external
rsyslog securely.

(Review request: http://reviews.vapour.ws/r/4432/)
lxd container type: fix build under go 1.2
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #4903 from tych0/better-lxd-configuration
Better lxd configuration

This series does two things:

1. use ZFS in the container type case by default
2. configure lxdbr0 in the container type case (basically to be the same as lxcbr0 is today).

Notably, `juju ssh 0/lxd/0` doesn't work, but it's not entirely clear to me that it works in the LXD case today.
Fix go fmt errors.
mongo/mongo.go was missing some whitespace and it
made go fmt sad (which prevented me from merging
wallyworld's PR:  #4715
Merge pull request #4997 from cherylj/fix-go-fmt
Merge mongo 3.2 PR from wallyworld

This PR merges wallyworld's already reviewed PR: #4715

But now with extra go fmt happiness (whitespace change, self-reviewed)

(Review request: http://reviews.vapour.ws/r/4436/)
lxd provider: better errors when bootstrap failed
When LXD isn't installed:

$ juju bootstrap bob lxd
ERROR invalid config: can't connect to the local LXD server: LXD socket not found; is LXD installed & running?

Please install LXD by running:
  $ sudo apt-get install lxd
and then configure it with:
  $ newgrp lxd
  $ lxd init

When the user doesn't have permissions:

$ juju bootstrap bob lxd
ERROR invalid config: can't connect to the local LXD server: Permisson denied, are you in the lxd group?

Please configure LXD by running:
  $ newgrp lxd
  $ lxd init

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd client: add tests for various Connect() error conditions
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd client: allow connecting to local non-default-path unix remotes
This is mostly for testing.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #4993 from davecheney/dummy-cleanup
provider/dummy: various cleanups

A set of drive by clean ups arising from #4977 

(Review request: http://reviews.vapour.ws/r/4433/)
lxd container type: don't try to change settings while running tests
avoids failures like:

----------------------------------------------------------------------
FAIL: initialisation_test.go:45: InitialiserSuite.TestLTSSeriesPackages

[LOG] 0:00.000 INFO juju.network setting prefer-ipv6 to false
initialisation_test.go:55:
    c.Assert(err, jc.ErrorIsNil)
... value *errors.Err = &errors.Err{message:"", cause:(*os.PathError)(0xc820448b10), previous:(*os.PathError)(0xc820448b10), file:"github.com/juju/juju/container/lxd/initialisation.go", line:107} ("open /etc/default/lxd-bridge: permission denied")
... error stack:
  open /etc/default/lxd-bridge: permission denied
  github.com/juju/juju/container/lxd/initialisation.go:107:

----------------------------------------------------------------------
FAIL: initialisation_test.go:62: InitialiserSuite.TestNoSeriesPackages

[LOG] 0:00.000 INFO juju.network setting prefer-ipv6 to false
initialisation_test.go:72:
    c.Assert(err, jc.ErrorIsNil)
... value *errors.Err = &errors.Err{message:"", cause:(*os.PathError)(0xc820449e00), previous:(*os.PathError)(0xc820449e00), file:"github.com/juju/juju/container/lxd/initialisation.go", line:107} ("open /etc/default/lxd-bridge: permission denied")
... error stack:
  open /etc/default/lxd-bridge: permission denied
  github.com/juju/juju/container/lxd/initialisation.go:107:

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd provider: use right bind address for LXD
Prevents:

ERROR cannot find network interface "lxcbr0": route ip+net: no such network interface
ERROR invalid config: route ip+net: no such network interface

when the user doesn't have a lxcbr0 (i.e. doesn't have lxc1 installed).

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd provider: check if lxdbr0 is configured
...and if it's not, give a better error message.

Also add a bit about configuration of lxdbr0 to the install tips for lxd.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
provider/dummy: remove call to dummy.Reset in init()
Remove the call to dummy.Reset in the package's init() function. With
this call removed, we can change the signature of Reset to always take a
gc.C
environs/dummy: always pass *gc.C to Reset
Make dummy.Reset take a *gc.C and use that rather than returning an
error (which is frequently ignored).

This also makes the signature of dummy.Reset compatbile with
CleanupSuite.AddCleanup.
Get image metadata from all data sources.
Added and improved logging.
Fixed typos in comment.
Revert "Merge pull request #4997 from cherylj/fix-go-fmt"
This reverts commit d9b6bc2, reversing
changes made to 4ea8a1b.
Merge pull request #5008 from cherylj/revert-mongo-32
Revert "Merge pull request #4997 from cherylj/fix-go-fmt"

This reverts commit d9b6bc2, reversing
changes made to 4ea8a1b.

For bug: https://bugs.launchpad.net/juju-core/+bug/1566628

(Review request: http://reviews.vapour.ws/r/4450/)
Merge pull request #4944 from natefinch/charminfo
Create CharmInfo struct and pass it around to various places doing addcharm.

This makes a lot of code nicer, and it also paves the way for adding macaroon usage to all these places.

(Review request: http://reviews.vapour.ws/r/4382/)
Merge pull request #5005 from davecheney/dummy-cleanup
provider/dummy: remove call to dummy.Reset in init()

Remove the call to dummy.Reset in the package's init() function. With
this call removed, we can change the signature of Reset to always take a
gc.C.

Make dummy.Reset take a *gc.C and use that rather than returning an
error (which is frequently ignored).

This also makes the signature of dummy.Reset compatible with
CleanupSuite.AddCleanup.

(Review request: http://reviews.vapour.ws/r/4447/)
Merge pull request #5006 from anastasiamac/images-fallaback-bug1560625
Fixes 1560625: image metadata not found.

Prior to this proposal, at bootstrap, we'd look into all data sources available to us to get an image metadata that can be used. However, we would stop looking at the first match for our desired product - stream and series combination. This does not work very well if the retrieved metadata does not satisfy further filtering: some constraints are checked later at provider level.

This proposal ensures that we look and combine metadata from all data sources relevant to the environment. 

bug: https://bugs.launchpad.net/juju-core/+bug/1560625
Merge pull request #5000 from tych0/dont-change-settings-during-tests
lxd container type: don't try to change settings while running tests

avoids failures like:

----------------------------------------------------------------------
FAIL: initialisation_test.go:45: InitialiserSuite.TestLTSSeriesPackages

[LOG] 0:00.000 INFO juju.network setting prefer-ipv6 to false
initialisation_test.go:55:
    c.Assert(err, jc.ErrorIsNil)
... value *errors.Err = &errors.Err{message:"", cause:(*os.PathError)(0xc820448b10), previous:(*os.PathError)(0xc820448b10), file:"github.com/juju/juju/container/lxd/initialisation.go", line:107} ("open /etc/default/lxd-bridge: permission denied")
... error stack:
  open /etc/default/lxd-bridge: permission denied
  github.com/juju/juju/container/lxd/initialisation.go:107:

----------------------------------------------------------------------
FAIL: initialisation_test.go:62: InitialiserSuite.TestNoSeriesPackages

[LOG] 0:00.000 INFO juju.network setting prefer-ipv6 to false
initialisation_test.go:72:
    c.Assert(err, jc.ErrorIsNil)
... value *errors.Err = &errors.Err{message:"", cause:(*os.PathError)(0xc820449e00), previous:(*os.PathError)(0xc820449e00), file:"github.com/juju/juju/container/lxd/initialisation.go", line:107} ("open /etc/default/lxd-bridge: permission denied")
... error stack:
  open /etc/default/lxd-bridge: permission denied
  github.com/juju/juju/container/lxd/initialisation.go:107:

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>

(Review request: http://reviews.vapour.ws/r/4442/)
Some code cleanup to set the stage.
- Turned some nested loops into some closures because I couldn't easily tell what errors were being modified/examined.
- Converted all errors to utilize juju/errors
lxd provider: remove dpkg-reconfigure hint lxd init hint is present
lxd init is now a superset of the dpkg-reconfigure bits (i.e. the bridge
configuration bits), so let's not tell users to do both.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd client: add go1.2 stub for GetDefaultBridgeName
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #4968 from cherylj/bootstrap-EOF-master
lp1538303: Retry with EOF error from API Open

During bootstrap, we may get EOF or upgrade in
progress errors while juju is still coming up.
We would retry when we got those errors from
the blocks.List call, but it is also possible
to get an EOF error from the Login (apiOpen).

Those should be retried as well.

This is a forward port of:
#4247

(Review request: http://reviews.vapour.ws/r/4407/)
backing support for channels used by list-resources.
This also creates a CharmID type that simplifies a lot of the code.
Merge pull request #5002 from cmars/post-step-allocate
Only create allocation if deployment succeeds.



(Review request: http://reviews.vapour.ws/r/4444/)
Merge pull request #5007 from cmars/romulus-right-align
Update romulus & uitable, picking up right-align column fix.



(Review request: http://reviews.vapour.ws/r/4449/)
Merge pull request #4828 from natefinch/list-resources-channels
backing support for using channel with juju charm list-resources

This creates a new type, charmstore.CharmID, which is used in places where we need to have a unique reference to the charmstore for a charm... with a resolved charm url (i.e. one that has a revision), this is a unique ID that is sufficient to request the current resources for a charm.

(Review request: http://reviews.vapour.ws/r/4269/)
Merge pull request #5004 from tych0/use-right-bridge-for-lxdif
lxd provider: use right bind address for LXD

Prevents:

ERROR cannot find network interface "lxcbr0": route ip+net: no such network interface
ERROR invalid config: route ip+net: no such network interface

when the user doesn't have a lxcbr0 (i.e. doesn't have lxc1 installed).

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>

(Review request: http://reviews.vapour.ws/r/4446/)
Merge pull request #5015 from kat-co/fix-1563576-lcy02-wont-bootstrap
Some code cleanup to set the stage.

- Turned some nested loops into some closures because I couldn't easily tell what errors were being modified/examined.
- Converted all errors to utilize juju/errors

(Review request: http://reviews.vapour.ws/r/4457/)
all: prefer AddCleanup to TearDown
A common failure mode of our tests is when an issue occurs during the
SetUp phase of the suite or test, not only does the test fail, but the
Tear down phase blows up because it is rarely written to handle the case
where the setup phase did not complete.

This PR is a toe in the water to experiment with applying a philosophy
of moving work from the TearDown phase of the test suite to a
'defer-like' AddCleanup style.
Merge pull request #5023 from davecheney/cleanup-teardown-suite
all: prefer AddCleanup to TearDown

A common failure mode of our tests is when an issue occurs during the
SetUp phase of the suite or test, not only does the test fail, but the
Tear down phase blows up because it is rarely written to handle the case
where the setup phase did not complete.

This PR is a toe in the water to experiment with applying a philosophy
of moving work from the TearDown phase of the test suite to a
'defer-like' AddCleanup style.

(Review request: http://reviews.vapour.ws/r/4465/)
lxd container type: skip local subnet test if no `ip` tool present
centos doesn't have `ip` by default, so we can't test against the local
network configuration since we can't query it.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Revert error propogation - sometimes we actually want to keep going r…
…egardless.

Changed to only try to delete security groups of instances we know we've terminated.
Added tests.
Merge branch 'master' into lxd-ensure-image-abstraction
Resolve a couple small conflicts.

Conflicts:
	tools/lxdclient/client_image.go
Merge pull request #5027 from tych0/skip-test-no-ip
lxd container type: skip local subnet test if no `ip` tool present

centos doesn't have `ip` by default, so we can't test against the local
network configuration since we can't query it.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>

(Review request: http://reviews.vapour.ws/r/4469/)
Merge pull request #4869 from jameinel/lxd-use-testing-cert
Create a testing certificate rather than runtime

Our test suite was generating at least 3 certificates at runtime, which
takes several seconds each time. Just generate one and leave it in the
file as a testing certificate.

(Review request: http://reviews.vapour.ws/r/4318/)
Merge pull request #4874 from jameinel/lxd-ensure-image-abstraction
Add direct tests of EnsureImageExists

We weren't able to directly put lxd.Client.CopyImage into an interface
because it needs the exact lxd.Client object. But if we wrap it a bit
deeper we can actually do some testing on the logic inside of
EnsureImageExists. It is a Stub (mock) sort of test which is fairly tied
to the specifics, but we really do want to test things like "what do we
do if we fail to connect to a Remote", and "what if the remote doesn't
have the Alias".

This doesn't change any functionality (that will be coming in later
patches), but does make it possible to test things.

(Review request: http://reviews.vapour.ws/r/4323/)
lxd container type: split out giant case into extra function
a fix from review

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #5014 from anastasiamac/blow-rate-bug1537620
Fixes bug 1537620: delete ec2 security group with exponential delay btw retries.

Added retry for security group delete with exponential delays plus tests.

Also tested manually.

(Review request: http://reviews.vapour.ws/r/4456/)
Merge pull request #5033 from juju/feature-juju-run-action
Feature juju run action

The branch is ready for merging. The only error at
    http://reports.vapour.ws/releases/3854
is caused by a lxd change that affects all juju branches

There are no open bugs
    https://bugs.launchpad.net/juju-core/feature-juju-run-action

(Review request: http://reviews.vapour.ws/r/4476/)
Merge pull request #4984 from tych0/better-lxd-bootstrap-errors
lxd provider: better errors when bootstrap failed

When LXD isn't installed:

$ juju bootstrap bob lxd
ERROR invalid config: can't connect to the local LXD server: LXD socket not found; is LXD installed & running?

Please install LXD by running:
  $ sudo apt-get install lxd
and then configure it with:
  $ newgrp lxd
  $ lxd init

When the user doesn't have permissions:

$ juju bootstrap bob lxd
ERROR invalid config: can't connect to the local LXD server: Permisson denied, are you in the lxd group?

Please configure LXD by running:
  $ newgrp lxd
  $ lxd init

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>

(Review request: http://reviews.vapour.ws/r/4424/)
Member

frankban commented Apr 7, 2016

$$merge$$

Contributor

jujubot commented Apr 7, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 659c902 into juju:embedded-gui Apr 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment