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

Issue 11318043: The bootstrap node now knows its hardware (Closed)

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

Description

The bootstrap node now knows its hardware It turns out that the solution used here is similar to what was done in pyjuju. On bootstrapping, we currently write out a provider-state file with the bootstrap instance id. This is now augmented to include the hardware charactistics of the bootstrap node. The bootstrap nodes reads these when it starts. An implication is that the InstanceId() method on the provider is no longer required. This was a bit of a hack anyway and I doubt many will mourn it's loss. There's a bit of copy and paste code for parsing hardware characteristics, due to a couple of other branches being blocked. The code would normally be in trunk but I don't want to block this branch on that. I'll resolve whatever conflicts exist prior to landing. https://code.launchpad.net/~wallyworld/juju-core/bootstrap-node-metadata/+merge/174903 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : The bootstrap node now knows its hardware #

Patch Set 3 : The bootstrap node now knows its hardware #

Total comments: 35

Patch Set 4 : The bootstrap node now knows its hardware #

Patch Set 5 : The bootstrap node now knows its hardware #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+227 lines, -223 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/bootstrap.go View 1 2 3 4 3 chunks +13 lines, -1 line 4 comments Download
M cmd/jujud/bootstrap_test.go View 1 2 3 3 chunks +25 lines, -1 line 0 comments Download
A cmd/jujud/export_test.go View 1 2 3 1 chunk +8 lines, -0 lines 2 comments Download
M cmd/jujud/machine_test.go View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M environs/azure/environ.go View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M environs/azure/environprovider.go View 1 2 3 4 2 chunks +0 lines, -11 lines 0 comments Download
M environs/azure/environprovider_test.go View 1 2 3 4 2 chunks +0 lines, -12 lines 0 comments Download
M environs/bootstrap.go View 1 2 3 4 3 chunks +9 lines, -5 lines 0 comments Download
M environs/cloudinit/cloudinit.go View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M environs/cloudinit/cloudinit_test.go View 1 2 3 4 4 chunks +8 lines, -4 lines 0 comments Download
M environs/dummy/environs.go View 1 chunk +0 lines, -4 lines 0 comments Download
M environs/ec2/ec2.go View 1 2 3 4 4 chunks +10 lines, -8 lines 0 comments Download
M environs/ec2/local_test.go View 1 2 3 chunks +3 lines, -6 lines 0 comments Download
M environs/interface.go View 2 chunks +1 line, -4 lines 0 comments Download
M environs/local/environ.go View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M environs/local/environprovider.go View 1 2 3 4 2 chunks +0 lines, -10 lines 0 comments Download
M environs/maas/environ.go View 1 2 3 4 4 chunks +17 lines, -1 line 0 comments Download
M environs/maas/environ_test.go View 1 2 3 2 chunks +11 lines, -1 line 0 comments Download
M environs/maas/environprovider.go View 2 chunks +0 lines, -11 lines 0 comments Download
M environs/maas/environprovider_test.go View 1 2 3 2 chunks +1 line, -24 lines 0 comments Download
M environs/maas/util.go View 1 2 3 1 chunk +2 lines, -3 lines 0 comments Download
M environs/maas/util_test.go View 1 2 3 4 3 chunks +2 lines, -5 lines 0 comments Download
M environs/openstack/export_test.go View 1 chunk +2 lines, -8 lines 0 comments Download
M environs/openstack/local_test.go View 1 2 4 chunks +4 lines, -18 lines 0 comments Download
M environs/openstack/provider.go View 1 2 3 4 8 chunks +10 lines, -57 lines 0 comments Download
M environs/state.go View 1 2 3 3 chunks +20 lines, -0 lines 0 comments Download
M environs/state_test.go View 1 2 3 chunks +29 lines, -7 lines 0 comments Download
M instance/instance.go View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M state/state.go View 1 2 3 4 3 chunks +21 lines, -10 lines 0 comments Download
M state/state_test.go View 1 2 3 4 3 chunks +16 lines, -5 lines 0 comments Download

Messages

