Bug 1546801: [firefox-ci] Use taskcluster-proxy for windows builds' tooltool access; r=Callek a=tomprince CLOSED TREE
authorTom Prince <mozilla@hocat.ca>
Sat, 09 Nov 2019 15:19:55 -0700
changeset 501362 8373434efcdb93aa2fef0459d357a120aa020e6e
parent 501361 641fe2e15d6f1e046f4064af76d1b7c701baa469
child 501363 4314b9f7e9923820472d33436673407eb3348242
push id114168
push userdluca@mozilla.com
push dateSun, 10 Nov 2019 03:08:55 +0000
treeherdermozilla-inbound@33f64c1ef3e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCallek, tomprince
bugs1546801
milestone72.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 1546801: [firefox-ci] Use taskcluster-proxy for windows builds' tooltool access; r=Callek a=tomprince CLOSED TREE MANUAL PUSH: Fix windows tooltool failures in firefox-ci cluster. Differential Revision: https://phabricator.services.mozilla.com/D52456
taskcluster/ci/build/windows.yml
taskcluster/ci/instrumented-build/kind.yml
taskcluster/ci/toolchain/cbindgen.yml
taskcluster/ci/toolchain/cctools-port.yml
taskcluster/ci/toolchain/clang-tidy.yml
taskcluster/ci/toolchain/clang.yml
taskcluster/ci/toolchain/gn.yml
taskcluster/ci/toolchain/grcov.yml
taskcluster/ci/toolchain/rust-size.yml
taskcluster/ci/toolchain/sccache.yml
taskcluster/ci/webrender/kind.yml
taskcluster/taskgraph/transforms/job/common.py
taskcluster/taskgraph/transforms/job/hazard.py
taskcluster/taskgraph/transforms/job/mozharness.py
taskcluster/taskgraph/transforms/job/run_task.py
taskcluster/taskgraph/transforms/job/spidermonkey.py
--- a/taskcluster/ci/build/windows.yml
+++ b/taskcluster/ci/build/windows.yml
@@ -1,16 +1,20 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 ---
 job-defaults:
     run:
         using: mozharness
         use-caches: false
+        tooltool-downloads: internal
+        extra-config:
+            "tooltool_servers": ['http://taskcluster/tooltool.mozilla-releng.net/']
+            'tooltool_url': 'http://taskcluster/tooltool.mozilla-releng.net/'
 
 win32/debug:
     description: "Win32 Debug"
     index:
         product: firefox
         job-name: win32-debug
     attributes:
         enable-full-crashsymbols: true
--- a/taskcluster/ci/instrumented-build/kind.yml
+++ b/taskcluster/ci/instrumented-build/kind.yml
@@ -143,16 +143,18 @@ jobs:
             options: [append-env-variables-from-configs]
             mozconfig-variant: profile-generate
             config:
                 - builds/releng_base_firefox.py
                 - builds/taskcluster_base_windows.py
                 - builds/taskcluster_base_win32.py
             extra-config:
                 stage_platform: win32
+                "tooltool_servers": ['http://taskcluster/tooltool.mozilla-releng.net/']
+                'tooltool_url': 'http://taskcluster/tooltool.mozilla-releng.net/'
         fetches:
             toolchain:
                 - win64-clang-cl
                 - win64-rust
                 - win64-rust-size
                 - win64-cbindgen
                 - win64-nasm
                 - win64-node
@@ -174,16 +176,18 @@ jobs:
             options: [append-env-variables-from-configs]
             mozconfig-variant: profile-generate
             config:
                 - builds/releng_base_firefox.py
                 - builds/taskcluster_base_windows.py
                 - builds/taskcluster_base_win64.py
             extra-config:
                 stage_platform: win64
+                "tooltool_servers": ['http://taskcluster/tooltool.mozilla-releng.net/']
+                'tooltool_url': 'http://taskcluster/tooltool.mozilla-releng.net/'
         fetches:
             toolchain:
                 - win64-clang-cl
                 - win64-rust
                 - win64-rust-size
                 - win64-cbindgen
                 - win64-nasm
                 - win64-node
--- a/taskcluster/ci/toolchain/cbindgen.yml
+++ b/taskcluster/ci/toolchain/cbindgen.yml
@@ -55,11 +55,12 @@ win64-cbindgen:
     worker:
         env:
             TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/win64/vs2017.manifest"
     run:
         arguments: ['x86_64-pc-windows-msvc']
         resources:
             - taskcluster/scripts/misc/tooltool-download.sh
         toolchain-artifact: public/build/cbindgen.tar.bz2
