Re: different delivery formats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 10, 2012 at 8:42 PM, Dennis Gilmore <dennis@xxxxxxxx> wrote:
> I made a qcow2 format image for f17 that came
> in at 610M, i also tarred and xz compressed the f16 ec2 raw disk and
> that came in at 114M the raw disk images are 10G

For testing in Openstack Glance, I'd prefer to point users directly to
the compressed qcow2 image, instead of giving them complicated
instructions this:
https://fedoraproject.org/wiki/Getting_started_with_OpenStack_Nova#Downloading_Existing_Images

I've attached patches for appliance-creator (tested) and koji
(untested) which add --compress option, could you please try them out?

> so the main question here is whats the best way to make them available
> that can easily be consumed by people.

If it is too big for mirrors, then publish it at
http://torrent.fedoraproject.org/ ?

Cheers,
Alan
From aa52eb83409ff10178a8873676c1f997251b24fb Mon Sep 17 00:00:00 2001
From: Alan Pevec <apevec@xxxxxxxxxx>
Date: Sat, 11 Feb 2012 01:26:16 +0100
Subject: [PATCH appliance-tools] add --compress option

QCOW* images can be optionally compressed
---
 appcreate/appliance.py  |   10 +++++++---
 tools/appliance-creator |    6 ++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/appcreate/appliance.py b/appcreate/appliance.py
index f9fc784..5cd2d4a 100644
--- a/appcreate/appliance.py
+++ b/appcreate/appliance.py
@@ -60,6 +60,7 @@ class ApplianceImageCreator(ImageCreator):
         self.vmem = vmem
         self.vcpu = vcpu
         self.checksum = False
+        self.compress = False
         self.appliance_version = None
         self.appliance_release = None
         
@@ -489,9 +490,12 @@ class ApplianceImageCreator(ImageCreator):
         for name in self.__disks.keys():
             dst = "%s/%s-%s.%s" % (self._outdir, self.name,name, self.__disk_format)       
             logging.debug("converting %s image to %s" % (self.__disks[name].lofile, dst))
-            rc = subprocess.call(["qemu-img", "convert",
-                                   "-f", "raw", self.__disks[name].lofile,
-                                   "-O", self.__disk_format,  dst])
+            qemuimg = ["qemu-img", "convert", "-f", "raw",
+                       "-O", self.__disk_format]
+            if self.compress:
+                qemuimg.append("-c")
+            qemuimg.extend([self.__disks[name].lofile, dst])
+            rc = subprocess.call(qemuimg)
             if rc == 0:
                 logging.debug("convert successful")
             if rc != 0:
diff --git a/tools/appliance-creator b/tools/appliance-creator
index c5f75f2..240c5d7 100755
--- a/tools/appliance-creator
+++ b/tools/appliance-creator
@@ -57,6 +57,8 @@ def parse_options(args):
                       help=("Generate a checksum for the created appliance"))
     appopt.add_option("-f", "--format", type="string", dest="disk_format", default="raw",
                       help="Disk format (default: raw)")
+    appopt.add_option("", "--compress", action="store_true", dest="compress",
+                      help=("Compressed disk image format (qcow* only)"))
     parser.add_option_group(appopt)
     
     
@@ -132,6 +134,10 @@ def main():
     creator = appcreate.ApplianceImageCreator(ks, name, options.disk_format, options.vmem, options.vcpu)
     creator.tmpdir = options.tmpdir
     creator.checksum = options.checksum
+    creator.compress = options.compress
+    if options.compress and not options.disk_format.startswith("qcow"):
+        logging.error("Compressed can only be qcow* disk formats")
+        return 1
 
     if options.version:
         creator.appliance_version = options.version
-- 
1.7.7.6

From 6f72e6bffcfa12fb41d9959d5fbbd7bd2c2ad185 Mon Sep 17 00:00:00 2001
From: Alan Pevec <apevec@xxxxxxxxxx>
Date: Sat, 11 Feb 2012 01:21:43 +0100
Subject: [PATCH koji] ApplianceTask: add --compress option

---
 builder/kojid |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/builder/kojid b/builder/kojid
index af6c081..61c8873 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -1955,6 +1955,9 @@ class ApplianceTask(ImageTask):
             arg = self.opts.get(arg_name)
             if arg != None: 
                 cmd.extend(['--%s' % arg_name, arg])
+        arg = self.opts.get('compress')
+        if arg != None:
+            cmd.append('--compress')
 
         # Run appliance-creator
         rv = broot.mock(['--cwd', '/tmp', '--chroot', '--'] + cmd)
-- 
1.7.7.6

_______________________________________________
cloud mailing list
cloud@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/cloud

[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Big List of Linux Books]     [Yosemite News]     [Linux Apps]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]

  Powered by Linux