-
-
Save jonasfj/d16a2d6edd6dc75f1599 to your computer and use it in GitHub Desktop.
Example task-graph.yml as it might look in-tree... Though we'll probably only have the single decision task there, and then have the decision task make all the other tasks...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build task-set as YAML file would look in-tree... this is instatitated by the decision task... if triggered | |
# Triggers are things that'll trigger the tasks in this file... | |
trigger: | |
# How this task is triggered by try-flags: | |
flags: # Require the following flags | |
build: # -b, as containing | |
- debug # d | |
platform: # AND -p, as containing either | |
- linux64 # linux64, OR | |
- all # all | |
# Example: 'try: -b d -p linux64,win32 -u none -t none' or 'try: -b d -p all -u none -t none' | |
# This makes me a little sad, as we'll need some parsing of try flags... but at least it'll | |
# possible to add new options that isn't included under 'all', and it would be possible to create | |
# "-p desktop" to build desktop platforms just by modifying in-tree configuration. I think that's | |
# a decent level of flexiblity to give people. We can always invent a new try-flag syntax that we | |
# can support in addition to what we otherwise have. | |
# Treeherder to which a commit trigger this task | |
projects: | |
- mozilla-central # always triggered for all commits to mozilla-central | |
- ... | |
# Name that can be used in dependsOn from other task-sets in-tree to trigger this task-set to be scheduled. | |
name: 'some-build-task-set' | |
# task-sets that needs to be triggered whenever this task-set is triggered. | |
# In fact most test tasks probably lives in a separate task-set and dependsOn the task-sets that contains | |
# required build-tasks... This way we don't need to replicated the "flags" and "projects" triggers in all task-sets. | |
# Note: most task-sets probably only contains one task. | |
dependsOn: | |
- ... # Identifier trigger.name | |
tasks: | |
- taskId: '{{ "build-task" | as-slugid }}' | |
task: | |
provisionerId: aws-provisioner | |
workerType: v2 | |
created: '{{ now }}' | |
deadline: '{{ "1 day 2 hours" | from-now }}' | |
payload: {} | |
metadata: | |
name: "TaskA: Build something TaskB" | |
description: | | |
Description of specific task... | |
owner: '{{ owner }}' | |
source: '{{ source }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"tasks": [ | |
{ | |
"taskId": "apTc63YtR82hWFcvyeKz_w", | |
"task": { | |
"provisionerId": "aws-provisioner", | |
"workerType": "v2", | |
"created": "2014-09-20T00:01:53.761Z", | |
"deadline": "2014-09-21T02:01:53.762Z", | |
"payload": { | |
"image": "quay.io/mozilla/decider:v3", | |
"command": [ | |
"/bin/decide" | |
], | |
"env": { | |
"FLAGS": "try: something...", | |
"REVISION": "REVISION", | |
"PROJECT": "try" | |
} | |
}, | |
"metadata": { | |
"name": "Make Decision based on flags", | |
"description": "Description of specific task...\n", | |
"owner": "user@example.com", | |
"source": "http://localhost/unit-test" | |
} | |
} | |
}, | |
{ | |
"taskId": "H-4TgomXT0iiAmfVMKXppQ", | |
"task": { | |
"provisionerId": "aws-provisioner", | |
"workerType": "v2", | |
"created": "2014-09-20T00:01:53.761Z", | |
"deadline": "2014-09-21T02:01:53.762Z", | |
"payload": {}, | |
"metadata": { | |
"name": "TaskA: Build something TaskB", | |
"description": "Description of specific task...\n", | |
"owner": "user@example.com", | |
"source": "http://localhost/unit-test" | |
} | |
} | |
}, | |
{ | |
"taskId": "wc_yKCDgSf-Vnn31bzAdCw", | |
"requires": [ | |
"H-4TgomXT0iiAmfVMKXppQ" | |
], | |
"task": { | |
"provisionerId": "aws-provisioner", | |
"workerType": "v2", | |
"created": "2014-09-20T00:01:53.761Z", | |
"deadline": "4WuFIn6mTieW-YsmG2MOxA", | |
"payload": {}, | |
"metadata": { | |
"name": "TaskA: Build something TaskB", | |
"description": "Description of specific task...\n", | |
"owner": "user@example.com", | |
"source": "http://localhost/unit-test" | |
} | |
} | |
} | |
], | |
"metadata": { | |
"name": "My Test TaskGraph", | |
"description": "Some description of the test task in **markdown**.\n", | |
"owner": "user@example.com", | |
"source": "http://localhost/unit-test" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tasks: | |
# A decision task | |
- taskId: '{{ "decision-task" | as-slugid }}' | |
task: | |
provisionerId: aws-provisioner | |
workerType: v2 | |
created: '{{ now }}' | |
deadline: '{{ "1 day 2 hours" | from-now }}' | |
payload: | |
image: quay.io/mozilla/decider:v3 | |
command: | |
- /bin/decide | |
env: | |
FLAGS: '{{ comment }}' | |
REVISION: '{{ revision }}' | |
PROJECT: '{{ project }}' | |
metadata: | |
name: "Make Decision based on flags" | |
description: | | |
Description of specific task... | |
owner: '{{ owner }}' | |
source: '{{ source }}' | |
# Build task that is independent of the decision task | |
- taskId: '{{ "build-task" | as-slugid }}' | |
task: | |
provisionerId: aws-provisioner | |
workerType: v2 | |
created: '{{ now }}' | |
deadline: '{{ "1 day 2 hours" | from-now }}' | |
payload: {} | |
metadata: | |
name: "TaskA: Build something TaskB" | |
description: | | |
Description of specific task... | |
owner: '{{ owner }}' | |
source: '{{ source }}' | |
# Test task that depends on build task | |
- taskId: '{{ "test-task" | as-slugid }}' | |
requires: | |
- '{{ "build-task" | as-slugid }}' | |
task: | |
provisionerId: aws-provisioner | |
workerType: v2 | |
created: '{{ now }}' | |
deadline: '{{ "1 day 2 hours" | as-slugid }}' | |
payload: {} | |
metadata: | |
name: "TaskA: Build something TaskB" | |
description: | | |
Description of specific task... | |
owner: '{{ owner }}' | |
source: '{{ source }}' | |
metadata: | |
name: "My Test TaskGraph" | |
description: | | |
Some description of the test task in **markdown**. | |
owner: '{{ owner }}' | |
source: '{{ source }}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note, this might still just be crazy I'm not sure triggers are smart... I just know that we have 3 different reasons that cause a task to be triggered by the decision task:
Case 3. should ideally be resolved using
requires
list.... Perhaps we need to substitute in taskIds and auto-trigger if the taskId is required by another task that is somehow triggered...