author | Tom Prince <mozilla@hocat.ca> |
Mon, 16 Apr 2018 20:43:50 -0600 | |
changeset 414564 | e2a4ff5c10f6e3104fe0ec39a34537bad222be80 |
parent 414563 | fc930141faf9f34e2c951da7582c01054807c14c |
child 414565 | dd7db84b4f1123552e46e4d68bd806485f26e7c4 |
push id | 33871 |
push user | csabou@mozilla.com |
push date | Thu, 19 Apr 2018 22:30:08 +0000 |
treeherder | mozilla-central@5d73549d363f [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | Callek |
bugs | 1442545 |
milestone | 61.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
|
--- a/taskcluster/taskgraph/util/taskcluster.py +++ b/taskcluster/taskgraph/util/taskcluster.py @@ -11,19 +11,22 @@ import functools import yaml import requests import logging from mozbuild.util import memoize from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter from taskgraph.task import Task -_TC_ARTIFACT_LOCATION = \ +_PUBLIC_TC_ARTIFACT_LOCATION = \ 'https://queue.taskcluster.net/v1/task/{task_id}/artifacts/{artifact_prefix}/{postfix}' +_PRIVATE_TC_ARTIFACT_LOCATION = \ + 'http://taskcluster/queue/v1/task/{task_id}/artifacts/{artifact_prefix}/{postfix}' + logger = logging.getLogger(__name__) # this is set to true for `mach taskgraph action-callback --test` testing = False @memoize def get_session(): @@ -172,19 +175,22 @@ def cancel_task(task_id, use_proxy=False logger.info('Would have cancelled {}.'.format(task_id)) else: _do_request(get_task_url(task_id, use_proxy) + '/cancel', json={}) def status_task(task_id, use_proxy=False): """Gets the status of a task given a task_id. In testing mode, just logs that it would have retrieved status.""" - resp = _do_request(get_task_url(task_id, use_proxy) + '/status') - status = resp.json().get("status", {}).get('state') or 'unknown' - return status + if testing: + logger.info('Would have gotten status for {}.'.format(task_id)) + else: + resp = _do_request(get_task_url(task_id, use_proxy) + '/status') + status = resp.json().get("status", {}).get('state') or 'unknown' + return status def rerun_task(task_id): """Reruns a task given a task_id. In testing mode, just logs that it would have reran.""" if testing: logger.info('Would have rerun {}.'.format(task_id)) else: @@ -204,17 +210,21 @@ def purge_cache(provisioner_id, worker_t if testing: logger.info('Would have purged {}/{}/{}.'.format(provisioner_id, worker_type, cache_name)) else: logger.info('Purging {}/{}/{}.'.format(provisioner_id, worker_type, cache_name)) purge_cache_url = get_purge_cache_url(provisioner_id, worker_type, use_proxy) _do_request(purge_cache_url, json={'cacheName': cache_name}) -def get_taskcluster_artifact_prefix(task, task_id, postfix='', locale=None): +def get_taskcluster_artifact_prefix(task, task_id, postfix='', locale=None, force_private=False): if locale: postfix = '{}/{}'.format(locale, postfix) artifact_prefix = get_artifact_prefix(task) + if artifact_prefix == 'public/build' and not force_private: + tmpl = _PUBLIC_TC_ARTIFACT_LOCATION + else: + tmpl = _PRIVATE_TC_ARTIFACT_LOCATION - return _TC_ARTIFACT_LOCATION.format( + return tmpl.format( task_id=task_id, postfix=postfix, artifact_prefix=artifact_prefix )