Bug 1595368: [firefox-ci] Use consitent logic to determine tooltool url; draft
authorTom Prince <mozilla@hocat.ca>
Sun, 10 Nov 2019 19:57:45 -0700
changeset 2424714 ce044a373790f9f7fef90e3e36e191dc01b1a813
parent 2424713 2ecfb9c3d93d788a5f607b1eb517bed43fe72bbd
child 2424715 67083420e3ff2cd73fdc824dda947e63cf9d1da4
push id447525
push usermozilla@hocat.ca
push dateMon, 11 Nov 2019 06:20:53 +0000
treeherdertry@887102da46f1 [default view] [failures only]
bugs1595368
milestone72.0a1
Bug 1595368: [firefox-ci] Use consitent logic to determine tooltool url; Differential Revision: https://phabricator.services.mozilla.com/D52498
js/src/devtools/automation/winbuildenv.sh
python/mozbuild/mozbuild/action/tooltool.py
python/mozbuild/mozbuild/artifact_commands.py
taskcluster/ci/build/windows.yml
taskcluster/ci/instrumented-build/kind.yml
taskcluster/ci/searchfox/kind.yml
taskcluster/ci/static-analysis-autotest/kind.yml
taskcluster/scripts/builder/sm-tooltool-config.sh
taskcluster/scripts/misc/tooltool-download.sh
testing/mozharness/configs/android/android_common.py
testing/mozharness/configs/android/android_hw.py
testing/mozharness/configs/android/wrench.py
testing/mozharness/configs/builds/build_pool_specifics.py
testing/mozharness/configs/openh264/macosx64.py
testing/mozharness/configs/raptor/android_hw_config.py
testing/mozharness/configs/repackage/linux32_signed.py
testing/mozharness/configs/repackage/linux64_signed.py
testing/mozharness/configs/repackage/osx_partner.py
testing/mozharness/configs/repackage/osx_signed.py
testing/mozharness/configs/repackage/win32_partner.py
testing/mozharness/configs/repackage/win64_partner.py
testing/mozharness/configs/single_locale/tc_android-api-16.py
testing/mozharness/configs/single_locale/tc_macosx64.py
testing/mozharness/configs/single_locale/tc_win32.py
testing/mozharness/configs/single_locale/tc_win64.py
testing/mozharness/configs/web_platform_tests/prod_config_android.py
testing/mozharness/external_tools/tooltool.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
testing/mozharness/mozharness/mozilla/tooltool.py
testing/mozharness/scripts/desktop_l10n.py
testing/mozharness/scripts/fx_desktop_build.py
testing/mozharness/scripts/repackage.py
tools/lint/eslint/update.sh
--- a/js/src/devtools/automation/winbuildenv.sh
+++ b/js/src/devtools/automation/winbuildenv.sh
@@ -22,12 +22,11 @@ mk_export_correct_style WINDOWSSDKDIR
 mk_export_correct_style DIA_SDK_PATH
 mk_export_correct_style VC_PATH
 
 # PATH also needs to point to mozmake.exe, which can come from either
 # newer mozilla-build or tooltool.
 if ! which mozmake 2>/dev/null; then
     export PATH="$PATH:$SOURCE/.."
     if ! which mozmake 2>/dev/null; then
-  TT_SERVER=${TT_SERVER:-https://tooltool.mozilla-releng.net/}
-  ( cd $SOURCE/..; $SOURCE/mach artifact toolchain -v --tooltool-manifest $SOURCE/browser/config/tooltool-manifests/${platform:-win32}/releng.manifest --tooltool-url $TT_SERVER --retry 4${TOOLTOOL_CACHE:+ --cache-dir ${TOOLTOOL_CACHE}}${MOZ_TOOLCHAINS:+ ${MOZ_TOOLCHAINS}})
+  ( cd $SOURCE/..; $SOURCE/mach artifact toolchain -v --tooltool-manifest $SOURCE/browser/config/tooltool-manifests/${platform:-win32}/releng.manifest --retry 4${TOOLTOOL_CACHE:+ --cache-dir ${TOOLTOOL_CACHE}}${MOZ_TOOLCHAINS:+ ${MOZ_TOOLCHAINS}})
     fi
 fi
--- a/python/mozbuild/mozbuild/action/tooltool.py
+++ b/python/mozbuild/mozbuild/action/tooltool.py
@@ -1274,24 +1274,27 @@ def main(argv, _skip_logging=False):
                       dest='message')
     parser.add_option('--authentication-file',
                       help='Use the RelengAPI token found in the given file to '
                            'authenticate to the RelengAPI server.',
                       dest='auth_file')
 
     (options_obj, args) = parser.parse_args(argv[1:])
 
-    # default the options list if not provided
-    if not options_obj.base_url:
-        options_obj.base_url = ['https://tooltool.mozilla-releng.net/']
+    tooltool_host = os.environ.get('TOOLTOOL_HOST', 'tooltool.mozilla-releng.net')
+    taskcluster_proxy_url = os.environ.get('TASKCLUSTER_PROXY_URL')
+    if taskcluster_proxy_url:
+        tooltool_url = '{}/{}'.format(taskcluster_proxy_url, tooltool_host)
+    else:
+        tooltool_url = 'https://{}'.format(tooltool_host)
 
     # ensure all URLs have a trailing slash
     def add_slash(url):
         return url if url.endswith('/') else (url + '/')
