diff --git a/taskcluster/taskgraph/transforms/job/__init__.py b/taskcluster/taskgraph/transforms/job/__init__.py index 1ccd3d0a3718..6b9466234187 100644 --- a/taskcluster/taskgraph/transforms/job/__init__.py +++ b/taskcluster/taskgraph/transforms/job/__init__.py @@ -350,8 +350,8 @@ def make_task_description(config, jobs): import_sibling_modules(exceptions=('common.py',)) for job in jobs: - # always-optimized tasks never execute, so have no workdir - if job['run']['using'] != 'always-optimized': + # only docker-worker uses a fixed absolute path to find directories + if job['worker']['implementation'] == 'docker-worker': job['run'].setdefault('workdir', '/builds/worker') taskdesc = copy.deepcopy(job) diff --git a/taskcluster/taskgraph/transforms/job/common.py b/taskcluster/taskgraph/transforms/job/common.py index 4de97faae077..b2381994a097 100644 --- a/taskcluster/taskgraph/transforms/job/common.py +++ b/taskcluster/taskgraph/transforms/job/common.py @@ -82,20 +82,21 @@ def support_vcs_checkout(config, job, taskdesc, sparse=False): is_mac = worker['os'] == 'macosx' is_win = worker['os'] == 'windows' is_linux = worker['os'] == 'linux' or 'linux-bitbar' + is_docker = worker['implementation'] == 'docker-worker' assert is_mac or is_win or is_linux if is_win: checkoutdir = './build' geckodir = '{}/src'.format(checkoutdir) hgstore = 'y:/hg-shared' - elif is_mac: - checkoutdir = './checkouts' - geckodir = '{}/gecko'.format(checkoutdir) - hgstore = '{}/hg-shared'.format(checkoutdir) - else: + elif is_docker: checkoutdir = '{workdir}/checkouts'.format(**job['run']) geckodir = '{}/gecko'.format(checkoutdir) hgstore = '{}/hg-store'.format(checkoutdir) + else: + checkoutdir = './checkouts' + geckodir = '{}/gecko'.format(checkoutdir) + hgstore = '{}/hg-shared'.format(checkoutdir) cache_name = 'checkouts' diff --git a/taskcluster/taskgraph/transforms/job/hazard.py b/taskcluster/taskgraph/transforms/job/hazard.py index b1bff519f0de..4e959e934286 100644 --- a/taskcluster/taskgraph/transforms/job/hazard.py +++ b/taskcluster/taskgraph/transforms/job/hazard.py @@ -38,7 +38,7 @@ haz_run_schema = Schema({ Optional('secrets'): Any(bool, [text_type]), # Base work directory used to set up the task. - Required('workdir'): text_type, + Optional('workdir'): text_type, }) diff --git a/taskcluster/taskgraph/transforms/job/mach.py b/taskcluster/taskgraph/transforms/job/mach.py index 64360c3adae4..36267a845335 100644 --- a/taskcluster/taskgraph/transforms/job/mach.py +++ b/taskcluster/taskgraph/transforms/job/mach.py @@ -30,7 +30,7 @@ mach_schema = Schema({ Required('comm-checkout'): bool, # Base work directory used to set up the task. - Required('workdir'): text_type, + Optional('workdir'): text_type, }) diff --git a/taskcluster/taskgraph/transforms/job/mozharness.py b/taskcluster/taskgraph/transforms/job/mozharness.py index fed92de1626c..62fc5702c7ca 100644 --- a/taskcluster/taskgraph/transforms/job/mozharness.py +++ b/taskcluster/taskgraph/transforms/job/mozharness.py @@ -116,7 +116,7 @@ mozharness_run_schema = Schema({ Required('comm-checkout'): bool, # Base work directory used to set up the task. - Required('workdir'): text_type, + Optional('workdir'): text_type, }) diff --git a/taskcluster/taskgraph/transforms/job/mozharness_test.py b/taskcluster/taskgraph/transforms/job/mozharness_test.py index 5c7ea7b5a695..e28698da5864 100644 --- a/taskcluster/taskgraph/transforms/job/mozharness_test.py +++ b/taskcluster/taskgraph/transforms/job/mozharness_test.py @@ -10,7 +10,7 @@ import re import six from six import text_type -from voluptuous import Required +from voluptuous import Required, Optional from taskgraph.util.taskcluster import get_artifact_url from taskgraph.transforms.job import ( @@ -50,7 +50,7 @@ mozharness_test_run_schema = Schema({ Required('using'): 'mozharness-test', Required('test'): test_description_schema, # Base work directory used to set up the task. - Required('workdir'): text_type, + Optional('workdir'): text_type, }) @@ -215,7 +215,6 @@ def mozharness_test_on_docker(config, job, taskdesc): @run_job_using('generic-worker', 'mozharness-test', schema=mozharness_test_run_schema) def mozharness_test_on_generic_worker(config, job, taskdesc): - run = job['run'] test = taskdesc['run']['test'] mozharness = test['mozharness'] worker = taskdesc['worker'] = job['worker'] @@ -406,7 +405,6 @@ def mozharness_test_on_generic_worker(config, job, taskdesc): }] job['run'] = { - 'workdir': run['workdir'], 'tooltool-downloads': mozharness['tooltool-downloads'], 'checkout': test['checkout'], 'command': mh_command, diff --git a/taskcluster/taskgraph/transforms/job/python_test.py b/taskcluster/taskgraph/transforms/job/python_test.py index adde3ba6b059..b84bfa107486 100644 --- a/taskcluster/taskgraph/transforms/job/python_test.py +++ b/taskcluster/taskgraph/transforms/job/python_test.py @@ -10,7 +10,7 @@ from __future__ import absolute_import, print_function, unicode_literals from six import text_type from taskgraph.transforms.job import run_job_using, configure_taskdesc_for_run from taskgraph.util.schema import Schema -from voluptuous import Required +from voluptuous import Required, Optional python_test_schema = Schema({ Required('using'): 'python-test', @@ -22,7 +22,7 @@ python_test_schema = Schema({ Required('subsuite'): text_type, # Base work directory used to set up the task. - Required('workdir'): text_type, + Optional('workdir'): text_type, }) diff --git a/taskcluster/taskgraph/transforms/job/run_task.py b/taskcluster/taskgraph/transforms/job/run_task.py index 5a9cd953fbe1..1fea81e2c64f 100644 --- a/taskcluster/taskgraph/transforms/job/run_task.py +++ b/taskcluster/taskgraph/transforms/job/run_task.py @@ -54,7 +54,7 @@ run_task_schema = Schema({ Required('command'): Any([taskref_or_string], taskref_or_string), # Base work directory used to set up the task. - Required('workdir'): text_type, + Optional('workdir'): text_type, # If not false, tooltool downloads will be enabled via relengAPIProxy # for either just public files, or all files. Only supported on diff --git a/taskcluster/taskgraph/transforms/job/spidermonkey.py b/taskcluster/taskgraph/transforms/job/spidermonkey.py index 8b007e7381e7..310c211941ce 100644 --- a/taskcluster/taskgraph/transforms/job/spidermonkey.py +++ b/taskcluster/taskgraph/transforms/job/spidermonkey.py @@ -29,7 +29,7 @@ sm_run_schema = Schema({ Optional('spidermonkey-platform'): text_type, # Base work directory used to set up the task. - Required('workdir'): text_type, + Optional('workdir'): text_type, Required('tooltool-downloads'): Any( False, diff --git a/taskcluster/taskgraph/transforms/job/toolchain.py b/taskcluster/taskgraph/transforms/job/toolchain.py index 42ac824a8cb8..abd9b53e099b 100644 --- a/taskcluster/taskgraph/transforms/job/toolchain.py +++ b/taskcluster/taskgraph/transforms/job/toolchain.py @@ -68,7 +68,7 @@ toolchain_run_schema = Schema({ ): text_type, # Base work directory used to set up the task. - Required('workdir'): text_type, + Optional('workdir'): text_type, })