Merge lp:~ubuntu-desktop/ubuntu-cdimage/ubuntu-next-system-image into lp:ubuntu-cdimage

Proposed by Didier Roche-Tolomelli
Status: Merged
Merged at revision: 1518
Proposed branch: lp:~ubuntu-desktop/ubuntu-cdimage/ubuntu-next-system-image
Merge into: lp:ubuntu-cdimage
Diff against target: 269 lines (+105/-13)
7 files modified
etc/crontab (+1/-1)
etc/default-arches (+1/-1)
etc/qa-products (+1/-0)
lib/cdimage/build.py (+28/-8)
lib/cdimage/livefs.py (+8/-3)
lib/cdimage/tests/test_build.py (+61/-0)
lib/cdimage/tree.py (+5/-0)
To merge this branch: bzr merge lp:~ubuntu-desktop/ubuntu-cdimage/ubuntu-next-system-image
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+257057@code.launchpad.net

Description of the change

Experimenting transforming ubuntu-desktop-next to a system-image base

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

As well as the inline comments below, could you please look into adding unit tests for at least some of this?

review: Needs Fixing
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

In addition to my inline comments, I did push some fixes which should address all your comments. Working with robert on the tests now.

The release team has been poked and the isotracker change will be soon there (thanks Laney). Please see the reasoning why I'm not renaming the image removing the -next suffix.

Thanks for the initial review (and explanations when there is no need to add the system-image subproject differentiation).

1509. By Didier Roche-Tolomelli

Ensure we are backward compatible to build older desktop-next images, various typo fixes and factorize some work in functions

Revision history for this message
Colin Watson (cjwatson) wrote :

Your call on the image naming. There are some Boolean logic problems here that need to be fixed, but aside from that I'm happy.

review: Approve
1510. By Didier Roche-Tolomelli

Correct logic for ubuntu-desktop-next and non system-image case

Fix as well some pep8 issues and missing is_live_fs_only() parameter
in call.

1511. By Didier Roche-Tolomelli

Fix existing ubuntu-desktop-next test

1512. By Didier Roche-Tolomelli

Merge Robert's ubuntu-desktop-next-test

1513. By Didier Roche-Tolomelli

Add a test for desktop-next system image

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

We added a test for ubuntu-desktop-next system image, based on the existing ubuntu-desktop-next one.

