Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/maas: persist bridge script #6599

Merged
merged 3 commits into from Nov 24, 2016

Conversation

frobware
Copy link
Contributor

Previously the MAAS script that bridges interfaces was deleted from
the filesystem after it had run because it was a one-time only event.

As we are now moving towards dynamic bridging we need permanent access
to the script; the script is now persisted in /var/lib/juju. That path
is not hard-coded, it comes from calling: paths.DataDir(series).

Previously the MAAS script that bridges interfaces was deleted from
the filesystem after it had run because it was a one-time only event.

As we are now moving towards dynamic bridging we need permanent access
to the script; the script is now persisted in /var/lib/juju. That path
is not hard-coded, it comes from calling: paths.DataDir(series).

QA steps:

1) bootstrap on MAAS
2) verify that /var/lib/juju/add-juju-bridge.py exists
3) verify that /var/lib/juju/add-juju-bridge.py is executable
4) reboot machine, and verify (2) and (3) post reboot
5) verify bridge(s) exist: $(brctl show)
Copy link
Member

@jameinel jameinel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we actually land this as is? I'm specifically looking at the fact that we are moving where the script is located. I suppose as part of that we're not calling it anymore. Wouldn't we have some sort of functional CI test that would fail to create containers on MAAS in that situation?

@@ -8,10 +8,7 @@ bridgescript.go: add-juju-bridge.py Makefile
$(RM) $@
echo -n '// This file is auto generated. Edits will be lost.\n\n' >> $@
echo -n 'package maas\n\n' >> $@
echo -n '//go:generate make -q\n\n' >> $@
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this line?
Don't we need "make" in order to build this .go file to include the .py file as a string?

I suppose we don't need "import path", but I think we do want to keep the "//go:generate" line. (I believe it tells 'go build' to run 'make -q' to regenerate this file).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was never used. We don't have a top-down rule that runs go generate. If I change the script I have (for ever) just run make in the provider/maas directory, then commit those changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The go generate mechanism never materialised in the build because, for a long time, we were stuck on versions of go that did not support go generate.

@@ -168,14 +171,18 @@ func (*environSuite) TestNewCloudinitConfigWithDisabledNetworkManagement(c *gc.C
c.Assert(cloudcfg.RunCmds(), jc.DeepEquals, expectedCloudinitConfig)
}

func (*environSuite) TestRenderEtcNetworkInterfacesScriptMultipleNames(c *gc.C) {
script := maas.RenderEtcNetworkInterfacesScript("eth0", "eth0:1", "eth2", "eth1")
func (*environSuite) xTestRenderEtcNetworkInterfacesScriptMultipleNames(c *gc.C) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why disable these tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Was testing various combos by commenting them out to ensure they did something real. Reinstating.

@frobware
Copy link
Contributor Author

Also note: the script is still executed, bridging interfaces that have a subnet/address as before. Only the location of the script has changed. Was /var/tmp, now /var/lib/juju.

Copy link
Contributor

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please provide QA steps and link a bug if there is one.


var bridgeScriptPath string

bridgeScriptPath, err = bridgeScriptPathForSeries(forSeries)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bridgeScriptPath, err := and drop the var above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


bridgeScriptPath, err = bridgeScriptPathForSeries(forSeries)
if err != nil {
return nil, err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errors.Trace (or annotate?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@frobware
Copy link
Contributor Author

QA steps:

  1. bootstrap on MAAS
  2. verify that /var/lib/juju/add-juju-bridge.py exists
  3. verify that /var/lib/juju/add-juju-bridge.py is executable
  4. reboot machine, and verify (2) and (3) post reboot
  5. verify bridge(s) exist: $(brctl show)

I did follow-up with these in a subsequent commit - they just don't show in the original commit message in GitHub.

Not an existing bug; feature work (gasp!).

@frobware
Copy link
Contributor Author

$$retry$$

@jujubot
Copy link
Collaborator

jujubot commented Nov 24, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit cf5ac80 into juju:develop Nov 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants