Merge ubuntu-cdimage:make-canary-default-add-legacy into ubuntu-cdimage:main

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: a800d02701b15191fb171caaca48ebb43ac25329
Proposed branch: ubuntu-cdimage:make-canary-default-add-legacy
Merge into: ubuntu-cdimage:main
Diff against target: 269 lines (+110/-5)
9 files modified
README (+6/-1)
bin/cron.daily-legacy (+43/-0)
etc/crontab (+1/-1)
etc/livefs-launchpad (+2/-1)
etc/purge-days (+1/-0)
etc/qa-products (+1/-0)
lib/cdimage/germinate.py (+1/-0)
lib/cdimage/tests/test_tree.py (+42/-0)
lib/cdimage/tree.py (+13/-2)
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+434091@code.launchpad.net

Commit message

Prepare for switching canary to become the default Ubuntu (needs releasing the related livecd-rootfs changes). Add support for daily-legacy to still build the old Ubuntu ubiquity based images.

Description of the change

Prepare for switching canary to become the default Ubuntu (needs releasing the related livecd-rootfs changes). Add support for daily-legacy to still build the old Ubuntu ubiquity based images.

This is basically https://code.launchpad.net/~ubuntu-cdimage/ubuntu-cdimage/canary-as-default but modified.

This requires https://code.launchpad.net/~seb128/livecd-rootfs/+git/livecd-rootfs/+merge/433534 to be released after this lands. There is still some work to be done, like, legacy should really get its own seed once the main ones are switched to canary. But that's separate.

Please note that I did not rip out daily-canary support and just added -legacy next to it. The reason is that I heard from Ken the there are some plans of using 'canary' again for some other experimental things, so I don't want us to just keep ripping out and re-adding for no reason. We can clean up separately if we need so.

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Tests are passing - well, at least there's no new failures. I'll clean up the main branch with tests later.

