Bug 1381577 - Part N; Make repackage task output its artifact to a locale included subdirectory, rather than rely on worker to publish there. r=kmoir
authorJustin Wood <Callek@gmail.com>
Tue, 18 Jul 2017 11:57:26 -0400
changeset 418977 8fed3841b32a327f9fa0ed2e5261848de0e7b7df
parent 418976 635129751d087f6ba2244f8a6dc4325b024003c2
child 418978 362aeaaac09ce7e01520b04c8180f71a881644fc
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmoir
bugs1381577
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1381577 - Part N; Make repackage task output its artifact to a locale included subdirectory, rather than rely on worker to publish there. r=kmoir Land date changes to support windows nightlies onto central This will be needed for windows, because if the artifact is output to a folder that is, itself, an artifact folder, we'll end up publishing the named artifact twice. Which is unhelpful. MozReview-Commit-ID: 5S6SNul6Fm9
taskcluster/taskgraph/transforms/repackage.py
testing/mozharness/configs/repackage/osx_signed.py
testing/mozharness/scripts/repackage.py
--- a/taskcluster/taskgraph/transforms/repackage.py
+++ b/taskcluster/taskgraph/transforms/repackage.py
@@ -136,16 +136,20 @@ def make_job_description(config, jobs):
         worker = {
             'env': _generate_task_env(build_platform, build_task_ref,
                                       signing_task_ref, locale=locale),
             'artifacts': _generate_task_output_files(build_platform, locale=locale),
             'chain-of-trust': True,
             'max-run-time': 3600,
         }
 
+        if locale:
+            # Make sure we specify the locale-specific upload dir
+            worker['env'].update(LOCALE=locale)
+
         if build_platform.startswith('macosx'):
             worker_type = 'aws-provisioner-v1/gecko-%s-b-macosx64' % level
 
             run['tooltool-downloads'] = 'internal'
             worker['docker-image'] = {"in-tree": "desktop-build"},
 
             cot = job.setdefault('extra', {}).setdefault('chainOfTrust', {})
             cot.setdefault('inputs', {})['docker-image'] = {"task-reference": "<docker-image>"}
@@ -194,17 +198,19 @@ def _generate_taskcluster_prefix(task_id
     return _TC_ARTIFACT_LOCATION.format(task_id=task_id, postfix=postfix)
 
 
 def _generate_task_output_files(build_platform, locale=None):
     locale_output_path = '{}/'.format(locale) if locale else ''
     if build_platform.startswith('macosx'):
         return [{
             'type': 'file',
-            'path': '/home/worker/workspace/build/artifacts/target.dmg',
+            'path': '/home/worker/workspace/build/artifacts/{}target.dmg'
+                    .format(locale_output_path),
             'name': 'public/build/{}target.dmg'.format(locale_output_path),
         }, {
             'type': 'file',
-            'path': '/home/worker/workspace/build/artifacts/target.complete.mar',
+            'path': '/home/worker/workspace/build/artifacts/{}target.complete.mar'
+                    .format(locale_output_path),
             'name': 'public/build/{}target.complete.mar'.format(locale_output_path),
         }]
     else:
         raise NotImplemented('Unsupported build_platform: "{}"'.format(build_platform))
--- a/testing/mozharness/configs/repackage/osx_signed.py
+++ b/testing/mozharness/configs/repackage/osx_signed.py
@@ -1,15 +1,17 @@
 import os
 
 config = {
     "input_home": "{abs_work_dir}/inputs",
-    "output_home": "{abs_work_dir}/artifacts",
+    "output_home": "{abs_work_dir}/artifacts{locale}",
     "src_mozconfig": "browser/config/mozconfigs/macosx64/repack",
 
+    "locale": os.environ.get("LOCALE"),
+
     "download_config": {
         "target.tar.gz": os.environ.get("SIGNED_INPUT"),
         "mar": os.environ.get("UNSIGNED_MAR"),
     },
 
     "repackage_config": [[
         "dmg",
         "-i", "{abs_work_dir}/inputs/target.tar.gz",
--- a/testing/mozharness/scripts/repackage.py
+++ b/testing/mozharness/scripts/repackage.py
@@ -52,17 +52,21 @@ class Repackage(BaseScript):
         abs_dirs = super(Repackage, self).query_abs_dirs()
         config = self.config
         for directory in abs_dirs:
             value = abs_dirs[directory]
             abs_dirs[directory] = value
         dirs = {}
         dirs['abs_tools_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'tools')
         dirs['abs_mozilla_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'src')
-        dirs['output_home'] = config['output_home'].format(**abs_dirs)
+        locale_dir = ''
+        if config.get('locale'):
+            locale_dir = "{}{}".format(os.path.sep, config['locale'])
+        dirs['output_home'] = config['output_home'].format(locale=locale_dir, **abs_dirs)
+
         for key in dirs.keys():
             if key not in abs_dirs:
                 abs_dirs[key] = dirs[key]
         self.abs_dirs = abs_dirs
         return self.abs_dirs
 
     def repackage(self):
         config = self.config
@@ -84,16 +88,17 @@ class Repackage(BaseScript):
     def _run_tooltool(self):
         config = self.config
         dirs = self.query_abs_dirs()
         manifest_src = os.environ.get('TOOLTOOL_MANIFEST')
         if not manifest_src:
             manifest_src = config.get('tooltool_manifest_src')
         if not manifest_src:
             return self.warning(ERROR_MSGS['tooltool_manifest_undetermined'])
+
         tooltool_manifest_path = os.path.join(dirs['abs_mozilla_dir'],
                                               manifest_src)
         cmd = [
             sys.executable, '-u',
             os.path.join(dirs['abs_mozilla_dir'], 'mach'),
             'artifact',
             'toolchain',
             '-v',