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

Issue 39940043: cloudinit/sshinit: wait for cloud-init to finish

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+198346, dave, dimitern, rog
Visibility:
Public.

Description

cloudinit/sshinit: wait for cloud-init to finish We must wait for cloud-init to finish doing its thing, as it will make various modifications to the base OS. One of the modifications is to set the cloud-local apt mirror, which we'll make use of during the synchronous bootstrap phase when apt updating/upgrading. Fixes #1259180 https://code.launchpad.net/~axwalk/juju-core/lp1259180-sshinit-wait-cloudinit/+merge/198346 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 6

Patch Set 2 : cloudinit/sshinit: wait for cloud-init to finish #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -7 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M cloudinit/sshinit/configure.go View 1 4 chunks +26 lines, -4 lines 11 comments Download
M cloudinit/sshinit/configure_test.go View 1 5 chunks +7 lines, -3 lines 0 comments Download

Messages

Total messages: 9
axw
Please take a look.
10 years, 5 months ago (2013-12-10 08:39:20 UTC) #1
dimitern
LGTM with some minor suggestions. https://codereview.appspot.com/39940043/diff/1/cloudinit/sshinit/configure.go File cloudinit/sshinit/configure.go (right): https://codereview.appspot.com/39940043/diff/1/cloudinit/sshinit/configure.go#newcode81 cloudinit/sshinit/configure.go:81: if pkill -0 cloud-init; ...
10 years, 5 months ago (2013-12-10 10:27:57 UTC) #2
axw
Please take a look. https://codereview.appspot.com/39940043/diff/1/cloudinit/sshinit/configure.go File cloudinit/sshinit/configure.go (right): https://codereview.appspot.com/39940043/diff/1/cloudinit/sshinit/configure.go#newcode81 cloudinit/sshinit/configure.go:81: if pkill -0 cloud-init; then ...
10 years, 5 months ago (2013-12-10 14:48:02 UTC) #3
dave_cheney.net
https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configure.go File cloudinit/sshinit/configure.go (right): https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configure.go#newcode38 cloudinit/sshinit/configure.go:38: cmd.Stdin = os.Stdin why pass stdin here ? it's ...
10 years, 5 months ago (2013-12-11 01:02:11 UTC) #4
axw
https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configure.go File cloudinit/sshinit/configure.go (right): https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configure.go#newcode38 cloudinit/sshinit/configure.go:38: cmd.Stdin = os.Stdin On 2013/12/11 01:02:11, dfc wrote: > ...
10 years, 5 months ago (2013-12-11 01:09:39 UTC) #5
rog
Looks reasonable, but one reservation outlined below. https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configure.go File cloudinit/sshinit/configure.go (right): https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configure.go#newcode81 cloudinit/sshinit/configure.go:81: if pkill ...
10 years, 5 months ago (2013-12-11 12:34:48 UTC) #6
axw
https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configure.go File cloudinit/sshinit/configure.go (right): https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configure.go#newcode81 cloudinit/sshinit/configure.go:81: if pkill -0 cloud-init; then On 2013/12/11 12:34:48, rog ...
10 years, 5 months ago (2013-12-11 13:15:34 UTC) #7
rog
https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configure.go File cloudinit/sshinit/configure.go (right): https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configure.go#newcode81 cloudinit/sshinit/configure.go:81: if pkill -0 cloud-init; then On 2013/12/11 13:15:34, axw ...
10 years, 5 months ago (2013-12-11 13:35:32 UTC) #8
axw
10 years, 5 months ago (2013-12-11 14:10:43 UTC) #9
https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configur...
File cloudinit/sshinit/configure.go (right):

https://codereview.appspot.com/39940043/diff/20001/cloudinit/sshinit/configur...
cloudinit/sshinit/configure.go:81: if pkill -0 cloud-init; then
On 2013/12/11 13:35:32, rog wrote:
> On 2013/12/11 13:15:34, axw wrote:
> > On 2013/12/11 12:34:48, rog wrote:
> > > This kind of logic makes me uncomfortable. It builds in a deep knowledge
of
> > > what's going on on the machine (that cloud-init is implemented by a single
> > > process named "cloud-init" for example) that we don't really need.
> > > 
> > > I'd prefer to see something that was triggered more directly by logic that
> we
> > > control. For example we could change our cloud-init script to create a
file
> > > which we look for; or we could even tail -f /var/log/cloud-init-output.log
> > > looking for a "cloud-init complete" line that we print (if we did that, we
> > > wouldn't need to poll)
> > 
> > I would prefer something we control too (I did consider this), but there's a
> > problem with relying on cloud-init: we don't always use cloud-init (manual
> > bootstrap). The approach taken works in both cases.
> 
> It won't work if someone's manual bootstrapped onto a machine where someone
> happens to be running a binary named "cloud-init".

True, that would stall the bootstrap. My answer to that at the moment is "don't
do that". I understand that we can do better, though, so I'm opening a tech debt
bug.

https://bugs.launchpad.net/juju-core/+bug/1259942

> Since we can't rely on cloud-init-output, perhaps looking for a file might be
> better.

Agreed. It's doable by adding an additional first "bootcmd" to the config passed
to sshinit by synchronous bootstrap that waits for a file created by a final
"runcmd" executed by cloud-init.
Sign in to reply to this message.

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