Merge lp://staging/~themue/juju-core/021-deployer-lxc-context into lp://staging/~juju/juju-core/trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp://staging/~themue/juju-core/021-deployer-lxc-context |
Merge into: | lp://staging/~juju/juju-core/trunk |
Diff against target: |
890 lines (+856/-0) 5 files modified
worker/deployer/export_test.go (+20/-0) worker/deployer/lxc/context.go (+355/-0) worker/deployer/lxc/export_test.go (+27/-0) worker/deployer/lxc/lxc.go (+213/-0) worker/deployer/lxc/lxc_test.go (+241/-0) |
To merge this branch: | bzr merge lp://staging/~themue/juju-core/021-deployer-lxc-context |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+163237@code.staging.launchpad.net |
Description of the change
lxc: adding lxc context for local provider
The LxcContext is the second context beside the currently used
SimpleContext to be used by the Deployer to deploy and recall
units. It uses a small subset of the LXC commands by calling
the binaries/scripts. Currently the new context isn't used. This
has to be done by cmd/jujud/agent.go when creating a new Deployer
instance.
Unmerged revisions
- 972. By Frank Mueller
-
lxc: merged trunk
- 971. By Frank Mueller
-
lxc: refactored into own package; first network code
- 970. By Frank Mueller
-
lxc: improved context
- 969. By Frank Mueller
-
deployer: merged trunk and done review changes
- 968. By Frank Mueller
-
deployer/lxc: merged after review changes
- 967. By Frank Mueller
-
deployer/lxc: changes after reviews
- 966. By Frank Mueller
-
deployer: merged trunk and renamed manager to context
- 965. By Frank Mueller
-
deployer: added LXC manager
- 964. By Francesco Banconi
-
Add a CharmInfo API command.
Add a CharmInfo API command to get information
about a charm, given its URL. It is needed by the
Juju GUI, modeled upon the similar one in pyJuju.R=dimitern, rog
CC=
https://codereview. appspot. com/7444052 - 963. By Martin Packman
-
Correct url for openstack info on metadata service
The location on the metadata service we were using to retrieve the openstack
specific json file was misnamed and lacked the 'openstack' path component,
which was causing the legacy id to be used in all cases. That results in a
suicidal state server, which also hints we need to worry more about the
other cases when we may run into non-canonical server ids.R=dfc, jameinel
CC=
https://codereview. appspot. com/7527043
NOT LGTM -- I would be prepared to let the unit-specific stuff slide,
but there's quite a lot to address here.
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go deployer/ lxc/context. go (right):
File worker/
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go#newcode26 deployer/ lxc/context. go:26: environSeries string
worker/
An environment does not have a series, other than default-series, which
is not relevant.
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go#newcode39 deployer/ lxc/context. go:39: // initDir specifies the directory
worker/
used by upstart on the local system.
If LXC autoconf works, we don't need upstart on the local system. We
*do* need it relative to a container's root though.
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go#newcode45 deployer/ lxc/context. go:45: dataDir string
worker/
Why not const? We're completely in control here.
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go#newcode53 deployer/ lxc/context. go:53: logDir string
worker/
Similarly, let's just make that const. No need to ever swap it out that
I can see.
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go#newcode57 deployer/ lxc/context. go:57: lxcContainerDir string
worker/
Hmm, I think I saw serge explaining that we can use whatever dir we
want. If we can, I'd really like us to just put them directly inside the
deploying agent's data dir... possible?
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go#newcode67 deployer/ lxc/context. go:67: // entity specified in info, that
worker/
deploys unit agents as upstart jobs in
FWIW, this can't be unit-specific any more. All containers are
"machines" and get their own machine agents.
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go#newcode77 deployer/ lxc/context. go:77: hostDataDir = "/var/lib/juju"
worker/
I don't think we should default this. We should always have the data dir
available, right?
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go#newcode104 deployer/ lxc/context. go:104: if err := iner(containerN ame); err != nil {
worker/
ctx.createConta
Shouldn't we trash it and try again? Failure partway through the first
attempt should not make a container undeployable on subsequent
attempts...
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go#newcode127 deployer/ lxc/context. go:127: }
worker/
If we fail here, the unit'll keep running forever.
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go#newcode146 deployer/ lxc/context. go:146: if groups[2] != ctx.deployerTag {
worker/
This is broken unless we also take into account environ name. But I'm
not sure we should care about environ names...
https:/ /codereview. appspot. com/9336045/ diff/1/ worker/ deployer/ lxc/context. go#newcode167 deployer/ lxc/context. go:167: svc.InitDir = ctx.initDir
worker/
Why are we using the host upstart dir? ISTM that this will cause us to
start containers that don't run agents, and start agents outside
containers.
https:/ /codereview. appspot. com/9336045/ diff/1/ work...