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

Issue 37320043: Handle cases where default-series is problematic.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 5 months ago by bac
Modified:
10 years, 5 months ago
Reviewers:
mp+197791, gary.poster
Visibility:
Public.

Description

Handle cases where default-series is problematic. If the bootstrap node is not the default (currently precise) then it is bad for deploying the Juju GUI since the charm is only currently available for precise. If an environment is already booted to non-precise or the default-series is set to something other than precise then special care needs to be taken. All of the scenarios are summarized in this note: http://bit.ly/1cXiPIW The three QA steps will all re-use the following command to invoke Quickstart: % .venv/bin/python juju-quickstart \ --gui-charm-url cs:~juju-gui/precise/juju-gui-136 \ bundle:~bac/muletrain/6/wiki All of the following use ec2, so: % juju switch ec2 1) No default-series. Destroy any existing environment. Edit ~/.juju/environments.yaml and comment out default-series for ec2. Run Quickstart as above. Expect: Three machines (BSN and GUI on 0) all precise. 2) Non-precise default-series Destroy any existing environment. Edit ~/.juju/environments.yaml and set 'default-series: raring' for ec2. Run Quickstart as above. Expect: Four machines 0 - bootstrap node, raring 1 - GUI, precise 2 & 3, bundle services, precise because that's what their charms are. Look at the output generated. You should see setting the default-series to raring Also do a % juju get-env The default-series should be raring. 3) Existing environment with non-precise. Destroy any existing environment. Edit ~/.juju/environments.yaml and set 'default-series: raring' for ec2. % juju bootstrap Run Quickstart as above. Expect: As #2 without the message about setting the default-series. https://code.launchpad.net/~bac/juju-quickstart/default-series/+merge/197791 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 16

Patch Set 2 : Handle cases where default-series is problematic. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -37 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M quickstart/app.py View 1 1 chunk +3 lines, -2 lines 0 comments Download
M quickstart/manage.py View 1 3 chunks +7 lines, -3 lines 0 comments Download
M quickstart/models/envs.py View 2 chunks +7 lines, -3 lines 0 comments Download
M quickstart/settings.py View 1 chunk +4 lines, -0 lines 0 comments Download
M quickstart/tests/helpers.py View 1 chunk +4 lines, -1 line 0 comments Download
M quickstart/tests/models/test_envs.py View 1 chunk +19 lines, -3 lines 0 comments Download
M quickstart/tests/test_app.py View 1 6 chunks +15 lines, -8 lines 0 comments Download
M quickstart/tests/test_manage.py View 1 7 chunks +11 lines, -2 lines 0 comments Download
M quickstart/tests/test_utils.py View 1 1 chunk +28 lines, -5 lines 0 comments Download
M quickstart/utils.py View 1 chunk +33 lines, -10 lines 0 comments Download

Messages

Total messages: 4
bac
Please take a look.
10 years, 5 months ago (2013-12-04 19:46:14 UTC) #1
bac
Developer notes added. https://codereview.appspot.com/37320043/diff/1/quickstart/app.py File quickstart/app.py (right): https://codereview.appspot.com/37320043/diff/1/quickstart/app.py#newcode178 quickstart/app.py:178: def set_environment(env_name, **kwargs): Docstring! It would ...
10 years, 5 months ago (2013-12-04 19:54:03 UTC) #2
gary.poster
LGTM with fully ignorable whining about names and such. QA good. When you rip out ...
10 years, 5 months ago (2013-12-04 21:00:39 UTC) #3
bac
10 years, 5 months ago (2013-12-04 22:33:35 UTC) #4
*** Submitted:

Handle cases where default-series is problematic.

If the bootstrap node is not the default (currently precise) then it is bad
for deploying the Juju GUI since the charm is only currently available for
precise.

If an environment is already booted to non-precise or the default-series is
set to something other than precise then special care needs to be taken.  All
of the scenarios are summarized in this note:

http://bit.ly/1cXiPIW

The three QA steps will all re-use the following command to invoke Quickstart:

% .venv/bin/python juju-quickstart \
   --gui-charm-url cs:~juju-gui/precise/juju-gui-136 \
   bundle:~bac/muletrain/6/wiki

All of the following use ec2, so:

