← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad-buildd/snap-lxd into lp:launchpad-buildd

 

Colin Watson has proposed merging lp:~cjwatson/launchpad-buildd/snap-lxd into lp:launchpad-buildd.

Commit message:
Switch snap builds to the LXD backend.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad-buildd/snap-lxd/+merge/329615
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad-buildd/snap-lxd into lp:launchpad-buildd.
=== modified file 'debian/changelog'
--- debian/changelog	2017-08-23 00:22:11 +0000
+++ debian/changelog	2017-08-25 16:06:34 +0000
@@ -25,6 +25,7 @@
   * Convert buildlivefs to the new Operation framework and add unit tests.
   * Convert buildsnap to the new Operation framework and add unit tests.
   * Add a LXD backend.
+  * Switch snap builds to the LXD backend.
 
  -- Colin Watson <cjwatson@xxxxxxxxxx>  Tue, 25 Jul 2017 23:07:58 +0100
 

=== modified file 'lpbuildd/snap.py'
--- lpbuildd/snap.py	2017-08-23 00:13:20 +0000
+++ lpbuildd/snap.py	2017-08-25 16:06:34 +0000
@@ -28,6 +28,7 @@
 class SnapBuildManager(DebianBuildManager):
     """Build a snap."""
 
+    backend_name = "lxd"
     initial_build_state = SnapBuildState.BUILD_SNAP
 
     @property

=== modified file 'lpbuildd/target/build_snap.py'
--- lpbuildd/target/build_snap.py	2017-08-23 00:13:20 +0000
+++ lpbuildd/target/build_snap.py	2017-08-25 16:06:34 +0000
@@ -99,6 +99,8 @@
     def install(self):
         logger.info("Running install phase...")
         deps = ["snapcraft"]
+        if self.args.backend == "lxd":
+            deps.extend(["snapd", "fuse", "squashfuse"])
         if self.args.branch is not None:
             deps.append("bzr")
         else:

=== modified file 'lpbuildd/tests/test_snap.py'
--- lpbuildd/tests/test_snap.py	2017-08-23 00:13:20 +0000
+++ lpbuildd/tests/test_snap.py	2017-08-25 16:06:34 +0000
@@ -77,7 +77,7 @@
         expected_command = [
             "sharepath/slavebin/in-target", "in-target",
             "buildsnap",
-            "--backend=chroot", "--series=xenial", "--arch=i386", self.buildid,
+            "--backend=lxd", "--series=xenial", "--arch=i386", self.buildid,
             "--git-repository", "https://git.launchpad.dev/~example/+git/snap";,
             "--git-path", "master",
             "test-snap",
@@ -113,8 +113,7 @@
         expected_command = [
             "sharepath/slavebin/in-target", "in-target",
             "scan-for-processes",
-            "--backend=chroot", "--series=xenial", "--arch=i386",
-            self.buildid,
+            "--backend=lxd", "--series=xenial", "--arch=i386", self.buildid,
             ]
         self.assertEqual(SnapBuildState.BUILD_SNAP, self.getState())
         self.assertEqual(expected_command, self.buildmanager.commands[-1])
@@ -130,8 +129,7 @@
         expected_command = [
             "sharepath/slavebin/in-target", "in-target",
             "umount-chroot",
-            "--backend=chroot", "--series=xenial", "--arch=i386",
-            self.buildid,
+            "--backend=lxd", "--series=xenial", "--arch=i386", self.buildid,
             ]
         self.assertEqual(SnapBuildState.UMOUNT, self.getState())
         self.assertEqual(expected_command, self.buildmanager.commands[-1])
@@ -158,8 +156,7 @@
         expected_command = [
             "sharepath/slavebin/in-target", "in-target",
             "scan-for-processes",
-            "--backend=chroot", "--series=xenial", "--arch=i386",
-            self.buildid,
+            "--backend=lxd", "--series=xenial", "--arch=i386", self.buildid,
             ]
         self.assertEqual(SnapBuildState.BUILD_SNAP, self.getState())
         self.assertEqual(expected_command, self.buildmanager.commands[-1])
@@ -176,8 +173,7 @@
         expected_command = [
             "sharepath/slavebin/in-target", "in-target",
             "umount-chroot",
-            "--backend=chroot", "--series=xenial", "--arch=i386",
-            self.buildid,
+            "--backend=lxd", "--series=xenial", "--arch=i386", self.buildid,
             ]
         self.assertEqual(SnapBuildState.UMOUNT, self.getState())
         self.assertEqual(expected_command, self.buildmanager.commands[-1])