-    options_obj.base_url = [add_slash(u) for u in options_obj.base_url]
+    options_obj.base_url = [add_slash(tooltool_url)]
 
     # expand ~ in --authentication-file
     if options_obj.auth_file:
         options_obj.auth_file = os.path.expanduser(options_obj.auth_file)
 
     # Dictionaries are easier to work with
     options = vars(options_obj)
 
--- a/python/mozbuild/mozbuild/artifact_commands.py
+++ b/python/mozbuild/mozbuild/artifact_commands.py
@@ -160,41 +160,38 @@ class PackageFrontend(MachCommandBase):
                      default=False)
     @CommandArgument('--from-build', metavar='BUILD', nargs='+',
                      help='Download toolchains resulting from the given build(s); '
                      'BUILD is a name of a toolchain task, e.g. linux64-clang')
     @CommandArgument('--tooltool-manifest', metavar='MANIFEST',
                      help='Explicit tooltool manifest to process')
     @CommandArgument('--authentication-file', metavar='FILE',
                      help='Use the RelengAPI token found in the given file to authenticate')
-    @CommandArgument('--tooltool-url', metavar='URL',
-                     help='Use the given url as tooltool server')
     @CommandArgument('--no-unpack', action='store_true',
                      help='Do not unpack any downloaded file')
     @CommandArgument('--retry', type=int, default=4,
                      help='Number of times to retry failed downloads')
     @CommandArgument('--artifact-manifest', metavar='FILE',
                      help='Store a manifest about the downloaded taskcluster artifacts')
     @CommandArgument('files', nargs='*',
                      help='A list of files to download, in the form path@task-id, in '
                      'addition to the files listed in the tooltool manifest.')
     def artifact_toolchain(self, verbose=False, cache_dir=None,
                            skip_cache=False, from_build=(),
                            tooltool_manifest=None, authentication_file=None,
-                           tooltool_url=None, no_unpack=False, retry=None,
+                           no_unpack=False, retry=None,
                            artifact_manifest=None, files=()):
         '''Download, cache and install pre-built toolchains.
         '''
         from mozbuild.artifacts import ArtifactCache
         from mozbuild.action.tooltool import (
             FileRecord,
             open_manifest,
             unpack_file,
         )
-        from requests.adapters import HTTPAdapter
         import redo
         import requests
 
         from taskgraph.util.taskcluster import (
             get_artifact_url,
         )
 
         self._set_log_level(verbose)
@@ -208,36 +205,26 @@ class PackageFrontend(MachCommandBase):
                 self.log_manager.terminal_handler)
             logging.getLogger('redo').addHandler(
                 self.log_manager.terminal_handler)
             self.log_manager.terminal_handler.addFilter(
                 self.log_manager.structured_filter)
         if not cache_dir:
             cache_dir = os.path.join(self._mach_context.state_dir, 'toolchains')
 
-        tooltool_url = (tooltool_url or
-                        'https://tooltool.mozilla-releng.net').rstrip('/')
+        tooltool_host = os.environ.get('TOOLTOOL_HOST', 'tooltool.mozilla-releng.net')
+        taskcluster_proxy_url = os.environ.get('TASKCLUSTER_PROXY_URL')
+        if taskcluster_proxy_url:
+            tooltool_url = '{}/{}'.format(taskcluster_proxy_url, tooltool_host)
+        else:
+            tooltool_url = 'https://{}'.format(tooltool_host)
 
         cache = ArtifactCache(cache_dir=cache_dir, log=self.log,
                               skip_cache=skip_cache)
 
-        if authentication_file:
-            with open(authentication_file, 'rb') as f:
-                token = f.read().strip()
-
-            class TooltoolAuthenticator(HTTPAdapter):
-                def send(self, request, *args, **kwargs):
-                    request.headers['Authorization'] = \
-                        'Bearer {}'.format(token)
-                    return super(TooltoolAuthenticator, self).send(
-                        request, *args, **kwargs)
-
-            cache._download_manager.session.mount(
-                tooltool_url, TooltoolAuthenticator())
-
         class DownloadRecord(FileRecord):
             def __init__(self, url, *args, **kwargs):
                 super(DownloadRecord, self).__init__(*args, **kwargs)
                 self.url = url
                 self.basename = self.filename
 
             def fetch_with(self, cache):
                 self.filename = cache.fetch(self.url)
--- a/taskcluster/ci/build/windows.yml
+++ b/taskcluster/ci/build/windows.yml
@@ -2,19 +2,16 @@
 # 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
@@ -144,18 +144,16 @@ jobs:
             mozconfig-variant: profile-generate
             config:
                 - builds/releng_base_firefox.py
                 - builds/taskcluster_base_windows.py
                 - builds/taskcluster_base_win32.py
             tooltool-downloads: internal
             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
