gecko_taskgraph package

Subpackages

Submodules

gecko_taskgraph.config module

gecko_taskgraph.config.load_graph_config(root_dir)
gecko_taskgraph.config.validate_graph_config(config)

gecko_taskgraph.create module

gecko_taskgraph.create.create_task(session, task_id, label, task_def)
gecko_taskgraph.create.create_tasks(graph_config, taskgraph, label_to_taskid, params, decision_task_id)

gecko_taskgraph.decision module

gecko_taskgraph.decision.full_task_graph_to_manifests_by_task(full_task_json)
gecko_taskgraph.decision.full_task_graph_to_runnable_jobs(full_task_json)
gecko_taskgraph.decision.get_decision_parameters(graph_config, options)

Load parameters from the command-line options for ‘taskgraph decision’. This also applies per-project parameters, based on the given project.

gecko_taskgraph.decision.get_existing_tasks(rebuild_kinds, parameters, graph_config)

Find the decision task corresponding to the on-push graph, and return a mapping of labels to task-ids from it. This will skip the kinds specificed by rebuild_kinds.

gecko_taskgraph.decision.read_artifact(filename)
gecko_taskgraph.decision.rename_artifact(src, dest)
gecko_taskgraph.decision.set_decision_indexes(decision_task_id, params, graph_config)
gecko_taskgraph.decision.set_try_config(parameters, task_config_file)
gecko_taskgraph.decision.taskgraph_decision(options, parameters=None)

Run the decision task. This function implements mach taskgraph decision, and is responsible for

  • processing decision task command-line options into parameters

  • running task-graph generation exactly the same way the other mach taskgraph commands do

  • generating a set of artifacts to memorialize the graph

  • calling TaskCluster APIs to create the graph

gecko_taskgraph.decision.try_syntax_from_message(message)

Parse the try syntax out of a commit message, returning ‘’ if none is found.

gecko_taskgraph.decision.try_task_config_schema = <Schema({'tasks': [<class 'str'>], 'browsertime': <class 'bool'>, 'chemspill-prio': <class 'bool'>, 'disable-pgo': <class 'bool'>, 'env': {<class 'str'>: <class 'str'>}, 'gecko-profile': <class 'bool'>, 'gecko-profile-interval': <class 'float'>, 'gecko-profile-entries': <class 'int'>, 'gecko-profile-features': <class 'str'>, 'gecko-profile-threads': <class 'str'>, 'perftest-options': <class 'object'>, 'optimize-strategies': <class 'str'>, 'rebuild': <class 'int'>, 'tasks-regex': {'include': Any(None, [<class 'str'>], msg=None), 'exclude': Any(None, [<class 'str'>], msg=None)}, 'use-artifact-builds': <class 'bool'>, 'worker-overrides': {<class 'str'>: <class 'str'>}, 'routes': [<class 'str'>]}, extra=PREVENT_EXTRA, required=False) object>

Schema for try_task_config.json files.

gecko_taskgraph.decision.write_artifact(filename, data)

gecko_taskgraph.docker module

gecko_taskgraph.files_changed module

Support for optimizing tasks based on the set of files that have changed.

gecko_taskgraph.files_changed.check(params, file_patterns)

Determine whether any of the files changed in the indicated push to https://hg.mozilla.org match any of the given file patterns.

gecko_taskgraph.files_changed.get_changed_files(repository, revision)

Get the set of files changed in the push headed by the given revision. Responses are cached, so multiple calls with the same arguments are OK.

gecko_taskgraph.files_changed.get_locally_changed_files(repo)

gecko_taskgraph.filter_tasks module

gecko_taskgraph.filter_tasks.filter_target_tasks(graph, parameters, graph_config)

Proxy filter to use legacy target tasks code.

This should go away once target_tasks are converted to filters.

gecko_taskgraph.filter_tasks.filter_task(name)

Generator to declare a task filter function.

gecko_taskgraph.generator module

class gecko_taskgraph.generator.Kind(name: str, path: str, config: dict, graph_config: taskgraph.config.GraphConfig)

Bases: object

classmethod load(root_dir, graph_config, kind_name)
load_tasks(parameters, loaded_tasks, write_artifacts)
exception gecko_taskgraph.generator.KindNotFound

Bases: Exception

Raised when trying to load kind from a directory without a kind.yml.

class gecko_taskgraph.generator.TaskGraphGenerator(root_dir, parameters, decision_task_id='DECISION-TASK', write_artifacts=False)

Bases: object

The central controller for taskgraph. This handles all phases of graph generation. The task is generated from all of the kinds defined in subdirectories of the generator’s root directory.

Access to the results of this generation, as well as intermediate values at various phases of generation, is available via properties. This encourages the provision of all generation inputs at instance construction time.

property full_task_graph

the full task set, with edges representing dependencies.

@type: TaskGraph

Type

The full task graph

property full_task_set

all tasks defined by any kind (a graph without edges)

@type: TaskGraph

Type

The full task set

property graph_config

The configuration for this graph.

@type: TaskGraph

property label_to_taskid

A dictionary mapping task label to assigned taskId. This property helps in interpreting optimized_task_graph.

@type: dictionary

property morphed_task_graph

The optimized task graph, with any subsequent morphs applied. This graph will have the same meaning as the optimized task graph, but be in a form more palatable to TaskCluster.

@type: TaskGraph

property optimized_task_graph

The set of targetted tasks and all of their dependencies; tasks that have been optimized out are either omitted or replaced with a Task instance containing only a task_id.

@type: TaskGraph

property parameters

The properties used for this graph.

@type: Properties

property target_task_graph

The set of targetted tasks and all of their dependencies

@type: TaskGraph

property target_task_set

The set of targetted tasks (a graph without edges)

@type: TaskGraph

verify(name, obj, *args, **kwargs)
gecko_taskgraph.generator.load_tasks_for_kind(parameters, kind, root_dir=None)

Get all the tasks of a given kind.

This function is designed to be called from outside of taskgraph.

gecko_taskgraph.main module

class gecko_taskgraph.main.Command(func, args, kwargs, defaults)

Bases: tuple

property args

Alias for field number 1

property defaults

Alias for field number 3

property func

Alias for field number 0

property kwargs

Alias for field number 2

gecko_taskgraph.main.action_callback(options)
gecko_taskgraph.main.argument(*args, **kwargs)
gecko_taskgraph.main.build_image(args)
gecko_taskgraph.main.command(*args, **kwargs)
gecko_taskgraph.main.create_parser()
gecko_taskgraph.main.decision(options)
gecko_taskgraph.main.dump_output(out, path=None, params_spec=None)
gecko_taskgraph.main.format_taskgraph(options, parameters, logfile=None)
gecko_taskgraph.main.format_taskgraph_json(taskgraph)
gecko_taskgraph.main.format_taskgraph_labels(taskgraph)
gecko_taskgraph.main.format_taskgraph_yaml(taskgraph)
gecko_taskgraph.main.generate_taskgraph(options, parameters, logdir)
gecko_taskgraph.main.get_filtered_taskgraph(taskgraph, tasksregex)

Filter all the tasks on basis of a regular expression and returns a new TaskGraph object

gecko_taskgraph.main.get_taskgraph_generator(root, parameters)

Helper function to make testing a little easier.

gecko_taskgraph.main.image_digest(args)
gecko_taskgraph.main.load_image(args)
gecko_taskgraph.main.main(args=['doc', '--upload', '--no-open', '--no-serve', '--write-url', '/builds/worker/firefox-source-docs-url.txt'])
gecko_taskgraph.main.setup_logging()
gecko_taskgraph.main.show_taskgraph(options)
gecko_taskgraph.main.test_action_callback(options)

gecko_taskgraph.morph module

Graph morphs are modifications to task-graphs that take place after the optimization phase.

These graph morphs are largely invisible to developers running ./mach locally, so they should be limited to changes that do not modify the meaning of the graph.

gecko_taskgraph.morph.add_eager_cache_index_tasks(taskgraph, label_to_taskid, parameters, graph_config, decision_task_id)

Some tasks (e.g. cached tasks) we want to exist in the index before they even run/complete. Our current use is to allow us to depend on an unfinished cached task in future pushes. This graph morph adds “eager-index tasks” that depend on the decision task and do the index insertions directly, which does not need to wait on the pointed at task to complete.

gecko_taskgraph.morph.add_index_tasks(taskgraph, label_to_taskid, parameters, graph_config, decision_task_id)

The TaskCluster queue only allows 10 routes on a task, but we have tasks with many more routes, for purposes of indexing. This graph morph adds “index tasks” that depend on such tasks and do the index insertions directly, avoiding the limits on task.routes.

gecko_taskgraph.morph.add_try_task_duplicates(taskgraph, label_to_taskid, parameters, graph_config, decision_task_id)
gecko_taskgraph.morph.amend_taskgraph(taskgraph, label_to_taskid, to_add)

Add the given tasks to the taskgraph, returning a new taskgraph

gecko_taskgraph.morph.derive_misc_task(target_task, purpose, image, taskgraph, label_to_taskid, parameters, graph_config, dependencies)

Create the shell of a task that depends on dependencies and on the given docker image.

gecko_taskgraph.morph.make_index_task(parent_task, taskgraph, label_to_taskid, parameters, graph_config, index_paths, index_rank, purpose, dependencies)
gecko_taskgraph.morph.morph(taskgraph, label_to_taskid, parameters, graph_config, decision_task_id)

Apply all morphs

gecko_taskgraph.parameters module

gecko_taskgraph.parameters.get_app_version(product_dir='browser')
gecko_taskgraph.parameters.get_contents(path)
gecko_taskgraph.parameters.get_defaults(repo_root=None)
gecko_taskgraph.parameters.get_version(product_dir='browser')
gecko_taskgraph.parameters.register_parameters()

gecko_taskgraph.target_tasks module

gecko_taskgraph.target_tasks.accept_raptor_android_build(platform)

Helper function for selecting the correct android raptor builds.

gecko_taskgraph.target_tasks.filter_by_regex(task_label, regexes, mode='include')

Filters tasks according to a list of pre-compiled reguar expressions.

If mode is “include”, a task label must match any regex to pass. If it is “exclude”, a task label must _not_ match any regex to pass.

gecko_taskgraph.target_tasks.filter_by_uncommon_try_tasks(task, optional_filters=None)

Filters tasks that should not be commonly run on try.

Parameters
  • task (str) – String representing the task name.

  • optional_filters (list, optional) – Additional filters to apply to task filtering.

Returns

True if task does not match any known filters.

False otherwise.

Return type

(Boolean)

gecko_taskgraph.target_tasks.filter_for_hg_branch(task, parameters)

Filter tasks by hg branch. If run_on_hg_branch is not defined, then task runs on all branches

gecko_taskgraph.target_tasks.filter_for_project(task, parameters)

Filter tasks by project. Optionally enable nightlies.

gecko_taskgraph.target_tasks.filter_on_platforms(task, platforms)

Filter tasks on the given platform

gecko_taskgraph.target_tasks.filter_out_cron(task, parameters)

Filter out tasks that run via cron.

gecko_taskgraph.target_tasks.filter_out_devedition(task, parameters)
gecko_taskgraph.target_tasks.filter_out_missing_signoffs(task, parameters)
gecko_taskgraph.target_tasks.filter_out_shippable(task)
gecko_taskgraph.target_tasks.filter_out_shipping_phase(task, parameters)
gecko_taskgraph.target_tasks.filter_release_tasks(task, parameters)
gecko_taskgraph.target_tasks.filter_tests_without_manifests(task, parameters)

Remove test tasks that have an empty ‘test_manifests’ attribute.

This situation can arise when the test loader (e.g bugbug) decided there weren’t any important manifests to run for the given push. We filter tasks out here rather than in the transforms so that the full task graph is still aware that the task exists (which is needed by the backfill action).

gecko_taskgraph.target_tasks.filter_unsupported_artifact_builds(task, parameters)
gecko_taskgraph.target_tasks.get_method(method)

Get a target_task_method to pass to a TaskGraphGenerator.

gecko_taskgraph.target_tasks.index_exists(index_path, reason='')
gecko_taskgraph.target_tasks.is_geckoview(task, parameters)
gecko_taskgraph.target_tasks.make_desktop_nightly_filter(platforms)

Returns a filter that gets all nightly tasks on the given platform.

gecko_taskgraph.target_tasks.standard_filter(task, parameters)
gecko_taskgraph.target_tasks.target_tasks_autoland(full_task_graph, parameters, graph_config)

In addition to doing the filtering by project that the ‘default’ filter does, also remove any tests running against shippable builds for non-backstop pushes.

gecko_taskgraph.target_tasks.target_tasks_backfill_all_browsertime(full_task_graph, parameters, graph_config)

Search for revisions that contains patches that were reviewed by perftest reviewers and landed the day before the cron is running. Trigger backfill-all-browsertime action task on each of them.

gecko_taskgraph.target_tasks.target_tasks_bouncer_check(full_task_graph, parameters, graph_config)

Select the set of tasks required to perform bouncer version verification.

gecko_taskgraph.target_tasks.target_tasks_build_linux64_clang_trunk_perf(full_task_graph, parameters, graph_config)

Select tasks required to run perf test on linux64 build with clang trunk

gecko_taskgraph.target_tasks.target_tasks_chromium_update(full_task_graph, parameters, graph_config)

Select tasks required for building latest chromium versions.

gecko_taskgraph.target_tasks.target_tasks_codereview(full_task_graph, parameters, graph_config)

Select all code review tasks needed to produce a report

gecko_taskgraph.target_tasks.target_tasks_condprof(full_task_graph, parameters, graph_config)

Select tasks required for building conditioned profiles.

gecko_taskgraph.target_tasks.target_tasks_customv8_update(full_task_graph, parameters, graph_config)

Select tasks required for building latest d8/v8 version.

gecko_taskgraph.target_tasks.target_tasks_daily_releases(full_task_graph, parameters, graph_config)

Select the set of tasks required to identify if we should release. If we determine that we should the task will communicate to ship-it to schedule the release itself.

gecko_taskgraph.target_tasks.target_tasks_default(full_task_graph, parameters, graph_config)

Target the tasks which have indicated they should be run on this project via the run_on_projects attributes.

gecko_taskgraph.target_tasks.target_tasks_file_update(full_task_graph, parameters, graph_config)

Select the set of tasks required to perform nightly in-tree file updates

gecko_taskgraph.target_tasks.target_tasks_general_perf_testing(full_task_graph, parameters, graph_config)

Select tasks required for running performance tests 3 times a week.

gecko_taskgraph.target_tasks.target_tasks_graphics(full_task_graph, parameters, graph_config)

In addition to doing the filtering by project that the ‘default’ filter does, also remove artifact builds because we have csets on the graphics branch that aren’t on the candidate branches of artifact builds

gecko_taskgraph.target_tasks.target_tasks_kaios(full_task_graph, parameters, graph_config)

The set of tasks to run for kaios integration

gecko_taskgraph.target_tasks.target_tasks_l10n_bump(full_task_graph, parameters, graph_config)

Select the set of tasks required to perform l10n bumping.

gecko_taskgraph.target_tasks.target_tasks_l10n_cross_channel(full_task_graph, parameters, graph_config)

Select the set of tasks required to run l10n cross-channel.

gecko_taskgraph.target_tasks.target_tasks_merge_automation(full_task_graph, parameters, graph_config)

Select the set of tasks required to perform repository merges.

gecko_taskgraph.target_tasks.target_tasks_mozilla_beta(full_task_graph, parameters, graph_config)

Select the set of tasks required for a promotable beta or release build of desktop, plus android CI. The candidates build process involves a pipeline of builds and signing, but does not include beetmover or balrog jobs.

gecko_taskgraph.target_tasks.target_tasks_mozilla_central(full_task_graph, parameters, graph_config)

In addition to doing the filtering by project that the ‘default’ filter does, also remove any tests running against regular (aka not shippable, asan, etc.) opt builds.

gecko_taskgraph.target_tasks.target_tasks_mozilla_esr102(full_task_graph, parameters, graph_config)

Select the set of tasks required for a promotable beta or release build of desktop, without android CI. The candidates build process involves a pipeline of builds and signing, but does not include beetmover or balrog jobs.

gecko_taskgraph.target_tasks.target_tasks_mozilla_esr91(full_task_graph, parameters, graph_config)

Select the set of tasks required for a promotable beta or release build of desktop, without android CI. The candidates build process involves a pipeline of builds and signing, but does not include beetmover or balrog jobs.

gecko_taskgraph.target_tasks.target_tasks_mozilla_release(full_task_graph, parameters, graph_config)

Select the set of tasks required for a promotable beta or release build of desktop, plus android CI. The candidates build process involves a pipeline of builds and signing, but does not include beetmover or balrog jobs.

gecko_taskgraph.target_tasks.target_tasks_nightly_asan(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of asan. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nightly_desktop(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of linux, mac, windows.

gecko_taskgraph.target_tasks.target_tasks_nightly_linux(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of linux. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nightly_macosx(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of macosx. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nightly_win32(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of win32 and win64. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nightly_win64(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of win32 and win64. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nightly_win64_aarch64(full_task_graph, parameters, graph_config)

Select the set of tasks required for a nightly build of win32 and win64. The nightly build process involves a pipeline of builds, signing, and, eventually, uploading the tasks to balrog.

gecko_taskgraph.target_tasks.target_tasks_nothing(full_task_graph, parameters, graph_config)

Select nothing, for DONTBUILD pushes

gecko_taskgraph.target_tasks.target_tasks_perftest(full_task_graph, parameters, graph_config)

Select perftest tasks we want to run daily

gecko_taskgraph.target_tasks.target_tasks_perftest_autoland(full_task_graph, parameters, graph_config)

Select perftest tasks we want to run daily

gecko_taskgraph.target_tasks.target_tasks_pine(full_task_graph, parameters, graph_config)

Bug 1339179 - no mobile automation needed on pine

gecko_taskgraph.target_tasks.target_tasks_promote_desktop(full_task_graph, parameters, graph_config)

Select the superset of tasks required to promote a beta or release build of a desktop product. This should include all non-android mozilla_{beta,release} tasks, plus l10n, beetmover, balrog, etc.

gecko_taskgraph.target_tasks.target_tasks_push_desktop(full_task_graph, parameters, graph_config)

Select the set of tasks required to push a build of desktop to cdns. Previous build deps will be optimized out via action task.

gecko_taskgraph.target_tasks.target_tasks_raptor_tp6m(full_task_graph, parameters, graph_config)

Select tasks required for running raptor cold page-load tests on fenix and refbrow

gecko_taskgraph.target_tasks.target_tasks_release_simulation(full_task_graph, parameters, graph_config)

Select builds that would run on push on a release branch.

gecko_taskgraph.target_tasks.target_tasks_scriptworker_canary(full_task_graph, parameters, graph_config)

Select the set of tasks required to run scriptworker canaries.

gecko_taskgraph.target_tasks.target_tasks_searchfox(full_task_graph, parameters, graph_config)

Select tasks required for indexing Firefox for Searchfox web site each day

gecko_taskgraph.target_tasks.target_tasks_ship_desktop(full_task_graph, parameters, graph_config)

Select the set of tasks required to ship desktop. Previous build deps will be optimized out via action task.

gecko_taskgraph.target_tasks.target_tasks_ship_geckoview(full_task_graph, parameters, graph_config)

Select the set of tasks required to ship geckoview nightly. The nightly build process involves a pipeline of builds and an upload to maven.mozilla.org.

gecko_taskgraph.target_tasks.target_tasks_staging_release(full_task_graph, parameters, graph_config)

Select all builds that are part of releases.

gecko_taskgraph.target_tasks.target_tasks_system_symbols(full_task_graph, parameters, graph_config)

Select tasks for scraping and uploading system symbols.

gecko_taskgraph.target_tasks.target_tasks_try(full_task_graph, parameters, graph_config)
gecko_taskgraph.target_tasks.target_tasks_try_auto(full_task_graph, parameters, graph_config)

Target the tasks which have indicated they should be run on autoland (rather than try) via the run_on_projects attributes.

Should do the same thing as the default target tasks method.

gecko_taskgraph.target_tasks.target_tasks_try_select(full_task_graph, parameters, graph_config)
gecko_taskgraph.target_tasks.target_tasks_try_select_uncommon(full_task_graph, parameters, graph_config)
gecko_taskgraph.target_tasks.target_tasks_updatebot_cron(full_task_graph, parameters, graph_config)

Select tasks required to run Updatebot’s cron job

gecko_taskgraph.try_option_syntax module

class gecko_taskgraph.try_option_syntax.TryOptionSyntax(parameters, full_task_graph, graph_config)

Bases: object

find_all_attribute_suffixes(graph, prefix)
generate_test_tiers(full_task_graph)
handle_alias(test, all_tests)

Expand a test if its name refers to an alias, returning a list of test dictionaries cloned from the first (to maintain any metadata).

parse_build_types(build_types_arg, full_task_graph)
parse_jobs(jobs_arg)
parse_platforms(options, full_task_graph)
parse_test_chunks(all_tests, tests)

Test flags may include parameters to narrow down the number of chunks in a given push. We don’t model 1 chunk = 1 job in taskcluster so we must check each test flag to see if it is actually specifying a chunk.

parse_test_option(attr_name, test_arg, full_task_graph)

Parse a unittest (-u) or talos (-t) option, in the context of a full task graph containing available unittest_try_name or talos_try_name attributes. There are three cases:

  • test_arg is == ‘none’ (meaning an empty list)

  • test_arg is == ‘all’ (meaning use the list of jobs for that job type)

  • test_arg is comma string which needs to be parsed

parse_test_opts(input_str, all_platforms)

Parse testspec,testspec,.., where each testspec is a test name optionally followed by a list of test platforms or negated platforms in [].

No brackets indicates that tests should run on all platforms for which builds are available. If testspecs are provided, then each is treated, from left to right, as an instruction to include or (if negated) exclude a set of test platforms. A single spec may expand to multiple test platforms via UNITTEST_PLATFORM_PRETTY_NAMES. If the first test spec is negated, processing begins with the full set of available test platforms; otherwise, processing begins with an empty set of test platforms.

task_matches(task)
gecko_taskgraph.try_option_syntax.alias_contains(infix)
gecko_taskgraph.try_option_syntax.alias_matches(pattern)
gecko_taskgraph.try_option_syntax.alias_prefix(prefix)
gecko_taskgraph.try_option_syntax.escape_whitespace_in_brackets(input_str)

In tests you may restrict them by platform [] inside of the brackets whitespace may occur this is typically invalid shell syntax so we escape it with backslash sequences .

gecko_taskgraph.try_option_syntax.parse_message(message)
gecko_taskgraph.try_option_syntax.split_try_msg(message)

Module contents

gecko_taskgraph.register(graph_config)

Used to register Gecko specific extensions.

Parameters

graph_config – The graph configuration object.