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

Issue 77270043: Fix bootstrap tools issues (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by wallyworld
Modified:
10 years, 1 month ago
Reviewers:
jameinel, mp+211449
Visibility:
Public.

Description

Fix bootstrap tools issues These bugs are addressed: lp:1227722 - tools for wrong arch lp:1282870 - cannot use constraints to select tools lp:1282869 - bad failure mode for incorrect arch tl;dr; you can bootstrap environments which run on architectures which are different to the client machine architcture, so long as tools are available. eg ppc client boottrapping an environment on EC2. Other error conditions are also addressed eg you cannot upload tools to a cloud if that cloud does not support the client machine architecture, since that's what the uploaded tools would be built for. You also cannot specify an arch constraint different to your client machine if you are uploading tools. A lot of the tools logic was duplicated. It has been refactoroed to used shared code. There's still more to do however since it's still possible to do bad things with upgrade-juju. https://code.launchpad.net/~wallyworld/juju-core/bootstrap-tools-fixes/+merge/211449 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 13

Patch Set 2 : Fix bootstrap tools issues #

Unified diffs Side-by-side diffs Delta from patch set Stats (+540 lines, -188 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M agent/tools/tools_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M cmd/juju/bootstrap.go View 4 chunks +1 line, -41 lines 0 comments Download
M cmd/juju/bootstrap_test.go View 1 12 chunks +59 lines, -20 lines 0 comments Download
M cmd/juju/upgradejuju.go View 1 3 chunks +3 lines, -2 lines 0 comments Download
M cmd/package_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M environs/bootstrap/bootstrap_test.go View 1 11 chunks +198 lines, -11 lines 0 comments Download
M environs/bootstrap/synctools.go View 1 5 chunks +92 lines, -46 lines 0 comments Download
M environs/interface.go View 3 chunks +12 lines, -1 line 0 comments Download
M environs/manual/init.go View 1 2 chunks +6 lines, -6 lines 0 comments Download
M environs/testing/tools.go View 3 chunks +18 lines, -13 lines 0 comments Download
M environs/tools/tools_test.go View 1 chunk +1 line, -1 line 0 comments Download
M juju/arch/arch.go View 1 2 chunks +13 lines, -15 lines 0 comments Download
M juju/arch/arch_test.go View 1 3 chunks +5 lines, -9 lines 0 comments Download
M provider/azure/environ.go View 2 chunks +8 lines, -3 lines 0 comments Download
M provider/azure/environ_test.go View 1 chunk +7 lines, -0 lines 0 comments Download
M provider/common/bootstrap.go View 2 chunks +6 lines, -5 lines 0 comments Download
M provider/common/bootstrap_test.go View 1 chunk +1 line, -1 line 0 comments Download
M provider/common/mock_test.go View 1 chunk +4 lines, -0 lines 0 comments Download
M provider/dummy/environs.go View 2 chunks +6 lines, -0 lines 0 comments Download
M provider/ec2/ec2.go View 1 chunk +5 lines, -0 lines 0 comments Download
M provider/ec2/local_test.go View 1 chunk +7 lines, -0 lines 0 comments Download
M provider/joyent/environ.go View 2 chunks +6 lines, -0 lines 0 comments Download
M provider/local/environ.go View 1 2 chunks +7 lines, -0 lines 0 comments Download
M provider/local/environ_test.go View 2 chunks +13 lines, -0 lines 0 comments Download
M provider/maas/environ.go View 1 2 chunks +7 lines, -0 lines 0 comments Download
M provider/maas/environ_test.go View 1 3 chunks +10 lines, -2 lines 0 comments Download
M provider/maas/environ_whitebox_test.go View 2 chunks +5 lines, -1 line 0 comments Download
M provider/manual/environ.go View 1 chunk +11 lines, -0 lines 0 comments Download
M provider/manual/environ_test.go View 1 chunk +10 lines, -0 lines 0 comments Download
M provider/openstack/local_test.go View 1 chunk +7 lines, -0 lines 0 comments Download
M provider/openstack/provider.go View 1 chunk +5 lines, -0 lines 0 comments Download
M version/version.go View 1 3 chunks +3 lines, -9 lines 0 comments Download

Messages

Total messages: 4
wallyworld
Please take a look.
10 years, 1 month ago (2014-03-18 05:20:12 UTC) #1
jameinel
I like this patch a lot. The only thing that concerns me is that all ...
10 years, 1 month ago (2014-03-18 06:29:10 UTC) #2
wallyworld
On 2014/03/18 06:29:10, jameinel wrote: > I like this patch a lot. The only thing ...
10 years, 1 month ago (2014-03-18 06:58:28 UTC) #3
wallyworld
10 years, 1 month ago (2014-03-19 01:21:48 UTC) #4
Please take a look.

https://codereview.appspot.com/77270043/diff/1/environs/bootstrap/bootstrap_t...
File environs/bootstrap/bootstrap_test.go (right):

https://codereview.appspot.com/77270043/diff/1/environs/bootstrap/bootstrap_t...
environs/bootstrap/bootstrap_test.go:244: // Can't upload tools is agent version
already set.
On 2014/03/18 06:29:11, jameinel wrote:
> "if agent version is already set"

Done.

https://codereview.appspot.com/77270043/diff/1/environs/bootstrap/synctools.go
File environs/bootstrap/synctools.go (left):

https://codereview.appspot.com/77270043/diff/1/environs/bootstrap/synctools.g...
environs/bootstrap/synctools.go:50: }
On 2014/03/18 06:29:11, jameinel wrote:
> I'm a little surprised that we have something called "validate*" and we are
> doing more validation before we get to it.
> Would it make more sense to move the series validation checks into
> validateUploadAllowed?

Different purposes - the series check just ensures the bootstrapSeries parameter
is syntactically correct. The validateUploadAllowed does semantic checking to
ensure the upload can proceed based on business rules eg arches must match. The
series check is not expected to fail and is a failsafe with a terse error
message. The upload validation error is quite verbose since it is plausible that
failure will occur and the user needs feedback. So I'd prefer to keep as is but
am happy to discuss if you want.

https://codereview.appspot.com/77270043/diff/1/environs/bootstrap/synctools.go
File environs/bootstrap/synctools.go (right):

https://codereview.appspot.com/77270043/diff/1/environs/bootstrap/synctools.g...
environs/bootstrap/synctools.go:31: // Not tested directly since there's
numerous tests which use it in cmd/juju and bootstrapSuite.
On 2014/03/18 06:29:11, jameinel wrote:
> I'm not sure if the comment here is relevant.
> I agree that it is effectively tested, but having a couple of direct tests can
> also help define what *this* part of the code is meant to be doing in
isolation.

Ok. The functionality was previously not exported. It was only exported when I
removed a bunch of duplicate code. But I'll add a direct test.

https://codereview.appspot.com/77270043/diff/1/environs/bootstrap/synctools.g...
environs/bootstrap/synctools.go:83: func UploadSeries(cfg *config.Config, series
[]string) []string {
On 2014/03/18 06:29:11, jameinel wrote:
> I think this should be called "SeriesToUpload".
> The problem is that "UploadTools" actually does an Upload, but UploadSeries is
> just determining what list of series we would like to use, so I'd rather see
it
> named something that doesn't look like an action.

Done.

https://codereview.appspot.com/77270043/diff/1/provider/joyent/environ.go
File provider/joyent/environ.go (right):

https://codereview.appspot.com/77270043/diff/1/provider/joyent/environ.go#new...
provider/joyent/environ.go:52: }
On 2014/03/18 06:29:11, jameinel wrote:
> Is there any way we could detect this from the Provider rather than hard
coding
> it inside Juju?
> 
> It seems like if a cloud start supporting a new arch which we already build
> tools for, then we'll have to issue a .patch release of Juju just to change
the
> bit field. (And I could certainly see it varying by region, etc.)

As discussed, I'll follow up with a simplestreams lookup to get the arches, and
for now will hard code to nominally support everything.
Sign in to reply to this message.

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