Add support for Build...ParentRevision tasks.

Bug: skia:7344
Change-Id: I458afe4abe5edff8b8ccbd5abdaf4ebbf892ee00
Reviewed-on: https://skia-review.googlesource.com/90245
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
This commit is contained in:
Ben Wagner 2018-01-04 11:37:17 -05:00 committed by Skia Commit-Bot
parent 243f605ce9
commit 6dbff086f0
9 changed files with 350 additions and 1 deletions

View File

@ -30,6 +30,7 @@
"Build-Debian9-Clang-x86_64-Release-Chromebook_GLES",
"Build-Debian9-Clang-x86_64-Release-Fast",
"Build-Debian9-Clang-x86_64-Release-Mini",
"Build-Debian9-Clang-x86_64-Release-ParentRevision",
"Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD",
"Build-Debian9-Clang-x86_64-Release-SK_CPU_LIMIT_SSE2",
"Build-Debian9-Clang-x86_64-Release-SK_CPU_LIMIT_SSE41",

View File

@ -35,7 +35,9 @@ class SkiaApi(recipe_api.RecipeApi):
def checkout_steps(self):
"""Run the steps to obtain a checkout of Skia."""
cfg_kwargs = {}
is_parent_revision = 'ParentRevision' in self.m.vars.extra_tokens
if not self.m.vars.persistent_checkout:
assert not is_parent_revision
# We should've obtained the Skia checkout through isolates, so we don't
# need to perform the checkout ourselves.
return
@ -132,9 +134,19 @@ class SkiaApi(recipe_api.RecipeApi):
)
self.m.bot_update._repository = patch_repo
if not self.m.vars.is_trybot and is_parent_revision:
main.revision = main.revision + '^'
self.m.gclient.c = gclient_cfg
with self.m.context(cwd=self.m.vars.checkout_root):
update_step = self.m.bot_update.ensure_checkout(patch_root=patch_root)
update_step = self.m.bot_update.ensure_checkout(
patch_root=patch_root,
# The logic in ensure_checkout for this arg is fairly naive, so if
# patch=False, we'll see "... (without patch)" in the step names, even
# for non-trybot runs, which is misleading and confusing. Therefore,
# always specify patch=True for non-trybot runs.
patch=not (self.m.vars.is_trybot and is_parent_revision)
)
self.m.vars.got_revision = (
update_step.presentation.properties['got_revision'])

View File

@ -0,0 +1,116 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"ensure-directory",
"--mode",
"0777",
"[CUSTOM_C:\\_B_WORK]"
],
"infra_step": true,
"name": "makedirs checkout_path"
},
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"remove",
"[CUSTOM_C:\\_B_WORK]/.gclient_entries"
],
"infra_step": true,
"name": "remove [CUSTOM_C:\\_B_WORK]/.gclient_entries"
},
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
"cache_dir = '[CUSTOM_C:\\\\_B_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': False, 'name': 'skia', 'url': 'https://skia.googlesource.com/skia.git'}]",
"--patch_root",
"skia",
"--revision_mapping_file",
"{\"got_revision\": \"skia\"}",
"--git-cache-dir",
"[CUSTOM_C:\\_B_CACHE]",
"--cleanup-dir",
"[CLEANUP]/bot_update",
"--output_json",
"/path/to/tmp/json",
"--revision",
"skia@abc123^"
],
"cwd": "[CUSTOM_C:\\_B_WORK]",
"env_prefixes": {
"PATH": [
"RECIPE_PACKAGE_REPO[depot_tools]"
]
},
"infra_step": true,
"name": "bot_update",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"skia\": \"abc123^\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"manifest\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"skia\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"repository\": \"https://fake.org/skia.git\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"skia\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_revision_cp\": \"refs/heads/master@{#164710}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"skia\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"source_manifest\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"directories\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"skia\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"git_checkout\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"repo_url\": \"https://fake.org/skia.git\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"version\": 0@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_revision@\"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
"@@@SET_BUILD_PROPERTY@got_revision_cp@\"refs/heads/master@{#164710}\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"ensure-directory",
"--mode",
"0777",
"[START_DIR]/tmp"
],
"infra_step": true,
"name": "makedirs tmp_dir"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

View File

@ -0,0 +1,116 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"ensure-directory",
"--mode",
"0777",
"[CUSTOM_C:\\_B_WORK]"
],
"infra_step": true,
"name": "makedirs checkout_path"
},
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"remove",
"[CUSTOM_C:\\_B_WORK]/.gclient_entries"
],
"infra_step": true,
"name": "remove [CUSTOM_C:\\_B_WORK]/.gclient_entries"
},
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
"cache_dir = '[CUSTOM_C:\\\\_B_CACHE]'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': False, 'name': 'skia', 'url': 'https://skia.googlesource.com/skia.git'}]",
"--patch_root",
"skia",
"--revision_mapping_file",
"{\"got_revision\": \"skia\"}",
"--git-cache-dir",
"[CUSTOM_C:\\_B_CACHE]",
"--cleanup-dir",
"[CLEANUP]/bot_update",
"--output_json",
"/path/to/tmp/json",
"--revision",
"skia@abc123"
],
"cwd": "[CUSTOM_C:\\_B_WORK]",
"env_prefixes": {
"PATH": [
"RECIPE_PACKAGE_REPO[depot_tools]"
]
},
"infra_step": true,
"name": "bot_update (without patch)",
"~followup_annotations": [
"@@@STEP_TEXT@Some step text@@@",
"@@@STEP_LOG_LINE@json.output@{@@@",
"@@@STEP_LOG_LINE@json.output@ \"did_run\": true, @@@",
"@@@STEP_LOG_LINE@json.output@ \"fixed_revisions\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"skia\": \"abc123\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"manifest\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"skia\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"repository\": \"https://fake.org/skia.git\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_failure\": false, @@@",
"@@@STEP_LOG_LINE@json.output@ \"patch_root\": \"skia\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"properties\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"got_revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"got_revision_cp\": \"refs/heads/master@{#164710}\"@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"root\": \"skia\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"source_manifest\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"directories\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"skia\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"git_checkout\": {@@@",
"@@@STEP_LOG_LINE@json.output@ \"repo_url\": \"https://fake.org/skia.git\", @@@",
"@@@STEP_LOG_LINE@json.output@ \"revision\": \"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"version\": 0@@@",
"@@@STEP_LOG_LINE@json.output@ }, @@@",
"@@@STEP_LOG_LINE@json.output@ \"step_text\": \"Some step text\"@@@",
"@@@STEP_LOG_LINE@json.output@}@@@",
"@@@STEP_LOG_END@json.output@@@",
"@@@SET_BUILD_PROPERTY@got_revision@\"9046e2e693bb92a76e972b694580e5d17ad10748\"@@@",
"@@@SET_BUILD_PROPERTY@got_revision_cp@\"refs/heads/master@{#164710}\"@@@"
]
},
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"ensure-directory",
"--mode",
"0777",
"[START_DIR]/tmp"
],
"infra_step": true,
"name": "makedirs tmp_dir"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

View File

@ -31,6 +31,33 @@ def GenTests(api):
)
)
buildername = 'Build-Win-Clang-x86_64-Release-ParentRevision'
yield (
api.test('parent_revision') +
api.properties(buildername=buildername,
repository='https://skia.googlesource.com/skia.git',
revision='abc123',
path_config='kitchen',
swarm_out_dir='[SWARM_OUT_DIR]')
)
yield (
api.test('parent_revision_trybot') +
api.properties(buildername=buildername,
repository='https://skia.googlesource.com/skia.git',
revision='abc123',
path_config='kitchen',
swarm_out_dir='[SWARM_OUT_DIR]',
patch_issue=500,
patch_set=1,
patch_storage='gerrit') +
api.properties.tryserver(
buildername=buildername,
gerrit_project='skia',
gerrit_url='https://skia-review.googlesource.com/',
)
)
buildername = ('Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-' +
'Debug-All-ANGLE')
yield (

View File

@ -93,6 +93,11 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.images_dir = self.slave_dir.join('skimage')
self.skia_out = self.skia_dir.join('out', self.builder_name)
self.swarming_out_dir = self.make_path(self.m.properties['swarm_out_dir'])
if 'ParentRevision' in self.builder_name:
# Tasks that depend on ParentRevision builds usually also depend on a
# second build task. Use a different path for build results so that the
# binaries end up in different directories in the isolate.
self.swarming_out_dir = self.swarming_out_dir.join('ParentRevision')
self.local_skp_dir = self.slave_dir.join('skp')
self.local_svg_dir = self.slave_dir.join('svg')
if not self.is_compile_bot:

View File

@ -0,0 +1,35 @@
[
{
"cmd": [
"python",
"-u",
"import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n"
],
"name": "get swarming bot id",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@import os@@@",
"@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"cmd": [
"python",
"-u",
"import os\nprint os.environ.get('SWARMING_TASK_ID', '')\n"
],
"name": "get swarming task id",
"stdout": "/path/to/tmp/",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@import os@@@",
"@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_TASK_ID', '')@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

View File

@ -22,6 +22,7 @@ def RunSteps(api):
TEST_BUILDERS = [
'Build-Debian9-Clang-x86_64-Release-ParentRevision',
'Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD',
'Build-Debian9-GCC-x86_64-Release-Flutter_Android',
'Build-Debian9-GCC-x86_64-Release-PDFium',

View File

@ -186,6 +186,12 @@
"Build-Debian9-Clang-x86_64-Release-Mini"
]
},
"Build-Debian9-Clang-x86_64-Release-ParentRevision": {
"priority": 0.8,
"tasks": [
"Build-Debian9-Clang-x86_64-Release-ParentRevision"
]
},
"Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD": {
"priority": 0.8,
"tasks": [
@ -3932,6 +3938,36 @@
"isolate": "compile_skia.isolate",
"priority": 0.8
},
"Build-Debian9-Clang-x86_64-Release-ParentRevision": {
"cipd_packages": [
{
"name": "skia/bots/clang_linux",
"path": "clang_linux",
"version": "version:10"
}
],
"dimensions": [
"cpu:x86-64-Haswell_GCE",
"gpu:none",
"os:Debian-9.2",
"pool:Skia"
],
"extra_args": [
"--workdir",
"../../..",
"compile",
"repository=<(REPO)",
"buildername=Build-Debian9-Clang-x86_64-Release-ParentRevision",
"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-x86_64-Release-SKNX_NO_SIMD": {
"cipd_packages": [
{