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

Issue 11325043: Add the initial bootstrap implementation.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by thumper
Modified:
10 years, 9 months ago
Reviewers:
gz, mp+174913, jtv.canonical, fwereade
Visibility:
Public.

Description

Add the initial bootstrap implementation. This isn't all that is needed to bootstrap, but it is the start. In particular, this adds the mongo upstart service. This branch also adds a very simple instance implementation for the local instances. I honestly spent about a day trying to get the bootstrap local juju test working, but there were just too many moving parts. Bootstrapping the local environment means installing an upstart service and waiting for it to start, then connecting to the just started service. https://code.launchpad.net/~thumper/juju-core/local-provider-bootstrap/+merge/174913 Requires: https://code.launchpad.net/~thumper/juju-core/local-default-root-dir/+merge/174908 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 24
Unified diffs Side-by-side diffs Delta from patch set Stats (+387 lines, -12 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M environs/local/environ.go View 6 chunks +262 lines, -6 lines 13 comments Download
M environs/local/environ_test.go View 3 chunks +41 lines, -3 lines 0 comments Download
M environs/local/environprovider.go View 3 chunks +14 lines, -3 lines 2 comments Download
M environs/local/export_test.go View 1 chunk +7 lines, -0 lines 0 comments Download
A environs/local/instance.go View 1 chunk +61 lines, -0 lines 9 comments Download

Messages

Total messages: 5
thumper
Please take a look.
10 years, 9 months ago (2013-07-16 03:51:15 UTC) #1
jtv.canonical
For your tests, you may now want to call PatchAttemptStrategies(&shortAttempt) to make sure that you ...
10 years, 9 months ago (2013-07-16 04:18:30 UTC) #2
gz
LGTM https://codereview.appspot.com/11325043/diff/1/environs/local/environ.go File environs/local/environ.go (right): https://codereview.appspot.com/11325043/diff/1/environs/local/environ.go#newcode30 environs/local/environ.go:30: var lxcBridgeName = "lxcbr0" const, as it's not ...
10 years, 9 months ago (2013-07-16 09:13:02 UTC) #3
fwereade
LGTM, but I'm a bit worried about the firewalling. What actually happens when we run ...
10 years, 9 months ago (2013-07-16 11:01:25 UTC) #4
thumper
10 years, 9 months ago (2013-07-16 22:31:44 UTC) #5
https://codereview.appspot.com/11325043/diff/1/environs/local/environ.go
File environs/local/environ.go (right):

https://codereview.appspot.com/11325043/diff/1/environs/local/environ.go#newc...
environs/local/environ.go:30: var lxcBridgeName = "lxcbr0"
On 2013/07/16 09:13:03, gz wrote:
> const, as it's not being overriden in tests anywhere?

Sure.  I had planned at some stage to allow this to be part of the
configuration.
If or when we do this, we can remove this I guess.  Changed to const.

https://codereview.appspot.com/11325043/diff/1/environs/local/environ.go#newc...
environs/local/environ.go:35: var upstartScriptLocation = "/etc/init"
On 2013/07/16 11:01:25, fwereade wrote:
> I'm a little suspicious that this is showing up again... I suspect it's in a
few
> places already. I think it's usually called InitDir, IIRC; please do a quick
> search and see if there's any obvious deduplication to be done.

This is more so it can be overridden in the tests, otherwise the code would try
to write to /etc/init in the tests, which is bad (and problematic).

There doesn't seem to be any particular deduplication that can be done right
now.

https://codereview.appspot.com/11325043/diff/1/environs/local/environ.go#newc...
environs/local/environ.go:108: // up yet, so we retry to verify if that is
happening.
On 2013/07/16 09:13:03, gz wrote:
> Is this comment at all truthful in the context of the local provider? What
> eventual consistency do we have to deal with for the local file store
> implementation?

It is at least theoretically possible if the user is either scripting things or
very quick on the fingers.  I'll update the comment slightly.

Actually, I'm just going to error out.  They can always try again.

https://codereview.appspot.com/11325043/diff/1/environs/local/environ.go#newc...
environs/local/environ.go:233: func (env *localEnviron) Instances(ids
[]instance.Id) ([]instance.Instance, error) {
On 2013/07/16 11:01:25, fwereade wrote:
> On 2013/07/16 09:13:03, gz wrote:
> > This probably wants a TODO about checking that the id is a machine that
> actually
> > exists?
> 
> Yeah, I'm definitely raising eyebrows here. Can this bit be cleanly separated
> into a new CL? What's it actually used for here?

I actually considered checking to see if the ids exist, but then thought, why?
This is only ever called with instance ids that we already know exist, so why
check again?
If we are wrong (which we aren't), it will fail later.

It is used in the bootstrap process somewhere.  I just implemented what was
called.

This reminds me that I need to implement a stacktrace logging helper.

https://codereview.appspot.com/11325043/diff/1/environs/local/environ.go#newc...
environs/local/environ.go:277: if err := os.RemoveAll(env.config.rootDir()); err
!= nil {
On 2013/07/16 09:13:03, gz wrote:
> Is this enough to cleanup current lxc containers?

No, but we aren't creating any either.

https://codereview.appspot.com/11325043/diff/1/environs/local/environ.go#newc...
environs/local/environ.go:277: if err := os.RemoveAll(env.config.rootDir()); err
!= nil {
On 2013/07/16 11:01:25, fwereade wrote:
> On 2013/07/16 09:13:03, gz wrote:
> > Is this enough to cleanup current lxc containers?
> 
> Don't think so. But I presume that this CL contains the absolute minimum of
> instancey bits necessary to get bootstrap working? If so I'm ok with this and
> the above.

Container creation comes later (and their clean up).

https://codereview.appspot.com/11325043/diff/1/environs/local/environprovider.go
File environs/local/environprovider.go (right):

https://codereview.appspot.com/11325043/diff/1/environs/local/environprovider...
environs/local/environprovider.go:122: // return "", fmt.Errorf("not
implemented")
On 2013/07/16 11:01:25, fwereade wrote:
> d

Done.

https://codereview.appspot.com/11325043/diff/1/environs/local/instance.go
File environs/local/instance.go (right):

https://codereview.appspot.com/11325043/diff/1/environs/local/instance.go#new...
environs/local/instance.go:40: return "", instance.ErrNoDNSName
On 2013/07/16 11:01:25, fwereade wrote:
> On 2013/07/16 09:13:03, gz wrote:
> > Can't this just be `return environs.WaitDNSName(inst)` now?
> 
> +1

Done.

https://codereview.appspot.com/11325043/diff/1/environs/local/instance.go#new...
environs/local/instance.go:45: return fmt.Errorf("not implemented")
On 2013/07/16 11:01:25, fwereade wrote:
> On 2013/07/16 09:13:03, gz wrote:
> > I'd be tempted to just log here, OpenPort never did anything on the local
> > provider.
> 
> +1

Done.

https://codereview.appspot.com/11325043/diff/1/environs/local/instance.go#new...
environs/local/instance.go:50: return fmt.Errorf("not implemented")
On 2013/07/16 11:01:25, fwereade wrote:
> On 2013/07/16 09:13:03, gz wrote:
> > Likewise, just log for ClosePort.
> 
> +1

Done.
Sign in to reply to this message.

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