Merge lp:~sil2100/ubuntu-cdimage/appliance-images-take-one into lp:ubuntu-cdimage

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 1885
Proposed branch: lp:~sil2100/ubuntu-cdimage/appliance-images-take-one
Merge into: lp:ubuntu-cdimage
Diff against target: 272 lines (+97/-10)
11 files modified
bin/rebuild-requests (+2/-1)
etc/default-arches (+1/-0)
etc/livefs-launchpad (+1/-0)
etc/purge-count (+2/-1)
etc/purge-days (+1/-0)
lib/cdimage/build.py (+3/-2)
lib/cdimage/livefs.py (+3/-2)
lib/cdimage/project.py (+1/-0)
lib/cdimage/tests/test_build.py (+34/-0)
lib/cdimage/tests/test_tree.py (+30/-0)
lib/cdimage/tree.py (+19/-4)
To merge this branch: bzr merge lp:~sil2100/ubuntu-cdimage/appliance-images-take-one
Reviewer Review Type Date Requested Status
Steve Langasek Pending
Ubuntu CD Image Team Pending
Review via email: mp+386304@code.launchpad.net

Commit message

Propose a new ubuntu-appliance project for building the ubuntu-core appliance images.

Description of the change

I see at least three options to do this:

1) Simply adding all the appliance images to the ubuntu-core project as-is.
2) Adding a new project called ubuntu-appliances and building those there, same way as ubuntu-core.
3) Declaring a new 'virtual' "appliances" channel and building them as ubuntu-core but only on that channel-set.

I can discuss more about all the possibilities, but basically this approach follows the 2) option (I have experimented some with 3 too). Of course, we still need some livecd-rootfs changes, but that's a different discussion.

What do you think?

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

Got a +1 on merging this from Steve without a full review - we can always revert, if needed.

1875. By Łukasz Zemczak

For now no default-arches for appliances.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/rebuild-requests'
2--- bin/rebuild-requests 2020-04-24 15:18:28 +0000
3+++ bin/rebuild-requests 2020-07-17 14:49:27 +0000
4@@ -151,7 +151,8 @@
5 cmd = ["for-project", project, "cron.%s" % image_type]
6
7 if (build_type != "daily" or
8- project in ("ubuntu-core", "ubuntu-base", "ubuntu-server")):
9+ project in ("ubuntu-core", "ubuntu-appliance", "ubuntu-base",
10+ "ubuntu-server")):
11 cmd += ["--live"]
12
13 if options.dry_run:
14
15=== modified file 'etc/default-arches'
16--- etc/default-arches 2020-06-17 09:16:38 +0000
17+++ etc/default-arches 2020-07-17 14:49:27 +0000
18@@ -20,6 +20,7 @@
19 ubuntu-core daily-live cosmic amd64 arm64+snapdragon armhf+cm3 armhf+raspi2 armhf+raspi3 i386
20 ubuntu-core daily-live disco-eoan amd64 amd64+kassel arm64+snapdragon armhf+raspi3 arm64+raspi3 i386
21 ubuntu-core daily-live focal- amd64 arm64+raspi armhf+raspi
22+#ubuntu-appliance daily-live bionic- amd64 arm64+raspi armhf+raspi
23
24 kubuntu daily-live precise amd64 i386
25 kubuntu daily-live trusty amd64 amd64+mac i386
26
27=== modified file 'etc/livefs-launchpad'
28--- etc/livefs-launchpad 2019-03-07 16:19:02 +0000
29+++ etc/livefs-launchpad 2020-07-17 14:49:27 +0000
30@@ -17,6 +17,7 @@
31 livecd-base livecd-base * * ubuntu-cdimage/livecd-base
32 ubuntu-base daily * * ubuntu-cdimage/ubuntu-base
33 ubuntu-core daily-live * * ubuntu-cdimage/ubuntu-core
34+ubuntu-appliance daily-live * * ubuntu-cdimage/ubuntu-appliance
35 ubuntu-core-system-image daily-preinstalled * * ubuntu-cdimage/ubuntu-core-system-image
36 kubuntu-active daily-live * * ubuntu-cdimage/kubuntu-active
37 ubuntukylin daily-live * * ubuntu-cdimage/ubuntukylin
38
39=== modified file 'etc/purge-count'
40--- etc/purge-count 2019-02-25 14:54:19 +0000
41+++ etc/purge-count 2020-07-17 14:49:27 +0000
42@@ -1,2 +1,3 @@
43 # Keep up to 5 images for Ubuntu Core projects
44-ubuntu-core 5
45\ No newline at end of file
46+ubuntu-core 5
47+ubuntu-appliance 3
48
49=== modified file 'etc/purge-days'
50--- etc/purge-days 2019-03-13 18:53:21 +0000
51+++ etc/purge-days 2020-07-17 14:49:27 +0000
52@@ -5,6 +5,7 @@
53 dvd 2
54 # Ubuntu Core images are not purged per age
55 ubuntu-core 0
56+ubuntu-appliance 0
57 ubuntu-touch 7
58 source 1
59 wubi 1
60
61=== modified file 'lib/cdimage/build.py'
62--- lib/cdimage/build.py 2019-02-28 22:58:50 +0000
63+++ lib/cdimage/build.py 2020-07-17 14:49:27 +0000
64@@ -434,7 +434,7 @@
65 shutil.copy2(
66 "%s.manifest" % live_prefix, "%s.manifest" % output_prefix)
67
68- if (config.project == "ubuntu-core" and
69+ if (config.project in ("ubuntu-core", "ubuntu-appliance") and
70 config.image_type == "daily-live"):
71 log_marker("Copying images to debian-cd output directory")
72 scratch_dir = os.path.join(
73@@ -648,7 +648,8 @@
74 def is_live_fs_only(config):
75 live_fs_only = False
76 if config.project in (
77- "livecd-base", "ubuntu-base", "ubuntu-core", "ubuntu-touch"):
78+ "livecd-base", "ubuntu-base", "ubuntu-core", "ubuntu-appliance",
79+ "ubuntu-touch"):
80 live_fs_only = True
81 elif (config.project == "ubuntu-server" and
82 config.image_type == "daily-preinstalled"):
83
84=== modified file 'lib/cdimage/livefs.py'
85--- lib/cdimage/livefs.py 2020-04-17 20:18:37 +0000
86+++ lib/cdimage/livefs.py 2020-07-17 14:49:27 +0000
87@@ -835,7 +835,7 @@
88 continue
89
90 if (project not in ("livecd-base", "ubuntu-base", "ubuntu-core",
91- "kubuntu-active") and
92+ "ubuntu-appliance", "kubuntu-active") and
93 (project != "edubuntu" or series >= "precise") and
94 (project != "ubuntukylin" or series <= "trusty")):
95 if series <= "trusty":
96@@ -859,7 +859,8 @@
97 if project not in ("livecd-base", "ubuntu-base", "ubuntu-core",
98 "edubuntu"):
99 download_live_items(config, arch, "usb-creator")
100- if project == "ubuntu-core" and config["CDIMAGE_LIVE"]:
101+ if (project in ("ubuntu-core", "ubuntu-appliance") and
102+ config["CDIMAGE_LIVE"]):
103 download_live_items(config, arch, "model-assertion")
104
105 if not got_image:
106
107=== modified file 'lib/cdimage/project.py'
108--- lib/cdimage/project.py 2019-02-28 22:58:50 +0000
109+++ lib/cdimage/project.py 2020-07-17 14:49:27 +0000
110@@ -46,6 +46,7 @@
111 "ubuntu-mate": "Ubuntu-MATE",
112 "livecd-base": "LiveCD-Base",
113 "ubuntu-core": "Ubuntu Core",
114+ "ubuntu-appliance": "Ubuntu Appliance",
115 "ubuntu-base": "Ubuntu-Base",
116 "ubuntu-touch-preview": "Ubuntu Touch Preview",
117 "ubuntu-touch": "Ubuntu Touch",
118
119=== modified file 'lib/cdimage/tests/test_build.py'
120--- lib/cdimage/tests/test_build.py 2019-02-28 22:58:50 +0000
121+++ lib/cdimage/tests/test_build.py 2020-07-17 14:49:27 +0000
122@@ -362,6 +362,40 @@
123 ], os.listdir(output_dir))
124
125 @mock.patch("cdimage.osextras.fetch")
126+ def test_ubuntu_appliance_raspi(self, mock_fetch):
127+ def fetch_side_effect(config, source, target):
128+ if (target.endswith(".model-assertion") or
129+ target.endswith(".manifest") or
130+ target.endswith(".img.xz")):
131+ touch(target)
132+ else:
133+ raise osextras.FetchError
134+
135+ mock_fetch.side_effect = fetch_side_effect
136+ self.config["CDIMAGE_LIVE"] = "1"
137+ self.config["PROJECT"] = "ubuntu-appliance"
138+ self.config["DIST"] = "bionic"
139+ self.config["IMAGE_TYPE"] = "daily-live"
140+ self.config["ARCHES"] = "armhf+raspi"
141+ self.capture_logging()
142+ build_livecd_base(self.config)
143+ self.assertLogEqual([
144+ "===== Downloading live filesystem images =====",
145+ self.epoch_date,
146+ "===== Copying images to debian-cd output directory =====",
147+ self.epoch_date,
148+ ])
149+ output_dir = os.path.join(
150+ self.temp_dir, "scratch", "ubuntu-appliance", "bionic",
151+ "daily-live", "live")
152+ self.assertTrue(os.path.isdir(output_dir))
153+ self.assertCountEqual([
154+ "armhf+raspi.img.xz",
155+ "armhf+raspi.model-assertion",
156+ "armhf+raspi.manifest",
157+ ], os.listdir(output_dir))
158+
159+ @mock.patch("cdimage.osextras.fetch")
160 def _perform_ubuntu_touch_testing(self, project, mock_fetch):
161 '''Convenience function for testing ubuntu-touch* builds.'''
162 def fetch_side_effect(config, source, target):
163
164=== modified file 'lib/cdimage/tests/test_tree.py'
165--- lib/cdimage/tests/test_tree.py 2020-06-30 16:49:46 +0000
166+++ lib/cdimage/tests/test_tree.py 2020-07-17 14:49:27 +0000
167@@ -911,6 +911,33 @@
168 "ubuntu-core-16-amd64.model-assertion",
169 ], os.listdir(target_dir))
170
171+ @mock.patch("cdimage.osextras.find_on_path", return_value=True)
172+ @mock.patch("cdimage.tree.DailyTreePublisher.detect_image_extension",
173+ return_value="img.xz")
174+ @mock.patch("cdimage.tree.zsyncmake")
175+ def test_publish_appliance_binary(self, mock_zsyncmake, *args):
176+ self.config["DIST"] = "bionic"
177+ publisher = self.make_publisher("ubuntu-appliance", "daily-live")
178+ source_dir = publisher.image_output("amd64")
179+ touch(os.path.join(
180+ source_dir, "%s-live-core-amd64.raw" % self.config.series))
181+ touch(os.path.join(
182+ source_dir,
183+ "%s-live-core-amd64.model-assertion" % self.config.series))
184+ self.capture_logging()
185+ list(publisher.publish_binary("live-core", "amd64", "20170429"))
186+ self.assertLogEqual([
187+ "Publishing amd64 ...",
188+ "Publishing amd64 model assertion ...",
189+ "Making amd64 zsync metafile ...",
190+ ])
191+ target_dir = os.path.join(publisher.publish_base, "20170429")
192+ self.assertEqual([], os.listdir(source_dir))
193+ self.assertCountEqual([
194+ "ubuntu-core-18-amd64.img.xz",
195+ "ubuntu-core-18-amd64.model-assertion",
196+ ], os.listdir(target_dir))
197+
198 def test_publish_livecd_base(self):
199 publisher = self.make_publisher("livecd-base", "livecd-base")
200 source_dir = os.path.join(
201@@ -1990,6 +2017,9 @@
202 def test_publish_core_binary(self):
203 pass
204
205+ def test_publish_appliance_binary(self):
206+ pass
207+
208 def test_publish_livecd_base(self):
209 pass
210
211
212=== modified file 'lib/cdimage/tree.py'
213--- lib/cdimage/tree.py 2020-06-30 16:49:46 +0000
214+++ lib/cdimage/tree.py 2020-07-17 14:49:27 +0000
215@@ -386,7 +386,7 @@
216 return "netbook"
217 elif self.project == "ubuntu-server":
218 return "live-server"
219- elif self.project == "ubuntu-core":
220+ elif self.project in ("ubuntu-core", "ubuntu-appliance"):
221 return "live-core"
222 else:
223 return "desktop"
224@@ -717,6 +717,21 @@
225 "https://wiki.ubuntu.com/Core", "Ubuntu Core wiki page",
226 show_class=True)
227 sentences.append("See the %s for more information." % link)
228+ elif publish_type == "ubuntu-appliance":
229+ sentences.append(
230+ "An Ubuntu Appliance turns a computer into a specialised "
231+ "appliance for home or work. It is a system disk image for a "
232+ "PC or Raspberry Pi, built for security and simplicity.")
233+ sentences.append(
234+ "Ubuntu Appliances have strong privacy policies and long term "
235+ "security maintenance guarantees. They are published by "
236+ "companies and open source communities, who follow the Ubuntu "
237+ "code of conduct and appliance guidelines, together with "
238+ "Canonical, the publisher of Ubuntu.")
239+ link = Link(
240+ "https://ubuntu.com/appliance", "Ubuntu Appliance page",
241+ show_class=True)
242+ sentences.append("See the %s for more information." % link)
243 elif publish_type == "wubi":
244 sentences.append(
245 "This is a filesystem image downloaded by Wubi (a system "
246@@ -982,7 +997,7 @@
247 full_project = "-".join(full_project_bits)
248 series = self.config["DIST"]
249
250- if self.project == "ubuntu-core":
251+ if self.project in ("ubuntu-core", "ubuntu-appliance"):
252 channel = self.config.get("CHANNEL", "edge")
253 heading = "%s %s (%s)" % (
254 self.config.capproject, self.config.core_series, channel)
255@@ -1754,7 +1769,7 @@
256
257 @property
258 def image_type_dir(self):
259- if (self.config.project == "ubuntu-core" and
260+ if (self.config.project in ("ubuntu-core", "ubuntu-appliance") and
261 self.image_type == 'daily-live'):
262 channel = self.config.get("CHANNEL", "edge")
263 return os.path.join(self.config.core_series, channel)
264@@ -2289,7 +2304,7 @@
265 if (entry.startswith("%s-" % self.config.series) or
266 (self.config.subproject == "wubi" and
267 entry.endswith(".tar.xz")) or
268- (self.config.project == "ubuntu-core" and
269+ (self.config.project in ("ubuntu-core", "ubuntu-appliance") and
270 self.image_type == "daily-live" and
271 entry.endswith(".img.xz"))):
272 images.add(entry)

Subscribers

People subscribed via source and target branches