-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Export IS_DOCKER from taskcluster/docker/base/Dockerfile Ensures that the `IS_DOCKER` environment variable is set to `1` for all CI tasks, by exporting it within the base Dockerfile build. * Define Dockerfile for inference-related tasks in CI Defines a Dockerfile for an image that is capable of running tasks related to the inference engine in the taskcluster CI. * Refactor how inference tasks are run within docker Refactors the organization and error messages for running inference-related tasks from Taskfile. Tasks should now be run in docker locally using `task docker-run`. This is because when the tasks are running in docker on CI, they should not be calling out to the `docker` command itself: the environment is already within docker. * Add taskcluster kind for inference Adds a taskcluster kind definition for tasks to run related to the inference directroy on each PR. Ensures that these tasks only run if releavant files to these tasks have been modified. * Rename "all*" kinds to "all*-pipeline" Renames taskcluster kinds that use the wording "all" to be called "all-pipeline" to improve the clarity of what they do.
- Loading branch information
Showing
12 changed files
with
195 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
FROM $DOCKER_IMAGE_PARENT | ||
LABEL maintainer="Mozilla Release Engineering <[email protected]>" | ||
|
||
RUN apt-get update -qq \ | ||
# We need to install tzdata before all of the other packages. Otherwise it will show an interactive dialog that | ||
# we cannot navigate while building the Docker image. | ||
&& apt-get install -y tzdata \ | ||
&& apt-get install -y wget \ | ||
curl \ | ||
zip \ | ||
build-essential \ | ||
gcc \ | ||
g++ \ | ||
make \ | ||
cmake \ | ||
libboost-dev \ | ||
libboost-all-dev \ | ||
libpcre2-dev \ | ||
zstd \ | ||
tar \ | ||
libxml2 \ | ||
libhunspell-dev \ | ||
bc \ | ||
autoconf \ | ||
automake \ | ||
autopoint \ | ||
libtool \ | ||
&& apt-get clean | ||
|
||
RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | apt-key add - | ||
COPY intel-mkl.list /etc/apt/sources.list.d/intel-mkl.list | ||
|
||
RUN apt-get update -qq \ | ||
&& apt-get install -y intel-mkl-64bit-2020.0-088 \ | ||
&& apt-get clean | ||
|
||
RUN locale-gen "$LANG" | ||
|
||
# Install taskfile - https://taskfile.dev/ | ||
# Keep the version in sync with docker/Dockerfile. | ||
RUN curl -sSLf "https://github.com/go-task/task/releases/download/v3.35.1/task_linux_amd64.tar.gz" \ | ||
| tar -xz -C /usr/local/bin | ||
|
||
ENV SHELL=/bin/bash \ | ||
HOME=/builds/worker \ | ||
PATH="/builds/worker/.local/bin:$PATH" | ||
|
||
VOLUME /builds/worker/checkouts | ||
VOLUME /builds/worker/.cache | ||
|
||
USER root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
deb https://apt.repos.intel.com/mkl all main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
--- | ||
|
||
loader: taskgraph.loader.transform:loader | ||
|
||
transforms: | ||
- translations_taskgraph.transforms.skip_unless_inference_changed | ||
- translations_taskgraph.transforms.worker_selection | ||
- taskgraph.transforms.task_context | ||
- taskgraph.transforms.run:transforms | ||
- taskgraph.transforms.task:transforms | ||
|
||
kind-dependencies: | ||
- toolchain | ||
|
||
task-defaults: | ||
task-context: | ||
from-parameters: | ||
base_rev: base_rev | ||
substitution-fields: | ||
- run.command | ||
worker: | ||
run: | ||
using: run-task | ||
cwd: '{checkout}' | ||
worker-type: b-cpu | ||
worker: | ||
max-run-time: 3600 | ||
docker-image: {in-tree: inference} | ||
# 128 happens when cloning this repository fails | ||
retry-exit-status: [128] | ||
|
||
tasks: | ||
build-local: | ||
description: "Build the inference engine locally" | ||
run-on-tasks-for: ["github-push", "github-pull-request"] | ||
run: | ||
command: | ||
- bash | ||
- -c | ||
- >- | ||
task inference-build | ||
test-local: | ||
description: "Run local-build tests for the inference engine" | ||
dependencies: | ||
build: inference-build-local | ||
run-on-tasks-for: ["github-pull-request"] | ||
run: | ||
command: | ||
- bash | ||
- -c | ||
- >- | ||
task inference-test | ||
build-wasm: | ||
description: "Build the wasm bindings for the inference engine" | ||
dependencies: | ||
build-local: inference-build-local | ||
run-on-tasks-for: ["github-pull-request"] | ||
run: | ||
command: | ||
- bash | ||
- -c | ||
- >- | ||
task inference-build-wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
taskcluster/translations_taskgraph/transforms/skip_unless_inference_changed.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
# | ||
# This transform sequence will remove all jobs unless at least one inference | ||
# impacting thing (an inference script or relevant Taskcluster code) has changed | ||
# (This is done with the `files_changed` helper, which uses data in the | ||
# parameters to determine files changed between the `base` and `head` revisions.) | ||
|
||
# When upstream taskgraph supports better selection (https://github.com/taskcluster/taskgraph/issues/369) | ||
# this can be replaced with it. | ||
|
||
import os | ||
from pathlib import Path | ||
|
||
from taskgraph.transforms.base import TransformSequence | ||
|
||
KIND_DIR = Path(__file__).parent.parent.parent / "kinds" | ||
|
||
# Kinds are slightly special - there are some kinds that don't affect inference, | ||
# and changing them shouldn't force inference to run. | ||
INCLUDE_KINDS = ["inference"] | ||
# Touching any file in any of these directories is considered an inference change | ||
INFERENCE_DIRS = [ | ||
"inference/**", | ||
"taskcluster/docker/inference/**", | ||
] | ||
INFERENCE_DIRS.extend( | ||
f"taskcluster/kinds/{kind}" for kind in os.listdir(KIND_DIR) if kind in INCLUDE_KINDS | ||
) | ||
|
||
transforms = TransformSequence() | ||
|
||
|
||
@transforms.add | ||
def skip_unless_inference_changed(config, jobs): | ||
for job in jobs: | ||
job.setdefault("optimization", {}) | ||
job["optimization"]["skip-unless-changed"] = INFERENCE_DIRS | ||
|
||
yield job |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters