Bug 1281004: Specify test tasks more flexibly; r=gps; r=gbrown
This introduces a completely new way of specifying test task in-tree,
completely replacing the old spider-web of YAML files.
The high-level view is this:
- some configuration files are used to determine which test suites to run
for each test platform, and against which build platforms
- each test suite is then represented by a dictionary, and modified by a
sequence of transforms, duplicating as necessary (e.g., chunks), until
it becomes a task definition
The transforms allow sufficient generality to support just about any desired
configuration, with the advantage that common configurations are "easy" while
unusual configurations are supported but notable for their oddness (they
require a custom transform).
As of this commit, this system produces the same set of test graphs as the
existing YAML, modulo:
- extra.treeherder.groupName -- this was not consistent in the YAML
- extra.treeherder.build -- this is ignored by taskcluster-treeherder anyway
- mozharness command argument order
- boolean True values for environment variables are now the string "true"
- metadata -- this is now much more consistent, with task name being the label
Testing of this commit demonstrates that it produces the same set of test tasks for
the following projects (those which had special cases defined in the YAML):
- autoland
- ash (*)
- willow
- mozilla-inbound
- mozilla-central
- try:
-b do -p all -t all -u all
-b d -p linux64,linux64-asan -u reftest -t none
-b d -p linux64,linux64-asan -u reftest[x64] -t none[x64]
(*) this patch omits the linux64/debug tc-M-e10s(dt) test, which is enabled on
ash; ash will require a small changeset to re-enable this test.
IGNORE BAD COMMIT MESSAGES (because the hook flags try syntax!)
MozReview-Commit-ID: G34dg9f17Hq
--HG--
rename : taskcluster/taskgraph/kind/base.py => taskcluster/taskgraph/task/base.py
rename : taskcluster/taskgraph/kind/docker_image.py => taskcluster/taskgraph/task/docker_image.py
rename : taskcluster/taskgraph/kind/legacy.py => taskcluster/taskgraph/task/legacy.py
extra : rebase_source : 03e70902c2d3a297eb9e3ce852f8737c2550d5a6
extra : histedit_source : d4d9f4b192605af21f41d83495fc3c923759c3cb
2016-07-12 02:27:14 +03:00
|
|
|
Transforms
|
|
|
|
==========
|
|
|
|
|
|
|
|
Many task kinds generate tasks by a process of transforming job descriptions
|
|
|
|
into task definitions. The basic operation is simple, although the sequence of
|
|
|
|
transforms applied for a particular kind may not be!
|
|
|
|
|
|
|
|
Overview
|
|
|
|
--------
|
|
|
|
|
2016-10-05 00:06:17 +03:00
|
|
|
To begin, a kind implementation generates a collection of items; see
|
|
|
|
:doc:`loading`. The items are simply Python dictionaries, and describe
|
|
|
|
"semantically" what the resulting task or tasks should do.
|
Bug 1281004: Specify test tasks more flexibly; r=gps; r=gbrown
This introduces a completely new way of specifying test task in-tree,
completely replacing the old spider-web of YAML files.
The high-level view is this:
- some configuration files are used to determine which test suites to run
for each test platform, and against which build platforms
- each test suite is then represented by a dictionary, and modified by a
sequence of transforms, duplicating as necessary (e.g., chunks), until
it becomes a task definition
The transforms allow sufficient generality to support just about any desired
configuration, with the advantage that common configurations are "easy" while
unusual configurations are supported but notable for their oddness (they
require a custom transform).
As of this commit, this system produces the same set of test graphs as the
existing YAML, modulo:
- extra.treeherder.groupName -- this was not consistent in the YAML
- extra.treeherder.build -- this is ignored by taskcluster-treeherder anyway
- mozharness command argument order
- boolean True values for environment variables are now the string "true"
- metadata -- this is now much more consistent, with task name being the label
Testing of this commit demonstrates that it produces the same set of test tasks for
the following projects (those which had special cases defined in the YAML):
- autoland
- ash (*)
- willow
- mozilla-inbound
- mozilla-central
- try:
-b do -p all -t all -u all
-b d -p linux64,linux64-asan -u reftest -t none
-b d -p linux64,linux64-asan -u reftest[x64] -t none[x64]
(*) this patch omits the linux64/debug tc-M-e10s(dt) test, which is enabled on
ash; ash will require a small changeset to re-enable this test.
IGNORE BAD COMMIT MESSAGES (because the hook flags try syntax!)
MozReview-Commit-ID: G34dg9f17Hq
--HG--
rename : taskcluster/taskgraph/kind/base.py => taskcluster/taskgraph/task/base.py
rename : taskcluster/taskgraph/kind/docker_image.py => taskcluster/taskgraph/task/docker_image.py
rename : taskcluster/taskgraph/kind/legacy.py => taskcluster/taskgraph/task/legacy.py
extra : rebase_source : 03e70902c2d3a297eb9e3ce852f8737c2550d5a6
extra : histedit_source : d4d9f4b192605af21f41d83495fc3c923759c3cb
2016-07-12 02:27:14 +03:00
|
|
|
|
|
|
|
The kind also defines a sequence of transformations. These are applied, in
|
|
|
|
order, to each item. Early transforms might apply default values or break
|
|
|
|
items up into smaller items (for example, chunking a test suite). Later
|
|
|
|
transforms rewrite the items entirely, with the final result being a task
|
|
|
|
definition.
|
|
|
|
|
2016-10-05 00:06:17 +03:00
|
|
|
Transform Functions
|
|
|
|
...................
|
|
|
|
|
Bug 1281004: Specify test tasks more flexibly; r=gps; r=gbrown
This introduces a completely new way of specifying test task in-tree,
completely replacing the old spider-web of YAML files.
The high-level view is this:
- some configuration files are used to determine which test suites to run
for each test platform, and against which build platforms
- each test suite is then represented by a dictionary, and modified by a
sequence of transforms, duplicating as necessary (e.g., chunks), until
it becomes a task definition
The transforms allow sufficient generality to support just about any desired
configuration, with the advantage that common configurations are "easy" while
unusual configurations are supported but notable for their oddness (they
require a custom transform).
As of this commit, this system produces the same set of test graphs as the
existing YAML, modulo:
- extra.treeherder.groupName -- this was not consistent in the YAML
- extra.treeherder.build -- this is ignored by taskcluster-treeherder anyway
- mozharness command argument order
- boolean True values for environment variables are now the string "true"
- metadata -- this is now much more consistent, with task name being the label
Testing of this commit demonstrates that it produces the same set of test tasks for
the following projects (those which had special cases defined in the YAML):
- autoland
- ash (*)
- willow
- mozilla-inbound
- mozilla-central
- try:
-b do -p all -t all -u all
-b d -p linux64,linux64-asan -u reftest -t none
-b d -p linux64,linux64-asan -u reftest[x64] -t none[x64]
(*) this patch omits the linux64/debug tc-M-e10s(dt) test, which is enabled on
ash; ash will require a small changeset to re-enable this test.
IGNORE BAD COMMIT MESSAGES (because the hook flags try syntax!)
MozReview-Commit-ID: G34dg9f17Hq
--HG--
rename : taskcluster/taskgraph/kind/base.py => taskcluster/taskgraph/task/base.py
rename : taskcluster/taskgraph/kind/docker_image.py => taskcluster/taskgraph/task/docker_image.py
rename : taskcluster/taskgraph/kind/legacy.py => taskcluster/taskgraph/task/legacy.py
extra : rebase_source : 03e70902c2d3a297eb9e3ce852f8737c2550d5a6
extra : histedit_source : d4d9f4b192605af21f41d83495fc3c923759c3cb
2016-07-12 02:27:14 +03:00
|
|
|
Each transformation looks like this:
|
|
|
|
|
2018-06-27 12:48:10 +03:00
|
|
|
.. code-block:: python
|
Bug 1281004: Specify test tasks more flexibly; r=gps; r=gbrown
This introduces a completely new way of specifying test task in-tree,
completely replacing the old spider-web of YAML files.
The high-level view is this:
- some configuration files are used to determine which test suites to run
for each test platform, and against which build platforms
- each test suite is then represented by a dictionary, and modified by a
sequence of transforms, duplicating as necessary (e.g., chunks), until
it becomes a task definition
The transforms allow sufficient generality to support just about any desired
configuration, with the advantage that common configurations are "easy" while
unusual configurations are supported but notable for their oddness (they
require a custom transform).
As of this commit, this system produces the same set of test graphs as the
existing YAML, modulo:
- extra.treeherder.groupName -- this was not consistent in the YAML
- extra.treeherder.build -- this is ignored by taskcluster-treeherder anyway
- mozharness command argument order
- boolean True values for environment variables are now the string "true"
- metadata -- this is now much more consistent, with task name being the label
Testing of this commit demonstrates that it produces the same set of test tasks for
the following projects (those which had special cases defined in the YAML):
- autoland
- ash (*)
- willow
- mozilla-inbound
- mozilla-central
- try:
-b do -p all -t all -u all
-b d -p linux64,linux64-asan -u reftest -t none
-b d -p linux64,linux64-asan -u reftest[x64] -t none[x64]
(*) this patch omits the linux64/debug tc-M-e10s(dt) test, which is enabled on
ash; ash will require a small changeset to re-enable this test.
IGNORE BAD COMMIT MESSAGES (because the hook flags try syntax!)
MozReview-Commit-ID: G34dg9f17Hq
--HG--
rename : taskcluster/taskgraph/kind/base.py => taskcluster/taskgraph/task/base.py
rename : taskcluster/taskgraph/kind/docker_image.py => taskcluster/taskgraph/task/docker_image.py
rename : taskcluster/taskgraph/kind/legacy.py => taskcluster/taskgraph/task/legacy.py
extra : rebase_source : 03e70902c2d3a297eb9e3ce852f8737c2550d5a6
extra : histedit_source : d4d9f4b192605af21f41d83495fc3c923759c3cb
2016-07-12 02:27:14 +03:00
|
|
|
|
|
|
|
@transforms.add
|
|
|
|
def transform_an_item(config, items):
|
|
|
|
"""This transform ...""" # always a docstring!
|
|
|
|
for item in items:
|
|
|
|
# ..
|
|
|
|
yield item
|
|
|
|
|
|
|
|
The ``config`` argument is a Python object containing useful configuration for
|
|
|
|
the kind, and is a subclass of
|
|
|
|
:class:`taskgraph.transforms.base.TransformConfig`, which specifies a few of
|
|
|
|
its attributes. Kinds may subclass and add additional attributes if necessary.
|
|
|
|
|
|
|
|
While most transforms yield one item for each item consumed, this is not always
|
|
|
|
true: items that are not yielded are effectively filtered out. Yielding
|
|
|
|
multiple items for each consumed item implements item duplication; this is how
|
|
|
|
test chunking is accomplished, for example.
|
|
|
|
|
|
|
|
The ``transforms`` object is an instance of
|
|
|
|
:class:`taskgraph.transforms.base.TransformSequence`, which serves as a simple
|
|
|
|
mechanism to combine a sequence of transforms into one.
|
|
|
|
|
|
|
|
Schemas
|
2016-09-12 18:51:49 +03:00
|
|
|
.......
|
Bug 1281004: Specify test tasks more flexibly; r=gps; r=gbrown
This introduces a completely new way of specifying test task in-tree,
completely replacing the old spider-web of YAML files.
The high-level view is this:
- some configuration files are used to determine which test suites to run
for each test platform, and against which build platforms
- each test suite is then represented by a dictionary, and modified by a
sequence of transforms, duplicating as necessary (e.g., chunks), until
it becomes a task definition
The transforms allow sufficient generality to support just about any desired
configuration, with the advantage that common configurations are "easy" while
unusual configurations are supported but notable for their oddness (they
require a custom transform).
As of this commit, this system produces the same set of test graphs as the
existing YAML, modulo:
- extra.treeherder.groupName -- this was not consistent in the YAML
- extra.treeherder.build -- this is ignored by taskcluster-treeherder anyway
- mozharness command argument order
- boolean True values for environment variables are now the string "true"
- metadata -- this is now much more consistent, with task name being the label
Testing of this commit demonstrates that it produces the same set of test tasks for
the following projects (those which had special cases defined in the YAML):
- autoland
- ash (*)
- willow
- mozilla-inbound
- mozilla-central
- try:
-b do -p all -t all -u all
-b d -p linux64,linux64-asan -u reftest -t none
-b d -p linux64,linux64-asan -u reftest[x64] -t none[x64]
(*) this patch omits the linux64/debug tc-M-e10s(dt) test, which is enabled on
ash; ash will require a small changeset to re-enable this test.
IGNORE BAD COMMIT MESSAGES (because the hook flags try syntax!)
MozReview-Commit-ID: G34dg9f17Hq
--HG--
rename : taskcluster/taskgraph/kind/base.py => taskcluster/taskgraph/task/base.py
rename : taskcluster/taskgraph/kind/docker_image.py => taskcluster/taskgraph/task/docker_image.py
rename : taskcluster/taskgraph/kind/legacy.py => taskcluster/taskgraph/task/legacy.py
extra : rebase_source : 03e70902c2d3a297eb9e3ce852f8737c2550d5a6
extra : histedit_source : d4d9f4b192605af21f41d83495fc3c923759c3cb
2016-07-12 02:27:14 +03:00
|
|
|
|
|
|
|
The items used in transforms are validated against some simple schemas at
|
|
|
|
various points in the transformation process. These schemas accomplish two
|
|
|
|
things: they provide a place to add comments about the meaning of each field,
|
|
|
|
and they enforce that the fields are actually used in the documented fashion.
|
|
|
|
|
|
|
|
Keyed By
|
2016-09-12 18:51:49 +03:00
|
|
|
........
|
Bug 1281004: Specify test tasks more flexibly; r=gps; r=gbrown
This introduces a completely new way of specifying test task in-tree,
completely replacing the old spider-web of YAML files.
The high-level view is this:
- some configuration files are used to determine which test suites to run
for each test platform, and against which build platforms
- each test suite is then represented by a dictionary, and modified by a
sequence of transforms, duplicating as necessary (e.g., chunks), until
it becomes a task definition
The transforms allow sufficient generality to support just about any desired
configuration, with the advantage that common configurations are "easy" while
unusual configurations are supported but notable for their oddness (they
require a custom transform).
As of this commit, this system produces the same set of test graphs as the
existing YAML, modulo:
- extra.treeherder.groupName -- this was not consistent in the YAML
- extra.treeherder.build -- this is ignored by taskcluster-treeherder anyway
- mozharness command argument order
- boolean True values for environment variables are now the string "true"
- metadata -- this is now much more consistent, with task name being the label
Testing of this commit demonstrates that it produces the same set of test tasks for
the following projects (those which had special cases defined in the YAML):
- autoland
- ash (*)
- willow
- mozilla-inbound
- mozilla-central
- try:
-b do -p all -t all -u all
-b d -p linux64,linux64-asan -u reftest -t none
-b d -p linux64,linux64-asan -u reftest[x64] -t none[x64]
(*) this patch omits the linux64/debug tc-M-e10s(dt) test, which is enabled on
ash; ash will require a small changeset to re-enable this test.
IGNORE BAD COMMIT MESSAGES (because the hook flags try syntax!)
MozReview-Commit-ID: G34dg9f17Hq
--HG--
rename : taskcluster/taskgraph/kind/base.py => taskcluster/taskgraph/task/base.py
rename : taskcluster/taskgraph/kind/docker_image.py => taskcluster/taskgraph/task/docker_image.py
rename : taskcluster/taskgraph/kind/legacy.py => taskcluster/taskgraph/task/legacy.py
extra : rebase_source : 03e70902c2d3a297eb9e3ce852f8737c2550d5a6
extra : histedit_source : d4d9f4b192605af21f41d83495fc3c923759c3cb
2016-07-12 02:27:14 +03:00
|
|
|
|
|
|
|
Several fields in the input items can be "keyed by" another value in the item.
|
|
|
|
For example, a test description's chunks may be keyed by ``test-platform``.
|
|
|
|
In the item, this looks like:
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
chunks:
|
|
|
|
by-test-platform:
|
|
|
|
linux64/debug: 12
|
|
|
|
linux64/opt: 8
|
2017-01-04 02:43:48 +03:00
|
|
|
android.*: 14
|
Bug 1281004: Specify test tasks more flexibly; r=gps; r=gbrown
This introduces a completely new way of specifying test task in-tree,
completely replacing the old spider-web of YAML files.
The high-level view is this:
- some configuration files are used to determine which test suites to run
for each test platform, and against which build platforms
- each test suite is then represented by a dictionary, and modified by a
sequence of transforms, duplicating as necessary (e.g., chunks), until
it becomes a task definition
The transforms allow sufficient generality to support just about any desired
configuration, with the advantage that common configurations are "easy" while
unusual configurations are supported but notable for their oddness (they
require a custom transform).
As of this commit, this system produces the same set of test graphs as the
existing YAML, modulo:
- extra.treeherder.groupName -- this was not consistent in the YAML
- extra.treeherder.build -- this is ignored by taskcluster-treeherder anyway
- mozharness command argument order
- boolean True values for environment variables are now the string "true"
- metadata -- this is now much more consistent, with task name being the label
Testing of this commit demonstrates that it produces the same set of test tasks for
the following projects (those which had special cases defined in the YAML):
- autoland
- ash (*)
- willow
- mozilla-inbound
- mozilla-central
- try:
-b do -p all -t all -u all
-b d -p linux64,linux64-asan -u reftest -t none
-b d -p linux64,linux64-asan -u reftest[x64] -t none[x64]
(*) this patch omits the linux64/debug tc-M-e10s(dt) test, which is enabled on
ash; ash will require a small changeset to re-enable this test.
IGNORE BAD COMMIT MESSAGES (because the hook flags try syntax!)
MozReview-Commit-ID: G34dg9f17Hq
--HG--
rename : taskcluster/taskgraph/kind/base.py => taskcluster/taskgraph/task/base.py
rename : taskcluster/taskgraph/kind/docker_image.py => taskcluster/taskgraph/task/docker_image.py
rename : taskcluster/taskgraph/kind/legacy.py => taskcluster/taskgraph/task/legacy.py
extra : rebase_source : 03e70902c2d3a297eb9e3ce852f8737c2550d5a6
extra : histedit_source : d4d9f4b192605af21f41d83495fc3c923759c3cb
2016-07-12 02:27:14 +03:00
|
|
|
default: 10
|
|
|
|
|
|
|
|
This is a simple but powerful way to encode business rules in the items
|
|
|
|
provided as input to the transforms, rather than expressing those rules in the
|
|
|
|
transforms themselves. If you are implementing a new business rule, prefer
|
|
|
|
this mode where possible. The structure is easily resolved to a single value
|
2017-01-05 21:42:14 +03:00
|
|
|
using :func:`taskgraph.transform.base.resolve_keyed_by`.
|
Bug 1281004: Specify test tasks more flexibly; r=gps; r=gbrown
This introduces a completely new way of specifying test task in-tree,
completely replacing the old spider-web of YAML files.
The high-level view is this:
- some configuration files are used to determine which test suites to run
for each test platform, and against which build platforms
- each test suite is then represented by a dictionary, and modified by a
sequence of transforms, duplicating as necessary (e.g., chunks), until
it becomes a task definition
The transforms allow sufficient generality to support just about any desired
configuration, with the advantage that common configurations are "easy" while
unusual configurations are supported but notable for their oddness (they
require a custom transform).
As of this commit, this system produces the same set of test graphs as the
existing YAML, modulo:
- extra.treeherder.groupName -- this was not consistent in the YAML
- extra.treeherder.build -- this is ignored by taskcluster-treeherder anyway
- mozharness command argument order
- boolean True values for environment variables are now the string "true"
- metadata -- this is now much more consistent, with task name being the label
Testing of this commit demonstrates that it produces the same set of test tasks for
the following projects (those which had special cases defined in the YAML):
- autoland
- ash (*)
- willow
- mozilla-inbound
- mozilla-central
- try:
-b do -p all -t all -u all
-b d -p linux64,linux64-asan -u reftest -t none
-b d -p linux64,linux64-asan -u reftest[x64] -t none[x64]
(*) this patch omits the linux64/debug tc-M-e10s(dt) test, which is enabled on
ash; ash will require a small changeset to re-enable this test.
IGNORE BAD COMMIT MESSAGES (because the hook flags try syntax!)
MozReview-Commit-ID: G34dg9f17Hq
--HG--
rename : taskcluster/taskgraph/kind/base.py => taskcluster/taskgraph/task/base.py
rename : taskcluster/taskgraph/kind/docker_image.py => taskcluster/taskgraph/task/docker_image.py
rename : taskcluster/taskgraph/kind/legacy.py => taskcluster/taskgraph/task/legacy.py
extra : rebase_source : 03e70902c2d3a297eb9e3ce852f8737c2550d5a6
extra : histedit_source : d4d9f4b192605af21f41d83495fc3c923759c3cb
2016-07-12 02:27:14 +03:00
|
|
|
|
2017-01-04 02:43:48 +03:00
|
|
|
Exact matches are used immediately. If no exact matches are found, each
|
|
|
|
alternative is treated as a regular expression, matched against the whole
|
2017-08-09 17:18:15 +03:00
|
|
|
value. Thus ``android.*`` would match ``android-api-16/debug``. If nothing
|
2017-01-04 02:43:48 +03:00
|
|
|
matches as a regular expression, but there is a ``default`` alternative, it is
|
|
|
|
used. Otherwise, an exception is raised and graph generation stops.
|
|
|
|
|
2016-09-12 18:51:49 +03:00
|
|
|
Organization
|
|
|
|
-------------
|
Bug 1281004: Specify test tasks more flexibly; r=gps; r=gbrown
This introduces a completely new way of specifying test task in-tree,
completely replacing the old spider-web of YAML files.
The high-level view is this:
- some configuration files are used to determine which test suites to run
for each test platform, and against which build platforms
- each test suite is then represented by a dictionary, and modified by a
sequence of transforms, duplicating as necessary (e.g., chunks), until
it becomes a task definition
The transforms allow sufficient generality to support just about any desired
configuration, with the advantage that common configurations are "easy" while
unusual configurations are supported but notable for their oddness (they
require a custom transform).
As of this commit, this system produces the same set of test graphs as the
existing YAML, modulo:
- extra.treeherder.groupName -- this was not consistent in the YAML
- extra.treeherder.build -- this is ignored by taskcluster-treeherder anyway
- mozharness command argument order
- boolean True values for environment variables are now the string "true"
- metadata -- this is now much more consistent, with task name being the label
Testing of this commit demonstrates that it produces the same set of test tasks for
the following projects (those which had special cases defined in the YAML):
- autoland
- ash (*)
- willow
- mozilla-inbound
- mozilla-central
- try:
-b do -p all -t all -u all
-b d -p linux64,linux64-asan -u reftest -t none
-b d -p linux64,linux64-asan -u reftest[x64] -t none[x64]
(*) this patch omits the linux64/debug tc-M-e10s(dt) test, which is enabled on
ash; ash will require a small changeset to re-enable this test.
IGNORE BAD COMMIT MESSAGES (because the hook flags try syntax!)
MozReview-Commit-ID: G34dg9f17Hq
--HG--
rename : taskcluster/taskgraph/kind/base.py => taskcluster/taskgraph/task/base.py
rename : taskcluster/taskgraph/kind/docker_image.py => taskcluster/taskgraph/task/docker_image.py
rename : taskcluster/taskgraph/kind/legacy.py => taskcluster/taskgraph/task/legacy.py
extra : rebase_source : 03e70902c2d3a297eb9e3ce852f8737c2550d5a6
extra : histedit_source : d4d9f4b192605af21f41d83495fc3c923759c3cb
2016-07-12 02:27:14 +03:00
|
|
|
|
2016-09-12 18:51:49 +03:00
|
|
|
Task creation operates broadly in a few phases, with the interfaces of those
|
|
|
|
stages defined by schemas. The process begins with the raw data structures
|
|
|
|
parsed from the YAML files in the kind configuration. This data can processed
|
|
|
|
by kind-specific transforms resulting, for test jobs, in a "test description".
|
2016-09-12 18:53:14 +03:00
|
|
|
For non-test jobs, the next step is a "job description". These transformations
|
|
|
|
may also "duplicate" tasks, for example to implement chunking or several
|
|
|
|
variations of the same task.
|
|
|
|
|
|
|
|
In any case, shared transforms then convert this into a "task description",
|
|
|
|
which the task-generation transforms then convert into a task definition
|
|
|
|
suitable for ``queue.createTask``.
|
Bug 1281004: Specify test tasks more flexibly; r=gps; r=gbrown
This introduces a completely new way of specifying test task in-tree,
completely replacing the old spider-web of YAML files.
The high-level view is this:
- some configuration files are used to determine which test suites to run
for each test platform, and against which build platforms
- each test suite is then represented by a dictionary, and modified by a
sequence of transforms, duplicating as necessary (e.g., chunks), until
it becomes a task definition
The transforms allow sufficient generality to support just about any desired
configuration, with the advantage that common configurations are "easy" while
unusual configurations are supported but notable for their oddness (they
require a custom transform).
As of this commit, this system produces the same set of test graphs as the
existing YAML, modulo:
- extra.treeherder.groupName -- this was not consistent in the YAML
- extra.treeherder.build -- this is ignored by taskcluster-treeherder anyway
- mozharness command argument order
- boolean True values for environment variables are now the string "true"
- metadata -- this is now much more consistent, with task name being the label
Testing of this commit demonstrates that it produces the same set of test tasks for
the following projects (those which had special cases defined in the YAML):
- autoland
- ash (*)
- willow
- mozilla-inbound
- mozilla-central
- try:
-b do -p all -t all -u all
-b d -p linux64,linux64-asan -u reftest -t none
-b d -p linux64,linux64-asan -u reftest[x64] -t none[x64]
(*) this patch omits the linux64/debug tc-M-e10s(dt) test, which is enabled on
ash; ash will require a small changeset to re-enable this test.
IGNORE BAD COMMIT MESSAGES (because the hook flags try syntax!)
MozReview-Commit-ID: G34dg9f17Hq
--HG--
rename : taskcluster/taskgraph/kind/base.py => taskcluster/taskgraph/task/base.py
rename : taskcluster/taskgraph/kind/docker_image.py => taskcluster/taskgraph/task/docker_image.py
rename : taskcluster/taskgraph/kind/legacy.py => taskcluster/taskgraph/task/legacy.py
extra : rebase_source : 03e70902c2d3a297eb9e3ce852f8737c2550d5a6
extra : histedit_source : d4d9f4b192605af21f41d83495fc3c923759c3cb
2016-07-12 02:27:14 +03:00
|
|
|
|
2016-09-12 18:51:49 +03:00
|
|
|
Test Descriptions
|
|
|
|
-----------------
|
Bug 1281004: Specify test tasks more flexibly; r=gps; r=gbrown
This introduces a completely new way of specifying test task in-tree,
completely replacing the old spider-web of YAML files.
The high-level view is this:
- some configuration files are used to determine which test suites to run
for each test platform, and against which build platforms
- each test suite is then represented by a dictionary, and modified by a
sequence of transforms, duplicating as necessary (e.g., chunks), until
it becomes a task definition
The transforms allow sufficient generality to support just about any desired
configuration, with the advantage that common configurations are "easy" while
unusual configurations are supported but notable for their oddness (they
require a custom transform).
As of this commit, this system produces the same set of test graphs as the
existing YAML, modulo:
- extra.treeherder.groupName -- this was not consistent in the YAML
- extra.treeherder.build -- this is ignored by taskcluster-treeherder anyway
- mozharness command argument order
- boolean True values for environment variables are now the string "true"
- metadata -- this is now much more consistent, with task name being the label
Testing of this commit demonstrates that it produces the same set of test tasks for
the following projects (those which had special cases defined in the YAML):
- autoland
- ash (*)
- willow
- mozilla-inbound
- mozilla-central
- try:
-b do -p all -t all -u all
-b d -p linux64,linux64-asan -u reftest -t none
-b d -p linux64,linux64-asan -u reftest[x64] -t none[x64]
(*) this patch omits the linux64/debug tc-M-e10s(dt) test, which is enabled on
ash; ash will require a small changeset to re-enable this test.
IGNORE BAD COMMIT MESSAGES (because the hook flags try syntax!)
MozReview-Commit-ID: G34dg9f17Hq
--HG--
rename : taskcluster/taskgraph/kind/base.py => taskcluster/taskgraph/task/base.py
rename : taskcluster/taskgraph/kind/docker_image.py => taskcluster/taskgraph/task/docker_image.py
rename : taskcluster/taskgraph/kind/legacy.py => taskcluster/taskgraph/task/legacy.py
extra : rebase_source : 03e70902c2d3a297eb9e3ce852f8737c2550d5a6
extra : histedit_source : d4d9f4b192605af21f41d83495fc3c923759c3cb
2016-07-12 02:27:14 +03:00
|
|
|
|
2016-12-24 01:12:17 +03:00
|
|
|
Test descriptions specify how to run a unittest or talos run. They aim to
|
|
|
|
describe this abstractly, although in many cases the unique nature of
|
|
|
|
invocation on different platforms leaves a lot of specific behavior in the test
|
|
|
|
description, divided by ``by-test-platform``.
|
|
|
|
|
|
|
|
Test descriptions are validated to conform to the schema in
|
|
|
|
``taskcluster/taskgraph/transforms/tests.py``. This schema is extensively
|
|
|
|
documented and is a the primary reference for anyone modifying tests.
|
|
|
|
|
|
|
|
The output of ``tests.py`` is a task description. Test dependencies are
|
|
|
|
produced in the form of a dictionary mapping dependency name to task label.
|
2016-09-12 18:51:49 +03:00
|
|
|
|
2016-09-12 18:53:14 +03:00
|
|
|
Job Descriptions
|
|
|
|
----------------
|
|
|
|
|
|
|
|
A job description says what to run in the task. It is a combination of a
|
|
|
|
``run`` section and all of the fields from a task description. The run section
|
|
|
|
has a ``using`` property that defines how this task should be run; for example,
|
|
|
|
``mozharness`` to run a mozharness script, or ``mach`` to run a mach command.
|
|
|
|
The remainder of the run section is specific to the run-using implementation.
|
|
|
|
|
|
|
|
The effect of a job description is to say "run this thing on this worker". The
|
|
|
|
job description must contain enough information about the worker to identify
|
|
|
|
the workerType and the implementation (docker-worker, generic-worker, etc.).
|
2016-11-18 23:07:56 +03:00
|
|
|
Alternatively, job descriptions can specify the ``platforms`` field in
|
|
|
|
conjunction with the ``by-platform`` key to specify multiple workerTypes and
|
|
|
|
implementations. Any other task-description information is passed along
|
|
|
|
verbatim, although it is augmented by the run-using implementation.
|
2016-09-12 18:53:14 +03:00
|
|
|
|
|
|
|
The run-using implementations are all located in
|
|
|
|
``taskcluster/taskgraph/transforms/job``, along with the schemas for their
|
2016-10-05 00:06:17 +03:00
|
|
|
implementations. Those well-commented source files are the canonical
|
|
|
|
documentation for what constitutes a job description, and should be considered
|
|
|
|
part of the documentation.
|
2016-09-12 18:53:14 +03:00
|
|
|
|
2016-11-25 22:52:46 +03:00
|
|
|
following ``run-using`` are available
|
|
|
|
|
2016-12-22 21:57:40 +03:00
|
|
|
* ``hazard``
|
|
|
|
* ``mach``
|
|
|
|
* ``mozharness``
|
2017-01-18 14:25:53 +03:00
|
|
|
* ``mozharness-test``
|
2016-12-22 21:57:40 +03:00
|
|
|
* ``run-task``
|
2017-09-05 19:26:21 +03:00
|
|
|
* ``spidermonkey`` or ``spidermonkey-package`` or ``spidermonkey-mozjs-crate`` or ``spidermonkey-rust-bindings``
|
2017-12-29 07:02:23 +03:00
|
|
|
* ``debian-package``
|
2016-12-22 21:57:40 +03:00
|
|
|
* ``toolchain-script``
|
2017-12-28 06:14:34 +03:00
|
|
|
* ``always-optimized``
|
Bug 1460777 - Taskgraph tasks for retrieving remote content; r=dustin, glandium
Currently, many tasks fetch content from the Internets. A problem with
that is fetching from the Internets is unreliable: servers may have
outages or be slow; content may disappear or change out from under us.
The unreliability of 3rd party services poses a risk to Firefox CI.
If services aren't available, we could potentially not run some CI tasks.
In the worst case, we might not be able to release Firefox. That would
be bad. In fact, as I write this, gmplib.org has been unavailable for
~24 hours and Firefox CI is unable to retrieve the GMP source code.
As a result, building GCC toolchains is failing.
A solution to this is to make tasks more hermetic by depending on
fewer network services (which by definition aren't reliable over time
and therefore introduce instability).
This commit attempts to mitigate some external service dependencies
by introducing the *fetch* task kind.
The primary goal of the *fetch* kind is to obtain remote content and
re-expose it as a task artifact. By making external content available
as a cached task artifact, we allow dependent tasks to consume this
content without touching the service originally providing that
content, thus eliminating a run-time dependency and making tasks more
hermetic and reproducible over time.
We introduce a single "fetch-url" "using" flavor to define tasks that
fetch single URLs and then re-expose that URL as an artifact. Powering
this is a new, minimal "fetch" Docker image that contains a
"fetch-content" Python script that does the work for us.
We have added tasks to fetch source archives used to build the GCC
toolchains.
Fetching remote content and re-exposing it as an artifact is not
very useful by itself: the value is in having tasks use those
artifacts.
We introduce a taskgraph transform that allows tasks to define an
array of "fetches." Each entry corresponds to the name of a "fetch"
task kind. When present, the corresponding "fetch" task is added as a
dependency. And the task ID and artifact path from that "fetch" task
is added to the MOZ_FETCHES environment variable of the task depending
on it. Our "fetch-content" script has a "task-artifacts"
sub-command that tasks can execute to perform retrieval of all
artifacts listed in MOZ_FETCHES.
To prove all of this works, the code for fetching dependencies when
building GCC toolchains has been updated to use `fetch-content`. The
now-unused legacy code has been deleted.
This commit improves the reliability and efficiency of GCC toolchain
tasks. Dependencies now all come from task artifacts and should always
be available in the common case. In addition, `fetch-content` downloads
and extracts files concurrently. This makes it faster than the serial
application which we were previously using.
There are some things I don't like about this commit.
First, a new Docker image and Python script for downloading URLs feels
a bit heavyweight. The Docker image is definitely overkill as things
stand. I can eventually justify it because I want to implement support
for fetching and repackaging VCS repositories and for caching Debian
packages. These will require more packages than what I'm comfortable
installing on the base Debian image, therefore justifying a dedicated
image.
The `fetch-content static-url` sub-command could definitely be
implemented as a shell script. But Python is readily available and
is more pleasant to maintain than shell, so I wrote it in Python.
`fetch-content task-artifacts` is more advanced and writing it in
Python is more justified, IMO. FWIW, the script is Python 3 only,
which conveniently gives us access to `concurrent.futures`, which
facilitates concurrent download.
`fetch-content` also duplicates functionality found elsewhere.
generic-worker's task payload supports a "mounts" feature which
facilitates downloading remote content, including from a task
artifact. However, this feature doesn't exist on docker-worker.
So we have to implement downloading inside the task rather than
at the worker level. I concede that if all workers had generic-worker's
"mounts" feature and supported concurrent download, `fetch-content`
wouldn't need to exist.
`fetch-content` also duplicates functionality of
`mach artifact toolchain`. I probably could have used
`mach artifact toolchain` instead of writing
`fetch-content task-artifacts`. However, I didn't want to introduce
the requirement of a VCS checkout. `mach artifact toolchain` has its
origins in providing a feature to the build system. And "fetching
artifacts from tasks" is a more generic feature than that. I think
it should be implemented as a generic feature and not something that is
"toolchain" specific.
I think the best place for a generic "fetch content" feature is in
the worker, where content can be defined in the task payload. But as
explained above, that feature isn't universally available. The next
best place is probably run-task. run-task already performs generic,
very-early task preparation steps, such as performing a VCS checkout.
I would like to fold `fetch-content` into run-task and make it all
driven by environment variables. But run-task is currently Python 2
and achieving concurrency would involve a bit of programming (or
adding package dependencies). I may very well port run-task to Python
3 and then fold fetch-content into it. Or maybe we leave
`fetch-content` as a standalone script.
MozReview-Commit-ID: AGuTcwNcNJR
--HG--
extra : source : 0b941cbdca76fb2fbb98dc5bbc1a0237c69954d0
extra : histedit_source : a3e43bdd8a9a58550bef02fec3be832ca304ea93
2018-06-07 00:37:49 +03:00
|
|
|
* ``fetch-url``
|
2018-06-21 08:07:01 +03:00
|
|
|
* ``python-test``
|
2016-11-25 22:52:46 +03:00
|
|
|
|
|
|
|
|
2016-09-12 18:51:49 +03:00
|
|
|
Task Descriptions
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
Every kind needs to create tasks, and all of those tasks have some things in
|
|
|
|
common. They all run on one of a small set of worker implementations, each
|
2019-05-17 18:56:50 +03:00
|
|
|
with their own idiosyncrasies. And they all report to TreeHerder in a similar
|
2016-09-12 18:51:49 +03:00
|
|
|
way.
|
|
|
|
|
|
|
|
The transforms in ``taskcluster/taskgraph/transforms/task.py`` implement
|
|
|
|
this common functionality. They expect a "task description", and produce a
|
|
|
|
task definition. The schema for a task description is defined at the top of
|
2016-10-05 00:06:17 +03:00
|
|
|
``task.py``, with copious comments. Go forth and read it now!
|
|
|
|
|
|
|
|
In general, the task-description transforms handle functionality that is common
|
|
|
|
to all Gecko tasks. While the schema is the definitive reference, the
|
|
|
|
functionality includes:
|
2016-09-12 18:51:49 +03:00
|
|
|
|
|
|
|
* TreeHerder metadata
|
|
|
|
|
|
|
|
* Build index routes
|
|
|
|
|
|
|
|
* Information about the projects on which this task should run
|
|
|
|
|
|
|
|
* Optimizations
|
|
|
|
|
|
|
|
* Defaults for ``expires-after`` and and ``deadline-after``, based on project
|
|
|
|
|
|
|
|
* Worker configuration
|
|
|
|
|
|
|
|
The parts of the task description that are specific to a worker implementation
|
2016-10-05 00:06:17 +03:00
|
|
|
are isolated in a ``task_description['worker']`` object which has an
|
|
|
|
``implementation`` property naming the worker implementation. Each worker
|
|
|
|
implementation has its own section of the schema describing the fields it
|
|
|
|
expects. Thus the transforms that produce a task description must be aware of
|
|
|
|
the worker implementation to be used, but need not be aware of the details of
|
|
|
|
its payload format.
|
|
|
|
|
|
|
|
The ``task.py`` file also contains a dictionary mapping treeherder groups to
|
|
|
|
group names using an internal list of group names. Feel free to add additional
|
|
|
|
groups to this list as necessary.
|
|
|
|
|
Bug 1322041 - Add signing support for all nightlies. r=dustin
Involved work which landed on the date project branch with:
* Bug 1277579, by kmoir@mozilla.com (https://hg.mozilla.org/projects/date/rev/afd3823c852b,
https://hg.mozilla.org/projects/date/rev/345f83708453,
https://hg.mozilla.org/projects/date/rev/8a3ed233af86,
https://hg.mozilla.org/projects/date/rev/0d737cf8e743,
https://hg.mozilla.org/projects/date/rev/e42b3d606002,
https://hg.mozilla.org/projects/date/rev/c3a160ac642b)
* Bug 1305096, by kmoir@mozilla.com (https://hg.mozilla.org/projects/date/rev/2287a2568038)
* Bug 1277579, by dustin@mozilla.com (https://hg.mozilla.org/projects/date/rev/79ceb7fa0589)
* Bug 1306166, by kmoir@mozilla.com (https://hg.mozilla.org/projects/date/rev/d3fd1966095d,
https://hg.mozilla.org/projects/date/rev/2f52061c02e6,
https://hg.mozilla.org/projects/date/rev/a9f52549a3c3,
https://hg.mozilla.org/projects/date/rev/f69efa90945a)
* Bug 1314847, by Callek@gmail.com (https://hg.mozilla.org/projects/date/rev/4a1231655fbb,
https://hg.mozilla.org/projects/date/rev/3cd3a0d32f43)
* Bug 1312000, by Callek@gmail.com (https://hg.mozilla.org/projects/date/rev/79a2f66ff5c0)
* Bug 1312500, by Callek@gmail.com (https://hg.mozilla.org/projects/date/rev/6ae07fa4b011)
* Bug 1316214, by Callek@gmail.com (https://hg.mozilla.org/projects/date/rev/edae37481cab,
https://hg.mozilla.org/projects/date/rev/62bd3371e954)
* Bug 1319189, by Callek@gmail.com (https://hg.mozilla.org/projects/date/rev/4c33f8ccecf5)
* Bug 1319546, by kmoir@mozilla.com (https://hg.mozilla.org/projects/date/rev/70a23d243d2c)
* No Bug, by asasaki@mozilla.com (https://hg.mozilla.org/projects/date/rev/5d8ba3560ae9)
* No Bug, by kmoir@mozilla.com (https://hg.mozilla.org/projects/date/rev/37d9733a7174)
MozReview-Commit-ID: K1uOY4HOWPX
--HG--
extra : rebase_source : 567392d5d5ddb5ee638c53221a6e545e7b5f1805
2016-12-21 19:21:06 +03:00
|
|
|
Signing Descriptions
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
Signing kinds are passed a single dependent job (from its kind dependency) to act
|
|
|
|
on.
|
|
|
|
|
|
|
|
The transforms in ``taskcluster/taskgraph/transforms/signing.py`` implement
|
|
|
|
this common functionality. They expect a "signing description", and produce a
|
|
|
|
task definition. The schema for a signing description is defined at the top of
|
|
|
|
``signing.py``, with copious comments.
|
|
|
|
|
2018-09-25 23:26:55 +03:00
|
|
|
In particular you define a set of upstream artifact urls (that point at the
|
|
|
|
dependent task) and can optionally provide a dependent name (defaults to build)
|
|
|
|
for use in ``task-reference``/``artifact-reference``. You also need to provide
|
|
|
|
the signing formats to use.
|
Bug 1322041 - Add signing support for all nightlies. r=dustin
Involved work which landed on the date project branch with:
* Bug 1277579, by kmoir@mozilla.com (https://hg.mozilla.org/projects/date/rev/afd3823c852b,
https://hg.mozilla.org/projects/date/rev/345f83708453,
https://hg.mozilla.org/projects/date/rev/8a3ed233af86,
https://hg.mozilla.org/projects/date/rev/0d737cf8e743,
https://hg.mozilla.org/projects/date/rev/e42b3d606002,
https://hg.mozilla.org/projects/date/rev/c3a160ac642b)
* Bug 1305096, by kmoir@mozilla.com (https://hg.mozilla.org/projects/date/rev/2287a2568038)
* Bug 1277579, by dustin@mozilla.com (https://hg.mozilla.org/projects/date/rev/79ceb7fa0589)
* Bug 1306166, by kmoir@mozilla.com (https://hg.mozilla.org/projects/date/rev/d3fd1966095d,
https://hg.mozilla.org/projects/date/rev/2f52061c02e6,
https://hg.mozilla.org/projects/date/rev/a9f52549a3c3,
https://hg.mozilla.org/projects/date/rev/f69efa90945a)
* Bug 1314847, by Callek@gmail.com (https://hg.mozilla.org/projects/date/rev/4a1231655fbb,
https://hg.mozilla.org/projects/date/rev/3cd3a0d32f43)
* Bug 1312000, by Callek@gmail.com (https://hg.mozilla.org/projects/date/rev/79a2f66ff5c0)
* Bug 1312500, by Callek@gmail.com (https://hg.mozilla.org/projects/date/rev/6ae07fa4b011)
* Bug 1316214, by Callek@gmail.com (https://hg.mozilla.org/projects/date/rev/edae37481cab,
https://hg.mozilla.org/projects/date/rev/62bd3371e954)
* Bug 1319189, by Callek@gmail.com (https://hg.mozilla.org/projects/date/rev/4c33f8ccecf5)
* Bug 1319546, by kmoir@mozilla.com (https://hg.mozilla.org/projects/date/rev/70a23d243d2c)
* No Bug, by asasaki@mozilla.com (https://hg.mozilla.org/projects/date/rev/5d8ba3560ae9)
* No Bug, by kmoir@mozilla.com (https://hg.mozilla.org/projects/date/rev/37d9733a7174)
MozReview-Commit-ID: K1uOY4HOWPX
--HG--
extra : rebase_source : 567392d5d5ddb5ee638c53221a6e545e7b5f1805
2016-12-21 19:21:06 +03:00
|
|
|
|
2016-10-05 00:06:17 +03:00
|
|
|
More Detail
|
|
|
|
-----------
|
|
|
|
|
|
|
|
The source files provide lots of additional detail, both in the code itself and
|
|
|
|
in the comments and docstrings. For the next level of detail beyond this file,
|
|
|
|
consult the transform source under ``taskcluster/taskgraph/transforms``.
|