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

Issue 8726044: environs: use new tool-finding funcs

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

Description

environs: use new tool-finding funcs ...and defer tool choice to the last moment, along with a whole bunch of other common machine-configuration logic. This resulted directly in: * new environs.FinishMachineConfig, that configures a MachineConfig according to the contents of an environment configuration; * expected, simple, but invasive changes to ec2, openstack, maas, and dummy provider; * a slimmed-down environs.Bootstrap (just checks predictable errors); * a serious reshuffling of the cmd/juju.Bootstrap tests; * minor tweaks here and there to other tests; ...and indirectly, but usefully: * --upload-tools versions are now always dev We can't quite trash the old code yet: sync-tools still uses it. That's coming next. https://code.launchpad.net/~fwereade/juju-core/environs-tools-provisioning-integration/+merge/158805 Requires: https://code.launchpad.net/~fwereade/juju-core/environs-tools-provisioning/+merge/158780 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 65

Patch Set 2 : environs: use new tool-finding funcs #

Total comments: 2

Patch Set 3 : environs: use new tool-finding funcs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+745 lines, -606 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/bootstrap.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M cmd/juju/bootstrap_test.go View 1 4 chunks +144 lines, -123 lines 0 comments Download
M cmd/juju/main_test.go View 1 1 chunk +4 lines, -6 lines 0 comments Download
M cmd/juju/upgradejuju.go View 1 1 chunk +1 line, -0 lines 0 comments Download
M cmd/juju/upgradejuju_test.go View 4 chunks +18 lines, -12 lines 0 comments Download
M cmd/jujud/machine_test.go View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M environs/bootstrap.go View 1 2 chunks +18 lines, -17 lines 0 comments Download
M environs/bootstrap_test.go View 1 4 chunks +27 lines, -26 lines 0 comments Download
A environs/cloudinit.go View 1 1 chunk +73 lines, -0 lines 0 comments Download
A environs/cloudinit_test.go View 1 1 chunk +88 lines, -0 lines 0 comments Download
M environs/config.go View 1 3 chunks +16 lines, -9 lines 0 comments Download
M environs/config_test.go View 2 chunks +2 lines, -11 lines 0 comments Download
M environs/dummy/environs.go View 1 6 chunks +13 lines, -14 lines 0 comments Download
M environs/ec2/ec2.go View 1 6 chunks +57 lines, -97 lines 0 comments Download
M environs/interface.go View 1 1 chunk +1 line, -5 lines 0 comments Download
M environs/jujutest/livetests.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M environs/jujutest/tests.go View 1 2 chunks +7 lines, -9 lines 0 comments Download
M environs/maas/environ.go View 1 8 chunks +56 lines, -87 lines 0 comments Download
M environs/maas/environ_test.go View 1 2 chunks +19 lines, -7 lines 0 comments Download
M environs/maas/maas_test.go View 2 chunks +11 lines, -2 lines 0 comments Download
M environs/open_test.go View 1 chunk +1 line, -1 line 0 comments Download
M environs/openstack/export_test.go View 1 2 chunks +4 lines, -8 lines 0 comments Download
M environs/openstack/image.go View 1 chunk +42 lines, -24 lines 0 comments Download
M environs/openstack/live_test.go View 1 chunk +0 lines, -16 lines 0 comments Download
M environs/openstack/local_test.go View 4 chunks +71 lines, -8 lines 0 comments Download
M environs/openstack/provider.go View 1 6 chunks +57 lines, -116 lines 0 comments Download
M environs/tools.go View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M environs/tools_test.go View 1 2 3 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 10
fwereade
Please take a look.
11 years ago (2013-04-14 19:19:23 UTC) #1
rog
some preliminary comments. a fantastic direction in general, but FinishMachineConfig in particular could do with ...
11 years ago (2013-04-15 12:28:08 UTC) #2
rog
rest of review below. https://codereview.appspot.com/8726044/diff/1/environs/ec2/ec2.go File environs/ec2/ec2.go (right): https://codereview.appspot.com/8726044/diff/1/environs/ec2/ec2.go#newcode406 environs/ec2/ec2.go:406: panic("series should have been chosen ...
11 years ago (2013-04-15 13:24:10 UTC) #3
dimitern
I like there this is going, esp. removing redundant code; mostly trivial suggestions. But I ...
11 years ago (2013-04-15 17:27:23 UTC) #4
fwereade
Please take a look. https://codereview.appspot.com/8726044/diff/1/cmd/juju/bootstrap_test.go File cmd/juju/bootstrap_test.go (right): https://codereview.appspot.com/8726044/diff/1/cmd/juju/bootstrap_test.go#newcode64 cmd/juju/bootstrap_test.go:64: type bootstrapTest struct { On ...
11 years ago (2013-04-16 07:39:13 UTC) #5
dimitern
LGTM, thanks for the changes. One comment though: https://codereview.appspot.com/8726044/diff/1/cmd/juju/main_test.go File cmd/juju/main_test.go (right): https://codereview.appspot.com/8726044/diff/1/cmd/juju/main_test.go#newcode167 cmd/juju/main_test.go:167: // ...
11 years ago (2013-04-16 11:36:15 UTC) #6
rog
LGTM with murmured grunts of discomfort. https://codereview.appspot.com/8726044/diff/1/environs/bootstrap.go File environs/bootstrap.go (right): https://codereview.appspot.com/8726044/diff/1/environs/bootstrap.go#newcode11 environs/bootstrap.go:11: func Bootstrap(environ Environ, ...
11 years ago (2013-04-16 12:22:12 UTC) #7
fwereade
Roger, you seem to be mistaking the purpose of this branch. It is *not* to ...
11 years ago (2013-04-17 06:40:55 UTC) #8
fwereade
*** Submitted: environs: use new tool-finding funcs ...and defer tool choice to the last moment, ...
11 years ago (2013-04-17 06:43:04 UTC) #9
rog
11 years ago (2013-04-17 09:29:30 UTC) #10
On 17 April 2013 07:40,  <fwereade@gmail.com> wrote:
> Roger, you seem to be mistaking the purpose of this branch. It is *not*
> to fix MachineConfig, it is to *use* the pre-existing MachineConfig
> despite its flaws and make it slightly easier for developers to do the
> Right Thing. On that basis I've also reverted FindBootstrapTools's name
> because, on reflection, EnsureAgentVersion is actually worse:
> agent-version should be ensured, but I think it should be done *before*
> we pass the config into bootstrap. That'll be a followup though.
>
>
>
> https://codereview.appspot.com/8726044/diff/1/environs/bootstrap.go
> File environs/bootstrap.go (right):
>
> https://codereview.appspot.com/8726044/diff/1/environs/bootstrap.go#newcode11
> environs/bootstrap.go:11: func Bootstrap(environ Environ, cons
> constraints.Value) error {
> On 2013/04/16 12:22:12, rog wrote:
>>
>> it's a trade-off. this is unnecessarily duplicated code bloat - it
>
> adds a
>>
>> maintenance burden for not that much benefit AFAICS and means we're
>
> baking in
>>
>> assumptions in places where they're not necessary.
>
>
>> i feel we're over-thinking this to the detriment of the code base.
>
>
>
> Just yesterday you were complaining about a change in bootstrap ordering
> that caused us to do work before discovering that work was meaningless.
> Is it your position that we *should* check knowably bogus data before
> acting on it, or that we should *not*?

I think there's no one right answer there - it's a compromise.

I don't mind too much about the error case - if you've got a bogus
config and it takes a little extra time to tell you that, I don't think
it's a terrible thing.

>> the check is already done in FinishMachineConfig. *two* speculative if
>> statmements seems like overkill to me.
>
>
> Machine configuration is so incoherent that two checks -- one for
> knowably bad input data, and one for bad final output -- seems to me
> like the absolute minimum necessary.

I'm not sure I understand you here. All the checks are on the input, no?
And we can't check for bad final output as we can't run the shell
script before it gets sent to the remote machine.

>> > If it's a param somewhere, it's a lot harder to forget to do it.
>
>
>> there are plenty of other fields in MachineConfig that are mandatory.
>> why do the constraints get special treatment?
>
>
> Because they were bound up with the code I was writing, and I wasn't
> going to do them badly just because other things are done badly too.

MachineConfig seems to me to be a reasonable
way of specifying the parameters that go into generating the cloud-init
user data. All the fields are well documented and there are checks
that the fields are as expected. The constraints are just another
parameter.

You assert several times that MachineConfig is bad - I would be
interested in exploring
just why you think so, so we can move towards fixing it.

> This is exactly as it was before, and documenting it here won't change
> that.

It's *not* exactly as it was before. Beforehand, it was possible
to read the doc comments in MachineConfig and know exactly
what parameters you needed to pass to make a valid configuration.

Now you can't do that, as *some* of them (you can only tell which ones
by reading the code) are now expected to be filled out by FinishMachineConfig.
Sign in to reply to this message.

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