Revision history for this message
Brian Murray (brian-murray) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/README b/README
2index 45bc00c..926a1f2 100644
3--- a/README
4+++ b/README
5@@ -29,10 +29,15 @@ the following scripts, which may be called by hand:
6 Build live CDs for all relevant Ubuntu architectures.
7
8 * cron.daily-canary
9-
10+
11 Build live CDs of the experimental canary layout for all relevant
12 Ubuntu architectures.
13
14+ * cron.daily-legacy
15+
16+ Build live CDs of the legacy (ubiquity-based) images for all relevant
17+ Ubuntu architectures.
18+
19 * cron.dvd
20
21 Build DVDs for all relevant Ubuntu architectures. These are normally
22diff --git a/bin/cron.daily-legacy b/bin/cron.daily-legacy
23new file mode 100755
24index 0000000..eff5f40
25--- /dev/null
26+++ b/bin/cron.daily-legacy
27@@ -0,0 +1,43 @@
28+#! /usr/bin/python3
29+
30+# Copyright (C) 2021 Canonical Ltd.
31+# Author: Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com>
32+
33+# This program is free software: you can redistribute it and/or modify
34+# it under the terms of the GNU General Public License as published by
35+# the Free Software Foundation; version 3 of the License.
36+#
37+# This program is distributed in the hope that it will be useful,
38+# but WITHOUT ANY WARRANTY; without even the implied warranty of
39+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40+# GNU General Public License for more details.
41+#
42+# You should have received a copy of the GNU General Public License
43+# along with this program. If not, see <http://www.gnu.org/licenses/>.
44+
45+"""Build a set of desktop legacy (ubiquity) images."""
46+
47+from optparse import OptionParser
48+import os
49+import sys
50+
51+sys.path.insert(0, os.path.join(sys.path[0], os.pardir, "lib"))
52+
53+
54+def main():
55+ from cdimage.build import build_image_set
56+ from cdimage.config import Config
57+
58+ parser = OptionParser("%prog")
59+ parser.add_option(
60+ "--live", default=False, action="store_true",
61+ help="build live filesystems first")
62+ options, _ = parser.parse_args()
63+ config = Config(IMAGE_TYPE="daily-legacy")
64+ config["CDIMAGE_LIVE"] = "1"
65+ if not build_image_set(config, options):
66+ sys.exit(1)
67+
68+
69+if __name__ == "__main__":
70+ main()
71diff --git a/etc/crontab b/etc/crontab
72index 10844c9..58cff5a 100644
73--- a/etc/crontab
74+++ b/etc/crontab
75@@ -52,7 +52,7 @@ PATH=/srv/cdimage.ubuntu.com/bin:/usr/sbin:/usr/bin:/sbin:/bin
76 52 4 * * * PROPOSED=0 DIST=jammy for-project ubuntu-base cron.daily-live --live
77 # regular lunar daily builds
78 41 7 * * * for-project ubuntu cron.daily-live --live; SUBPROJECT=desktop-preinstalled for-project ubuntu cron.daily-preinstalled --live
79-41 8 * * * SUBPROJECT=canary for-project ubuntu cron.daily-canary --live
80+41 8 * * * SUBPROJECT=legacy for-project ubuntu cron.daily-legacy --live
81 24 5 * * * for-project kubuntu cron.daily-live --live
82 40 1 * * * for-project xubuntu cron.daily-live --live
83 10 3 * * * for-project ubuntu-server cron.daily-preinstalled --live; SUBPROJECT=live for-project ubuntu-server cron.daily-live --live
84diff --git a/etc/livefs-launchpad b/etc/livefs-launchpad
85index 025f725..979dec4 100644
86--- a/etc/livefs-launchpad
87+++ b/etc/livefs-launchpad
88@@ -3,8 +3,9 @@
89 # Like etc/default-arches, "PROJECT" is in fact PROJECT[-SUBPROJECT][-LOCALE].
90
91 ubuntu daily-live * * ubuntu-cdimage/ubuntu
92+ubuntu daily-legacy * * ubuntu-cdimage/ubuntu-legacy
93+ubuntu-canary daily-live * disco- ubuntu-cdimage/ubuntu-canary
94 ubuntu-desktop-preinstalled daily-preinstalled focal- * ubuntu-cdimage/ubuntu-preinstalled
95-ubuntu-canary daily-canary * * ubuntu-cdimage/ubuntu-canary
96 kubuntu daily-live * * ubuntu-cdimage/kubuntu
97 xubuntu daily-live * * ubuntu-cdimage/xubuntu
98 ubuntu-server daily trusty- * ubuntu-cdimage/ubuntu-server
99diff --git a/etc/purge-days b/etc/purge-days
100index b778029..acdd921 100644
101--- a/etc/purge-days
102+++ b/etc/purge-days
103@@ -2,6 +2,7 @@ daily 1
104 daily-live 1
105 daily-preinstalled 1
106 daily-canary 1
107+daily-legacy 1
108 # Purge images older than 2 days => keep the most recent build.
109 dvd 2
110 # Ubuntu Core images are not purged per age
111diff --git a/etc/qa-products b/etc/qa-products
112index aa7a307..ea32841 100644
113--- a/etc/qa-products
114+++ b/etc/qa-products
115@@ -41,6 +41,7 @@ Ubuntu Base s390x ubuntu-base daily base s390x iso
116
117 # Ubuntu Desktop
118 Ubuntu Desktop amd64 ubuntu daily-live desktop amd64 iso
119+Ubuntu Desktop (Legacy) amd64 ubuntu/legacy daily-legacy desktop-legacy amd64 iso
120 Ubuntu Desktop (Canary) amd64 ubuntu/canary daily-canary desktop-canary amd64 iso
121 Ubuntu Desktop arm64 ubuntu daily-live desktop arm64 iso
122 Ubuntu Desktop arm64+raspi ubuntu/desktop-preinstalled daily-preinstalled preinstalled-desktop arm64+raspi iso
123diff --git a/lib/cdimage/germinate.py b/lib/cdimage/germinate.py
124index 4bd3ee2..af88a5f 100644
125--- a/lib/cdimage/germinate.py
126+++ b/lib/cdimage/germinate.py
127@@ -315,6 +315,7 @@ class GerminateOutput:
128 elif project == "ubuntu" and self.config["SUBPROJECT"] == "canary":
129 # ubuntu-desktop-installer
130 yield "canary-ship-live"
131+ # TODO: we will probably need a legacy-ship-live seed
132 else:
133 yield "ship-live"
134 elif mode == "addon":
135diff --git a/lib/cdimage/tests/test_tree.py b/lib/cdimage/tests/test_tree.py
136index abf6369..c293665 100644
137--- a/lib/cdimage/tests/test_tree.py
138+++ b/lib/cdimage/tests/test_tree.py
139@@ -269,6 +269,7 @@ class TestPublisher(TestCase):
140 ("daily", "ubuntu-server", "focal", "legacy-server"),
141 ("daily", "ubuntu", "precise", "alternate"),
142 ("daily-canary", "ubuntu", "jammy", "desktop-canary"),
143+ ("daily-legacy", "ubuntu", "lunar", "desktop-legacy"),
144 ):
145 self.config["PROJECT"] = project
146 self.config["DIST"] = dist
147@@ -1032,6 +1033,44 @@ class TestDailyTreePublisher(TestCase):
148 self.config.series),
149 "%s-desktop-canary-amd64.iso" % self.config.series)
150
151+ @mock.patch("cdimage.osextras.find_on_path", return_value=True)
152+ @mock.patch("cdimage.tree.zsyncmake")
153+ def test_publish_legacy_binary(self, mock_zsyncmake, *args):
154+ publisher = self.make_publisher("ubuntu", "daily-legacy")
155+ source_dir = publisher.image_output("amd64")
156+ touch(os.path.join(
157+ source_dir, "%s-desktop-legacy-amd64.raw" %
158+ self.config.series))
159+ touch(os.path.join(
160+ source_dir, "%s-desktop-legacy-amd64.list" %
161+ self.config.series))
162+ touch(os.path.join(
163+ source_dir, "%s-desktop-legacy-amd64.manifest" %
164+ self.config.series))
165+ self.capture_logging()
166+ list(publisher.publish_binary("desktop-legacy", "amd64", "20201215"))
167+ self.assertLogEqual([
168+ "Publishing amd64 ...",
169+ "Unknown file type 'empty'; assuming .iso",
170+ "Publishing amd64 live manifest ...",
171+ "Making amd64 zsync metafile ...",
172+ ])
173+ target_dir = os.path.join(publisher.publish_base, "20201215")
174+ self.assertEqual([], os.listdir(source_dir))
175+ self.assertCountEqual([
176+ "%s-desktop-legacy-amd64.iso" % self.config.series,
177+ "%s-desktop-legacy-amd64.list" % self.config.series,
178+ "%s-desktop-legacy-amd64.manifest" % self.config.series,
179+ ], os.listdir(target_dir))
180+ mock_zsyncmake.assert_called_once_with(
181+ os.path.join(
182+ target_dir, "%s-desktop-legacy-amd64.iso" %
183+ self.config.series),
184+ os.path.join(
185+ target_dir, "%s-desktop-legacy-amd64.iso.zsync" %
186+ self.config.series),
187+ "%s-desktop-legacy-amd64.iso" % self.config.series)
188+
189 def test_publish_livecd_base(self):
190 publisher = self.make_publisher("livecd-base", "livecd-base")
191 source_dir = os.path.join(
192@@ -2138,6 +2177,9 @@ class TestChinaDailyTreePublisher(TestDailyTreePublisher):
193 def test_publish_canary_binary(self):
194 pass
195
196+ def test_publish_legacy_binary(self):
197+ pass
198+
199 def test_publish_livecd_base(self):
200 pass
201
202diff --git a/lib/cdimage/tree.py b/lib/cdimage/tree.py
203index 0c5c592..3be7f9a 100644
204--- a/lib/cdimage/tree.py
205+++ b/lib/cdimage/tree.py
206@@ -433,6 +433,8 @@ class Publisher:
207 return "dvd"
208 elif self.image_type == "daily-canary":
209 return "desktop-canary"
210+ elif self.image_type == "daily-legacy":
211+ return "desktop-legacy"
212 else:
213 if self.project == "edubuntu":
214 return "addon"
215@@ -463,6 +465,8 @@ class Publisher:
216 return "daily"
217 elif publish_type == "desktop-canary":
218 return "daily-canary"
219+ elif publish_type == "desktop-legacy":
220+ return "daily-legacy"
221 else:
222 return None
223
224@@ -517,6 +521,8 @@ class Publisher:
225 return "desktop %s" % cd
226 elif publish_type == "desktop-canary":
227 return "canary desktop %s" % cd
228+ elif publish_type == "desktop-legacy":
229+ return "legacy desktop %s" % cd
230 elif publish_type == "install":
231 return "install %s" % cd
232 elif publish_type == "alternate":
233@@ -597,7 +603,7 @@ class Publisher:
234 "The live %s allows you to try %s without changing your "
235 "computer at all, and at your option to install it "
236 "permanently later.</p>" % (cd, capproject))
237- elif publish_type in ("desktop", "desktop-canary"):
238+ elif publish_type in ("desktop", "desktop-canary", "desktop-legacy"):
239 sentences.append(
240 "The desktop %s allows you to try %s without changing your "
241 "computer at all, and at your option to install it "
242@@ -611,6 +617,10 @@ class Publisher:
243 sentences.append(
244 "This type of %s is experimental." %
245 cd)
246+ if publish_type == "desktop-legacy":
247+ sentences.append(
248+ "This type of %s uses the legacy installer." %
249+ cd)
250 sentences.append(desktop_req)
251 if self.project == "edubuntu":
252 sentences.append(
253@@ -1197,6 +1207,7 @@ class Publisher:
254 "preinstalled-touch", "preinstalled-core", "wubi",
255 "live-core",
256 "desktop-canary",
257+ "desktop-legacy",
258 )
259
260 all_arches = (
261@@ -3314,7 +3325,7 @@ class ReleasePublisher(Publisher):
262
263 def want_manifest(self, publish_type, path):
264 if publish_type in (
265- "live", "desktop", "desktop-canary", "netbook",
266+ "live", "desktop", "desktop-canary", "desktop-legacy", "netbook",
267 "uec", "server-uec", "core", "wubi", "server", "live-server",
268 "legacy-server",
269 ):

Subscribers

People subscribed via source and target branches

to all changes: