Commit Graph

39 Commits

Author SHA1 Message Date
Dustin J. Mitchell
cef5efbeff Bug 1333255: introduce graph morphs, use them to make index tasks; r=jonasfj
Graph morphs modify the graph after optimization, without changing its meaning.
In this case, that means adding index tasks that will insert paths into the
index beyond the relatively limited number afforded in task.routes.

MozReview-Commit-ID: AJy4exX7q2v
2017-03-07 20:39:27 +00:00
Dustin J. Mitchell
f5b1646423 Bug 1333255: always include docker-image tasks in the target task graph; r=jonasfj
MozReview-Commit-ID: GX18D68TAWG
2017-03-10 17:08:34 +00:00
Dustin J. Mitchell
7b617b9156 Bug 1333255: rename taskgraph.task to taskgraph.loader; r=jonasfj
MozReview-Commit-ID: 6aPdGbxn0D1
2017-03-09 19:00:49 -05:00
Dustin J. Mitchell
37dca4a3be Bug 1333255: always transform tasks; r=jonasfj
MozReview-Commit-ID: 3A5wzXKG0Yp
2017-03-09 16:40:33 -05:00
Dustin J. Mitchell
4168dc665a Bug 1333255: remove t.get_dependencies(); r=jonasfj
MozReview-Commit-ID: 1UF9yKXeRt7
2017-03-08 21:22:31 +00:00
Dustin J. Mitchell
a0095736a7 Bug 1333255: use normal old functions to load tasks; r=jonasfj
Instead of using a class's static method, use a simple function, specified by
the `loader` key.

MozReview-Commit-ID: IeOl9qiSCXf
2017-03-09 23:14:40 -05:00
Wander Lairson Costa
97113977c9 Bug 1333167: Add extra try options to taskcluster. r=dustin a=jmaher
We add the following command line options to Taskcluster try syntax:

--spsProfile - enable profile mode.
--rebuild-talos <N> - retrigger talos tests N times.
--setenv <VAR>=<val> - add extra environments variables.
--tag <TAG> - run tests only the tag TAG.
--no-retry - doesn't retry failed jobs.

We have a chicken-egg problem, as we first generate the full task graph
and then parse the try message. But the graph generation step needs to
know the try message to process the aforementioned options. The
solution is to parse the message before graph generation and then
pass the command line options to the transforms. Then, each transform
can look at the option that interests it and process it accordingly.

The message parse function is configured in kind.yml, which gives some
flexibility for future implementations of alternative syntaxes.

MozReview-Commit-ID: GPFdi0FD6Vn
2017-02-02 09:34:43 -02:00
Sebastian Hengst
6ceaf1e6a8 Backed out changeset d6648b8f36ed (bug 1333167) for breaking gecko decision task. r=backout on a CLOSED TREE 2017-01-31 21:47:45 +01:00
Wander Lairson Costa
97963da965 Bug 1333167: Add extra try options to taskcluster. r=dustin a=jmaher
We add the following command line options to Taskcluster try syntax:

--spsProfile - enable profile mode.
--rebuild-talos <N> - retrigger talos tests N times.
--setenv <VAR>=<val> - add extra environments variables.
--tag <TAG> - run tests only the tag TAG.
--no-retry - doesn't retry failed jobs.

We have a chicken-egg problem, as we first generate the full task graph
and then parse the try message. But the graph generation step needs to
know the try message to process the aforementioned options. The
solution is to parse the message before graph generation and then
pass the command line options to the transforms. Then, each transform
can look at the option that interests it and process it accordingly.

The message parse function is configured in kind.yml, which gives some
flexibility for future implementations of alternative syntaxes.

MozReview-Commit-ID: DMwRjuV2vpf
2017-01-31 18:16:07 -02:00
Sebastian Hengst
7cb5f66fd9 Backed out changeset 50cf83b69046 (bug 1333167) for breaking gecko decision task. r=backout 2017-01-31 18:25:50 +01:00
Wander Lairson Costa
064a62b081 Bug 1333167: Add extra try options to taskcluster. r=dustin a=jmaher
We add the following command line options to Taskcluster try syntax:

--spsProfile: enable profile mode.
--rebuild-talos <N>: retrigger talos tests N times.
--setenv <VAR>=<val>: add extra environments variables.
--tag <TAG>: run tests only the tag TAG.
--no-retry: doesn't retry failed jobs.

We have a chicken-egg problem, as we first generate the full task graph
and then parse the try message. But the graph generation step needs to
know the try message to process the aforementioned options. The
solution is to parse the message before graph generation and then
pass the command line options to the transforms. Then, each transform
can look at the option that interests it and process it accordingly.

The message parse function is configured in kind.yml, which gives some
flexibility for future implementations of alternative syntaxes.

MozReview-Commit-ID: EQlE6q5E8z7
2017-01-31 15:03:10 -02:00
Hammad Akhtar
ad6e3856ce Bug 1326462 - Make the check for duplicate gecko v2 routes, happen during full graph; r=Callek
MozReview-Commit-ID: HkHpfvcjlQG
2017-01-02 19:39:30 +05:30
Justin Wood
b835b115db Bug 1325398 - Make the check for duplicate Treeherder symbols, happen during full graph not target graph stage. r=dustin
MozReview-Commit-ID: GfwAgERKdsL
2016-12-22 11:45:10 -05:00
Hammad Akhtar
4fd926d2ee Bug 1302804 - Ensure that tasks in a taskgraph do not have duplicate gecko.v2 routes; r=dustin
MozReview-Commit-ID: B4Ok4WhqBVq
2016-12-21 13:34:04 +05:30
Hammad Akhtar
331cc8e455 Bug 1323633 - Ensure that task graphs do not contain duplicate Treeherder symbols, also consider treeherder.collection.keys(); r=dustin
MozReview-Commit-ID: 3F0BHQQmSOg
2016-12-13 11:51:53 +05:30
Phil Ringnalda
2390a77384 Backed out changeset 6034929c3e4a (bug 1302802) for decision task bustage
CLOSED TREE
2016-12-13 10:01:05 -08:00
Hammad Akhtar
83471420c6 Bug 1302802 - Ensure that task graphs do not contain duplicate Treeherder symbols; r=dustin
MozReview-Commit-ID: LO2fEbxzZH2
2016-12-13 11:51:53 +05:30
Hammad Akhtar
419f90c11b Bug 1322193 - Verify taskgraph implementations against documentation, with proper regex. Updated doc verification for fake values of kinds, parameters etc., regex optimized r=Callek
MozReview-Commit-ID: 56ZEJECbtK5
2016-12-06 12:03:36 +05:30
Hammad Akhtar
b7f4533590 Bug 1302800 - Verify taskgraph implementations against documentation; r=dustin
MozReview-Commit-ID: J8djr4ifvzm
2016-11-26 01:22:46 +05:30
Gregory Szorc
5d56d07832 Bug 1318200 - Introduce task graph filtering; r=dustin
Previously, we ran a single "target task" function to mutate the full
task graph into a subset based on input parameters (try syntax,
repository being built for, etc). This concept is useful. But
the implementation was limiting because we could only have a single
"target tasks" function.

This commit introduces the concept of "filters." They conceptually
do the same thing as "target tasks methods" but you can run more than
1 of them.

Filters are simply functions that examine an input graph+parameters
and emit nodes that should be retained. Filters, like target tasks
methods, are defined via decorated functions in a module.

TaskGraphGenerator has been converted to use filters. The list of
defined filters can be defined in the parameters dict passed into
TaskGraphGenerator. A default filter list is provided in decision.py.

The intent is to eventually convert target tasks to filters. Until
that happens, we always run the registered target tasks method via
a filter proxy function.

No new tests have been added because we don't yet have any
functionality relying explicitly on filters. Tests will be added in
a subsequent commit once we add a new filter.

While I was here, I also snuck in some logging on the size of the
graphs.

MozReview-Commit-ID: ERn2hIYbMRp
2016-11-17 15:53:30 -08:00
Gregory Szorc
49ecc723ac Bug 1318200 - Obtain target tasks method from parameters; r=dustin
Previously, all callers outside of tests that passed
"target_tasks_method" to TaskGraphGenerator all used the same pattern
of looking for a key in the parameters and calling a function in
the target_tasks module.

Future commits will refactor how target tasks graph work. To
make the transition easier, we move the logic for obtaining the
target tasks method into TaskGraphGenerator.

MozReview-Commit-ID: 3QU09iGhoXh
2016-11-17 16:29:51 -08:00
Dustin J. Mitchell
1c449ca5e0 Bug 1286075: add support for optimizing based on files changed in the push; r=gps
MozReview-Commit-ID: 5di7TuL9X2P
2016-09-12 18:40:12 +00:00
Dustin J. Mitchell
bc3b92be2b Bug 1286075: if <kind>/kind.yml doesn't exist, skip it; r=gps
Version control tends to leave kind directories around containing .orig files
or other such detritus.  It's best to just ignore such directories, rather than
failing to generate the taskgraph.

MozReview-Commit-ID: B9GIZndbfi1
2016-08-18 20:08:22 +00:00
Gregory Szorc
248b1e1823 Backed out changeset 7a3a65ff5865 (bug 1295486) for test failures 2016-08-18 10:21:26 -07:00
Gregory Szorc
5fe1f3f6e3 Bug 1295486 - Decode YAML files to UTF-8 at read time; r=dustin
Before, we'd open files and feed bytes to yaml.load(). When a str
is fed to yaml.load(), it attempts to guess the encoding. It defaults
to UTF-8 unless somebody set us up the BOM. This is probably OK.
Except if the file isn't valid UTF-8, the exception will be raised
in the bowels of YAML parsing and it may not be obvious the failure
is due to invalid UTF-8 input versus say Python str/unicode
coercion foo.

