Bug 1460475 - Install zstandard 0.9.0 in mach; r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Wed, 09 May 2018 20:13:28 -0700
changeset 795340 2131479e4f102bdeb40ad20bb17f6a023d156214
parent 795339 926d63dd653f83582675ac653a454c8149de4ec7
child 795341 66960fb95d9ac26217896ea24c3798994860aa43
push id109939
push userbmo:gps@mozilla.com
push dateTue, 15 May 2018 17:16:39 +0000
reviewersdustin
bugs1460475
milestone62.0a1
Bug 1460475 - Install zstandard 0.9.0 in mach; r?dustin The latest python-zstandard uses a newer zstandard that is faster. It also has wheels available, which means installation doesn't require Python development headers, etc. MozReview-Commit-ID: 5gRq81KYmX4
taskcluster/mach_commands.py
taskcluster/taskgraph/docker.py
--- a/taskcluster/mach_commands.py
+++ b/taskcluster/mach_commands.py
@@ -385,24 +385,20 @@ class MachCommands(MachCommandBase):
         filtered_taskgraph = TaskGraph(filteredtasks, Graph(set(filteredtasks), filterededges))
         return filtered_taskgraph
 
 
 @CommandProvider
 class TaskClusterImagesProvider(MachCommandBase):
     def _ensure_zstd(self):
         try:
-            import zstd
-            # There are two zstd libraries that exist in the wild, ensure we
-            # have the right one.
-            zstd.ZstdCompressor
-            zstd.ZstdDecompressor
+            import zstandard  # noqa: F401
         except (ImportError, AttributeError):
             self._activate_virtualenv()
-            self.virtualenv_manager.install_pip_package('zstandard==0.8.1')
+            self.virtualenv_manager.install_pip_package('zstandard==0.9.0')
 
     @Command('taskcluster-load-image', category="ci",
              description="Load a pre-built Docker image")
     @CommandArgument('--task-id',
                      help="Load the image at public/image.tar.zst in this task,"
                           "rather than searching the index")
     @CommandArgument('-t', '--tag',
                      help="tag that the image should be loaded as. If not "
--- a/taskcluster/taskgraph/docker.py
+++ b/taskcluster/taskgraph/docker.py
@@ -118,17 +118,17 @@ class IteratorReader(object):
 
 def load_image(url, imageName=None, imageTag=None):
     """
     Load docker image from URL as imageName:tag, if no imageName or tag is given
     it will use whatever is inside the zstd compressed tarball.
 
     Returns an object with properties 'image', 'tag' and 'layer'.
     """
-    import zstd
+    import zstandard as zstd
 
     # If imageName is given and we don't have an imageTag
     # we parse out the imageTag from imageName, or default it to 'latest'
     # if no imageName and no imageTag is given, 'repositories' won't be rewritten
     if imageName and not imageTag:
         if ':' in imageName:
             imageName, imageTag = imageName.split(':', 1)
         else: