mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1383880: add only-if-dependencies-run optimization for follow-ons; r=ahal
MozReview-Commit-ID: JuhwyQIx3Mh --HG-- extra : rebase_source : ea02aed4d2f716315c3e51553c3a0d19d40d7679
This commit is contained in:
parent
aa0f008926
commit
cb543f8ecc
@ -31,5 +31,7 @@ job-template:
|
||||
command: >
|
||||
cd /builds/worker/checkouts/gecko &&
|
||||
./mach python build/upload_generated_sources.py ${ARTIFACT_URL}
|
||||
optimization:
|
||||
only-if-dependencies-run: null
|
||||
scopes:
|
||||
- secrets:get:project/releng/gecko/build/level-{level}/gecko-generated-sources-upload
|
||||
|
@ -43,5 +43,7 @@ job-template:
|
||||
GECKO_HEAD_REPOSITORY: # see transforms
|
||||
GECKO_HEAD_REV: # see transforms
|
||||
ARTIFACT_TASKID: {"task-reference": "<build>"}
|
||||
optimization:
|
||||
only-if-dependencies-run: null
|
||||
scopes:
|
||||
- docker-worker:image:taskclusterprivate/upload_symbols:0.0.4
|
||||
|
@ -77,6 +77,7 @@ def _make_default_strategies():
|
||||
'skip-unless-changed': SkipUnlessChanged(),
|
||||
'skip-unless-schedules': SkipUnlessSchedules(),
|
||||
'skip-unless-schedules-or-seta': Either(SkipUnlessSchedules(), SETA()),
|
||||
'only-if-dependencies-run': OnlyIfDependenciesRun(),
|
||||
}
|
||||
|
||||
|
||||
@ -281,6 +282,18 @@ class Either(OptimizationStrategy):
|
||||
lambda sub, arg: sub.should_replace_task(task, params, arg))
|
||||
|
||||
|
||||
class OnlyIfDependenciesRun(OptimizationStrategy):
|
||||
"""Run this taks only if its dependencies run."""
|
||||
|
||||
# This takes advantage of the behavior of the second phase of optimization:
|
||||
# a task can only be replaced if it has no un-optimized dependencies. So if
|
||||
# should_replace_task is called, then a task has no un-optimized
|
||||
# dependencies and can be removed (indicated by returning True)
|
||||
|
||||
def should_replace_task(self, task, params, arg):
|
||||
return True
|
||||
|
||||
|
||||
class IndexSearch(OptimizationStrategy):
|
||||
def should_remove_task(self, task, params, index_paths):
|
||||
"If this task has no dependencies, don't run it.."
|
||||
|
@ -164,6 +164,9 @@ task_description_schema = Schema({
|
||||
{'skip-unless-schedules': list(schedules.ALL_COMPONENTS)},
|
||||
# skip if SETA or skip-unless-schedules says to
|
||||
{'skip-unless-schedules-or-seta': list(schedules.ALL_COMPONENTS)},
|
||||
# only run this task if its dependencies will run (useful for follow-on tasks that
|
||||
# are unnecessary if the parent tasks are not run)
|
||||
{'only-if-dependencies-run': None}
|
||||
),
|
||||
|
||||
# the provisioner-id/worker-type for the task. The following parameters will
|
||||
|
Loading…
Reference in New Issue
Block a user