Total messages: 10
wallyworld
Please take a look.
10 years, 9 months ago (2013-07-16 02:38:04 UTC) #1
wallyworld
Please take a look.
10 years, 9 months ago (2013-07-16 02:40:21 UTC) #2
wallyworld
Please take a look.
10 years, 9 months ago (2013-07-16 05:04:30 UTC) #3
gz
LGTM. The basic logic of passing a storage url into bootstrap with cloudconfig, and after ...
10 years, 9 months ago (2013-07-16 11:29:40 UTC) #4
mue
Wow, lots of work. LGTM minus some comments. https://codereview.appspot.com/11318043/diff/6001/cmd/jujud/bootstrap.go File cmd/jujud/bootstrap.go (right): https://codereview.appspot.com/11318043/diff/6001/cmd/jujud/bootstrap.go#newcode46 cmd/jujud/bootstrap.go:46: if ...
10 years, 9 months ago (2013-07-16 14:34:38 UTC) #5
fwereade
+100 to the general idea, but NOT LGTM as is. I'm unconvinced by the changes ...
10 years, 9 months ago (2013-07-16 17:19:57 UTC) #6
wallyworld
Please take a look. https://codereview.appspot.com/11318043/diff/6001/cmd/jujud/bootstrap.go File cmd/jujud/bootstrap.go (right): https://codereview.appspot.com/11318043/diff/6001/cmd/jujud/bootstrap.go#newcode37 cmd/jujud/bootstrap.go:37: f.StringVar(&c.stateInfoURL, "stateinfo-url", "", "the URL ...
10 years, 9 months ago (2013-07-17 04:59:29 UTC) #7
wallyworld
Please take a look.
10 years, 9 months ago (2013-07-17 06:28:45 UTC) #8
fwereade
LGTM apart from duplication of "/tmp/provider-state-url". Other comments left to your judgment. https://codereview.appspot.com/11318043/diff/20001/cmd/jujud/bootstrap.go File cmd/jujud/bootstrap.go ...
10 years, 9 months ago (2013-07-17 09:12:03 UTC) #9
wallyworld
10 years, 9 months ago (2013-07-18 11:32:43 UTC) #10
https://codereview.appspot.com/11318043/diff/20001/cmd/jujud/bootstrap.go
File cmd/jujud/bootstrap.go (right):

https://codereview.appspot.com/11318043/diff/20001/cmd/jujud/bootstrap.go#new...
cmd/jujud/bootstrap.go:22: var providerStateURLFile = "/tmp/provider-state-url"
On 2013/07/17 09:12:03, fwereade wrote:
> There is a "bootstrap" dir somewhere in DataDir (agents/bootstrap perhaps?);
> might be better to put it in there. Have a quick look for it, see whether it
> actually makes sense to use it.
> 
> Either way, I think it'd be best to define where we get it from OAOO rather
than
> risk ignorant changes to one definition or the other.

I declared a const in environs/cloudinit/cloudinit.go. I had to put it there to
avoid import loops. The agent stuff is not really related and I didn't want to
mess that up. This file really is transient and only required during bootstrap.

https://codereview.appspot.com/11318043/diff/20001/cmd/jujud/bootstrap.go#new...
cmd/jujud/bootstrap.go:98: return environs.ConfigureBootstrapMachine(st, cfg,
c.Constraints, c.Conf.DataDir, jobs, stateInfoURL)
On 2013/07/17 09:12:03, fwereade wrote:
> I'd really like it if we read the contents of stateInfoURL here and passed
down
> explicit HardwareCharacteristics. Any particular reason why not?

The instanceId needs to be loaded as well, not just hardware. So I wanted to
pass down one param instead of multiple. Nonetheless, I've changed the method
sig.

https://codereview.appspot.com/11318043/diff/20001/cmd/jujud/export_test.go
File cmd/jujud/export_test.go (right):

https://codereview.appspot.com/11318043/diff/20001/cmd/jujud/export_test.go#n...
cmd/jujud/export_test.go:8: }
On 2013/07/17 09:12:03, fwereade wrote:
> Not actually necessary to use the export_test mechanism here. What with the
> "main" package being weird, all the tests are in-package anyway.
> 
> Maybe we *should* be using it regardless, but if we do this we should move all
> the test-specific bits in here at once.

For now, I removed the export_test
Sign in to reply to this message.

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