Merged master @ 01a0ddd into maas-spaces2 #4583

Merged
merged 124 commits into from Mar 1, 2016

Conversation

Projects
None yet
10 participants
Contributor

dimitern commented Mar 1, 2016

No description provided.

Tycho Andersen and others added some commits Jan 14, 2016

lxd: update config for latest version
The LXD API has updated to allow config files to be loaded from arbitrary
locations on disk without mucking around with the environment (sorry about
that), which gets rid of some ugly code.

Additionally, there are some minor symbol signature updates as well.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxdclient: fix typo
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd provider: remove irrelevent documentation
Since lxd-images is completely independent of images.linuxcontainers.org
(and linuxcontainers.org don't have cloud-init anyway), let's not have
people do this unnecessary step.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd provider: use the right config path in all places
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
update lxd client version to 0.27
There is a breakage with version 0.27 such that older versions of the go
client don't behave correctly when setting configuration. Let's use 0.27.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxc: get rid of custom container detection code
The mechanism for detecting whether or not the task is in a container here
(checking if we're in the / cgroup) is very broken, and will not work with
cgroup namespaces (to land in kernel 4.5, but will be backported to
xenial's 4.4 kernel).

Instead, we should use the running-in-container script, as provided by the
init-system-helpers package, which encapsulates all the logic required for
various init systems. (n.b. that this adds a dependency; I'm not sure how
juju handles this.)

Also, I've mode the code to container/ instead of in lxc/lxcutils in
anticipation of the lxd container type which will also need to use this
function.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxdclient: get rid of spurious println
I introduced this while debugging something, but didn't get rid of it.
Happy to squash this commit into the previous ones if necessary.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
add a LXD container type
This patch adds a LXD container type to juju. Note that currently it uses
the same image name schema that the lxd provider uses, i.e. ubuntu-$series.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
switch default local container type to lxd
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: move lxdclient from /provider to /tools
This is in preparation for adding the LXD container type.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
s/insideLXC/insideContainer
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
actually use the verifyLxd function
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
add backports logic for lxd
This commit needs to be updated when juju/utils#192
is merged.

This assumes that
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1512219 has been fixed
in trusty, which I'm not sure it has. I'm trying to verify that now. If
not, we'll have to do something more complicated.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
remove debugging
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
add lxd container initialization tests
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
fix lxdclient test import path
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
commonize container detection code
Use the same container detection code for both LXC and LXD. Also add some
tests for this.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd container type: remember to use the namespace
If we don't do this everything works fine, but if you destroy your
juju environment, it destroys all the containers on the host. Instead,
let's not do that :)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd container type: add some tests
Here's a basic testcase for the previous commit. It also adds some plumbing
necessary to write more LXD tests.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: bump version to 2.0.0beta1
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge branch 'master' into lxd-master-merge
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
restrict lxd container type to go1.3
natefinch | tych0: the landing bot runs go 1.2, which means we have to mark
all LXD code as // +build go1.3  so it only builds with 1.3 or higher

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
add build directive to instance.go too
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
add go 1.2 stubs for LXD
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
state/lease: driveby cleanups
* ensureClockDoc: use switch rather than a sequence of if conditions.
* expireLeaseOp: wrap ErrInvalid with the cause of why it's invalid,
  rather than logging the error at trace level. The only called of
  expireLeaseOp is the public ExpireLease method which makes looser
  guarentees on the error value returned, so this is probably ok.
* client.Validate is only called inside the lease package, so unexport
  it to reduce the API surface.
use real build tag for <1.3
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
fix compiler error w/ go1.2
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: blacklist some tests on go1.2
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
fix go fmt
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: bump version to i18n-less client
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #4355 from tych0/bump-lxd-version
lxd: bump version to i18n-less client

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

(Review request: http://reviews.vapour.ws/r/3800/)
Merge branch 'master' into lxd-container-type
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
un-fuck tools/lxdclient after master merge
For whatever reason git couldn't figure this out, so this is basically a
cherry-pick of 2a17adb on top of this
branch.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
more un-fucking of master merge
This is a cherry pick of 70c8b25 and
f8e3c5e.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
remove unused import
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #4396 from tych0/lxd-container-type
merge master to lxd-container-type



(Review request: http://reviews.vapour.ws/r/3838/)
MADE storageprovisioner worker
Move the storageprovisioner worker from the machine agent runner to the dependency engine.
Update the lxdclient code to be compatible with 2.0.0beta3.
There is one glaring ommision, namely that Ips is no longer accessible from ContainerInfo,
which was returned by ListContainers. So we'll have to figure out how to properly build
our Instances. But I'm submitting a request for more information. Everything else is
available.
Merge pull request #4495 from jameinel/lxd-container-type
Lxd container type

Merge master and lxd-container-type. This updates the branch without changing anything in lxd-container-type.
I probably messed something up, cause it looks like I accidentally auto-pushed to juju/juju instead of jameinel/juju. But this should resolve it.


(Review request: http://reviews.vapour.ws/r/3927/)
MADE Identity File Writer
Move the Identity File Writer worker from the machine agent runner to the dependancy engine.
It compiles against the proposed lxd branch.
It doesn't pass any test suites. In fact, it segfaults. But it does compile.

This rips out all the code that dealt with writing to disk in order to get
certificates and configuration working with the LXD code.
The nice part is that it is removing a bunch of code. Bad part is it doesn't work yet.
lxd: use real upstream hash for new client API
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: really fix compilation :)
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: fix segfault in tests
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: implement Addresses() call for lxd provider
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: s/limits.cpus/limits.cpu
This key was renamed a while ago.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: fix parsing of limits.memory
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: get rid of lxdNewClient
This is dead code.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: include default port in hostname
This code is all kind of a clusterfuck, but when we generate the remote
address for a LXD, we need to include the default port as well, since we
set https_address to ::, which binds to 8443 by default.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
lxd: plumb the server cert through
This adds a config option for the server cert and the plumbing to get it
through.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
apiserver: Close listener before cleaning up apiserver
A recent change made it so the apiserver's listener was closed *after*
the cleanup of the apiserver's resources, instead of before. The
previous order is now restored, preventing new connections when the
apiserver is on its way down.

jameinel and others added some commits Feb 25, 2016

Move ServerPEMCert to an attribute of Remote.
The Certificate for the Server is an attribute of the Remote host
that we are connecting to. Not an attribute of the Client itself.
Handle review feedback.
Fixed a few things detected in review. Still need to handle the mem conversion bug.
Merge pull request #4178 from davecheney/state-lease-driveby-gardening
state/lease: drive by cleanups

state/lease: drive by cleanups

A few small gardening nits.

* ensureClockDoc: use switch rather than a sequence of if conditions.
* expireLeaseOp: wrap ErrInvalid with the cause of why it's invalid,
  rather than logging the error at trace level. The only called of
  expireLeaseOp is the public ExpireLease method which makes looser
  guarentees on the error value returned, so this is probably ok.
* client.Validate: unexport

(Review request: http://reviews.vapour.ws/r/3602/)
container/lxc: clean up error logging
Drive by commit

- Do not log errors at warning level
- Do not log errors *and* return errors. The latter probably needs
  and extension to the errors package for a MultiError type.
Merge pull request #4324 from davecheney/container-lxc-errors
container/lxc: clean up error logging

Drive by commit

- Do not log errors at warning level
- Do not log errors *and* return errors. The latter probably needs
  and extension to the errors package for a MultiError type.

(Review request: http://reviews.vapour.ws/r/3766/)
Don't run TestNotAllContainersAreDeleted right now.
It connects to a real LXD server and creates real containers.
This should become a CI test.
Merge pull request #4535 from wallyworld/autoload-credentials-part2
Add gce credential detection, improve autoload command

The GCE provider now detects credentials by looking for the json file in known google locations.
The detect credentials method signature is reworked to allow detection to include region.
The autoload credentials command supports the --replace option.
Bootstrap complains if auto credential detection finds > 1 credentials.

Still todo: present detected credentials to user and allow them to choose which to import

(Review request: http://reviews.vapour.ws/r/3971/)
api/charms: remove unused methods
Remove all but one method, the rest were unused. This package is
obviously misnamed.
Merge pull request #4544 from jameinel/lxd-container-type-master
merge juju master into lxd-container-type



(Review request: http://reviews.vapour.ws/r/3980/)
Merge pull request #4474 from davecheney/api-charms-remove-unused-met…
…hods

api/charms: remove unused methods

Remove all but one method, the rest were unused. This package is
obviously misnamed.

(Review request: http://reviews.vapour.ws/r/3909/)
Fix newInstanceSummary to properly handle memory.
Add a few tests so that we actually know it is doing the right thing.
Merge pull request #4537 from jameinel/lxd-container-type-no-disk
Update lxd-container-type to support lxd-2.0.0~beta4

This should be all the steps we need to make Juju compatible with LXD 2.0.0~beta4.

This was done in collaboration with Tycho. I've tested it doing a local "juju bootstrap lxd lxd" on Trusty using the 2.0.0~beta4 packages from ppa:ubuntu-lxc/lxd-stable as well as bootstrapping an AWS controller and installing the ppa there as well before doing "juju deploy --to lxd". 

There may still need to be some tests fixed. containers/lxd still expects you to have installed an image into your local lxd server. But I think this is really close to being good enough to land in master.


(Review request: http://reviews.vapour.ws/r/3973/)
Merge pull request #4548 from wallyworld/destroy-model-regression
destroy model doesn't use legacy config store

Fixes: https://bugs.launchpad.net/juju-core/+bug/1550580

juju destroy-model was broken because it still tried to use the legacy config store which we no longer use when creating models


(Review request: http://reviews.vapour.ws/r/3987/)
fix int overflows in lxdclient test
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #4549 from tych0/fix-int-overflows
fix int overflows in lxdclient test

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

(Review request: http://reviews.vapour.ws/r/3988/)
Merge pull request #4551 from wallyworld/fix-detect-credentials-windows
Fix typo in windows test

Wrong env var was patched, should have been USERPROFILE

(Review request: http://reviews.vapour.ws/r/3990/)
Merge pull request #4552 from juju/lxd-container-type
Lxd container type

This branch is good to merge into master. It is currentish with master. The failures seen on
    http://reports.vapour.ws/releases/3676
are all from master. This branch fixes some of the errors in master, so it is desirable to merge now.
The one bug shown on
     https://bugs.launchpad.net/juju-core/lxd-container-type
is still valid and will affect master when merged. Both the gccgo and golang ppc64el unittests are already broken and need a fix.

(Review request: http://reviews.vapour.ws/r/3991/)
rpc: remove Conn.Go method
Conn.Go was never called directly, but was exported in the package's
API. As `go` is a reserved word, this probably explains the method's
public name. Because the method was public, a lot of preconditions, some
panicing had to be set to ensure the method was not called incorrectly.

Remove all of this and collapse `Go` into its single caller, reducing
the API surface, and ensuring it is always called correctly.
Merge pull request #4553 from davecheney/rpc-cleanup
rpc: remove Conn.Go method

Conn.Go was never called directly, but was exported in the package's
API. As `go` is a reserved word, this probably explains the method's
public name. Because the method was public, a lot of preconditions, some
panicing had to be set to ensure the method was not called incorrectly.

Remove all of this and collapse `Go` into its single caller, reducing
the API surface, and ensuring it is always called correctly.

(Review request: http://reviews.vapour.ws/r/3992/)
Merge pull request #4391 from cmars/callout-agreements
Message listing prior agreements to terms for the deployment.



(Review request: http://reviews.vapour.ws/r/3833/)
Merge pull request #4516 from waigani/MADE-identity-file-writer
MADE Identity File Writer

Move the Identity File Writer worker from the machine agent runner to the dependancy engine.

(Review request: http://reviews.vapour.ws/r/3951/)
Merge pull request #4486 from waigani/MADE-storageprovisioner-machine
Made storageprovisioner machine

Move the storageprovisioner worker from the machine agent runner to the dependency engine.

(Review request: http://reviews.vapour.ws/r/3919/)
rpc: refactor error handling to use juju/errors
Use the juju/errors package more consistantly in the rpc package to
provide better error stack traces.
Merge pull request #4572 from wallyworld/fix-joyent-regions
Fix typo in Joyent regions

Joyent regions us-east-1 and us-east-2 were misconfigured.

(Review request: http://reviews.vapour.ws/r/4010/)
Merge pull request #4571 from davecheney/rpc-refactor-error
rpc: refactor error handling to use juju/errors

Use the juju/errors package more consistantly in the rpc package to
provide better error stack traces.

(Review request: http://reviews.vapour.ws/r/4009/)
apiserver/common: remove unused second argument from common.RestoreError
None of the callers of this method used the value.
apiserver/params: remove dependency on rpc package
There was only one constant that tied apiserver/params to the rpc
package, so copy the constant and add a test to make sure it doesn't
change in the future.

This means the millions of packages that import apiserver/params no
longer depend on the rpc package.
Merge pull request #4576 from davecheney/apiserver-common-remove-rest…
…oreerror-bool-param

apiserver/common: remove unused second argument from common.RestoreError

None of the callers of this method used the value.

(Review request: http://reviews.vapour.ws/r/4014/)
Merge pull request #4575 from davecheney/apiserver-params-no-longer-d…
…epends-on-rpc

apiserver/params: remove dependency on rpc package

There was only one constant that tied apiserver/params to the rpc
package, so copy the constant and add a test to make sure it doesn't
change in the future.

This means the millions of packages that import apiserver/params no
longer depend on the rpc package.

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

dimitern commented Mar 1, 2016

$$merge$$

Contributor

jujubot commented Mar 1, 2016

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

Contributor

jujubot commented Mar 1, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/6619

Contributor

dimitern commented Mar 1, 2016

$$kick-it$$

Contributor

jujubot commented Mar 1, 2016

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

jujubot added a commit that referenced this pull request Mar 1, 2016

@jujubot jujubot merged commit 3a55476 into juju:maas-spaces2 Mar 1, 2016

@dimitern dimitern deleted the dimitern:maas-spaces2-merge-master-01a0ddd branch Mar 1, 2016

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