Merge lp:~ltrager/maas-images/v3_squashfs_only into lp:maas-images

Proposed by Lee Trager
Status: Merged
Merged at revision: 376
Proposed branch: lp:~ltrager/maas-images/v3_squashfs_only
Merge into: lp:maas-images
Prerequisite: lp:~smoser/maas-images/lp1689557-build-squashfs-trusty
Diff against target: 48 lines (+18/-2)
1 file modified
meph2/stream.py (+18/-2)
To merge this branch: bzr merge lp:~ltrager/maas-images/v3_squashfs_only
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Andres Rodriguez (community) Needs Information
Review via email: mp+326129@code.launchpad.net

Commit message

If the squashfs config option is set produce streams only with SquashFS images.

Any image which is only available as a root-image will be automatically
converted.

Description of the change

Sample stream is up at http://162.213.35.187/squashfs/ it does not contain Precise as maas-images currently ignores unsupported releases and we do not plan to support in in MAAS 2.3+.

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Why squashfs *only*? We should continue to produce the root tarballs for trusty. There are still a lot of users on older versions of MAAS that would potentially be broken if we make the switch.

review: Needs Information
Revision history for this message
Scott Moser (smoser) wrote :

I agree with Andres. You'll need to make both image types available.

Revision history for this message
Lee Trager (ltrager) wrote :

Any version of MAAS which can use the V3 stream can deploy SquashFS images. In the current V3 stream if a release has a SquashFS image we only publish the SquashFS image. The only reason Trusty and Precise have yet to goto a SquashFS image is because they aren't available on http://cloud-images.ubuntu.com. If MAAS detects a release in the stream contains both a root-image and a SquashFS image the SquashFS image will be downloaded and the root-image will be ignored[1]. If a SquashFS image is added to an existing release version the root-image will be deleted and the SquashFS image will be downloaded[2]. So once the Trusty SquashFS image is released to the V3 stream no version of MAAS will use the root-image, even if its available.

[1] https://git.launchpad.net/maas/tree/src/maasserver/bootresources.py#n1084
[2] https://git.launchpad.net/maas/tree/src/maasserver/bootresources.py#n652

375. By Lee Trager

Merge trunk

376. By Lee Trager

If upstream contains a root-image publish it along side the SquashFS image.

Revision history for this message
Lee Trager (ltrager) wrote :

I've updated the MP to publish both the root-image.gz and SquashFS image for Trusty. As previously mentioned any version of MAAS which can use the V3 stream will ignore the root-image.gz. The only effect this should have is increasing the stream size.

Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good. Thanks for the fixes.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'meph2/stream.py'
--- meph2/stream.py 2016-12-16 23:52:01 +0000
+++ meph2/stream.py 2017-06-23 02:07:18 +0000
@@ -155,10 +155,17 @@
155 krd_packs = []155 krd_packs = []
156 squashfs = cfgdata.get('squashfs', False)156 squashfs = cfgdata.get('squashfs', False)
157 base_boot_keys = ['boot-kernel', 'boot-initrd']157 base_boot_keys = ['boot-kernel', 'boot-initrd']
158 if squashfs and img_url.endswith('.squashfs'):158 if squashfs:
159 # Only publish SquashFS root images when the squashfs option is set. If
160 # the image is a tar.gz it will be converted below.
159 base_ikeys = base_boot_keys + ['squashfs', 'squashfs.manifest']161 base_ikeys = base_boot_keys + ['squashfs', 'squashfs.manifest']
160 manifest_path = PATH_FORMATS['squashfs.manifest'] % subs162 manifest_path = PATH_FORMATS['squashfs.manifest'] % subs
161 newpaths = set((PATH_FORMATS['squashfs'] % subs, manifest_path))163 newpaths = set((PATH_FORMATS['squashfs'] % subs, manifest_path))
164 # If upstream is only providing a root-image include it in addition to
165 # the SquashFS image
166 if not img_url.endswith('.squashfs'):
167 base_ikeys += ['root-image.gz']
168 newpaths.update([rootimg_path])
162 else:169 else:
163 base_ikeys = base_boot_keys + ['root-image.gz', 'root-image.manifest']170 base_ikeys = base_boot_keys + ['root-image.gz', 'root-image.manifest']
164 manifest_path = PATH_FORMATS['root-image.manifest'] % subs171 manifest_path = PATH_FORMATS['root-image.manifest'] % subs
@@ -300,8 +307,8 @@
300 subprocess.check_call(gencmd)307 subprocess.check_call(gencmd)
301 LOG.info("finished: %s" % gencmd)308 LOG.info("finished: %s" % gencmd)
302309
310 base_dir = os.path.join(out_d, release, arch, version_name)
303 if img_url.endswith('squashfs'):311 if img_url.endswith('squashfs'):
304 base_dir = os.path.join(out_d, release, arch, version_name)
305 src_squash = os.path.join(base_dir, os.path.basename(img_url))312 src_squash = os.path.join(base_dir, os.path.basename(img_url))
306 if squashfs:313 if squashfs:
307 # If we're publishing a SquashFS file rename it to its314 # If we're publishing a SquashFS file rename it to its
@@ -318,6 +325,15 @@
318 # If we're not publishing the SquashFS image but used it to325 # If we're not publishing the SquashFS image but used it to
319 # generate the root-img clean it up.326 # generate the root-img clean it up.
320 os.remove(src_squash)327 os.remove(src_squash)
328 elif squashfs and img_url.endswith('tar.gz'):
329 # If the stream is publishing SquashFS images convert any
330 # non-SquashFS image into a SquashFS image.
331 subprocess.check_call([
332 'sudo', 'env', 'PATH=%s' % os.environ.get('PATH'),
333 os.environ.get('IMG2SQUASHFS', 'img2squashfs'),
334 os.path.join(base_dir, 'root-image.gz'),
335 os.path.join(base_dir, 'squashfs'),
336 ])
321337
322 # get checksum and size of new files created338 # get checksum and size of new files created
323 file_info = {}339 file_info = {}

Subscribers

People subscribed via source and target branches