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

Issue 13627051: api/provisioner: Complete Provisioner API (Closed)

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

Description

api/provisioner: Complete Provisioner API This implements the full client-side provisioner API, as needed by the provisioner worker. https://code.launchpad.net/~dimitern/juju-core/142-api-provisioner-1/+merge/186516 Requires: https://code.launchpad.net/~dimitern/juju-core/141-apiserver-provisioner-2/+merge/186355 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 14

Patch Set 2 : api/provisioner: Complete Provisioner API #

Unified diffs Side-by-side diffs Delta from patch set Stats (+700 lines, -0 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
A state/api/provisioner/machine.go View 1 chunk +237 lines, -0 lines 0 comments Download
A state/api/provisioner/provisioner.go View 1 chunk +103 lines, -0 lines 0 comments Download
A state/api/provisioner/provisioner_test.go View 1 chunk +339 lines, -0 lines 0 comments Download
M state/api/state.go View 2 chunks +7 lines, -0 lines 0 comments Download
M state/apiserver/root.go View 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 6
dimitern
Please take a look.
10 years, 7 months ago (2013-09-19 12:13:23 UTC) #1
jameinel
Overall it seems a pretty straightforward wrapping of the APIServer side of the code. So ...
10 years, 7 months ago (2013-09-19 13:00:14 UTC) #2
dimitern
https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/provisioner_test.go File state/api/provisioner/provisioner_test.go (right): https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/provisioner_test.go#newcode68 state/api/provisioner/provisioner_test.go:68: On 2013/09/19 13:00:14, jameinel wrote: > If it isn't ...
10 years, 7 months ago (2013-09-19 14:01:42 UTC) #3
dimitern
Please take a look.
10 years, 7 months ago (2013-09-19 14:28:16 UTC) #4
fwereade
LGTM https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/machine.go File state/api/provisioner/machine.go (right): https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/machine.go#newcode135 state/api/provisioner/machine.go:135: } Hmm. Isn't this what we had for ...
10 years, 7 months ago (2013-09-19 15:23:04 UTC) #5
dimitern
10 years, 7 months ago (2013-09-19 15:28:22 UTC) #6
Message was sent while issue was closed.
Sorry, I landed this before I got your comments, but will accommodate the
suggestions in a follow-up, where applicable.

https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/machine.go
File state/api/provisioner/machine.go (right):

https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/machine....
state/api/provisioner/machine.go:135: }
On 2013/09/19 15:23:04, fwereade wrote:
> Hmm. Isn't this what we had for deployer, but with machines instead of units?
If
> a provisioner sets dead it always wants to remove as well, right?
> 
> If this actually mirrors deployer, forget I said anything.

I can change that in the course of changing the provisioner to use the API. It's
different from the deployer, but easy to change.

https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/machine....
state/api/provisioner/machine.go:140: // as well, because it needs to do an API
call.
On 2013/09/19 15:23:04, fwereade wrote:
> This may be a case for the "this is immutable and therefore safe to cache"
TODO

Will add one in a follow-up.

https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/provisio...
File state/api/provisioner/provisioner.go (right):

https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/provisio...
state/api/provisioner/provisioner.go:92: func (st *State) WatchEnvironMachines()
(watcher.StringsWatcher, error) {
On 2013/09/19 15:23:04, fwereade wrote:
> I do find myself wondering if maybe this should take an environment tag. But I
> don't think any of the others do, do they? Probably best to stay consistent
for
> now regardless.

None of the others do, so it's consistent.

https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/provisio...
File state/api/provisioner/provisioner_test.go (right):

https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/provisio...
state/api/provisioner/provisioner_test.go:68: 
On 2013/09/19 15:23:04, fwereade wrote:
> On 2013/09/19 14:01:42, dimitern wrote:
> > On 2013/09/19 13:00:14, jameinel wrote:
> > > If it isn't hard, it would be nice to have these in
> > > state/api/provisioner/machine_test.go since that matches where the object
> > itself
> > > is defined. Certainly it is where I expected to find them.
> > 
> > This is not the only case where client-side facade tests are in a single
file.
> > For most is not a problem - they're not big, for the uniter it got too big,
so
> I
> > separated them. If you insist, I can separate them here as well, but in a
> > follow-up, which will cause some refactoring to reduce duplication of setup
> > code.
> 
> I'm generally +1 on more, smaller, files :).

In a follow-up.

https://codereview.appspot.com/13627051/diff/1/state/api/provisioner/provisio...
state/api/provisioner/provisioner_test.go:254: wc.AssertNoChange()
On 2013/09/19 15:23:04, fwereade wrote:
> On 2013/09/19 14:01:42, dimitern wrote:
> > On 2013/09/19 13:00:14, jameinel wrote:
> > > I'm pretty surprised that WatchContainers takes a container type. Wouldn't
> the
> > > same provisioning agent do all container types?
> > > 
> > > However, that is more of an odd-model problem than something wrong with
the
> > code
> > > you've written. (so it isn't that you have to change something for this
> patch,
> > > but I wonder if the overall design is correct.)
> > 
> > Getting the supported containers from the authenticated machine could be
done,
> > but it seems unnecessary for now. We can do it later,  if needed.
> 
> FWIW, it is expected that we have one provisioner per container kind: the idea
> is that a provisioner be the connection between a single set of machines and a
> single instance broker (which provisions/decommissions machinesof a particular
> type).
> 
> I *do* think that we shouldn't even run a provisioner on a machine without
> containers, and that we should be able to watch the set of active container
> kinds to start/stop individual provisioners... but we never got that far.

Will change as needed.
Sign in to reply to this message.

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