% juju switch ec2

1) No default-series.

Destroy any existing environment.
Edit ~/.juju/environments.yaml and comment out default-series for ec2.
Run Quickstart as above.

Expect: Three machines (BSN and GUI on 0) all precise.


2) Non-precise default-series

Destroy any existing environment.
Edit ~/.juju/environments.yaml and set 'default-series: raring' for ec2.
Run Quickstart as above.

Expect: Four machines
	0 - bootstrap node, raring
	1 - GUI, precise
	2 & 3, bundle services, precise because that's what their charms are.

Look at the output generated.  You should see

setting the default-series to raring

Also do a
% juju get-env
The default-series should be raring.


3) Existing environment with non-precise.

Destroy any existing environment.
Edit ~/.juju/environments.yaml and set 'default-series: raring' for ec2.
% juju bootstrap
Run Quickstart as above.

Expect: As #2 without the message about setting the default-series.

R=gary.poster
CC=
https://codereview.appspot.com/37320043

https://codereview.appspot.com/37320043/diff/1/quickstart/app.py
File quickstart/app.py (right):

https://codereview.appspot.com/37320043/diff/1/quickstart/app.py#newcode164
quickstart/app.py:164: agent_state = utils.get_agent_state(output)
I'm not opposed to making changes.  But I don't think the suggestion really
improves clarity that much. I rarely invoke the tie-goes-to-the-runner rule but
will this time.

https://codereview.appspot.com/37320043/diff/1/quickstart/app.py#newcode178
quickstart/app.py:178: def set_environment(env_name, **kwargs):
YAGNI -- deleting the whole method.

https://codereview.appspot.com/37320043/diff/1/quickstart/app.py#newcode254
quickstart/app.py:254: check_preexisting=False):
On 2013/12/04 19:54:03, bac wrote:
> This line should not have been wrapped.

Done.

https://codereview.appspot.com/37320043/diff/1/quickstart/manage.py
File quickstart/manage.py (right):

https://codereview.appspot.com/37320043/diff/1/quickstart/manage.py#newcode284
quickstart/manage.py:284: 
On 2013/12/04 21:00:39, gary.poster wrote:
> On 2013/12/04 19:54:03, bac wrote:
> > This entire section may be unnecessary now.
> > 
> > Since 'juju bootstrap' no equivalent of the 'default-series' being set in
the
> > environment.yaml, the bootstrap now just uses the default, which is sanely
> > 'precise'. 
> > 
> > If there is a default-series set, then the bootstrap does not somehow
override
> > it and it remains in place.  Thus this block is a no-op.
> > 
> > I've left it in for review as I discovered it late and want confirmation.
> 
> From whom? :-) If that's what you found then sorry for misguiding you, but
let's
> clean this out.

Done.

https://codereview.appspot.com/37320043/diff/1/quickstart/manage.py#newcode293
quickstart/manage.py:293: bsn_series != settings.JUJU_GUI_PREFERRED_SERIES)
I thought that originally.

But we have lots of ways to talk about the charm.  We try to get one from
charmworld and if that fails we have a default we use.  Each of those is tied to
a series.  

So even if we do have charms for precise and trusty you can't put a trusty charm
on a bootnode running precise.  So this test is more restrictive but I think
more correct.

The fragility is that those other places where we specify the charm must match
this setting.

https://codereview.appspot.com/37320043/diff/1/quickstart/tests/test_utils.py
File quickstart/tests/test_utils.py (right):

https://codereview.appspot.com/37320043/diff/1/quickstart/tests/test_utils.py...
quickstart/tests/test_utils.py:476: def test_no_bsn_series(self):
On 2013/12/04 21:00:39, gary.poster wrote:
> I must admit that I have no idea what bsn is, other than the fact that I
assume
> "s" is series.
> 
> [Later] Oh!  Bootstrap Node!
> 
> +1 on just spelling it out. :-)

Done.

https://codereview.appspot.com/37320043/diff/1/quickstart/utils.py
File quickstart/utils.py (right):

https://codereview.appspot.com/37320043/diff/1/quickstart/utils.py#newcode225
quickstart/utils.py:225: def parse_status_output(output, keys=None):
I think the helpers are useful.
Sign in to reply to this message.

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