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

Issue 6944058: state: machines now have Jobs not Workers

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

Description

state: machines now have Jobs not Workers Approach as agreed with niemeyer on IRC. Main point is to avoid encoding assumptions about the workers in state: state knows what jobs an agent has to do, and jujud knows what tasks to run to accomplish those jobs. Type is int also at niemeyer's request; this is to allow us to refine job names in future without disturbing running installations (assuming the responsibilities do change in a sane way, at least). Since I was making this change, I observed that it was trivial to fix one of the machine-zero warts: we now mark the bootstrap machine agent off-limits to units merely by omitting JobHostUnits. Local assignment still uses explicit machine 0, and I'm not sure that's entirely sensible, but I think the local assignment code is kinda speculative anyway so it seems foolish to distract myself with it. The bulk of this change is just s/MachinerWorker/JobHostUnits/; the more interesting bits are in cmd/jujud/machine.go and state/assign_test.go (and ofc state/machine.go). https://code.launchpad.net/~fwereade/juju-core/machine-agent-jobs/+merge/140202 Requires: https://code.launchpad.net/~fwereade/juju-core/machine-agent-deployer/+merge/140174 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 11

Patch Set 2 : state: machines now have Jobs not Workers #

Patch Set 3 : state: machines now have Jobs not Workers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+170 lines, -153 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/ssh_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M cmd/juju/status_test.go View 1 2 chunks +3 lines, -3 lines 0 comments Download
M cmd/jujud/bootstrap.go View 1 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/bootstrap_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/machine.go View 1 1 chunk +13 lines, -16 lines 0 comments Download
M cmd/jujud/machine_test.go View 1 5 chunks +6 lines, -10 lines 0 comments Download
M state/api/api_test.go View 1 2 chunks +2 lines, -2 lines 0 comments Download
M state/assign_test.go View 1 21 chunks +41 lines, -33 lines 0 comments Download
M state/life_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M state/machine.go View 1 3 chunks +14 lines, -4 lines 0 comments Download
M state/machine_test.go View 1 9 chunks +10 lines, -10 lines 0 comments Download
M state/service_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M state/state.go View 1 3 chunks +13 lines, -21 lines 0 comments Download
M state/state_test.go View 1 2 10 chunks +26 lines, -27 lines 0 comments Download
M state/tools_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M state/unit.go View 1 3 chunks +18 lines, -5 lines 0 comments Download
M state/unit_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M worker/deployer/deployer_test.go View 1 2 chunks +2 lines, -2 lines 0 comments Download
M worker/firewaller/firewaller_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M worker/provisioner/provisioner_test.go View 1 11 chunks +12 lines, -12 lines 0 comments Download

Messages

Total messages: 6
fwereade
Please take a look.
11 years, 4 months ago (2012-12-17 13:51:18 UTC) #1
dimitern
On 2012/12/17 13:51:18, fwereade wrote: > Please take a look. LGTM, easier to understand at ...
11 years, 4 months ago (2012-12-17 14:13:07 UTC) #2
rog
definitely going in a good direction. a few comments below. https://codereview.appspot.com/6944058/diff/1/cmd/juju/ssh_test.go File cmd/juju/ssh_test.go (right): https://codereview.appspot.com/6944058/diff/1/cmd/juju/ssh_test.go#newcode120 ...
11 years, 4 months ago (2012-12-17 17:26:47 UTC) #3
fwereade
Please take a look. https://codereview.appspot.com/6944058/diff/1/cmd/juju/ssh_test.go File cmd/juju/ssh_test.go (right): https://codereview.appspot.com/6944058/diff/1/cmd/juju/ssh_test.go#newcode120 cmd/juju/ssh_test.go:120: m, err := s.State.AddMachine(state.HostPrincipalUnits) On ...
11 years, 4 months ago (2012-12-18 10:12:19 UTC) #4
rog
On 2012/12/18 10:12:19, fwereade wrote: > Please take a look. > > https://codereview.appspot.com/6944058/diff/1/cmd/juju/ssh_test.go > File ...
11 years, 4 months ago (2012-12-20 17:08:43 UTC) #5
fwereade
11 years, 4 months ago (2012-12-20 21:42:06 UTC) #6
*** Submitted:

state: machines now have Jobs not Workers

Approach as agreed with niemeyer on IRC. Main point is to avoid encoding
assumptions about the workers in state: state knows what jobs an agent has
to do, and jujud knows what tasks to run to accomplish those jobs. Type is
int also at niemeyer's request; this is to allow us to refine job names in
future without disturbing running installations (assuming the responsibilities
do change in a sane way, at least).

Since I was making this change, I observed that it was trivial to fix one of
the machine-zero warts: we now mark the bootstrap machine agent off-limits
to units merely by omitting JobHostUnits. Local assignment still uses
explicit machine 0, and I'm not sure that's entirely sensible, but I think
the local assignment code is kinda speculative anyway so it seems foolish to
distract myself with it.

The bulk of this change is just s/MachinerWorker/JobHostUnits/; the more
interesting bits are in cmd/jujud/machine.go and state/assign_test.go
(and ofc state/machine.go).

R=dimitern, rog
CC=
https://codereview.appspot.com/6944058
Sign in to reply to this message.

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