+        tooltool-downloads: internal
     fetches:
         toolchain:
             - win64-rust-1.34
--- a/taskcluster/ci/toolchain/cctools-port.yml
+++ b/taskcluster/ci/toolchain/cctools-port.yml
@@ -13,12 +13,13 @@ job-defaults:
             - libtapi
 
 linux64-cctools-port:
     treeherder:
         symbol: TL(cctools)
     run:
         script: build-cctools-port.sh
         toolchain-artifact: public/build/cctools.tar.xz
+        tooltool-downloads: internal
     fetches:
         toolchain:
             - linux64-clang-9
             - linux64-binutils
--- a/taskcluster/ci/toolchain/clang-tidy.yml
+++ b/taskcluster/ci/toolchain/clang-tidy.yml
@@ -82,12 +82,13 @@ win64-clang-tidy:
             TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/win64/vs2017.manifest"
     run:
         script: build-clang.sh
         arguments:
             - 'build/build-clang/clang-tidy-win64.json'
         resources:
             - 'build/build-clang/clang-tidy-win64.json'
         toolchain-artifact: public/build/clang-tidy.tar.bz2
+        tooltool-downloads: internal
     fetches:
         fetch:
             - cmake
             - ninja
--- a/taskcluster/ci/toolchain/clang.yml
+++ b/taskcluster/ci/toolchain/clang.yml
@@ -245,13 +245,14 @@ win64-clang-cl:
     run:
         script: build-clang.sh
         arguments:
             - 'build/build-clang/clang-win64.json'
         resources:
             - 'build/build-clang/clang-win64.json'
             - 'taskcluster/scripts/misc/tooltool-download.sh'
         toolchain-artifact: public/build/clang.tar.bz2
+        tooltool-downloads: internal
     fetches:
         fetch:
             - clang-9
             - cmake
             - ninja
--- a/taskcluster/ci/toolchain/gn.yml
+++ b/taskcluster/ci/toolchain/gn.yml
@@ -51,11 +51,12 @@ win32-gn:
         max-run-time: 3600
         env:
             TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/win64/vs2017.manifest"
     run:
         script: build-gn-win32.sh
         resources:
             - 'taskcluster/scripts/misc/tooltool-download.sh'
         toolchain-artifact: public/build/gn.tar.bz2
+        tooltool-downloads: internal
     fetches:
         fetch:
             - ninja
--- a/taskcluster/ci/toolchain/grcov.yml
+++ b/taskcluster/ci/toolchain/grcov.yml
@@ -37,11 +37,12 @@ win64-grcov:
     worker-type: b-win2012
     worker:
         env:
             TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/win64/vs2017.manifest"
     run:
         toolchain-artifact: public/build/grcov.tar.bz2
         resources:
             - 'taskcluster/scripts/misc/tooltool-download.sh'
+        tooltool-downloads: internal
     fetches:
         toolchain:
             - win64-rust-1.34
--- a/taskcluster/ci/toolchain/rust-size.yml
+++ b/taskcluster/ci/toolchain/rust-size.yml
@@ -28,11 +28,12 @@ win64-rust-size:
     worker-type: b-win2012
     worker:
         env:
             TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/win64/vs2017.manifest"
     run:
         toolchain-artifact: public/build/rust-size.tar.bz2
         resources:
             - 'taskcluster/scripts/misc/tooltool-download.sh'
+        tooltool-downloads: internal
     fetches:
         toolchain:
             - win64-rust-1.28
--- a/taskcluster/ci/toolchain/sccache.yml
+++ b/taskcluster/ci/toolchain/sccache.yml
@@ -60,11 +60,12 @@ win64-sccache:
     worker:
         max-run-time: 3600
         env:
             TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/win64/vs2017.manifest"
     run:
         toolchain-artifact: public/build/sccache.tar.bz2
         resources:
             - 'taskcluster/scripts/misc/tooltool-download.sh'
+        tooltool-downloads: internal
     fetches:
         toolchain:
             - win64-rust-1.34
--- a/taskcluster/ci/webrender/kind.yml
+++ b/taskcluster/ci/webrender/kind.yml
@@ -226,16 +226,17 @@ jobs:
         fetches:
             toolchain:
                 - win64-rust
                 - wrench-deps
         run:
             using: run-task
             use-caches: false
             command: '$GECKO_PATH/taskcluster/scripts/misc/wrench-windows-tests.sh'
+            tooltool-downloads: internal
         treeherder:
             platform: windows10-64-qr/release
             symbol: WR(wrench)
         when:
             files-changed:
                 - 'build/win64/mozconfig.vs2017'
                 - 'browser/config/tooltool-manifests/win64/webrender.manifest'
                 - 'gfx/wr/**'
