application-services/automation/taskcluster
Thom Chiovoloni cb975b17e2
Merge branch 'master' into omegazord
2019-07-09 17:10:18 -07:00
..
docker rc_crypto initial commit (#1349) 2019-07-09 14:00:48 -04:00
README.md [automation] Rewrite Taskcluster integration to be based on servo's decisionlib. 2018-10-30 16:41:20 -07:00
build_config.py Resolves "PublicationType" not being properly used 2019-07-04 09:57:09 -07:00
decision_task.py Merge branch 'master' into omegazord 2019-07-09 17:10:18 -07:00
decisionlib.py Adds signing 2019-07-04 09:57:09 -07:00
mock.py Publish on Maven via beetmover 2019-04-24 15:31:20 -04:00

README.md

Testing Application Services on Taskcluster

Taskcluster GitHub integration

Taskcluster is very flexible and not necessarily tied to GitHub, but it does have an optional GitHub integration service that you can enable on a repository as a GitHub App. When enabled, this service gets notified for every push, pull request, or GitHub release. It then schedules some tasks based on reading .taskcluster.yml in the corresponding commit.

This file contains templates for creating one or more tasks, but the logic it can support is fairly limited. So a common pattern is to have it only run a single initial task called a decision task that can have complex logic based on code and data in the repository to build an arbitrary task graph.

Application Services decision task

This repositorys .taskcluster.yml schedules a single task that runs the Python 3 script etc/taskcluster/decision_task.py. It is called a decision task as it is responsible for deciding what other tasks to schedule.

The Docker image that runs the decision task is hosted on Docker Hub at servobrowser/taskcluster-bootstrap. It is built by Docker Hub automated builds based on a Dockerfile in the taskcluster-bootstrap-docker-images GitHub repository. Hopefully, this image does not need to be modified often as it only needs to clone the repository and run Python.

In-tree Docker images

Similar to Firefox, Application Services decision task supports running other tasks in Docker images built on-demand, based on Dockerfiles in the main repository. Modifying a Dockerfile and relying on those new changes can be done in the same pull request or commit.

To avoid rebuilding images on every pull request, they are cached based on a hash of the source Dockerfile. For now, to support this hashing, we make Dockerfiles be self-contained (with one exception). Images are built without a context, so instructions like COPY cannot be used because there is nothing to copy from. The exception is that the decision task adds support for a non-standard include directive: when a Dockerfile first line is % include followed by a filename, that line is replaced with the content of that file.

For example, automation/taskcluster/docker/build.dockerfile starts like so:

% include base.dockerfile

RUN \
    apt-get install -qy --no-install-recommends \
# […]

Build artifacts

On Taskcluster with a decision task, we can have a single build task save its resulting binary executable as an artifact, together with multiple testing tasks that each depend on the build task (wait until it successfully finishes before they can start) and start by downloading the artifact that was saved earlier.

The logic for all this is in decision_task.py and can be modified in any pull request.

Log artifacts

Taskcluster automatically save the stdio output of a task as an artifact, and as special support for seeing and streaming that output while the task is still running.

Self-service, Bugzilla, and IRC

Taskcluster is designed to be “self-service” as much as possible, with features like in-tree .taskcluster.yml or the web UI for modifying the worker type definitions. However some changes like adding a new worker type still require Taskcluster admin access. For those, file requests on Bugzilla under Taskcluster :: Service Request.

For asking for help less formally, try the #app-services or #rust-components channels on Mozilla Slack.

Configuration recap

We try to keep as much as possible of our Taskcluster configuration in this repository. To modify those, submit a pull request.