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

Issue 30190043: Implement synchronous bootstrap

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 5 months ago by axw
Modified:
10 years, 5 months ago
Reviewers:
mp+196058, jameinel, wallyworld, fwereade
Visibility:
Public.

Description

Implement synchronous bootstrap environs/manual has been further refactored to split the "manual cloud-init over SSH" out into a separate package (cloudinit/sshinit). provider/common now starts an instance with the basic cloud-init only (SSH keys + logging), then waits for a DNS name, waits to be able to connect via SSH, and then defers to sshinit to execute the remaining cloud-init steps. If the user hits Ctrl-C, SIGINT will terminate the SSH connection, and the bootstrap process will attempt to clean up by stopping the instance and removing the state file (if the instance could be cleanly stopped). We also ignore SIGINT in the juju process so a second Ctrl-C will not terminate the cleanup procedure. Fixes #1224230 https://code.launchpad.net/~axwalk/juju-core/synchronous-bootstrap/+merge/196058 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 13

Patch Set 2 : Implement synchronous bootstrap #

Total comments: 8

Patch Set 3 : Implement synchronous bootstrap #

Patch Set 4 : Implement synchronous bootstrap #

Total comments: 14

Patch Set 5 : Implement synchronous bootstrap #

Unified diffs Side-by-side diffs Delta from patch set Stats (+682 lines, -120 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M cloudinit/cloudinit_test.go View 1 2 3 1 chunk +31 lines, -0 lines 0 comments Download
M cloudinit/options.go View 1 2 3 2 chunks +21 lines, -0 lines 0 comments Download
A cloudinit/progress.go View 1 2 3 1 chunk +43 lines, -0 lines 0 comments Download
A cloudinit/progress_test.go View 1 2 3 1 chunk +27 lines, -0 lines 0 comments Download
M cloudinit/sshinit/configure.go View 1 2 3 4 5 chunks +45 lines, -29 lines 0 comments Download
M cloudinit/sshinit/configure_test.go View 1 2 3 4 7 chunks +68 lines, -18 lines 0 comments Download
A cloudinit/sshinit/suite_test.go View 1 chunk +14 lines, -0 lines 0 comments Download
M cmd/juju/debughooks.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/juju/debughooks_test.go View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M cmd/juju/scp.go View 1 2 3 4 2 chunks +2 lines, -4 lines 0 comments Download
M cmd/juju/scp_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/juju/ssh.go View 1 2 3 4 2 chunks +8 lines, -4 lines 0 comments Download
M cmd/juju/ssh_test.go View 1 2 3 4 2 chunks +7 lines, -7 lines 0 comments Download
M environs/bootstrap/state.go View 1 chunk +5 lines, -0 lines 0 comments Download
M environs/bootstrap/state_test.go View 1 2 3 4 3 chunks +21 lines, -0 lines 0 comments Download
M environs/cloudinit.go View 1 2 3 1 chunk +10 lines, -3 lines 0 comments Download
M environs/cloudinit/cloudinit.go View 1 2 3 5 chunks +56 lines, -8 lines 0 comments Download
M environs/cloudinit/cloudinit_test.go View 1 2 3 5 chunks +8 lines, -0 lines 0 comments Download
M environs/cloudinit_test.go View 1 3 chunks +38 lines, -4 lines 0 comments Download
M environs/manual/bootstrap.go View 1 chunk +1 line, -1 line 0 comments Download
M environs/manual/detection.go View 1 2 3 4 3 chunks +3 lines, -2 lines 0 comments Download
M environs/manual/provisioner.go View 3 chunks +14 lines, -1 line 0 comments Download
M environs/sshstorage/storage.go View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
A environs/testing/bootstrap.go View 1 2 3 4 1 chunk +26 lines, -0 lines 0 comments Download
M provider/common/bootstrap.go View 1 2 3 4 4 chunks +163 lines, -8 lines 0 comments Download
M provider/common/bootstrap_test.go View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M provider/ec2/local_test.go View 1 2 3 4 3 chunks +16 lines, -10 lines 0 comments Download
M provider/maas/maas_test.go View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M provider/openstack/local_test.go View 1 2 3 4 3 chunks +7 lines, -0 lines 0 comments Download
M utils/ssh/ssh.go View 1 2 3 4 1 chunk +32 lines, -12 lines 0 comments Download

Messages

Total messages: 14
axw
Please take a look.
10 years, 5 months ago (2013-11-21 06:33:20 UTC) #1
wallyworld
This looks pretty solid. I like how manual provisioning and cloud provisioning now share more ...
10 years, 5 months ago (2013-11-22 01:53:59 UTC) #2
axw
I've tested against ec2, will do openstack and azure later. I don't have access to ...
10 years, 5 months ago (2013-11-22 02:52:01 UTC) #3
axw
Please take a look.
10 years, 5 months ago (2013-11-22 06:05:03 UTC) #4
wallyworld
Thanks for dealing with the finishBootstrap issues - I think it's much better now that ...
10 years, 5 months ago (2013-11-22 06:37:49 UTC) #5
axw
On 2013/11/22 06:37:49, wallyworld wrote: > Thanks for dealing with the finishBootstrap issues - I ...
10 years, 5 months ago (2013-11-22 07:54:35 UTC) #6
axw
Please take a look. https://codereview.appspot.com/30190043/diff/20001/cloudinit/sshinit/configure_test.go File cloudinit/sshinit/configure_test.go (right): https://codereview.appspot.com/30190043/diff/20001/cloudinit/sshinit/configure_test.go#newcode136 cloudinit/sshinit/configure_test.go:136: assertScriptMatches(c, cfg, "(.|\n)*apt-get -y update(.|\n)*", ...
10 years, 5 months ago (2013-11-22 08:07:50 UTC) #7
jameinel
I tried this, and I *really* like the first steps where it is starting to ...
10 years, 5 months ago (2013-11-24 08:11:01 UTC) #8
axw
On 2013/11/24 08:11:01, jameinel wrote: > I tried this, and I *really* like the first ...
10 years, 5 months ago (2013-11-25 09:16:38 UTC) #9
axw
Please take a look.
10 years, 5 months ago (2013-12-02 09:53:10 UTC) #10
fwereade
This is *great*. Thanks very much. It would be really nice to have an initial ...
10 years, 5 months ago (2013-12-02 14:54:09 UTC) #11
fwereade
Oh! And, can we run in-environment storage everywhere soon? This doesn't handle the bootstrap-state case ...
10 years, 5 months ago (2013-12-02 15:30:09 UTC) #12
axw
On 2013/12/02 14:54:09, fwereade wrote: > This is *great*. Thanks very much. It would be ...
10 years, 5 months ago (2013-12-03 05:17:21 UTC) #13
axw
10 years, 5 months ago (2013-12-03 05:54:12 UTC) #14
Please take a look.

https://codereview.appspot.com/30190043/diff/60001/cloudinit/sshinit/configur...
File cloudinit/sshinit/configure_test.go (right):

https://codereview.appspot.com/30190043/diff/60001/cloudinit/sshinit/configur...
cloudinit/sshinit/configure_test.go:36: environs.RegisterProvider("sshinit",
&testProvider{})
On 2013/12/02 14:54:09, fwereade wrote:
> Can we stick an explicit "test" into the name somewhere please?

Done.

https://codereview.appspot.com/30190043/diff/60001/environs/bootstrap/state_t...
File environs/bootstrap/state_test.go (right):

https://codereview.appspot.com/30190043/diff/60001/environs/bootstrap/state_t...
environs/bootstrap/state_test.go:59: c.Assert(err, gc.IsNil) // doesn't exist,
juju don't carea
On 2013/12/02 14:54:09, fwereade wrote:
> s/carea/care/

Done.

https://codereview.appspot.com/30190043/diff/60001/provider/common/bootstrap.go
File provider/common/bootstrap.go (right):

https://codereview.appspot.com/30190043/diff/60001/provider/common/bootstrap....
provider/common/bootstrap.go:40: // Std{in,out,err}, and interrupt signal
handling.
On 2013/12/02 14:54:09, fwereade wrote:
> I'd like this to be an imminent followup, please :).

No problems.

https://codereview.appspot.com/30190043/diff/60001/provider/common/bootstrap....
provider/common/bootstrap.go:61: inst, hw, err = env.StartInstance(cons,
selectedTools, machineConfig)
On 2013/12/02 14:54:09, fwereade wrote:
> Wouldn't this still work with :=, even given inst? Maybe I'm still sluggish
> after lunch...

No, you're right, that'll work. Fixed.

https://codereview.appspot.com/30190043/diff/60001/provider/common/testing/bo...
File provider/common/testing/bootstrap.go (right):

https://codereview.appspot.com/30190043/diff/60001/provider/common/testing/bo...
provider/common/testing/bootstrap.go:17: f := func(*common.BootstrapContext,
instance.Instance, *cloudinit.MachineConfig) error {
On 2013/12/02 14:54:09, fwereade wrote:
> Let's log something in here so that there's some way of diagnosing what
happened
> if Disable gets called in a surprising situation.

Done.

https://codereview.appspot.com/30190043/diff/60001/provider/maas/maas_test.go
File provider/maas/maas_test.go (right):

https://codereview.appspot.com/30190043/diff/60001/provider/maas/maas_test.go...
provider/maas/maas_test.go:14: commontesting
"launchpad.net/juju-core/provider/common/testing"
On 2013/12/02 14:54:09, fwereade wrote:
> Oh, a thought. Might DisableFinishBootstrap be happier in environs/testing?

Hmm yeah that's fine, and stops the package proliferation. Moved.

https://codereview.appspot.com/30190043/diff/60001/utils/ssh/ssh.go
File utils/ssh/ssh.go (left):

https://codereview.appspot.com/30190043/diff/60001/utils/ssh/ssh.go#oldcode15
utils/ssh/ssh.go:15: // Move this to a common package for use in cmd/juju, and
others.
On 2013/12/02 14:54:09, fwereade wrote:
> Can the SSHy bits in cmd/juju use this now?

Done. Also updated environs/sshstorage, and environs/manual. Had to tweak
utils/ssh a bit, and add an ScpCommand function.
Sign in to reply to this message.

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