aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots
diff options
context:
space:
mode:
authorGravatar Ravi Mistry <rmistry@google.com>2018-02-01 13:38:13 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-01 19:10:59 +0000
commit5e967422e048cffc8618a11d392898033ba304b4 (patch)
treea528c4097c8f5bf6b77309c9953d3a089f67225b /infra/bots
parent7198ba1726b069aad0cf9d7ca8cc815614ba5bfb (diff)
Add recipe and bots for android-compile.skia.org
Bug: skia:7469 Change-Id: I4a570a92d266d86fca20c9394c8d446df3c41e9b Reviewed-on: https://skia-review.googlesource.com/102600 Reviewed-by: Eric Boren <borenet@google.com> Commit-Queue: Ravi Mistry <rmistry@google.com>
Diffstat (limited to 'infra/bots')
-rw-r--r--infra/bots/gen_tasks.go36
-rw-r--r--infra/bots/jobs.json1
-rw-r--r--infra/bots/recipes/android_compile.expected/android_compile_nontrybot.json7
-rw-r--r--infra/bots/recipes/android_compile.expected/android_compile_trybot.json18
-rw-r--r--infra/bots/recipes/android_compile.py65
-rw-r--r--infra/bots/tasks.json29
6 files changed, 154 insertions, 2 deletions
diff --git a/infra/bots/gen_tasks.go b/infra/bots/gen_tasks.go
index 480bf9a2d1..6ba5b3f288 100644
--- a/infra/bots/gen_tasks.go
+++ b/infra/bots/gen_tasks.go
@@ -498,7 +498,10 @@ func compile(b *specs.TasksCfgBuilder, name string, parts map[string]string) str
// Android bots require a toolchain.
if strings.Contains(name, "Android") {
- if strings.Contains(name, "Mac") {
+ if parts["extra_config"] == "Android_Framework" {
+ // Do not need a toolchain when building the
+ // Android Framework.
+ } else if strings.Contains(name, "Mac") {
pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("android_ndk_darwin"))
} else if strings.Contains(name, "Win") {
pkg := b.MustGetCipdPackageFromAsset("android_ndk_windows")
@@ -747,6 +750,29 @@ func bookmaker(b *specs.TasksCfgBuilder, name, compileTaskName string) string {
return name
}
+// androidFrameworkCompile generates an Android Framework Compile task. Returns
+// the name of the last task in the generated chain of tasks, which the Job
+// should add as a dependency.
+func androidFrameworkCompile(b *specs.TasksCfgBuilder, name string) string {
+ b.MustAddTask(name, &specs.TaskSpec{
+ Dimensions: linuxGceDimensions(),
+ ExtraArgs: []string{
+ "--workdir", "../../..", "android_compile",
+ fmt.Sprintf("repository=%s", specs.PLACEHOLDER_REPO),
+ fmt.Sprintf("buildername=%s", name),
+ fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLATED_OUTDIR),
+ fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
+ fmt.Sprintf("patch_repo=%s", specs.PLACEHOLDER_PATCH_REPO),
+ fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_STORAGE),
+ fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE),
+ fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET),
+ },
+ Isolate: relpath("compile_skia.isolate"),
+ Priority: 0.8,
+ })
+ return name
+}
+
// infra generates an infra_tests task. Returns the name of the last task in the
// generated chain of tasks, which the Job should add as a dependency.
func infra(b *specs.TasksCfgBuilder, name string) string {
@@ -1155,7 +1181,12 @@ func process(b *specs.TasksCfgBuilder, name string) {
// Compile bots.
if parts["role"] == "Build" {
- deps = append(deps, compile(b, name, parts))
+ if parts["extra_config"] == "Android_Framework" {
+ // Android Framework compile tasks use a different recipe.
+ deps = append(deps, androidFrameworkCompile(b, name))
+ } else {
+ deps = append(deps, compile(b, name, parts))
+ }
}
// Most remaining bots need a compile task.
@@ -1175,6 +1206,7 @@ func process(b *specs.TasksCfgBuilder, name string) {
name != "Housekeeper-PerCommit-BundleRecipes" &&
name != "Housekeeper-PerCommit-InfraTests" &&
name != "Housekeeper-PerCommit-CheckGeneratedFiles" &&
+ !strings.Contains(name, "Android_Framework") &&
!strings.Contains(name, "RecreateSKPs") &&
!strings.Contains(name, "UpdateMetaConfig") &&
!strings.Contains(name, "-CT_") &&
diff --git a/infra/bots/jobs.json b/infra/bots/jobs.json
index cfdfb18857..b78a02623b 100644
--- a/infra/bots/jobs.json
+++ b/infra/bots/jobs.json
@@ -14,6 +14,7 @@
"Build-Debian9-Clang-arm64-Release-Android_ASAN",
"Build-Debian9-Clang-arm64-Release-Android_ASAN_Vulkan",
"Build-Debian9-Clang-arm64-Release-Android_Vulkan",
+ "Build-Debian9-Clang-gce_x86_phone-eng-Android_Framework",
"Build-Debian9-Clang-x64-Debug-Android",
"Build-Debian9-Clang-x64-Release-Android",
"Build-Debian9-Clang-x86-Debug",
diff --git a/infra/bots/recipes/android_compile.expected/android_compile_nontrybot.json b/infra/bots/recipes/android_compile.expected/android_compile_nontrybot.json
new file mode 100644
index 0000000000..4e91a2fd2c
--- /dev/null
+++ b/infra/bots/recipes/android_compile.expected/android_compile_nontrybot.json
@@ -0,0 +1,7 @@
+[
+ {
+ "name": "$result",
+ "reason": "Uncaught Exception: Exception('Build-Debian9-Clang-gce_x86_phone-eng-Android_Framework can only be run as a trybot.',)",
+ "status_code": -1
+ }
+] \ No newline at end of file
diff --git a/infra/bots/recipes/android_compile.expected/android_compile_trybot.json b/infra/bots/recipes/android_compile.expected/android_compile_trybot.json
new file mode 100644
index 0000000000..7ab6f8e4df
--- /dev/null
+++ b/infra/bots/recipes/android_compile.expected/android_compile_trybot.json
@@ -0,0 +1,18 @@
+[
+ {
+ "cmd": [
+ "python",
+ "[CUSTOM_/_B_WORK]/skia/infra/bots/android_compile/trigger_wait_ac_task.py",
+ "--issue",
+ "1234",
+ "--patchset",
+ "1"
+ ],
+ "name": "Trigger and wait for task on android-compile.skia.org"
+ },
+ {
+ "name": "$result",
+ "recipe_result": null,
+ "status_code": 0
+ }
+] \ No newline at end of file
diff --git a/infra/bots/recipes/android_compile.py b/infra/bots/recipes/android_compile.py
new file mode 100644
index 0000000000..8f8489d584
--- /dev/null
+++ b/infra/bots/recipes/android_compile.py
@@ -0,0 +1,65 @@
+# Copyright 2018 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+import math
+
+
+DEPS = [
+ 'recipe_engine/properties',
+ 'recipe_engine/step',
+ 'vars',
+]
+
+
+def RunSteps(api):
+ api.vars.setup()
+
+ buildername = api.properties['buildername']
+ issue = api.properties.get('patch_issue')
+ patchset = api.properties.get('patch_set')
+ if not issue or not patchset:
+ # This bot currently only supports trybot runs because:
+ # Non-trybot runs could fail if the Android tree is red. We mitigate this
+ # for trybot runs by verifying that runs without the patch succeed. We do
+ # not currently have a way to do the same for non-trybot runs.
+ raise Exception('%s can only be run as a trybot.' % buildername)
+
+ infrabots_dir = api.vars.skia_dir.join('infra', 'bots')
+ trigger_wait_ac_script = infrabots_dir.join('android_compile',
+ 'trigger_wait_ac_task.py')
+
+ # Trigger a compile task on android-compile.skia.org and wait for it to
+ # complete.
+ cmd = ['python', trigger_wait_ac_script,
+ '--issue', issue,
+ '--patchset', patchset,
+ ]
+ api.step('Trigger and wait for task on android-compile.skia.org', cmd=cmd)
+
+
+def GenTests(api):
+ yield(
+ api.test('android_compile_trybot') +
+ api.properties(
+ buildername='Build-Debian9-Clang-gce_x86_phone-eng-Android_Framework',
+ path_config='kitchen',
+ swarm_out_dir='[SWARM_OUT_DIR]',
+ repository='https://skia.googlesource.com/skia.git',
+ patch_issue=1234,
+ patch_set=1,
+ )
+ )
+
+ yield(
+ api.test('android_compile_nontrybot') +
+ api.properties(
+ buildername='Build-Debian9-Clang-gce_x86_phone-eng-Android_Framework',
+ path_config='kitchen',
+ swarm_out_dir='[SWARM_OUT_DIR]',
+ repository='https://skia.googlesource.com/skia.git',
+ revision='abc123',
+ ) +
+ api.expect_exception('Exception')
+ )
diff --git a/infra/bots/tasks.json b/infra/bots/tasks.json
index c4f8a04fff..48b41a6ab1 100644
--- a/infra/bots/tasks.json
+++ b/infra/bots/tasks.json
@@ -90,6 +90,12 @@
"Build-Debian9-Clang-arm64-Release-Android_Vulkan"
]
},
+ "Build-Debian9-Clang-gce_x86_phone-eng-Android_Framework": {
+ "priority": 0.8,
+ "tasks": [
+ "Build-Debian9-Clang-gce_x86_phone-eng-Android_Framework"
+ ]
+ },
"Build-Debian9-Clang-x64-Debug-Android": {
"priority": 0.8,
"tasks": [
@@ -3606,6 +3612,29 @@
"isolate": "compile_skia.isolate",
"priority": 0.8
},
+ "Build-Debian9-Clang-gce_x86_phone-eng-Android_Framework": {
+ "dimensions": [
+ "cpu:x86-64-Haswell_GCE",
+ "gpu:none",
+ "os:Debian-9.2",
+ "pool:Skia"
+ ],
+ "extra_args": [
+ "--workdir",
+ "../../..",
+ "android_compile",
+ "repository=<(REPO)",
+ "buildername=Build-Debian9-Clang-gce_x86_phone-eng-Android_Framework",
+ "swarm_out_dir=${ISOLATED_OUTDIR}",
+ "revision=<(REVISION)",
+ "patch_repo=<(PATCH_REPO)",
+ "patch_storage=<(PATCH_STORAGE)",
+ "patch_issue=<(ISSUE)",
+ "patch_set=<(PATCHSET)"
+ ],
+ "isolate": "compile_skia.isolate",
+ "priority": 0.8
+ },
"Build-Debian9-Clang-x64-Debug-Android": {
"dependencies": [
"Housekeeper-PerCommit-IsolateAndroidNDKLinux"