← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~tobijk/launchpad-buildd/cohort-key into lp:launchpad-buildd

 

Tobias Koch has proposed merging lp:~tobijk/launchpad-buildd/cohort-key into lp:launchpad-buildd.

Commit message:
buildlivefs: support passing a COHORT_KEY variable into the environment
  
This is used to pre-seed images with identical versions of snaps during parallelized image builds.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~tobijk/launchpad-buildd/cohort-key/+merge/361190

The corresponding MP for livecd-rootfs is here:

https://code.launchpad.net/~tobijk/livecd-rootfs/+git/livecd-rootfs/+merge/360986
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~tobijk/launchpad-buildd/cohort-key into lp:launchpad-buildd.
=== modified file 'debian/changelog'
--- debian/changelog	2018-11-07 11:48:18 +0000
+++ debian/changelog	2018-12-20 13:10:55 +0000
@@ -5,6 +5,9 @@
 
   [ Tobias Koch ]
   * Update LXD backend to work with LXD 3.
+  * buildlivefs: support passing a COHORT_KEY variable into the
+    environment, used to pre-seed images with identical versions of
+    snaps during parallelized image builds.
 
  -- Colin Watson <cjwatson@xxxxxxxxxx>  Thu, 25 Oct 2018 10:03:14 +0100
 

=== modified file 'lpbuildd/livefs.py'
--- lpbuildd/livefs.py	2018-10-19 06:46:23 +0000
+++ lpbuildd/livefs.py	2018-12-20 13:10:55 +0000
@@ -38,6 +38,7 @@
         self.extra_ppas = extra_args.get("extra_ppas", [])
         self.channel = extra_args.get("channel")
         self.image_targets = extra_args.get("image_targets", [])
+        self.cohort_key = extra_args.get("cohort-key")
         self.debug = extra_args.get("debug", False)
 
         super(LiveFilesystemBuildManager, self).initiate(
@@ -65,6 +66,8 @@
             args.extend(["--channel", self.channel])
         for image_target in self.image_targets:
             args.extend(["--image-target", image_target])
+        if self.cohort_key:
+            args.extend(["--cohort-key", self.cohort_key])
         if self.debug:
             args.append("--debug")
         self.runTargetSubProcess("buildlivefs", *args)

=== modified file 'lpbuildd/target/build_livefs.py'
--- lpbuildd/target/build_livefs.py	2018-10-09 09:46:07 +0000
+++ lpbuildd/target/build_livefs.py	2018-12-20 13:10:55 +0000
@@ -53,6 +53,9 @@
             action="append", metavar="TARGET",
             help="produce image for TARGET")
         parser.add_argument(
+            "--cohort-key", dest="cohort_key", metavar="COHORT_KEY",
+            help="use COHORT_KEY during snap downloads")
+        parser.add_argument(
             "--proposed", default=False, action="store_true",
             help="enable use of -proposed pocket")
         parser.add_argument(
@@ -131,6 +134,8 @@
             if self.args.image_targets:
                 base_lb_env["IMAGE_TARGETS"] = " ".join(
                     self.args.image_targets)
+            if self.args.cohort_key:
+                base_lb_env["COHORT_KEY"] = self.args.cohort_key
             lb_env = base_lb_env.copy()
             lb_env["SUITE"] = self.args.series
             if self.args.datestamp is not None: