Make lunch/mmma targets configurable and add new Android compile bot

Bug: skia:8560
Change-Id: I9287d8286a49d067c14a4cc560220c08d3c0c040
Reviewed-on: https://skia-review.googlesource.com/c/172865
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
This commit is contained in:
Ravi Mistry 2018-11-26 12:36:34 -05:00 committed by Skia Commit-Bot
parent 98cb159121
commit 65523c5555
8 changed files with 196 additions and 0 deletions

View File

@ -49,6 +49,8 @@ class AndroidCompileException(Exception):
def _create_task_dict(options):
"""Creates a dict representation of the requested task."""
params = {}
params['lunch_target'] = options.lunch_target
params['mmma_targets'] = options.mmma_targets
params['issue'] = options.issue
params['patchset'] = options.patchset
params['hash'] = options.hash
@ -191,6 +193,13 @@ def pretty_task_str(task):
def main():
option_parser = optparse.OptionParser()
option_parser.add_option(
'', '--lunch_target', type=str, default='',
help='The lunch target the android compile bot should build with.')
option_parser.add_option(
'', '--mmma_targets', type=str, default='',
help='The comma-separated mmma targets the android compile bot should '
'build.')
option_parser.add_option(
'', '--issue', type=int, default=0,
help='The Gerrit change number to get the patch from.')

View File

@ -18,6 +18,7 @@
"Build-Debian9-Clang-arm64-Release-Android_ASAN_Vulkan",
"Build-Debian9-Clang-arm64-Release-Android_Vulkan",
"Build-Debian9-Clang-cf_x86_phone-eng-Android_Framework",
"Build-Debian9-Clang-host-sdk-Android_Framework",
"Build-Debian9-Clang-x64-Debug-Android",
"Build-Debian9-Clang-x64-Release-Android",
"Build-Debian9-Clang-x86-Debug",

View File

@ -0,0 +1,21 @@
[
{
"cmd": [
"python",
"[START_DIR]/skia/infra/bots/android_compile/trigger_wait_ac_task.py",
"--lunch_target",
"sdk",
"--mmma_targets",
"external/skia",
"--issue",
"1234",
"--patchset",
"1"
],
"name": "Trigger and wait for task on android compile server"
},
{
"jsonResult": null,
"name": "$result"
}
]

View File

@ -3,6 +3,10 @@
"cmd": [
"python",
"[START_DIR]/skia/infra/bots/android_compile/trigger_wait_ac_task.py",
"--lunch_target",
"cf_x86_phone-eng",
"--mmma_targets",
"frameworks/base/core/jni,external/skia",
"--issue",
"1234",
"--patchset",

View File

@ -3,6 +3,10 @@
"cmd": [
"python",
"[START_DIR]/skia/infra/bots/android_compile/trigger_wait_ac_task.py",
"--lunch_target",
"cf_x86_phone-eng",
"--mmma_targets",
"frameworks/base/core/jni,external/skia",
"--issue",
"1234",
"--patchset",

View File

@ -0,0 +1,13 @@
[
{
"failure": {
"exception": {
"traceback": [
"<omitted by recipe engine>"
]
},
"humanReason": "Uncaught Exception: Exception('Lunch target in Build-Debian9-Clang-unrecognized-Android_Framework is not recognized.',)"
},
"name": "$result"
}
]

View File

@ -15,6 +15,14 @@ DEPS = [
'recipe_engine/step',
]
CF_X86_PHONE_ENG_LUNCH_TARGET = 'cf_x86_phone-eng'
SDK_LUNCH_TARGET = 'sdk'
LUNCH_TARGET_TO_MMMA_TARGETS = {
CF_X86_PHONE_ENG_LUNCH_TARGET: 'frameworks/base/core/jni,external/skia',
SDK_LUNCH_TARGET: 'external/skia',
}
def RunSteps(api):
buildername = api.properties['buildername']
@ -27,6 +35,15 @@ def RunSteps(api):
# not currently have a way to do the same for non-trybot runs.
raise Exception('%s can only be run as a trybot.' % buildername)
if CF_X86_PHONE_ENG_LUNCH_TARGET in buildername:
lunch_target = CF_X86_PHONE_ENG_LUNCH_TARGET
mmma_targets = LUNCH_TARGET_TO_MMMA_TARGETS[lunch_target]
elif SDK_LUNCH_TARGET in buildername:
lunch_target = SDK_LUNCH_TARGET
mmma_targets = LUNCH_TARGET_TO_MMMA_TARGETS[SDK_LUNCH_TARGET]
else:
raise Exception('Lunch target in %s is not recognized.' % buildername)
infrabots_dir = api.path['start_dir'].join('skia', 'infra', 'bots')
trigger_wait_ac_script = infrabots_dir.join('android_compile',
'trigger_wait_ac_task.py')
@ -34,6 +51,8 @@ def RunSteps(api):
# Trigger a compile task on the android compile server and wait for it to
# complete.
cmd = ['python', trigger_wait_ac_script,
'--lunch_target', lunch_target,
'--mmma_targets', mmma_targets,
'--issue', issue,
'--patchset', patchset,
]
@ -68,6 +87,31 @@ def GenTests(api):
)
)
yield(
api.test('android_compile_sdk_trybot') +
api.properties(
buildername='Build-Debian9-Clang-host-sdk-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_unrecognized_target') +
api.properties(
buildername='Build-Debian9-Clang-unrecognized-Android_Framework',
path_config='kitchen',
swarm_out_dir='[SWARM_OUT_DIR]',
repository='https://skia.googlesource.com/skia.git',
patch_issue=1234,
patch_set=1,
) +
api.expect_exception('Exception')
)
yield(
api.test('android_compile_trybot_failure') +
api.properties(

View File

@ -97,6 +97,12 @@
],
"trigger": "on demand"
},
"Build-Debian9-Clang-host-sdk-Android_Framework": {
"tasks": [
"Build-Debian9-Clang-host-sdk-Android_Framework"
],
"trigger": "on demand"
},
"Build-Debian9-Clang-x64-Debug-Android": {
"tasks": [
"Build-Debian9-Clang-x64-Debug-Android"
@ -5416,6 +5422,100 @@
"max_attempts": 1,
"service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com"
},
"Build-Debian9-Clang-host-sdk-Android_Framework": {
"caches": [
{
"name": "vpython",
"path": "cache/vpython"
}
],
"cipd_packages": [
{
"name": "infra/tools/luci/kitchen/${platform}",
"path": ".",
"version": "git_revision:546aae39f1fb9dce9add528e2011afa574535ecd"
},
{
"name": "infra/tools/luci-auth/${platform}",
"path": "cipd_bin_packages",
"version": "git_revision:e1abc57be62d198b5c2f487bfb2fa2d2eb0e867c"
},
{
"name": "infra/tools/luci/vpython/${platform}",
"path": "cipd_bin_packages",
"version": "git_revision:b6cdec8586c9f8d3d728b1bc0bd4331330ba66fc"
}
],
"command": [
"./kitchen${EXECUTABLE_SUFFIX}",
"cook",
"-checkout-dir",
"recipe_bundle",
"-mode",
"swarming",
"-luci-system-account",
"system",
"-cache-dir",
"cache",
"-temp-dir",
"tmp",
"-known-gerrit-host",
"android.googlesource.com",
"-known-gerrit-host",
"boringssl.googlesource.com",
"-known-gerrit-host",
"chromium.googlesource.com",
"-known-gerrit-host",
"dart.googlesource.com",
"-known-gerrit-host",
"fuchsia.googlesource.com",
"-known-gerrit-host",
"go.googlesource.com",
"-known-gerrit-host",
"llvm.googlesource.com",
"-known-gerrit-host",
"skia.googlesource.com",
"-known-gerrit-host",
"webrtc.googlesource.com",
"-output-result-json",
"${ISOLATED_OUTDIR}/build_result_filename",
"-workdir",
".",
"-recipe",
"android_compile",
"-properties",
"{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"Build-Debian9-Clang-host-sdk-Android_Framework\",\"patch_issue\":\"<(ISSUE)\",\"patch_ref\":\"<(PATCH_REF)\",\"patch_repo\":\"<(PATCH_REPO)\",\"patch_set\":\"<(PATCHSET)\",\"patch_storage\":\"<(PATCH_STORAGE)\",\"repository\":\"<(REPO)\",\"revision\":\"<(REVISION)\",\"swarm_out_dir\":\"output_ignored\"}",
"-logdog-annotation-url",
"logdog://logs.chromium.org/skia/<(TASK_ID)/+/annotations"
],
"dependencies": [
"Housekeeper-PerCommit-BundleRecipes"
],
"dimensions": [
"cpu:x86-64-Haswell_GCE",
"gpu:none",
"machine_type:n1-highmem-2",
"os:Debian-9.4",
"pool:Skia"
],
"env_prefixes": {
"PATH": [
"cipd_bin_packages",
"cipd_bin_packages/bin"
],
"VPYTHON_VIRTUALENV_ROOT": [
"cache/vpython"
]
},
"execution_timeout_ns": 3600000000000,
"extra_tags": {
"log_location": "logdog://logs.chromium.org/skia/<(TASK_ID)/+/annotations"
},
"io_timeout_ns": 3600000000000,
"isolate": "swarm_recipe.isolate",
"max_attempts": 1,
"service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com"
},
"Build-Debian9-Clang-x64-Debug-Android": {
"caches": [
{