taskgraph.transforms.job package#
Submodules#
taskgraph.transforms.job.common module#
Common support for various job types. These functions are all named after the worker implementation they operate on, and take the same three parameters, for consistency.
- taskgraph.transforms.job.common.add_artifacts(config, job, taskdesc, path)#
- taskgraph.transforms.job.common.add_cache(job, taskdesc, name, mount_point, skip_untrusted=False)#
Adds a cache based on the worker’s implementation.
- Parameters:
job (dict) – Task’s job description.
taskdesc (dict) – Target task description to modify.
name (str) – Name of the cache.
mount_point (path) – Path on the host to mount the cache.
skip_untrusted (bool) – Whether cache is used in untrusted environments (default: False). Only applies to docker-worker.
- taskgraph.transforms.job.common.docker_worker_add_artifacts(config, job, taskdesc)#
Adds an artifact directory to the task
- taskgraph.transforms.job.common.docker_worker_add_workspace_cache(config, job, taskdesc, extra=None)#
Add the workspace cache.
- Parameters:
config (TransformConfig) – Transform configuration object.
job (dict) – Task’s job description.
taskdesc (dict) – Target task description to modify.
extra (str) – Optional context passed in that supports extending the cache key name to avoid undesired conflicts with other caches.
- taskgraph.transforms.job.common.generic_worker_add_artifacts(config, job, taskdesc)#
Adds an artifact directory to the task
- taskgraph.transforms.job.common.get_vcsdir_name(os)#
- taskgraph.transforms.job.common.support_vcs_checkout(config, job, taskdesc, repo_configs, sparse=False)#
Update a job/task with parameters to enable a VCS checkout.
This can only be used with
run-task
tasks, as the cache name is reserved forrun-task
tasks.
taskgraph.transforms.job.index_search module#
This transform allows including indexed tasks from other projects in the current taskgraph. The transform takes a list of indexes, and the optimization phase will replace the task with the task from the other graph.
- taskgraph.transforms.job.index_search.fill_template(config, job, taskdesc)#
taskgraph.transforms.job.run_task module#
Support for running jobs that are invoked via the run-task script.
- taskgraph.transforms.job.run_task.common_setup(config, job, taskdesc, command)#
- taskgraph.transforms.job.run_task.docker_worker_run_task(config, job, taskdesc)#
- taskgraph.transforms.job.run_task.generic_worker_run_task(config, job, taskdesc)#
- taskgraph.transforms.job.run_task.script_url(config, script)#
- taskgraph.transforms.job.run_task.substitute_command_context(command_context, command)#
taskgraph.transforms.job.toolchain module#
Support for running toolchain-building jobs via dedicated scripts
- taskgraph.transforms.job.toolchain.common_toolchain(config, job, taskdesc, is_docker)#
- taskgraph.transforms.job.toolchain.docker_worker_toolchain(config, job, taskdesc)#
- taskgraph.transforms.job.toolchain.generic_worker_toolchain(config, job, taskdesc)#
- taskgraph.transforms.job.toolchain.get_digest_data(config, run, taskdesc)#
Module contents#
Convert a job description into a task description.
Jobs descriptions are similar to task descriptions, but they specify how to run the job at a higher level, using a “run” field that can be interpreted by run-using handlers in taskcluster/taskgraph/transforms/job.
- taskgraph.transforms.job.add_resource_monitor(config, jobs)#
- taskgraph.transforms.job.always_optimized(config, job, taskdesc)#
- taskgraph.transforms.job.configure_taskdesc_for_run(config, job, taskdesc, worker_implementation)#
Run the appropriate function for this job against the given task description.
This will raise an appropriate error if no function exists, or if the job’s run is not valid according to the schema.
- taskgraph.transforms.job.get_attribute(dict, key, attributes, attribute_name)#
Get attribute_name from the given attributes dict, and if there is a corresponding value, set key in dict to that value.
- taskgraph.transforms.job.make_task_description(config, jobs)#
Given a build description, create a task description
- taskgraph.transforms.job.rewrite_when_to_optimization(config, jobs)#
- taskgraph.transforms.job.run_job_using(worker_implementation, run_using, schema=None, defaults={})#
Register the decorated function as able to set up a task description for jobs with the given worker implementation and run.using property. If schema is given, the job’s run field will be verified to match it.
The decorated function should have the signature using_foo(config, job, taskdesc) and should modify the task description in-place. The skeleton of the task description is already set up, but without a payload.
- taskgraph.transforms.job.set_implementation(config, jobs)#
- taskgraph.transforms.job.set_label(config, jobs)#
- taskgraph.transforms.job.use_fetches(config, jobs)#