Just a note, we are unsure if the artefacts that we counted (as they are the same than the other tests) makes sense.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'etc/crontab'
--- etc/crontab 2015-04-16 20:24:54 +0000
+++ etc/crontab 2015-04-22 15:04:54 +0000
@@ -20,7 +20,7 @@
2032 14 * * * DIST=trusty for-project ubuntu-gnome cron.daily-live --live2032 14 * * * DIST=trusty for-project ubuntu-gnome cron.daily-live --live
21# regular vivid daily builds21# regular vivid daily builds
2231 7 * * * for-project ubuntu cron.daily-live --live2231 7 * * * for-project ubuntu cron.daily-live --live
2322 3 * * * for-project ubuntu-desktop-next cron.daily-live --live2322 3 * * * SUBPROJECT=system-image for-project ubuntu-desktop-next cron.daily-preinstalled --live
2414 5 * * * for-project kubuntu cron.daily-live --live2414 5 * * * for-project kubuntu cron.daily-live --live
2524 0 * * * for-project edubuntu cron.dvd --live2524 0 * * * for-project edubuntu cron.dvd --live
2650 9 * * * for-project xubuntu cron.daily-live --live2650 9 * * * for-project xubuntu cron.daily-live --live
2727
=== modified file 'etc/default-arches'
--- etc/default-arches 2015-03-20 20:01:29 +0000
+++ etc/default-arches 2015-04-22 15:04:54 +0000
@@ -55,7 +55,7 @@
55ubuntu daily-live raring-trusty amd64 amd64+mac i38655ubuntu daily-live raring-trusty amd64 amd64+mac i386
56ubuntu daily-live utopic- amd64 i38656ubuntu daily-live utopic- amd64 i386
5757
58ubuntu-desktop-next * * amd64 i38658ubuntu-desktop-next * * amd64 i386 armhf
5959
60ubuntu-gnome * * amd64 i38660ubuntu-gnome * * amd64 i386
6161
6262
=== modified file 'etc/qa-products'
--- etc/qa-products 2015-02-25 11:39:07 +0000
+++ etc/qa-products 2015-04-22 15:04:54 +0000
@@ -50,6 +50,7 @@
50Ubuntu Desktop Preinstalled armhf+nexus7 ubuntu daily-preinstalled preinstalled-desktop armhf+nexus7 iso50Ubuntu Desktop Preinstalled armhf+nexus7 ubuntu daily-preinstalled preinstalled-desktop armhf+nexus7 iso
5151
52# Ubuntu Desktop Next52# Ubuntu Desktop Next
53Ubuntu Desktop (Unity 8) armhf ubuntu-desktop-next daily-live desktop armhf iso
53Ubuntu Desktop (Unity 8) amd64 ubuntu-desktop-next daily-live desktop amd64 iso54Ubuntu Desktop (Unity 8) amd64 ubuntu-desktop-next daily-live desktop amd64 iso
54Ubuntu Desktop (Unity 8) i386 ubuntu-desktop-next daily-live desktop i386 iso55Ubuntu Desktop (Unity 8) i386 ubuntu-desktop-next daily-live desktop i386 iso
5556
5657
=== modified file 'lib/cdimage/build.py'
--- lib/cdimage/build.py 2015-01-29 04:56:17 +0000
+++ lib/cdimage/build.py 2015-04-22 15:04:54 +0000
@@ -458,7 +458,9 @@
458 log_marker("Downloading live filesystem images")458 log_marker("Downloading live filesystem images")
459 download_live_filesystems(config)459 download_live_filesystems(config)
460460
461 if config.project in ("ubuntu-core", "ubuntu-touch"):461 if (config.project in ("ubuntu-core", "ubuntu-touch") or
462 (config.project == "ubuntu-desktop-next" and
463 config.subproject == "system-image")):
462 log_marker("Copying images to debian-cd output directory")464 log_marker("Copying images to debian-cd output directory")
463 scratch_dir = os.path.join(465 scratch_dir = os.path.join(
464 config.root, "scratch", config.project, config.full_series,466 config.root, "scratch", config.project, config.full_series,
@@ -482,6 +484,16 @@
482 output_prefix = os.path.join(484 output_prefix = os.path.join(
483 output_dir,485 output_dir,
484 "%s-preinstalled-touch-%s" % (config.series, arch))486 "%s-preinstalled-touch-%s" % (config.series, arch))
487 elif config.project == "ubuntu-desktop-next":
488 if config.image_type == "daily-preinstalled":
489 output_prefix = os.path.join(
490 output_dir,
491 "%s-preinstalled-desktop-next-%s" %
492 (config.series, arch))
493 else:
494 output_prefix = os.path.join(
495 output_dir, "%s-desktop-next-%s" %
496 (config.series, arch))
485 shutil.copy2(rootfs, "%s.raw" % output_prefix)497 shutil.copy2(rootfs, "%s.raw" % output_prefix)
486 with open("%s.type" % output_prefix, "w") as f:498 with open("%s.type" % output_prefix, "w") as f:
487 print("tar archive", file=f)499 print("tar archive", file=f)
@@ -495,7 +507,7 @@
495 if os.path.exists(custom):507 if os.path.exists(custom):
496 shutil.copy2(508 shutil.copy2(
497 custom, "%s.custom.tar.gz" % output_prefix)509 custom, "%s.custom.tar.gz" % output_prefix)
498 if config.project == "ubuntu-core":510 if config.project in ("ubuntu-core", "ubuntu-desktop-next"):
499 device = "%s.device.tar.gz" % live_prefix511 device = "%s.device.tar.gz" % live_prefix
500 if os.path.exists(device):512 if os.path.exists(device):
501 shutil.copy2(513 shutil.copy2(
@@ -639,15 +651,23 @@
639 body.close()651 body.close()
640652
641653
654def is_live_fs_only(config):
655 live_fs_only = False
656 if config.project in ("livecd-base", "ubuntu-core", "ubuntu-touch"):
657 live_fs_only = True
658 elif (config.project == "ubuntu-desktop-next" and
659 config.subproject == "system-image"):
660 live_fs_only = True
661 elif config.subproject == "wubi":
662 live_fs_only = True
663 return live_fs_only
664
665
642def build_image_set_locked(config, options, semaphore_state):666def build_image_set_locked(config, options, semaphore_state):
643 image_type = config.image_type667 image_type = config.image_type
644 config["CDIMAGE_DATE"] = date = next_build_id(config, image_type)668 config["CDIMAGE_DATE"] = date = next_build_id(config, image_type)
645 log_path = None669 log_path = None
646670
647 live_fs_only = (
648 config.project in ("livecd-base", "ubuntu-core", "ubuntu-touch") or
649 config.subproject == "wubi")
650
651 try:671 try:
652 configure_for_project(config)672 configure_for_project(config)
653 log_path = open_log(config)673 log_path = open_log(config)
@@ -659,7 +679,7 @@
659 else:679 else:
660 tracker_set_rebuild_status(config, [0, 1], 2)680 tracker_set_rebuild_status(config, [0, 1], 2)
661681
662 if not live_fs_only:682 if not is_live_fs_only(config):
663 sync_local_mirror(config, semaphore_state)683 sync_local_mirror(config, semaphore_state)
664684
665 if config["LOCAL"]:685 if config["LOCAL"]:
@@ -673,7 +693,7 @@
673693
674 if config["UBUNTU_DEFAULTS_LOCALE"]:694 if config["UBUNTU_DEFAULTS_LOCALE"]:
675 build_ubuntu_defaults_locale(config)695 build_ubuntu_defaults_locale(config)
676 elif live_fs_only:696 elif is_live_fs_only(config):
677 build_livecd_base(config)697 build_livecd_base(config)
678 else:698 else:
679 if not config["CDIMAGE_PREINSTALLED"]:699 if not config["CDIMAGE_PREINSTALLED"]:
680700
=== modified file 'lib/cdimage/livefs.py'
--- lib/cdimage/livefs.py 2014-11-13 07:16:42 +0000
+++ lib/cdimage/livefs.py 2015-04-22 15:04:54 +0000
@@ -121,7 +121,9 @@
121 elif subarch in ("ac100", "nexus7"):121 elif subarch in ("ac100", "nexus7"):
122 options.extend(["-f", "plain"])122 options.extend(["-f", "plain"])
123123
124 if config.project in ("ubuntu-core", "ubuntu-touch"):124 if (config.project in ("ubuntu-core", "ubuntu-touch") or
125 (config.project == "ubuntu-desktop-next" and
126 config.subproject == "system-image")):
125 options.extend(["-f", "plain"])127 options.extend(["-f", "plain"])
126128
127 if config.subproject == "wubi":129 if config.subproject == "wubi":
@@ -882,6 +884,8 @@
882884
883 if (project not in ("livecd-base", "ubuntu-core",885 if (project not in ("livecd-base", "ubuntu-core",
884 "kubuntu-active") and886 "kubuntu-active") and
887 (project != "ubuntu-desktop-next" or
888 config.subproject == "system-image") and
885 (project != "edubuntu" or series >= "precise") and889 (project != "edubuntu" or series >= "precise") and
886 (project != "ubuntukylin" or series < "utopic")):890 (project != "ubuntukylin" or series < "utopic")):
887 if series <= "feisty":891 if series <= "feisty":
@@ -912,7 +916,8 @@
912 config, arch, "wubi.exe",916 config, arch, "wubi.exe",
913 "Install %s" % autorun_project)917 "Install %s" % autorun_project)
914918
915 if project not in ("livecd-base", "ubuntu-core", "edubuntu"):919 if project not in ("livecd-base", "ubuntu-core",
920 "ubuntu-desktop-next", "edubuntu"):
916 if (project in ("kubuntu-active", "ubuntu-netbook",921 if (project in ("kubuntu-active", "ubuntu-netbook",
917 "ubuntu-moblin-remix") or922 "ubuntu-moblin-remix") or
918 config["CDIMAGE_DVD"] or923 config["CDIMAGE_DVD"] or
@@ -947,7 +952,7 @@
947 )952 )
948 download_live_items(config, arch, "custom.tar.gz")953 download_live_items(config, arch, "custom.tar.gz")
949954
950 if config.project == "ubuntu-core":955 if config.project in ("ubuntu-core", "ubuntu-desktop-next"):
951 for arch in config.arches:956 for arch in config.arches:
952 download_live_items(config, arch, "device.tar.gz")957 download_live_items(config, arch, "device.tar.gz")
953958
954959
=== modified file 'lib/cdimage/tests/test_build.py'
--- lib/cdimage/tests/test_build.py 2015-01-29 04:56:17 +0000
+++ lib/cdimage/tests/test_build.py 2015-04-22 15:04:54 +0000
@@ -343,6 +343,67 @@
343 self.assertTrue(os.path.exists(343 self.assertTrue(os.path.exists(
344 os.path.join(output_dir, recovery_img)))344 os.path.join(output_dir, recovery_img)))
345345
346 @mock.patch("cdimage.osextras.fetch")
347 def test_ubuntu_desktop_next(self, mock_fetch):
348 def fetch_side_effect(config, source, target):
349 if (target.endswith(".manifest") or
350 target.endswith(".rootfs.tar.gz")):
351 touch(target)
352 else:
353 raise osextras.FetchError
354
355 mock_fetch.side_effect = fetch_side_effect
356 self.config["PROJECT"] = "ubuntu-desktop-next"
357 self.config["DIST"] = "utopic"
358 self.config["IMAGE_TYPE"] = "daily"
359 self.config["ARCHES"] = "i386"
360 self.capture_logging()
361 build_livecd_base(self.config)
362 self.assertLogEqual([
363 "===== Downloading live filesystem images =====",
364 self.epoch_date,
365 ])
366 output_dir = os.path.join(
367 self.temp_dir, "scratch", "ubuntu-desktop-next", "utopic", "daily",
368 "live")
369 self.assertTrue(os.path.isdir(output_dir))
370 self.assertCountEqual([
371 "i386.manifest",
372 "i386.rootfs.tar.gz",
373 ], os.listdir(output_dir))
374
375 @mock.patch("cdimage.osextras.fetch")
376 def test_ubuntu_desktop_next_system_image(self, mock_fetch):
377 def fetch_side_effect(config, source, target):
378 if (target.endswith(".manifest") or
379 target.endswith(".rootfs.tar.gz")):
380 touch(target)
381 else:
382 raise osextras.FetchError
383
384 mock_fetch.side_effect = fetch_side_effect
385 self.config["PROJECT"] = "ubuntu-desktop-next"
386 self.config["SUBPROJECT"] = "system-image"
387 self.config["DIST"] = "utopic"
388 self.config["IMAGE_TYPE"] = "daily"
389 self.config["ARCHES"] = "i386"
390 self.capture_logging()
391 build_livecd_base(self.config)
392 self.assertLogEqual([
393 "===== Downloading live filesystem images =====",
394 self.epoch_date,
395 "===== Copying images to debian-cd output directory =====",
396 self.epoch_date,
397 ])
398 output_dir = os.path.join(
399 self.temp_dir, "scratch", "ubuntu-desktop-next", "utopic", "daily",
400 "live")
401 self.assertTrue(os.path.isdir(output_dir))
402 self.assertCountEqual([
403 "i386.manifest",
404 "i386.rootfs.tar.gz",
405 ], os.listdir(output_dir))
406
346407
347class TestExtractDebootstrap(TestCase):408class TestExtractDebootstrap(TestCase):
348 def setUp(self):409 def setUp(self):
349410
=== modified file 'lib/cdimage/tree.py'
--- lib/cdimage/tree.py 2015-02-26 14:29:10 +0000
+++ lib/cdimage/tree.py 2015-04-22 15:04:54 +0000
@@ -380,6 +380,8 @@
380 return "preinstalled-touch"380 return "preinstalled-touch"
381 elif self.project == "ubuntu-core":381 elif self.project == "ubuntu-core":
382 return "preinstalled-core"382 return "preinstalled-core"
383 elif self.project == "ubuntu-desktop-next":
384 return "preinstalled-desktop-next"
383 else:385 else:
384 return "preinstalled-desktop"386 return "preinstalled-desktop"
385 elif self.image_type.endswith("-live"):387 elif self.image_type.endswith("-live"):
@@ -529,6 +531,8 @@
529 return "preinstalled touch image"531 return "preinstalled touch image"
530 elif publish_type == "preinstalled-core":532 elif publish_type == "preinstalled-core":
531 return "preinstalled core image"533 return "preinstalled core image"
534 elif publish_type == "preinstalled-desktop-next":
535 return "preinstalled desktop next image"
532 elif publish_type == "wubi":536 elif publish_type == "wubi":
533 return "Wubi %s" % cd537 return "Wubi %s" % cd
534 else:538 else:
@@ -1107,6 +1111,7 @@
1107 "preinstalled-mobile", "preinstalled-active",1111 "preinstalled-mobile", "preinstalled-active",
1108 "preinstalled-headless", "preinstalled-server",1112 "preinstalled-headless", "preinstalled-server",
1109 "preinstalled-touch", "preinstalled-core", "wubi",1113 "preinstalled-touch", "preinstalled-core", "wubi",
1114 "preinstalled-desktop-next",
1110 )1115 )
11111116
1112 all_arches = (1117 all_arches = (

Subscribers

People subscribed via source and target branches