@@ -178,18 +176,16 @@ jobs:
             mozconfig-variant: profile-generate
             config:
                 - builds/releng_base_firefox.py
                 - builds/taskcluster_base_windows.py
                 - builds/taskcluster_base_win64.py
             tooltool-downloads: internal
             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/searchfox/kind.yml
+++ b/taskcluster/ci/searchfox/kind.yml
@@ -115,19 +115,16 @@ jobs:
             options: [append-env-variables-from-configs]
             script: mozharness/scripts/fx_desktop_build.py
             config:
                 - builds/releng_base_firefox.py
                 - builds/taskcluster_base_windows.py
                 - builds/taskcluster_base_win64.py
                 - builds/taskcluster_sub_win64/searchfox_debug.py
             tooltool-downloads: internal
-            extra-config:
-                "tooltool_servers": ['http://taskcluster/tooltool.mozilla-releng.net/']
-                'tooltool_url': 'http://taskcluster/tooltool.mozilla-releng.net/'
         fetches:
             toolchain:
                 - win64-clang-cl
                 - win64-node
                 - win64-rust
                 - win64-cbindgen
                 - win64-nasm
 
--- a/taskcluster/ci/static-analysis-autotest/kind.yml
+++ b/taskcluster/ci/static-analysis-autotest/kind.yml
@@ -79,18 +79,16 @@ jobs:
             config:
                 - builds/releng_base_firefox.py
                 - builds/taskcluster_base_windows.py
                 - builds/taskcluster_base_win64.py
                 - builds/taskcluster_sub_win64/debug.py
             tooltool-downloads: internal
             extra-config:
                 mozconfig_variant: debug
-                "tooltool_servers": ['http://taskcluster/tooltool.mozilla-releng.net/']
-                'tooltool_url': 'http://taskcluster/tooltool.mozilla-releng.net/'
         fetches:
             toolchain:
                 - win64-clang-cl
                 - win64-rust
                 - win64-sccache
                 - win64-cbindgen
                 - win64-clang-tidy
                 - win64-nasm
--- a/taskcluster/scripts/builder/sm-tooltool-config.sh
+++ b/taskcluster/scripts/builder/sm-tooltool-config.sh
@@ -1,13 +1,12 @@
 #!/bin/bash
 
 set -x
 
-TOOLTOOL_SERVER=${TOOLTOOL_SERVER:-https://tooltool.mozilla-releng.net/}
 SPIDERMONKEY_VARIANT=${SPIDERMONKEY_VARIANT:-plain}
 UPLOAD_DIR=${UPLOAD_DIR:-$HOME/artifacts/}
 WORK=${WORK:-$HOME/workspace}
 SRCDIR=${SRCDIR:-$GECKO_PATH}
 
 export TOOLTOOL_CHECKOUT=${TOOLTOOL_CHECKOUT:-$WORK}
 
 ( # Create scope for set -e
@@ -52,17 +51,17 @@ if [ -e "$TOOLTOOL_AUTH_FILE" ]; then
     TOOLTOOL_AUTH_FLAGS="--authentication-file=$TOOLTOOL_AUTH_FILE"
 fi
 
 # Install everything needed for the browser on this platform. Not all of it is
 # necessary for the JS shell, but it's less duplication to share tooltool
 # manifests.
 BROWSER_PLATFORM=$PLATFORM_OS$BITS
 
-(cd $TOOLTOOL_CHECKOUT && ${SRCDIR}/mach artifact toolchain${TOOLTOOL_MANIFEST:+ -v $TOOLTOOL_AUTH_FLAGS --tooltool-url $TOOLTOOL_SERVER --tooltool-manifest $SRCDIR/$TOOLTOOL_MANIFEST}${TOOLTOOL_CACHE:+ --cache-dir $TOOLTOOL_CACHE}${MOZ_TOOLCHAINS:+ ${MOZ_TOOLCHAINS}})
+(cd $TOOLTOOL_CHECKOUT && ${SRCDIR}/mach artifact toolchain${TOOLTOOL_MANIFEST:+ -v $TOOLTOOL_AUTH_FLAGS --tooltool-manifest $SRCDIR/$TOOLTOOL_MANIFEST}${TOOLTOOL_CACHE:+ --cache-dir $TOOLTOOL_CACHE}${MOZ_TOOLCHAINS:+ ${MOZ_TOOLCHAINS}})
 
 ) || exit 1 # end of set -e scope
 
 # Add all the fetches and tooltool binaries to our $PATH.
 for bin in $MOZ_FETCHES_DIR/*/bin $TOOLTOOL_CHECKOUT/VC/bin/Hostx64/x86; do
     if [ ! -d "$bin" ]; then
         continue
     fi
--- a/taskcluster/scripts/misc/tooltool-download.sh
+++ b/taskcluster/scripts/misc/tooltool-download.sh
@@ -13,21 +13,16 @@ esac
 
 TOOLTOOL_DL_FLAGS=
 
 if [ -e "$TOOLTOOL_AUTH_FILE" ]; then
     # When the worker has the relengapi token pass it down
     TOOLTOOL_DL_FLAGS="${TOOLTOOL_DL_FLAGS=} --authentication-file=$TOOLTOOL_AUTH_FILE"
 fi
 
-if [ -n "$TASKCLUSTER_PROXY_URL" ]; then
-    # When the worker has the relengapi proxy setup, use it.
-    TOOLTOOL_DL_FLAGS="${TOOLTOOL_DL_FLAGS=} --tooltool-url=${TASKCLUSTER_PROXY_URL}/tooltool.mozilla-releng.net/"
-fi
-
 if [ -n "$UPLOAD_DIR" ]; then
     TOOLTOOL_DL_FLAGS="${TOOLTOOL_DL_FLAGS=} --artifact-manifest $UPLOAD_DIR/toolchains.json"
 fi
 
 : TOOLTOOL_CACHE                ${TOOLTOOL_CACHE:=/builds/worker/tooltool-cache}
 export TOOLTOOL_CACHE
 
 if [ -n "$MOZ_TOOLCHAINS" ]; then
--- a/testing/mozharness/configs/android/android_common.py
+++ b/testing/mozharness/configs/android/android_common.py
@@ -38,17 +38,16 @@ config = {
         'start-emulator',
         'download-and-extract',
         'create-virtualenv',
         'verify-device',
         'install',
         'run-tests',
     ],
     "tooltool_cache": os.environ.get("TOOLTOOL_CACHE"),
-    "tooltool_servers": ['http://taskcluster/tooltool.mozilla-releng.net/'],
     "hostutils_manifest_path": "testing/config/tooltool-manifests/linux64/hostutils.manifest",
     "avds_dir": "/builds/worker/workspace/build/.android",
     # "log_format": "%(levelname)8s - %(message)s",
     "log_tbpl_level": "info",
     "log_raw_level": "info",
     "minidump_stackwalk_path": "linux64-minidump_stackwalk",
     # To take device screenshots at timed intervals (each time in seconds, relative
     # to the start of the run-tests step) specify screenshot_times. For example, to
--- a/testing/mozharness/configs/android/android_hw.py
+++ b/testing/mozharness/configs/android/android_hw.py
@@ -17,12 +17,11 @@ config = {
         'verify-device',
         'install',
         'run-tests',
     ],
     "tooltool_cache": "/builds/tooltool_cache",
     # from android_common.py
     "download_tooltool": True,
     "minidump_stackwalk_path": "linux64-minidump_stackwalk",
-    "tooltool_servers": ['https://tooltool.mozilla-releng.net/'],
     "minidump_tooltool_manifest_path": "config/tooltool-manifests/linux64/releng.manifest",
     "xpcshell_extra": "--remoteTestRoot=/data/local/tests",
 }
--- a/testing/mozharness/configs/android/wrench.py
+++ b/testing/mozharness/configs/android/wrench.py
@@ -1,16 +1,15 @@
 # mozharness configuration for Android x86 7.0 unit tests
 #
 # This configuration should be combined with suite definitions and other
 # mozharness configuration from android_common.py, or similar.
 
 config = {
     "tooltool_manifest_path": "testing/config/tooltool-manifests/androidx86_7_0/releng.manifest",
-    "tooltool_servers": ['http://taskcluster/tooltool.mozilla-releng.net/'],
     "emulator_manifest": """
         [
         {
             "algorithm": "sha512",
             "visibility": "internal",
             "filename": "android-sdk_r29.2.1.0-linux-x86emu.tar.gz",
             "unpack": true,
             "digest": "4014389d2e0c6889edf89a714e4defbd42c2bced79eee1cce726a9b2c921c6d857723f918a9f1b7dca35b9f8d6cbfdf6b47d2934d800bdd396bf5c17ada3b827",
--- a/testing/mozharness/configs/builds/build_pool_specifics.py
+++ b/testing/mozharness/configs/builds/build_pool_specifics.py
@@ -1,13 +1,10 @@
 # this is a dict of pool specific keys/values. As this fills up and more
 # fx build factories are ported, we might deal with this differently
 
 config = {
     "taskcluster": {
-        # use the relengapi proxy to talk to tooltool
-        "tooltool_servers": ['http://taskcluster/tooltool.mozilla-releng.net/'],
-        "tooltool_url": 'http://taskcluster/tooltool.mozilla-releng.net/',
         'upload_env': {
             'UPLOAD_PATH': '/builds/worker/artifacts',
         },
     },
 }
--- a/testing/mozharness/configs/openh264/macosx64.py
+++ b/testing/mozharness/configs/openh264/macosx64.py
@@ -27,11 +27,9 @@ config = {
         'LDFLAGS': ('-target x86_64-apple-darwin '
                     '-B {MOZ_FETCHES_DIR}/cctools/bin '
                     '-isysroot %(abs_work_dir)s/src/MacOSX10.11.sdk '
                     '-mmacosx-version-min=10.11'
                      .format(MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR'])),
         'PATH': ('{MOZ_FETCHES_DIR}/clang/bin/:%(PATH)s'
                  .format(MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR'])),
     },
-    "tooltool_servers": ['http://taskcluster/tooltool.mozilla-releng.net/'],
-    "tooltool_url": 'http://taskcluster/tooltool.mozilla-releng.net/',
 }
--- a/testing/mozharness/configs/raptor/android_hw_config.py
+++ b/testing/mozharness/configs/raptor/android_hw_config.py
@@ -10,16 +10,15 @@ config = {
         "install-chromium-distribution",
         "create-virtualenv",
         "install",
         "run-tests",
     ],
     "tooltool_cache": "/builds/tooltool_cache",
     "download_tooltool": True,
     "minidump_stackwalk_path": "linux64-minidump_stackwalk",
-    "tooltool_servers": ['https://tooltool.mozilla-releng.net/'],
     "minidump_tooltool_manifest_path": "config/tooltool-manifests/linux64/releng.manifest",
     "hostutils_manifest_path": "testing/config/tooltool-manifests/linux64/hostutils.manifest",
 }
 
 # raptor will pick these up in mitmproxy.py, doesn't use the mozharness config
 os.environ['TOOLTOOLCACHE'] = config['tooltool_cache']
 os.environ['HOSTUTILS_MANIFEST_PATH'] = config['hostutils_manifest_path']
--- a/testing/mozharness/configs/repackage/linux32_signed.py
+++ b/testing/mozharness/configs/repackage/linux32_signed.py
@@ -1,13 +1,12 @@
 import os
 
 platform = "linux32"
 
 config = {
     "locale": os.environ.get("LOCALE"),
 
     # ToolTool
-    "tooltool_url": 'http://taskcluster/tooltool.mozilla-releng.net/',
     'tooltool_cache': os.environ.get('TOOLTOOL_CACHE'),
 
     'run_configure': False,
 }
--- a/testing/mozharness/configs/repackage/linux64_signed.py
+++ b/testing/mozharness/configs/repackage/linux64_signed.py
@@ -1,13 +1,12 @@
 import os
 
 platform = "linux64"
 
 config = {
     "locale": os.environ.get("LOCALE"),
 
     # ToolTool
-    "tooltool_url": 'http://taskcluster/tooltool.mozilla-releng.net/',
     'tooltool_cache': os.environ.get('TOOLTOOL_CACHE'),
 
     'run_configure': False,
 }
--- a/testing/mozharness/configs/repackage/osx_partner.py
+++ b/testing/mozharness/configs/repackage/osx_partner.py
@@ -1,11 +1,10 @@
 import os
 
 config = {
     "src_mozconfig": "browser/config/mozconfigs/macosx64/repack",
 
     "repack_id": os.environ.get("REPACK_ID"),
 
     # ToolTool
-    "tooltool_url": 'http://taskcluster/tooltool.mozilla-releng.net/',
     'tooltool_cache': os.environ.get('TOOLTOOL_CACHE'),
 }
--- a/testing/mozharness/configs/repackage/osx_signed.py
+++ b/testing/mozharness/configs/repackage/osx_signed.py
@@ -1,11 +1,10 @@
 import os
 
 config = {
     "src_mozconfig": "browser/config/mozconfigs/macosx64/repack",
 
     "locale": os.environ.get("LOCALE"),
 
     # ToolTool
-    "tooltool_url": 'http://taskcluster/tooltool.mozilla-releng.net/',
     'tooltool_cache': os.environ.get('TOOLTOOL_CACHE'),
 }
--- a/testing/mozharness/configs/repackage/win32_partner.py
+++ b/testing/mozharness/configs/repackage/win32_partner.py
@@ -1,14 +1,13 @@
 import os
 
 platform = "win32"
 
 config = {
     "repack_id": os.environ.get("REPACK_ID"),
 
-    'tooltool_url': 'https://tooltool.mozilla-releng.net/',
     'run_configure': False,
 
     'env': {
         'PATH': "%(abs_input_dir)s/upx/bin:%(PATH)s",
     }
 }
--- a/testing/mozharness/configs/repackage/win64_partner.py
+++ b/testing/mozharness/configs/repackage/win64_partner.py
@@ -1,14 +1,13 @@
 import os
 
 platform = "win64"
 
 config = {
     "repack_id": os.environ.get("REPACK_ID"),
 
-    'tooltool_url': 'https://tooltool.mozilla-releng.net/',
     'run_configure': False,
 
     'env': {
         'PATH': "%(abs_input_dir)s/upx/bin:%(PATH)s",
     }
 }
--- a/testing/mozharness/configs/single_locale/tc_android-api-16.py
+++ b/testing/mozharness/configs/single_locale/tc_android-api-16.py
@@ -10,17 +10,16 @@ config = {
 
     'vcs_share_base': "/builds/hg-shared",
 
     "mozconfig": "src/mobile/android/config/mozconfigs/android-api-16/l10n-nightly",
     "tooltool_config": {
         "manifest": "mobile/android/config/tooltool-manifests/android/releng.manifest",
         "output_dir": "%(abs_work_dir)s/src",
     },
-    "tooltool_servers": ['http://taskcluster/tooltool.mozilla-releng.net/'],
 
     "upload_env": {
         'UPLOAD_PATH': '/builds/worker/artifacts/',
     },
     'secret_files': [
         {'filename': '/builds/gls-gapi.data',
          'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/gls-gapi.data',
          'min_scm_level': 1},
--- a/testing/mozharness/configs/single_locale/tc_macosx64.py
+++ b/testing/mozharness/configs/single_locale/tc_macosx64.py
@@ -8,13 +8,11 @@ config = {
         "DIST": "%(abs_objdir)s",
         "L10NBASEDIR": "../../l10n",
         'TOOLTOOL_CACHE': os.environ.get('TOOLTOOL_CACHE'),
     },
     "upload_env": {
         'UPLOAD_PATH': '/builds/worker/artifacts/',
     },
 
-    "tooltool_url": 'http://taskcluster/tooltool.mozilla-releng.net/',
-
     "vcs_share_base": "/builds/hg-shared",
 }
 
--- a/testing/mozharness/configs/single_locale/tc_win32.py
+++ b/testing/mozharness/configs/single_locale/tc_win32.py
@@ -10,15 +10,14 @@ config = {
         "L10NBASEDIR": "../../l10n",
         'TOOLTOOL_CACHE': os.environ.get('TOOLTOOL_CACHE', 'c:/builds/tooltool_cache'),
         'EN_US_PACKAGE_NAME': 'target.zip',
     },
     "upload_env": {
         'UPLOAD_PATH': os.path.join(os.getcwd(), 'public', 'build'),
     },
 
-    "tooltool_url": 'https://tooltool.mozilla-releng.net/',
     'tooltool_manifest_src': "browser/config/tooltool-manifests/win32/releng.manifest",
 
     # use mozmake?
     "enable_mozmake": True,
     'exes': {}
 }
--- a/testing/mozharness/configs/single_locale/tc_win64.py
+++ b/testing/mozharness/configs/single_locale/tc_win64.py
@@ -10,16 +10,15 @@ config = {
         "L10NBASEDIR": "../../l10n",
         'TOOLTOOL_CACHE': os.environ.get('TOOLTOOL_CACHE', 'c:/builds/tooltool_cache'),
         'EN_US_PACKAGE_NAME': 'target.zip',
     },
     "upload_env": {
         'UPLOAD_PATH': os.path.join(os.getcwd(), 'public', 'build'),
     },
 
-    "tooltool_url": 'https://tooltool.mozilla-releng.net/',
     'tooltool_manifest_src': "browser/config/tooltool-manifests/win64/releng.manifest",
 
     # use mozmake?
     "enable_mozmake": True,
     'exes': {},
 }
 
--- a/testing/mozharness/configs/web_platform_tests/prod_config_android.py
+++ b/testing/mozharness/configs/web_platform_tests/prod_config_android.py
@@ -20,10 +20,9 @@ config = {
     "binary_path": "/tmp",
     "geckodriver": "%(abs_test_bin_dir)s/geckodriver",
     "hostutils_manifest_path": "testing/config/tooltool-manifests/linux64/hostutils.manifest",
     "log_tbpl_level": "info",
     "log_raw_level": "info",
     "minidump_stackwalk_path": "linux64-minidump_stackwalk",
     "per_test_category": "web-platform",
     "tooltool_cache": os.environ.get("TOOLTOOL_CACHE"),
-    "tooltool_servers": ['http://taskcluster/tooltool.mozilla-releng.net/'],
 }
--- a/testing/mozharness/external_tools/tooltool.py
+++ b/testing/mozharness/external_tools/tooltool.py
@@ -1273,25 +1273,28 @@ def main(argv, _skip_logging=False):
                       dest='message')
     parser.add_option('--authentication-file',
                       help='Use the RelengAPI token found in the given file to '
                            'authenticate to the RelengAPI server.',
                       dest='auth_file')
 
     (options_obj, args) = parser.parse_args(argv[1:])
 
-    # default the options list if not provided
-    if not options_obj.base_url:
-        options_obj.base_url = ['https://tooltool.mozilla-releng.net/']
+
+    tooltool_host = os.environ.get('TOOLTOOL_HOST', 'tooltool.mozilla-releng.net')
+    taskcluster_proxy_url = os.environ.get('TASKCLUSTER_PROXY_URL')
+    if taskcluster_proxy_url:
+        tooltool_url = '{}/{}'.format(taskcluster_proxy_url, tooltool_host)
+    else:
+        tooltool_url = 'https://{}'.format(tooltool_host)
 
     # ensure all URLs have a trailing slash
     def add_slash(url):
         return url if url.endswith('/') else (url + '/')
-    options_obj.base_url = [add_slash(u) for u in options_obj.base_url]
-
+    options_obj.base_url = [add_slash(tooltool_url)]
     # expand ~ in --authentication-file
     if options_obj.auth_file:
         options_obj.auth_file = os.path.expanduser(options_obj.auth_file)
 
     # Dictionaries are easier to work with
     options = vars(options_obj)
 
     log.setLevel(options['loglevel'])
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -591,43 +591,16 @@ items from that key's value."
                   'config files used, run script as before but extend options '
                   'with "--dump-config"')
         self.info('For a diff of where self.config got its items, '
                   'run the script again as before but extend options with: '
                   '"--dump-config-hierarchy"')
         self.info("Both --dump-config and --dump-config-hierarchy don't "
                   "actually run any actions.")
 
-    def _assert_cfg_valid_for_action(self, dependencies, action):
-        """ assert dependency keys are in config for given action.
-
-        Takes a list of dependencies and ensures that each have an
-        assoctiated key in the config. Displays error messages as
-        appropriate.
-
-        """
-        # TODO add type and value checking, not just keys
-        # TODO solution should adhere to: bug 699343
-        # TODO add this to BaseScript when the above is done
-        # for now, let's just use this as a way to save typing...
-        c = self.config
-        undetermined_keys = []
-        err_template = "The key '%s' could not be determined \
-and is needed for the action '%s'. Please add this to your config \
-or run without that action (ie: --no-{action})"
-        for dep in dependencies:
-            if dep not in c:
-                undetermined_keys.append(dep)
-        if undetermined_keys:
-            fatal_msgs = [err_template % (key, action)
-                          for key in undetermined_keys]
-            self.fatal("".join(fatal_msgs))
-        # otherwise:
-        return  # all good
-
     def _query_build_prop_from_app_ini(self, prop, app_ini_path=None):
         dirs = self.query_abs_dirs()
         print_conf_setting_path = os.path.join(dirs['abs_src_dir'],
                                                'config',
                                                'printconfigsetting.py')
         if not app_ini_path:
             # set the default
             app_ini_path = dirs['abs_app_ini_path']
@@ -776,20 +749,16 @@ or run without that action (ie: --no-{ac
         # necessary.
         if os.path.exists(fn):
             return fn
 
     def _run_tooltool(self):
         env = self.query_build_env()
         env.update(self.query_mach_build_env())
 
-        self._assert_cfg_valid_for_action(
-            ['tooltool_url'],
-            'build'
-        )
         c = self.config
         dirs = self.query_abs_dirs()
         toolchains = os.environ.get('MOZ_TOOLCHAINS')
         manifest_src = os.environ.get('TOOLTOOL_MANIFEST')
         if not manifest_src:
             manifest_src = c.get('tooltool_manifest_src')
         if not manifest_src and not toolchains:
             return self.warning(ERROR_MSGS['tooltool_manifest_undetermined'])
@@ -802,18 +771,16 @@ or run without that action (ie: --no-{ac
             '--retry', '4',
             '--artifact-manifest',
             os.path.join(dirs['abs_src_dir'], 'toolchains.json'),
         ]
         if manifest_src:
             cmd.extend([
                 '--tooltool-manifest',
                 os.path.join(dirs['abs_src_dir'], manifest_src),
-                '--tooltool-url',
-                c['tooltool_url'],
             ])
             auth_file = self._get_tooltool_auth_file()
             if auth_file:
                 cmd.extend(['--authentication-file', auth_file])
         cache = c['env'].get('TOOLTOOL_CACHE')
         if cache:
             cmd.extend(['--cache-dir', cache])
         if toolchains:
--- a/testing/mozharness/mozharness/mozilla/tooltool.py
+++ b/testing/mozharness/mozharness/mozilla/tooltool.py
@@ -5,29 +5,25 @@ import sys
 from mozharness.base.errors import PythonErrorList
 from mozharness.base.log import ERROR, FATAL
 
 TooltoolErrorList = PythonErrorList + [{
     'substr': 'ERROR - ', 'level': ERROR
 }]
 
 
-TOOLTOOL_SERVERS = [
-    'https://tooltool.mozilla-releng.net/',
-]
-
 _here = os.path.abspath(os.path.dirname(__file__))
 _external_tools_path = os.path.normpath(os.path.join(_here, '..', '..',
                                                      'external_tools'))
 
 
 class TooltoolMixin(object):
     """Mixin class for handling tooltool manifests.
-    To use a tooltool server other than the Mozilla server, override
-    config['tooltool_servers'].  To specify a different authentication
+    To use a tooltool server other than the Mozilla server, set
+    TOOLTOOL_HOST in the environment.  To specify a different authentication
     file than that used in releng automation,override
     config['tooltool_authentication_file']; set it to None to not pass
     any authentication information (OK for public files)
     """
     def _get_auth_file(self):
         # set the default authentication file based on platform; this
         # corresponds to where puppet puts the token
         if 'tooltool_authentication_file' in self.config:
@@ -62,27 +58,16 @@ class TooltoolMixin(object):
                 '-v',
             ]
         else:
             cmd = [
                 sys.executable, '-u',
                 os.path.join(_external_tools_path, 'tooltool.py'),
             ]
 
-        # get the tooltool servers from configuration
-        default_urls = self.config.get('tooltool_servers', TOOLTOOL_SERVERS)
-
-        # add slashes (bug 1155630)
-        def add_slash(url):
-            return url if url.endswith('/') else (url + '/')
-        default_urls = [add_slash(u) for u in default_urls]
-
-        for url in default_urls:
-            cmd.extend(['--tooltool-url' if self.topsrcdir else '--url', url])
-
         # handle authentication file, if given
         auth_file = self._get_auth_file()
         if auth_file and os.path.exists(auth_file):
             cmd.extend(['--authentication-file', auth_file])
 
         if self.topsrcdir:
             cmd.extend(['--tooltool-manifest', manifest])
             cmd.extend(['--artifact-manifest',
--- a/testing/mozharness/scripts/desktop_l10n.py
+++ b/testing/mozharness/scripts/desktop_l10n.py
@@ -460,18 +460,16 @@ class DesktopSingleLocale(LocalesMixin, 
             '--retry', '4',
             '--artifact-manifest',
             os.path.join(dirs['abs_mozilla_dir'], 'toolchains.json'),
         ]
         if manifest_src:
             cmd.extend([
                 '--tooltool-manifest',
                 os.path.join(dirs['abs_mozilla_dir'], manifest_src),
-                '--tooltool-url',
-                config['tooltool_url'],
             ])
             auth_file = self._get_tooltool_auth_file()
             if auth_file and os.path.exists(auth_file):
                 cmd.extend(['--authentication-file', auth_file])
         cache = config['bootstrap_env'].get('TOOLTOOL_CACHE')
         if cache:
             cmd.extend(['--cache-dir', cache])
         if toolchains:
--- a/testing/mozharness/scripts/fx_desktop_build.py
+++ b/testing/mozharness/scripts/fx_desktop_build.py
@@ -47,17 +47,16 @@ class FxDesktopBuild(BuildScript, TryToo
                 # nightly stuff
                 "nightly_build": False,
                 # hg tool stuff
                 "tools_repo": "https://hg.mozilla.org/build/tools",
                 # Seed all clones with mozilla-unified. This ensures subsequent
                 # jobs have a minimal `hg pull`.
                 "clone_upstream_url": "https://hg.mozilla.org/mozilla-unified",
                 "repo_base": "https://hg.mozilla.org",
-                'tooltool_url': 'https://tooltool.mozilla-releng.net/',
                 "graph_selector": "/server/collect.cgi",
                 # only used for make uploadsymbols
                 'old_packages': [
                     "%(objdir)s/dist/firefox-*",
                     "%(objdir)s/dist/fennec*",
                     "%(objdir)s/dist/seamonkey*",
                     "%(objdir)s/dist/thunderbird*",
                     "%(objdir)s/dist/install/sea/*.exe"
--- a/testing/mozharness/scripts/repackage.py
+++ b/testing/mozharness/scripts/repackage.py
@@ -115,18 +115,16 @@ class Repackage(BaseScript):
             '--retry', '4',
             '--artifact-manifest',
             os.path.join(dirs['abs_mozilla_dir'], 'toolchains.json'),
         ]
         if manifest_src:
             cmd.extend([
                 '--tooltool-manifest',
                 os.path.join(dirs['abs_mozilla_dir'], manifest_src),
-                '--tooltool-url',
-                config['tooltool_url'],
             ])
             auth_file = self._get_tooltool_auth_file()
             if auth_file:
                 cmd.extend(['--authentication-file', auth_file])
         cache = config.get('tooltool_cache')
         if cache:
             cmd.extend(['--cache-dir', cache])
         if toolchains:
--- a/tools/lint/eslint/update.sh
+++ b/tools/lint/eslint/update.sh
@@ -51,20 +51,20 @@ echo "Installing eslint and external plu
 # access to make changes.
 npm install
 
 echo "Creating eslint.tar.gz..."
 tar cvz --exclude=eslint-plugin-mozilla --exclude=eslint-plugin-spidermonkey-js -f eslint.tar.gz node_modules
 
 echo "Adding eslint.tar.gz to tooltool..."
 rm tools/lint/eslint/manifest.tt
-./python/mozbuild/mozbuild/action/tooltool.py add --visibility public --unpack eslint.tar.gz --url="https://tooltool.mozilla-releng.net/"
+./python/mozbuild/mozbuild/action/tooltool.py add --visibility public --unpack eslint.tar.gz
 
 echo "Uploading eslint.tar.gz to tooltool..."
-./python/mozbuild/mozbuild/action/tooltool.py upload --authentication-file=~/.tooltool-token --message "node_modules folder update for tools/lint/eslint" --url="https://tooltool.mozilla-releng.net/"
+./python/mozbuild/mozbuild/action/tooltool.py upload --authentication-file=~/.tooltool-token --message "node_modules folder update for tools/lint/eslint"
 
 echo "Cleaning up..."
 mv manifest.tt tools/lint/eslint/manifest.tt
 rm eslint.tar.gz
 
 cd $DIR
 
 echo ""