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

Issue 11800045: deployer: Replace state calls with API calls (Closed)

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

Description

deployer: Replace state calls with API calls This is the last step needed to enable the API connection for the deployer worker. Several other things needed to be moved around and reused (in state, api/deployer). Contains a workaround to get the correct API and State addresses, which needs to be fixed properly once we store machine addresses in state and can get the public addresses of all machines with JobManageState. https://code.launchpad.net/~dimitern/juju-core/080-deployer-uses-api/+merge/176937 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : deployer: Replace state calls with API calls #

Total comments: 36

Patch Set 3 : deployer: Replace state calls with API calls #

Total comments: 13

Patch Set 4 : deployer: Replace state calls with API calls #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -239 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/agent.go View 2 chunks +13 lines, -5 lines 0 comments Download
M cmd/jujud/deploy_test.go View 1 2 2 chunks +13 lines, -6 lines 0 comments Download
M cmd/jujud/machine.go View 1 2 3 2 chunks +20 lines, -3 lines 0 comments Download
M cmd/jujud/machine_test.go View 1 chunk +1 line, -1 line 0 comments Download
M state/api/deployer/deployer_test.go View 1 2 3 chunks +3 lines, -33 lines 0 comments Download
M state/api/deployer/unit.go View 1 2 3 3 chunks +6 lines, -21 lines 0 comments Download
M state/api/params/internal.go View 1 2 1 chunk +0 lines, -12 lines 0 comments Download
M state/api/state.go View 1 chunk +2 lines, -2 lines 0 comments Download
M state/apiserver/deployer/deployer.go View 1 2 3 3 chunks +44 lines, -48 lines 0 comments Download
M state/apiserver/deployer/deployer_test.go View 1 2 2 chunks +2 lines, -28 lines 0 comments Download
M worker/deployer/addresser.go View 1 chunk +3 lines, -2 lines 0 comments Download
M worker/deployer/deployer.go View 1 2 7 chunks +45 lines, -52 lines 0 comments Download
M worker/deployer/deployer_test.go View 1 2 3 11 chunks +39 lines, -19 lines 0 comments Download
M worker/deployer/export_test.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/deployer/simple.go View 1 2 3 5 chunks +9 lines, -6 lines 2 comments Download

Messages

Total messages: 10
dimitern
Please take a look.
10 years, 9 months ago (2013-07-25 13:32:07 UTC) #1
dimitern
Please take a look.
10 years, 9 months ago (2013-07-25 13:35:00 UTC) #2
fwereade
What did we miss that caused us to need CanDeploy? https://codereview.appspot.com/11800045/diff/6001/cmd/jujud/agent.go File cmd/jujud/agent.go (right): https://codereview.appspot.com/11800045/diff/6001/cmd/jujud/agent.go#newcode242 ...
10 years, 9 months ago (2013-07-25 14:59:17 UTC) #3
rog
Great direction, thanks, but that error handling needs sorting out, and a few other thoughts. ...
10 years, 9 months ago (2013-07-25 15:07:40 UTC) #4
rog
one other remark https://codereview.appspot.com/11800045/diff/6001/state/apiserver/deployer/deployer.go File state/apiserver/deployer/deployer.go (right): https://codereview.appspot.com/11800045/diff/6001/state/apiserver/deployer/deployer.go#newcode68 state/apiserver/deployer/deployer.go:68: unitName := state.UnitNameFromTag(tag) A discussion with ...
10 years, 9 months ago (2013-07-25 15:34:44 UTC) #5
dimitern
Please take a look. https://codereview.appspot.com/11800045/diff/6001/cmd/jujud/agent.go File cmd/jujud/agent.go (right): https://codereview.appspot.com/11800045/diff/6001/cmd/jujud/agent.go#newcode242 cmd/jujud/agent.go:242: return deployer.NewSimpleContext(dataDir, caCert, st), nil ...
10 years, 9 months ago (2013-07-26 11:33:22 UTC) #6
fwereade
LGTM, but my questions may indicate the need for a followup. I'd be +1 on ...
10 years, 9 months ago (2013-07-26 13:04:37 UTC) #7
dimitern
Please take a look. https://codereview.appspot.com/11800045/diff/22001/cmd/jujud/deploy_test.go File cmd/jujud/deploy_test.go (right): https://codereview.appspot.com/11800045/diff/22001/cmd/jujud/deploy_test.go#newcode95 cmd/jujud/deploy_test.go:95: stateAddrs, err := dst.StateAddresses() On ...
10 years, 9 months ago (2013-07-26 15:21:10 UTC) #8
rog
LGTM thanks!
10 years, 9 months ago (2013-07-26 15:25:19 UTC) #9
fwereade
10 years, 9 months ago (2013-07-26 15:31:15 UTC) #10
LGTM. Am I missing something wrt the separate-calls argument?

https://codereview.appspot.com/11800045/diff/22001/cmd/jujud/deploy_test.go
File cmd/jujud/deploy_test.go (right):

https://codereview.appspot.com/11800045/diff/22001/cmd/jujud/deploy_test.go#n...
cmd/jujud/deploy_test.go:95: stateAddrs, err := dst.StateAddresses()
On 2013/07/26 15:21:11, dimitern wrote:
> On 2013/07/26 13:04:37, fwereade wrote:
> > This might be worth tweaking -- if we always want CACert and StateAddresses,
> > might be smarter to get them all at once in a single api call.
> 
> It was originally like that, but Roger suggested it's unnecessary to incur
> round-trips if we need them separately.

Isn't that leaking api implementation details into the interface? The api surely
needs to be designed for the client -- which *does* need all that information at
the same time -- not for the convenience of the backend. API implementation
problems are easily addressed when compared to API interface problems...

https://codereview.appspot.com/11800045/diff/31001/worker/deployer/simple.go
File worker/deployer/simple.go (right):

https://codereview.appspot.com/11800045/diff/31001/worker/deployer/simple.go#...
worker/deployer/simple.go:85: tag := apideployer.UnitTag(unitName)
May as well keep state.UnitTag in place? Assuming it'll be refactored as would
apideployer.UnitTag in the followup anyway?

https://codereview.appspot.com/11800045/diff/31001/worker/deployer/simple.go#...
worker/deployer/simple.go:105: logger.Debugf("state addresses: %q", stateAddrs)
got state addresses?
Sign in to reply to this message.

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