← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~vorlon/launchpad-buildd/u-i-channels into lp:launchpad-buildd

 

Steve Langasek has proposed merging lp:~vorlon/launchpad-buildd/u-i-channels into lp:launchpad-buildd.

Requested reviews:
  Adam Conrad (adconrad)
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~vorlon/launchpad-buildd/u-i-channels/+merge/335864

To fully support autobuilding of ubuntu-core images, we should make it possible to specify a snap channel to build from.

Consistent with the ubuntu-image (and snap prepare-image) interface, we only allow specifying a single channel here, which is then applied for all snaps.  This is vaguely dissatisfying, but does meet all of the present requirements, and anything beyond this would need to be designed in the low-level tools first.

I have not implemented the corresponding bits in livecd-rootfs yet as I thought it preferable to gather feedback on the launchpad-buildd design beforehand.

'make check' runs locally without regressions in a bionic environment.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~vorlon/launchpad-buildd/u-i-channels into lp:launchpad-buildd.
=== modified file 'lpbuildd/livefs.py'
--- lpbuildd/livefs.py	2017-09-13 09:32:19 +0000
+++ lpbuildd/livefs.py	2018-01-09 01:03:26 +0000
@@ -36,6 +36,7 @@
         self.image_format = extra_args.get("image_format")
         self.locale = extra_args.get("locale")
         self.extra_ppas = extra_args.get("extra_ppas", [])
+        self.channel = extra_args.get("channel")
         self.debug = extra_args.get("debug", False)
 
         super(LiveFilesystemBuildManager, self).initiate(
@@ -59,6 +60,8 @@
             args.extend(["--locale", self.locale])
         for ppa in self.extra_ppas:
             args.extend(["--extra-ppa", ppa])
+        if self.channel:
+            args.extend(["--channel", self.channel])
         if self.debug:
             args.append("--debug")
         self.runTargetSubProcess("buildlivefs", *args)

=== modified file 'lpbuildd/target/build_livefs.py'
--- lpbuildd/target/build_livefs.py	2017-11-13 16:07:55 +0000
+++ lpbuildd/target/build_livefs.py	2018-01-09 01:03:26 +0000
@@ -58,6 +58,9 @@
             "--extra-ppa", dest="extra_ppas", default=[], action="append",
             help="use this additional PPA")
         parser.add_argument(
+            "--channel", metavar="CHANNEL",
+            help="pull snaps from channel CHANNEL for ubuntu-core image")
+        parser.add_argument(
             "--debug", default=False, action="store_true",
             help="enable detailed live-build debugging")
 
@@ -117,6 +120,8 @@
                 base_lb_env["SUBPROJECT"] = self.args.subproject
             if self.args.subarch is not None:
                 base_lb_env["SUBARCH"] = self.args.subarch
+            if self.args.channel is not None:
+                base_lb_env["CHANNEL"] = self.args.channel
             lb_env = base_lb_env.copy()
             lb_env["SUITE"] = self.args.series
             if self.args.datestamp is not None: