Backed out changeset d8122277e9fd (bug 1341214) for causing on m-c problems in vp tc tasks
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 22 Feb 2017 15:33:42 +0100
changeset 373258 b06968288cff469814bf830aa90f1c84da490f61
parent 373257 a7b465111b2c5cdde91515b52c035b7c567fa7c4
child 373259 267a325cb2db1c1317ad86ed9432a54d10098180
child 373504 4069aff634580f3bd35c8dbc63a35a132212539c
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1341214
milestone54.0a1
backs outd8122277e9fd43b8f20ab31f25f184de54be8abc
Backed out changeset d8122277e9fd (bug 1341214) for causing on m-c problems in vp tc tasks
taskcluster/taskgraph/__init__.py
taskcluster/taskgraph/cron/__init__.py
taskcluster/taskgraph/decision.py
taskcluster/taskgraph/docker.py
taskcluster/taskgraph/filter_tasks.py
taskcluster/taskgraph/task/docker_image.py
taskcluster/taskgraph/taskgraph.py
taskcluster/taskgraph/transforms/job/toolchain.py
taskcluster/taskgraph/util/docker.py
--- a/taskcluster/taskgraph/__init__.py
+++ b/taskcluster/taskgraph/__init__.py
@@ -1,7 +0,0 @@
-# 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/.
-
-import os
-
-GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..'))
--- a/taskcluster/taskgraph/cron/__init__.py
+++ b/taskcluster/taskgraph/cron/__init__.py
@@ -16,28 +16,28 @@ import requests
 import yaml
 
 from . import decision, schema
 from .util import (
     match_utc,
     calculate_head_rev
 )
 from ..create import create_task
-from .. import GECKO
 from taskgraph.util.attributes import match_run_on_projects
 from taskgraph.util.schema import resolve_keyed_by
 
 # Functions to handle each `job.type` in `.cron.yml`.  These are called with
 # the contents of the `job` property from `.cron.yml` and should return a
 # sequence of (taskId, task) tuples which will subsequently be fed to
 # createTask.
 JOB_TYPES = {
     'decision-task': decision.run_decision_task,
 }
 
+GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..', '..'))
 logger = logging.getLogger(__name__)
 _session = None
 
 
 def get_session():
     global _session
     if not _session:
         _session = requests.Session()
--- a/taskcluster/taskgraph/decision.py
+++ b/taskcluster/taskgraph/decision.py
@@ -13,27 +13,27 @@ import re
 import time
 import yaml
 
 from .generator import TaskGraphGenerator
 from .create import create_tasks
 from .parameters import Parameters
 from .taskgraph import TaskGraph
 from actions import render_actions_json
-from . import GECKO
 
 from taskgraph.util.templates import Templates
 from taskgraph.util.time import (
     json_time_from_now,
     current_json_time,
 )
 
 logger = logging.getLogger(__name__)
 
 ARTIFACTS_DIR = 'artifacts'
+GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..'))
 
 # For each project, this gives a set of parameters specific to the project.
 # See `taskcluster/docs/parameters.rst` for information on parameters.
 PER_PROJECT_PARAMETERS = {
     'try': {
         'target_tasks_method': 'try_option_syntax',
         # Always perform optimization.  This makes it difficult to use try
         # pushes to run a task that would otherwise be optimized, but is a
--- a/taskcluster/taskgraph/docker.py
+++ b/taskcluster/taskgraph/docker.py
@@ -13,18 +13,18 @@ import subprocess
 import tarfile
 import tempfile
 import urllib2
 import which
 from subprocess import Popen, PIPE
 from io import BytesIO
 
 from taskgraph.util import docker
-from . import GECKO
 
+GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..'))
 INDEX_URL = 'https://index.taskcluster.net/v1/task/' + docker.INDEX_PREFIX + '.{}.{}.hash.{}'
 ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/{}'
 
 
 def load_image_by_name(image_name, tag=None):
     context_path = os.path.join(GECKO, 'taskcluster', 'docker', image_name)
     context_hash = docker.generate_context_hash(GECKO, context_path, image_name)
 
--- a/taskcluster/taskgraph/filter_tasks.py
+++ b/taskcluster/taskgraph/filter_tasks.py
@@ -1,22 +1,25 @@
 # 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/.
 
 from __future__ import absolute_import, unicode_literals
 
 import logging
+import os
 
 from . import (
     target_tasks,
 )
 
 logger = logging.getLogger(__name__)
 
+GECKO = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..'))
+
 filter_task_functions = {}
 
 
 def filter_task(name):
     """Generator to declare a task filter function."""
     def wrap(func):
         filter_task_functions[name] = func
         return func
--- a/taskcluster/taskgraph/task/docker_image.py
+++ b/taskcluster/taskgraph/task/docker_image.py
@@ -4,25 +4,25 @@
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 import logging
 import os
 import urllib2
 
 from . import base
-from .. import GECKO
 from taskgraph.util.docker import (
     docker_image,
     generate_context_hash,
     INDEX_PREFIX,
 )
 from taskgraph.util.templates import Templates
 
 logger = logging.getLogger(__name__)
+GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..', '..'))
 
 # if running in a task, prefer to use the taskcluster proxy (http://taskcluster/),
 # otherwise hit the services directly
 if os.environ.get('TASK_ID'):
     ARTIFACT_URL = 'http://taskcluster/queue/v1/task/{}/artifacts/{}'
 else:
     ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/{}'
 
--- a/taskcluster/taskgraph/taskgraph.py
+++ b/taskcluster/taskgraph/taskgraph.py
@@ -1,18 +1,21 @@
 # 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/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
+import os
+
 from .graph import Graph
 from .util.python_path import find_object
 
 TASKCLUSTER_QUEUE_URL = "https://queue.taskcluster.net/v1/task/"
+GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..'))
 
 
 class TaskGraph(object):
     """
     Representation of a task graph.
 
     A task graph is a combination of a Graph and a dictionary of tasks indexed
     by label.  TaskGraph instances should be treated as immutable.
--- a/taskcluster/taskgraph/transforms/job/toolchain.py
+++ b/taskcluster/taskgraph/transforms/job/toolchain.py
@@ -2,28 +2,30 @@
 # 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/.
 """
 Support for running toolchain-building jobs via dedicated scripts
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
 
+import os
+
 from voluptuous import Schema, Optional, Required, Any
 
 from taskgraph.transforms.job import run_job_using
 from taskgraph.transforms.job.common import (
     docker_worker_add_tc_vcs_cache,
     docker_worker_add_gecko_vcs_env_vars,
     docker_worker_support_vcs_checkout,
 )
 from taskgraph.util.hash import hash_paths
-from taskgraph import GECKO
 
 
+GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..', '..', '..'))
 TOOLCHAIN_INDEX = 'gecko.cache.level-{level}.toolchains.v1.{name}.{digest}'
 
 toolchain_run_schema = Schema({
     Required('using'): 'toolchain-script',
 
     # the script (in taskcluster/scripts/misc) to run
     Required('script'): basestring,
 
--- a/taskcluster/taskgraph/util/docker.py
+++ b/taskcluster/taskgraph/util/docker.py
@@ -9,19 +9,19 @@ import os
 import shutil
 import subprocess
 import tarfile
 import tempfile
 
 from mozpack.archive import (
     create_tar_gz_from_files,
 )
-from .. import GECKO
 
 
+GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..', '..'))
 IMAGE_DIR = os.path.join(GECKO, 'taskcluster', 'docker')
 INDEX_PREFIX = 'docker.images.v2'
 ARTIFACT_URL = 'https://queue.taskcluster.net/v1/task/{}/artifacts/{}'
 
 
 def docker_image(name, by_tag=False):
     '''
         Resolve in-tree prebuilt docker image to ``<registry>/<repository>@sha256:<digest>``,