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

Issue 63730043: New unit upgrader back end (Closed)

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

Description

New unit upgrader back end A new backend for the unit agent upgrader is added. The unit upgrader listens to the tools version recorded against the unit's assigned machine (using a machine watcher). If an upgrade is needed, the unit agent restarts. It no longer downloads tools since this has already been done by the machine agent upgrader. The key point of this branch is to have the machine agent have sole responsibility for listening to upgrade requests made by the user and doing the work of downloading the tools. The unit agent upgrader is informed when all this has been done and simply reboots the unit agent. This branch leaves many of the current moving parts in place. Each unit agent still symlinks to a common tools directory using the unit tag. The tools version being run by each unit agent is still recorded against the unit and a user requested upgrade will be rejected if any units are recorded as being out of date. The unit agent upgrader still gets its cue to reboot by listening to state (albeit to its assigned machine rather than the global env agent version). These aspects can be refined later. https://code.launchpad.net/~wallyworld/juju-core/simpler-unit-upgrader-2/+merge/206336 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 7

Patch Set 2 : New unit upgrader back end #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+905 lines, -150 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/agent_test.go View 2 chunks +0 lines, -25 lines 0 comments Download
M cmd/jujud/machine_test.go View 2 chunks +18 lines, -0 lines 0 comments Download
M cmd/jujud/unit_test.go View 7 chunks +43 lines, -11 lines 0 comments Download
M environs/testing/tools.go View 2 chunks +3 lines, -5 lines 0 comments Download
A state/api/upgrader/unitupgrader_test.go View 1 1 chunk +170 lines, -0 lines 0 comments Download
M state/api/upgrader/upgrader_test.go View 1 6 chunks +34 lines, -24 lines 0 comments Download
M state/apiserver/common/tools.go View 1 chunk +47 lines, -0 lines 0 comments Download
M state/apiserver/common/tools_test.go View 1 chunk +59 lines, -0 lines 0 comments Download
M state/apiserver/root.go View 1 2 chunks +18 lines, -2 lines 0 comments Download
A state/apiserver/upgrader/unitupgrader.go View 1 1 chunk +151 lines, -0 lines 2 comments Download
A state/apiserver/upgrader/unitupgrader_test.go View 1 chunk +281 lines, -0 lines 0 comments Download
M state/apiserver/upgrader/upgrader.go View 1 3 chunks +12 lines, -38 lines 0 comments Download
M state/apiserver/upgrader/upgrader_test.go View 1 chunk +2 lines, -3 lines 0 comments Download
A worker/upgrader/error.go View 1 chunk +34 lines, -0 lines 0 comments Download
M worker/upgrader/upgrader.go View 7 chunks +18 lines, -35 lines 0 comments Download
M worker/upgrader/upgrader_test.go View 8 chunks +13 lines, -7 lines 0 comments Download

Messages

Total messages: 5
wallyworld
Please take a look.
10 years, 2 months ago (2014-02-14 05:39:24 UTC) #1
fwereade
Apart from the upgrade-time problem, this is great. I'm not particularly invested in which approach ...
10 years, 2 months ago (2014-02-17 10:24:55 UTC) #2
wallyworld
Please take a look. https://codereview.appspot.com/63730043/diff/1/state/apiserver/root.go File state/apiserver/root.go (right): https://codereview.appspot.com/63730043/diff/1/state/apiserver/root.go#newcode206 state/apiserver/root.go:206: func (r *srvRoot) UnitUpgrader(id string) ...
10 years, 2 months ago (2014-02-18 00:16:56 UTC) #3
fwereade
LGTM with one trivial fix. https://codereview.appspot.com/63730043/diff/1/state/apiserver/upgrader/upgrader.go File state/apiserver/upgrader/upgrader.go (left): https://codereview.appspot.com/63730043/diff/1/state/apiserver/upgrader/upgrader.go#oldcode32 state/apiserver/upgrader/upgrader.go:32: if !authorizer.AuthMachineAgent() && !authorizer.AuthUnitAgent() ...
10 years, 2 months ago (2014-02-18 22:10:55 UTC) #4
wallyworld
10 years, 2 months ago (2014-02-18 23:15:32 UTC) #5
https://codereview.appspot.com/63730043/diff/20001/state/apiserver/upgrader/u...
File state/apiserver/upgrader/unitupgrader.go (right):

https://codereview.appspot.com/63730043/diff/20001/state/apiserver/upgrader/u...
state/apiserver/upgrader/unitupgrader.go:121: entity, err :=
u.st.FindEntity(tag)
On 2014/02/18 22:10:55, fwereade wrote:
> Since we know it's a unit, we can just `u.state.Unit(name)` and skip the type
> assertions

Done.
Sign in to reply to this message.

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