Merge lp:~simpoir/landscape-charm/bionic-source-build into lp:~landscape/landscape-charm/trunk

Proposed by Simon Poirier
Status: Merged
Approved by: Simon Poirier
Approved revision: 394
Merged at revision: 391
Proposed branch: lp:~simpoir/landscape-charm/bionic-source-build
Merge into: lp:~landscape/landscape-charm/trunk
Diff against target: 82 lines (+17/-8)
3 files modified
lib/apt.py (+6/-2)
lib/tests/test_apt.py (+10/-6)
metadata.yaml (+1/-0)
To merge this branch: bzr merge lp:~simpoir/landscape-charm/bionic-source-build
Reviewer Review Type Date Requested Status
Dave Jones (community) Approve
🤖 Landscape Builder test results Approve
Review via email: mp+349439@code.launchpad.net

Commit message

Adds support for bionic.

Description of the change

Adds support for bionic.

Also sets local repo trusted for source installs, so it doesn't error on the unsigned repo.

Testing instructions.

# build source tarball since the PPA doesn't have bionic packages (yet)
cd landscape/trunk/standalone && make standalone-package-source
cp landscape-server_*.tar.gz path/to/this_charm/
juju deploy . --series bionic --config source="deb https://<redacted>@private-ppa.launchpad.net/landscape/lds-trunk/ubuntu bionic main" --config key=6E85A86E4652B4E6

juju debug-log # look for deployment errors

# feel free to also deploy and relate haproxy, postgresql and rabbitmq-server

To post a comment you must log in.
Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: make ci-test
Result: Fail
Revno: 393
Branch: lp:~simpoir/landscape-charm/bionic-source-build
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3899/

review: Needs Fixing (test results)
394. By Simon Poirier

lint

Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: make ci-test
Result: Success
Revno: 394
Branch: lp:~simpoir/landscape-charm/bionic-source-build
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3900/

review: Approve (test results)
Revision history for this message
Dave Jones (waveform) wrote :

Deployment of charm went smoothly, as did deployment and relation of postgresql and rabbitmq-server. Hit a snag with haproxy though: deployed fine but fails to relate complaining it can't find an SSL cert:

unit-haproxy-1: 21:46:09 DEBUG unit.haproxy/1.reverseproxy-relation-changed [ALERT] 207/204609 (6354) : parsing [/etc/
haproxy/haproxy.cfg:59] : 'bind 0.0.0.0:443' : unable to load SSL certificate file '/var/lib/haproxy/default.pem' file
 does not exist.
unit-haproxy-1: 21:46:09 DEBUG unit.haproxy/1.reverseproxy-relation-changed [ALERT] 207/204609 (6354) : Parsing [/etc/
haproxy/haproxy.cfg:129]: frontend 'haproxy-1-80' has the same name as frontend 'haproxy-1-80' declared at /etc/haprox
y/haproxy.cfg:22.
unit-haproxy-1: 21:46:09 DEBUG unit.haproxy/1.reverseproxy-relation-changed [ALERT] 207/204609 (6354) : Error(s) found
 in configuration file : /etc/haproxy/haproxy.cfg
unit-haproxy-1: 21:46:09 DEBUG unit.haproxy/1.reverseproxy-relation-changed [ALERT] 207/204609 (6354) : Fatal errors f
ound in configuration.
unit-haproxy-1: 21:46:09 INFO unit.haproxy/1.juju-log reverseproxy:7: HAProxy configuration check failed, exiting.
unit-haproxy-1: 21:46:09 ERROR juju.worker.uniter.operation hook "reverseproxy-relation-changed" failed: exit status 1

I wonder if that's expected though; something the deployer is meant to provide?

Revision history for this message
Dave Jones (waveform) wrote :

Right, all looks good - SSL cert deployment is as expected; +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/apt.py'
2--- lib/apt.py 2017-03-04 02:50:00 +0000
3+++ lib/apt.py 2018-07-13 14:11:40 +0000
4@@ -69,11 +69,13 @@
5 """
6
7 def __init__(self, hookenv=hookenv, fetch=fetch, subprocess=subprocess,
8- paths=default_paths):
9+ paths=default_paths, sources_file=None):
10 self._hookenv = hookenv
11 self._fetch = fetch
12 self._subprocess = subprocess
13 self._paths = paths
14+ self._sources_file = (
15+ sources_file or "/etc/apt/sources.list.d/landscape.list")
16
17 self._runner = CommandRunner(hookenv, subprocess)
18
19@@ -237,7 +239,9 @@
20 runner = self._runner.in_dir(repo_dir)
21 runner.shell(BUILD_LOCAL_REPO)
22
23- self._fetch.add_source("deb file://%s/ ./" % repo_dir)
24+ # SoftwareProperties does not store trusted flag.
25+ with open(self._sources_file, "w") as sources:
26+ sources.write("deb [trusted=yes] file://%s/ ./" % repo_dir)
27 self._fetch.apt_update(fatal=True)
28
29 return True
30
31=== modified file 'lib/tests/test_apt.py'
32--- lib/tests/test_apt.py 2016-07-12 22:55:20 +0000
33+++ lib/tests/test_apt.py 2018-07-13 14:11:40 +0000
34@@ -20,13 +20,14 @@
35 self.subprocess = SubprocessStub()
36 self.root_dir = self.useFixture(RootDir())
37 self.paths = self.root_dir.paths
38+ self.sources_file = self.useFixture(TempDir()).join("landscape.list")
39 self.subprocess.add_fake_executable("add-apt-repository")
40 self.subprocess.add_fake_executable("apt-mark")
41 self.subprocess.add_fake_executable(
42 "/usr/lib/pbuilder/pbuilder-satisfydepends")
43 self.apt = Apt(
44 hookenv=self.hookenv, fetch=self.fetch, subprocess=self.subprocess,
45- paths=self.paths)
46+ paths=self.paths, sources_file=self.sources_file)
47
48 def _create_local_tarball(self, name, version):
49 """Create a local minimal source package tarball that can be built.
50@@ -177,13 +178,16 @@
51 self.assertTrue(os.path.exists(os.path.join(
52 repo_dir, "landscape-server_1.2.3_all.deb")))
53
54- self.assertEqual(
55- [("ppa:landscape/14.10", None),
56- ("deb file://%s/build/repo/ ./" % self.hookenv.charm_dir(),
57- None)],
58- self.fetch.sources)
59+ self.assertEqual([("ppa:landscape/14.10", None)], self.fetch.sources)
60 # XXX: We should check that the generated repository is valid.
61
62+ with open(self.sources_file) as sources_file:
63+ sources = sources_file.read()
64+ self.assertEqual(
65+ "deb [trusted=yes] file://{}/build/repo/ ./".format(
66+ self.hookenv.charm_dir()),
67+ sources)
68+
69 def test_local_tarball_not_new(self):
70 """
71 If the landscape tarball hasn't changed, it won't be built.
72
73=== modified file 'metadata.yaml'
74--- metadata.yaml 2016-05-18 18:36:20 +0000
75+++ metadata.yaml 2018-07-13 14:11:40 +0000
76@@ -20,5 +20,6 @@
77 interface: landscape-hosted
78 scope: container
79 series:
80+ - bionic
81 - xenial
82 - trusty

Subscribers

People subscribed via source and target branches