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

Issue 61410051: Fixed bug #1240667: pin priority for cloud-tools (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by dimitern
Modified:
10 years, 2 months ago
Reviewers:
gz, axw, mp+205816, rog
Visibility:
Public.

Description

Fixed bug #1240667: pin priority for cloud-tools This introduces several new calls in cloudinit, which deal with apt sources, their preferences (/etc/apt/preferences.d/) and packages that we install from there. Basically, when deploying a precise machine that needs to install mongodb-server package, we add the cloud-tools pocket, but by default this will add it as an apt source with a higher priority than the main archive. As a consequence, charms that try to install packages from main, which are also in the cloud-tools pocket get the latter, rather than the former (i.e. the described problem with python-django's version 1.5 in cloud-tools vs. 1.14 in main, which breaks openstack-dashboard charm). Now, when adding the cloud-tools archive we also change its apt preferences, so that its priority as an apt source is lower than main, which means when installing mongodb-server during cloudinit we need to explicitly specity --target-release 'precise-updates/cloud-tools' to pick the version from cloud-tools. Live tested on EC2 and works as expected. https://code.launchpad.net/~dimitern/juju-core/290-lp-1240667-cloud-tools-priority/+merge/205816 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 8

Patch Set 2 : Fixed bug #1240667: pin priority for cloud-tools #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -22 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M cloudinit/cloudinit.go View 1 2 chunks +37 lines, -3 lines 0 comments Download
M cloudinit/cloudinit_test.go View 3 chunks +41 lines, -2 lines 0 comments Download
M cloudinit/options.go View 1 3 chunks +19 lines, -2 lines 2 comments Download
M cloudinit/sshinit/configure.go View 1 2 chunks +12 lines, -1 line 2 comments Download
M cloudinit/sshinit/configure_test.go View 3 chunks +12 lines, -2 lines 0 comments Download
M environs/cloudinit/cloudinit.go View 3 chunks +21 lines, -9 lines 0 comments Download
M environs/cloudinit/cloudinit_test.go View 4 chunks +7 lines, -3 lines 0 comments Download

Messages

Total messages: 6
dimitern
Please take a look.
10 years, 2 months ago (2014-02-11 16:50:30 UTC) #1
gz
LGTM if we get sign-off from smoser. https://codereview.appspot.com/61410051/diff/1/cloudinit/options.go File cloudinit/options.go (right): https://codereview.appspot.com/61410051/diff/1/cloudinit/options.go#newcode134 cloudinit/options.go:134: cfg.AddPackage(fmt.Sprintf("--target-release '%s' ...
10 years, 2 months ago (2014-02-11 17:05:01 UTC) #2
rog
LGTM modulo mgz's concerns and some suggestions below. https://codereview.appspot.com/61410051/diff/1/cloudinit/options.go File cloudinit/options.go (right): https://codereview.appspot.com/61410051/diff/1/cloudinit/options.go#newcode17 cloudinit/options.go:17: // ...
10 years, 2 months ago (2014-02-11 17:31:54 UTC) #3
dimitern
Please take a look. https://codereview.appspot.com/61410051/diff/1/cloudinit/options.go File cloudinit/options.go (right): https://codereview.appspot.com/61410051/diff/1/cloudinit/options.go#newcode17 cloudinit/options.go:17: // AptPreferencesTemplate defines the format ...
10 years, 2 months ago (2014-02-11 20:02:50 UTC) #4
axw
https://codereview.appspot.com/61410051/diff/20001/cloudinit/options.go File cloudinit/options.go (right): https://codereview.appspot.com/61410051/diff/20001/cloudinit/options.go#newcode91 cloudinit/options.go:91: cfg.AddFile(prefs.Path, prefs.FileContents(), 0644) Did you live test both add-machine ...
10 years, 2 months ago (2014-02-12 01:25:41 UTC) #5
dimitern
10 years, 2 months ago (2014-02-12 08:49:36 UTC) #6
Message was sent while issue was closed.
https://codereview.appspot.com/61410051/diff/20001/cloudinit/options.go
File cloudinit/options.go (right):

https://codereview.appspot.com/61410051/diff/20001/cloudinit/options.go#newco...
cloudinit/options.go:91: cfg.AddFile(prefs.Path, prefs.FileContents(), 0644)
On 2014/02/12 01:25:42, axw wrote:
> Did you live test both add-machine and bootstrap?
> 
> I don't see how this could have worked as expected in a live test of
add-machine
> (which uses cloud-init all the way, as opposed to cloud-init + "sshinit").
> AddFile is implemented in terms of runcmd; runcmd runs after packages are
> installed.
> 
> I'm really not keen on this approach at all. I think environs/cloudinit should
> be modified to add a bootcmd in ConfigureBasic. Bootcmds are run before
packages
> are installed.

It works all the same - the repository is added and with it the prefs file gets
created. Just tested it carefully again with add-machine and a fresh precise VM.

About the approach, since it fixes the bug, which I was aiming to do, it's
adequate, if not the best one, I agree. If you feel strongly that it should be
changed, please propose a follow-up?

https://codereview.appspot.com/61410051/diff/20001/cloudinit/sshinit/configur...
File cloudinit/sshinit/configure.go (right):

https://codereview.appspot.com/61410051/diff/20001/cloudinit/sshinit/configur...
cloudinit/sshinit/configure.go:144: if src.Prefs != nil {
On 2014/02/12 01:25:42, axw wrote:
> Is there a good reason to duplicate this logic here and in
cloudinit/options.go?
> Anything that's not core cloud-init functionality should really belong in
> environs/cloudinit.

This is due to the fact that runcmds are run after everything else, as you
mentioned. So I had to pull it out here in order for it to work.
Sign in to reply to this message.

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