--- a/taskcluster/taskgraph/transforms/job/common.py
+++ b/taskcluster/taskgraph/transforms/job/common.py
@@ -205,37 +205,36 @@ def setup_secrets(config, job, taskdesc)
     secrets = job['run']['secrets']
     if secrets is True:
         secrets = ['*']
     for sec in secrets:
         taskdesc['scopes'].append(SECRET_SCOPE.format(
             job['treeherder']['kind'], config.params['level'], sec))
 
 
-def docker_worker_add_tooltool(config, job, taskdesc, internal=False):
+def add_tooltool(config, job, taskdesc, internal=False):
     """Give the task access to tooltool.
 
     Enables the tooltool cache. Adds releng proxy. Configures scopes.
 
     By default, only public tooltool access will be granted. Access to internal
     tooltool can be enabled via ``internal=True``.
 
     This can only be used with ``run-task`` tasks, as the cache name is
     reserved for use with ``run-task``.
     """
 
-    assert job['worker']['implementation'] in ('docker-worker',)
+    if job['worker']['implementation'] in ('docker-worker',):
+        level = config.params['level']
+        add_cache(job, taskdesc, 'tooltool-cache'.format(level),
+                  '{workdir}/tooltool-cache'.format(**job['run']))
 
-    level = config.params['level']
-    add_cache(job, taskdesc, 'tooltool-cache'.format(level),
-              '{workdir}/tooltool-cache'.format(**job['run']))
-
-    taskdesc['worker'].setdefault('env', {}).update({
-        'TOOLTOOL_CACHE': '{workdir}/tooltool-cache'.format(**job['run']),
-    })
+        taskdesc['worker'].setdefault('env', {}).update({
+            'TOOLTOOL_CACHE': '{workdir}/tooltool-cache'.format(**job['run']),
+        })
 
     taskdesc['worker']['taskcluster-proxy'] = True
     taskdesc['scopes'].extend([
         'project:releng:services/tooltool/api/download/public',
     ])
 
     if internal:
         taskdesc['scopes'].extend([
--- a/taskcluster/taskgraph/transforms/job/hazard.py
+++ b/taskcluster/taskgraph/transforms/job/hazard.py
@@ -13,17 +13,17 @@ from voluptuous import Required, Optiona
 from taskgraph.transforms.job import (
     run_job_using,
     configure_taskdesc_for_run,
 )
 from taskgraph.transforms.job.common import (
     docker_worker_add_workspace_cache,
     setup_secrets,
     docker_worker_add_artifacts,
-    docker_worker_add_tooltool,
+    add_tooltool,
 )
 
 haz_run_schema = Schema({
     Required('using'): 'hazard',
 
     # The command to run within the task image (passed through to the worker)
     Required('command'): basestring,
 
@@ -46,17 +46,17 @@ haz_run_schema = Schema({
 def docker_worker_hazard(config, job, taskdesc):
     run = job['run']
 
     worker = taskdesc['worker'] = job['worker']
     worker['artifacts'] = []
 
     docker_worker_add_artifacts(config, job, taskdesc)
     docker_worker_add_workspace_cache(config, job, taskdesc)
-    docker_worker_add_tooltool(config, job, taskdesc)
+    add_tooltool(config, job, taskdesc)
     setup_secrets(config, job, taskdesc)
 
     env = worker['env']
     env.update({
         'MOZ_BUILD_DATE': config.params['moz_build_date'],
         'MOZ_SCM_LEVEL': config.params['level'],
     })
 
--- a/taskcluster/taskgraph/transforms/job/mozharness.py
+++ b/taskcluster/taskgraph/transforms/job/mozharness.py
@@ -236,27 +236,29 @@ def mozharness_on_generic_worker(config,
     assert (
         job["worker"]["os"] == "windows"
     ), "only supports windows right now: {}".format(job["label"])
 
     run = job['run']
 
     # fail if invalid run options are included
     invalid = []
-    for prop in ['tooltool-downloads', 'taskcluster-proxy', 'need-xvfb']:
+    for prop in ['need-xvfb']:
         if prop in run and run.pop(prop):
             invalid.append(prop)
     if not run.pop('keep-artifacts', True):
         invalid.append('keep-artifacts')
     if invalid:
         raise Exception("Jobs run using mozharness on Windows do not support properties " +
                         ', '.join(invalid))
 
     worker = taskdesc['worker'] = job['worker']
 
+    worker['taskcluster-proxy'] = run.pop('taskcluster-proxy', None)
+
     setup_secrets(config, job, taskdesc)
 
     taskdesc['worker'].setdefault('artifacts', []).append({
         'name': 'public/logs',
         'path': 'logs',
         'type': 'directory'
     })
     if not worker.get('skip-artifacts', False):
--- a/taskcluster/taskgraph/transforms/job/run_task.py
+++ b/taskcluster/taskgraph/transforms/job/run_task.py
@@ -10,17 +10,17 @@ from __future__ import absolute_import, 
 from six import text_type
 
 from mozpack import path
 
 from taskgraph.transforms.task import taskref_or_string
 from taskgraph.transforms.job import run_job_using
 from taskgraph.util.schema import Schema
 from taskgraph.transforms.job.common import (
-        docker_worker_add_tooltool,
+        add_tooltool,
         support_vcs_checkout
 )
 from voluptuous import Any, Optional, Required
 
 run_task_schema = Schema({
     Required('using'): 'run-task',
 
     # if true, add a cache at ~worker/.cache, which is where things like pip
@@ -104,17 +104,17 @@ def script_url(config, script):
 def docker_worker_run_task(config, job, taskdesc):
     run = job['run']
     worker = taskdesc['worker'] = job['worker']
     command = ['/builds/worker/bin/run-task']
     common_setup(config, job, taskdesc, command)
 
     if run['tooltool-downloads']:
         internal = run['tooltool-downloads'] == 'internal'
-        docker_worker_add_tooltool(config, job, taskdesc, internal=internal)
+        add_tooltool(config, job, taskdesc, internal=internal)
 
     if run.get('cache-dotcache'):
         worker['caches'].append({
             'type': 'persistent',
             'name': '{project}-dotcache'.format(**config.params),
             'mount-point': '{workdir}/.cache'.format(**run),
             'skip-untrusted': True,
         })
@@ -150,16 +150,20 @@ def docker_worker_run_task(config, job, 
 @run_job_using("generic-worker", "run-task", schema=run_task_schema, defaults=worker_defaults)
 def generic_worker_run_task(config, job, taskdesc):
     run = job['run']
     worker = taskdesc['worker'] = job['worker']
     is_win = worker['os'] == 'windows'
     is_mac = worker['os'] == 'macosx'
     is_bitbar = worker['os'] == 'linux-bitbar'
 
+    if run['tooltool-downloads']:
+        internal = run['tooltool-downloads'] == 'internal'
+        add_tooltool(config, job, taskdesc, internal=internal)
+
     if is_win:
         command = ['C:/mozilla-build/python3/python3.exe', 'run-task']
     elif is_mac:
         command = ['/tools/python37/bin/python3.7', 'run-task']
         if job['worker-type'].endswith('1014'):
             command = ['/usr/local/bin/python3', 'run-task']
     else:
         command = ['./run-task']
--- a/taskcluster/taskgraph/transforms/job/spidermonkey.py
+++ b/taskcluster/taskgraph/transforms/job/spidermonkey.py
@@ -12,17 +12,17 @@ from voluptuous import Required, Any, Op
 
 from taskgraph.transforms.job import (
     run_job_using,
     configure_taskdesc_for_run,
 )
 from taskgraph.transforms.job.common import (
     docker_worker_add_artifacts,
     generic_worker_add_artifacts,
-    docker_worker_add_tooltool,
+    add_tooltool,
 )
 
 sm_run_schema = Schema({
     Required('using'): Any('spidermonkey', 'spidermonkey-package', 'spidermonkey-mozjs-crate',
                            'spidermonkey-rust-bindings'),
 
     # SPIDERMONKEY_VARIANT and SPIDERMONKEY_PLATFORM
     Required('spidermonkey-variant'): basestring,
@@ -47,17 +47,17 @@ def docker_worker_spidermonkey(config, j
     worker.setdefault('caches', []).append({
         'type': 'persistent',
         'name': '{}-build-spidermonkey-workspace'.format(config.params['project']),
         'mount-point': "{workdir}/workspace".format(**run),
         'skip-untrusted': True,
     })
 
     docker_worker_add_artifacts(config, job, taskdesc)
-    docker_worker_add_tooltool(config, job, taskdesc)
+    add_tooltool(config, job, taskdesc)
 
     env = worker.setdefault('env', {})
     env.update({
         'MOZHARNESS_DISABLE': 'true',
         'SPIDERMONKEY_VARIANT': run.pop('spidermonkey-variant'),
         'MOZ_BUILD_DATE': config.params['moz_build_date'],
         'MOZ_SCM_LEVEL': config.params['level'],
         'GECKO_PATH': '{}/workspace/build/src'.format(run['workdir'])