Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1600)

Issue 10259049: cmd/jujud: machine agent API connect

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by rog
Modified:
10 years, 10 months ago
Reviewers:
mp+170856, jameinel, fwereade
Visibility:
Public.

Description

cmd/jujud: machine agent API connect This is a fairly substantial refactor of the juju agent stuff to use worker.Runner. This also reinstates the password changing, but only for the machine agent (in fact the unit agent password changing is not important, as that password does not go into the cloudinit data). https://code.launchpad.net/~rogpeppe/juju-core/305-alt-jujud-use-tasks-package/+merge/170856 Requires: https://code.launchpad.net/~rogpeppe/juju-core/311-juju-bootstrap-state-change-password-1.6/+merge/170854 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : cmd/jujud: machine agent API connect #

Patch Set 3 : cmd/jujud: machine agent API connect #

Total comments: 27

Patch Set 4 : cmd/jujud: machine agent API connect #

Total comments: 5

Patch Set 5 : cmd/jujud: machine agent API connect #

Patch Set 6 : cmd/jujud: machine agent API connect #

Unified diffs Side-by-side diffs Delta from patch set Stats (+399 lines, -478 lines) Patch
A [revision details] View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/agent.go View 1 2 3 5 chunks +104 lines, -96 lines 0 comments Download
M cmd/jujud/agent_test.go View 1 5 chunks +59 lines, -193 lines 0 comments Download
M cmd/jujud/machine.go View 1 2 3 4 5 4 chunks +136 lines, -116 lines 0 comments Download
M cmd/jujud/machine_test.go View 1 2 5 chunks +17 lines, -16 lines 0 comments Download
M cmd/jujud/unit.go View 1 2 3 3 chunks +39 lines, -25 lines 0 comments Download
M cmd/jujud/unit_test.go View 1 1 chunk +3 lines, -6 lines 0 comments Download
M cmd/jujud/upgrade.go View 1 chunk +0 lines, -10 lines 0 comments Download
M state/api/machineagent/state_test.go View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M state/api/machiner/machiner_test.go View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M state/api/params/params.go View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M state/apiserver/apiserver.go View 1 2 3 4 5 2 chunks +11 lines, -1 line 0 comments Download
M state/apiserver/machine/agent_test.go View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M state/life.go View 2 chunks +6 lines, -5 lines 0 comments Download
M state/open.go View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M worker/deployer/deployer.go View 2 chunks +5 lines, -1 line 0 comments Download
M worker/provisioner/authentication.go View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 9
rog
Please take a look.
10 years, 10 months ago (2013-06-21 17:10:44 UTC) #1
fwereade
There's a lot to love in this branch, but I have a couple of significant ...
10 years, 10 months ago (2013-06-22 14:06:11 UTC) #2
rog
On 22 June 2013 15:06, <fwereade@gmail.com> wrote: Thanks a lot for the review. > There's ...
10 years, 10 months ago (2013-06-23 13:07:06 UTC) #3
fwereade
As discussed, LGTM with (1) an immediate followup to add Cleaner and Resumer, even if ...
10 years, 10 months ago (2013-06-26 08:39:15 UTC) #4
jameinel
We chatted about this quite a bit on IRC. LGTM with some of the tweaks ...
10 years, 10 months ago (2013-06-26 09:33:48 UTC) #5
rog
Please take a look. https://codereview.appspot.com/10259049/diff/5001/cmd/jujud/machine.go File cmd/jujud/machine.go (right): https://codereview.appspot.com/10259049/diff/5001/cmd/jujud/machine.go#newcode81 cmd/jujud/machine.go:81: if a.MachineId == "0" { ...
10 years, 10 months ago (2013-06-26 12:13:49 UTC) #6
jameinel
a couple of stale comments, but LGTM https://codereview.appspot.com/10259049/diff/16001/cmd/jujud/machine.go File cmd/jujud/machine.go (right): https://codereview.appspot.com/10259049/diff/16001/cmd/jujud/machine.go#newcode84 cmd/jujud/machine.go:84: // that ...
10 years, 10 months ago (2013-06-26 12:15:19 UTC) #7
fwereade
LGTM with one thought,probably fine to ignore it. https://codereview.appspot.com/10259049/diff/5001/cmd/jujud/machine.go File cmd/jujud/machine.go (right): https://codereview.appspot.com/10259049/diff/5001/cmd/jujud/machine.go#newcode81 cmd/jujud/machine.go:81: if ...
10 years, 10 months ago (2013-06-26 12:24:40 UTC) #8
rog
10 years, 10 months ago (2013-06-26 13:27:16 UTC) #9
Please take a look.

https://codereview.appspot.com/10259049/diff/5001/cmd/jujud/machine.go
File cmd/jujud/machine.go (right):

https://codereview.appspot.com/10259049/diff/5001/cmd/jujud/machine.go#newcode81
cmd/jujud/machine.go:81: if a.MachineId == "0" {
On 2013/06/26 12:24:40, fwereade wrote:
> On 2013/06/26 12:13:49, rog wrote:
> > On 2013/06/26 08:39:15, fwereade wrote:
> > > On 2013/06/23 13:07:06, rog wrote:
> > > > On 2013/06/22 14:06:11, fwereade wrote:
> > > > > state.BootstrapMachineId or whatever it is?
> > > > 
> > > > there doesn't seem to be such a thing.
> > > > do you think it's worth adding? i think that
> > > > the constant "0" is probably fine - lots of test code
> > > > assumes that the first machine to be created has
> > > > that id, and zero the number is good and special.
> > > 
> > > Huh, I could have sworn there was. If there isn't, there should be (for
> crying
> > > out loud, we have BootstrapNonce but no BootstrapMachineId? How?).
> > > 
> > > (Tests might assume that machine numbering starts at 0; that's not great
but
> > not
> > > terrible, I think. But it's really not ok to assume that machine 0 has any
> > > particular properties; not in tests and definitely not in code. I don't
> think
> > > either niemeyer or I ever failed to bang that drum given the opportunity
to
> do
> > > so ;p. If machine 0 has special properties -- which, ok, it does -- then
the
> > > specialness really ought to be somehow indicated in the name. Hence,
please
> > use
> > > a constant not a magic number.)
> > > 
> > > There aren't that many places where 0 is special though. Provider
bootstrap
> > has
> > > to use it, yes; and probably bootstrap-state; and I accept its necessity
> here;
> > > anywhere else?
> > 
> > I don't think so. If anything, perhaps it could be a constant inside
> cmd/jujud,
> > which is the place that starts and knows about the bootstrap machine.
> > 
> > It occurs to me that this logic will also be wrong in the HA future. When
> other
> > API servers have started, we won't actually want to follow the
> bootstrap-machine
> > path here - we should connect to those other API servers and then decide
what
> to
> > do (we might well want to allow the bootstrap machine to be repurposed as a
> > non-manager machine).
> > 
> 
> That feels like a vote for "machine agents should know how to bootstrap
> themselves if some more-independent condition holds" :).

I'm not sure. Needs some thought.

https://codereview.appspot.com/10259049/diff/16001/cmd/jujud/machine.go
File cmd/jujud/machine.go (right):

https://codereview.appspot.com/10259049/diff/16001/cmd/jujud/machine.go#newco...
cmd/jujud/machine.go:105: ensureStateWorker()
On 2013/06/26 12:24:40, fwereade wrote:
> What if, just for this CL, we were just to always start a state worker? Only a
> thought, but it might simplify things a bit...

I'll leave things as they are, if that's ok. This skeleton is there and
hopefully appropriate for future purpose, and saves someone from needing to try
to remember how it was supposed to work when we get there.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b