We change all call sites that load YAML from a file to use
codecs.open() to open the file in UTF-8 and perform UTF-8
decoding/validation at file read time. This should make any UTF-8
failures more obvious. Furthermore, it reinforces that our YAML files
are UTF-8 and not some other encoding.

I discovered this issue as part of trying to get emoji symbols to
render on Treeherder. Unfortunately, it appears pyyaml detects
many emoji as unprintable characters and refuses to load them. This
makes me sad and makes me want to abandon pyyaml/YAML in favor of
something that supports emoji :P

MozReview-Commit-ID: AOvAruZFfnK
2016-08-18 08:58:59 -07:00
Dustin J. Mitchell
7f8ec1b437 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
2016-07-11 23:27:14 +00:00
Dustin J. Mitchell
d7455c195e Bug 1281004: factor out searching for python objects by path; r=gps
MozReview-Commit-ID: 4ioEqPA7BQk
2016-06-29 22:12:09 +00:00
Dustin J. Mitchell
dd34a63fe1 Bug 1280231: rename types.py to taskgraph.py; r=Callek
MozReview-Commit-ID: Jf6CVyFCGMI
2016-06-20 19:11:52 +00:00
Dustin J. Mitchell
9a56719bd1 Bug 1280231: Load kinds in order by dependencies; r=jonasfj
This enables kinds that generate tasks based on those output by another kind.
For example, the test kind might generate a set of test tasks for each build
task.

MozReview-Commit-ID: K7ha9OmJ6gd
2016-06-27 22:31:06 +00:00
Dustin J. Mitchell
95e890d6db Bug 1280231: refactor task kinds to task classes; r=jonasfj
MozReview-Commit-ID: 1cNukxBgfey
2016-06-27 22:57:44 +00:00
Wes Kocher
d3e226b5f1 Backed out 3 changesets (bug 1280231) for decision task failures CLOSED TREE
Backed out changeset 4b1d94901b4d (bug 1280231)
Backed out changeset 7898d1ab1afc (bug 1280231)
Backed out changeset ba5cbf4e06a5 (bug 1280231)
2016-06-27 15:45:44 -07:00
Dustin J. Mitchell
0b73b6890c Bug 1280231: rename types.py to taskgraph.py; r=Callek
MozReview-Commit-ID: Jf6CVyFCGMI
2016-06-20 19:11:52 +00:00
Dustin J. Mitchell
afbf045084 Bug 1280231: Load kinds in order by dependencies; r=jonasfj
This enables kinds that generate tasks based on those output by another kind.
For example, the test kind might generate a set of test tasks for each build
task.

MozReview-Commit-ID: K7ha9OmJ6gd
2016-06-27 22:31:06 +00:00
Dustin J. Mitchell
c27fdb1128 Bug 1280231: refactor task kinds to task classes; r=jonasfj
MozReview-Commit-ID: 1cNukxBgfey
2016-06-20 20:45:15 +00:00
Justin Wood
46e1d74044 Bug 1280956 - Use in-tree linter job to flake8 test taskcluster directory. r=dustin
MozReview-Commit-ID: FsWmAnnycZ2
2016-06-20 21:06:55 -04:00
Dustin J. Mitchell
833bb86436 Bug 1274611: Implement task-graph optimization; r=gps
* Implement & document optimization (although legacy kind doesn't do much of it)
 * Introduce `optimize_target_tasks` parameter to control whether tasks in the
   target set can be optimized (no for try, yes for most other branches)
 * Refactor to include resolved taskIds in the optimized task graph
 * Include a `label-to-taskid.json` artifact.
 * Introduce {'task-reference': '... <dependency-name> ...'} for referring to
   parent tasks' taskId.

MozReview-Commit-ID: LWvlWNz49U5
2016-06-05 19:49:41 +00:00
Dustin J. Mitchell
5044322096 Bug 1273673: log phases of taskgraph generation; r=gps
MozReview-Commit-ID: 1raUmGXSS8b
2016-05-18 15:54:30 +00:00
Dustin J. Mitchell
856120aa44 Bug 1273673: use Python logging for taskgraph generation; r=gps
MozReview-Commit-ID: EYI6hGFUWP8
2016-05-18 18:02:51 +00:00
Dustin J. Mitchell
2db03e8aeb Bug 1258497: Implement a new taskgraph generation system; r=gps
The `taskgraph` package generates TaskCluster task graphs based on collections
of task "kinds".  Initially, there is only one kind, the "legacy" kind, which
reads the YAML files from `testing/taskcluster/tasks` to generate the task
graph.

Try syntax is implemented by filtering the tasks in the taskgraph after it has
been created, then extending the result to include any prerequisite tasks.

A collection of `mach taskgraph` subcommands are provided for developers to
extend or debug the task-graph generation process.

MozReview-Commit-ID: 1TJCns4XxZ8
2016-05-16 22:53:22 +00:00