diff options
author | 2018-01-05 11:13:43 -0500 | |
---|---|---|
committer | 2018-01-05 18:13:36 +0000 | |
commit | 4a577af2d8b177fef873acdfc1915e4f09e3614d (patch) | |
tree | e22884f72b2eeea069c3a46b6b19ef7a9981049e | |
parent | f5404bbcf49dbb3b0799cb6bd647c9a2ea14bea4 (diff) |
Separate compile task from calmbench task
Bug: skia:7344
Change-Id: I019fe5e3178d13ccf3a510bdcf1c81915149def5
Reviewed-on: https://skia-review.googlesource.com/89900
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
-rw-r--r-- | infra/bots/calmbench.isolate | 14 | ||||
-rw-r--r-- | infra/bots/gen_tasks.go | 37 | ||||
-rw-r--r-- | infra/bots/recipe_modules/vars/api.py | 2 | ||||
-rw-r--r-- | infra/bots/recipe_modules/vars/examples/full.py | 2 | ||||
-rw-r--r-- | infra/bots/recipes/calmbench.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json | 174 | ||||
-rw-r--r-- | infra/bots/recipes/calmbench.expected/Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All.json | 174 | ||||
-rw-r--r-- | infra/bots/recipes/calmbench.py | 29 | ||||
-rw-r--r-- | infra/bots/recipes/upload_calmbench_results.expected/normal_bot.json | 98 | ||||
-rw-r--r-- | infra/bots/recipes/upload_calmbench_results.expected/trybot.json | 102 | ||||
-rw-r--r-- | infra/bots/tasks.json | 8 | ||||
-rw-r--r-- | tools/calmbench/ab.py | 7 | ||||
-rw-r--r-- | tools/calmbench/calmbench.py | 1 |
12 files changed, 109 insertions, 539 deletions
diff --git a/infra/bots/calmbench.isolate b/infra/bots/calmbench.isolate new file mode 100644 index 0000000000..58cf18a1b3 --- /dev/null +++ b/infra/bots/calmbench.isolate @@ -0,0 +1,14 @@ +{ + 'includes': [ + 'android_bin.isolate', + 'ios_bin.isolate', + 'resources.isolate', + 'swarm_recipe.isolate', + ], + 'variables': { + 'files': [ + '../../../.gclient', + '../../tools/calmbench/', + ], + }, +} diff --git a/infra/bots/gen_tasks.go b/infra/bots/gen_tasks.go index 06565c842b..a29d75864d 100644 --- a/infra/bots/gen_tasks.go +++ b/infra/bots/gen_tasks.go @@ -122,7 +122,7 @@ func deriveCompileTaskName(jobName string, parts map[string]string) string { return "Build-Debian9-GCC-x86_64-Release" } else if parts["role"] == "Housekeeper" { return "Build-Debian9-GCC-x86_64-Release-Shared" - } else if parts["role"] == "Test" || parts["role"] == "Perf" { + } else if parts["role"] == "Test" || parts["role"] == "Perf" || parts["role"] == "Calmbench" { task_os := parts["os"] ec := []string{} if val := parts["extra_config"]; val != "" { @@ -772,10 +772,19 @@ func infra(b *specs.TasksCfgBuilder, name string) string { return name } +func getParentRevisionName(compileTaskName string, parts map[string]string) string { + if parts["extra_config"] == "" { + return compileTaskName + "-ParentRevision" + } else { + return compileTaskName + "_ParentRevision" + } +} + // calmbench generates a calmbench task. Returns the name of the last task in the // generated chain of tasks, which the Job should add as a dependency. -func calmbench(b *specs.TasksCfgBuilder, name string, parts map[string]string) string { +func calmbench(b *specs.TasksCfgBuilder, name string, parts map[string]string, compileTaskName string, compileParentName string) string { s := &specs.TaskSpec{ + Dependencies: []string{compileTaskName, compileParentName}, CipdPackages: []*specs.CipdPackage{b.MustGetCipdPackageFromAsset("clang_linux")}, Dimensions: swarmDimensions(parts), ExtraArgs: []string{ @@ -789,7 +798,7 @@ func calmbench(b *specs.TasksCfgBuilder, name string, parts map[string]string) s fmt.Sprintf("patch_issue=%s", specs.PLACEHOLDER_ISSUE), fmt.Sprintf("patch_set=%s", specs.PLACEHOLDER_PATCHSET), }, - Isolate: relpath("infra_skia.isolate"), + Isolate: relpath("calmbench.isolate"), Priority: 0.8, } @@ -1146,19 +1155,20 @@ func process(b *specs.TasksCfgBuilder, name string) { deps = append(deps, compile(b, name, parts)) } - // Calmbench bots. - if parts["role"] == "Calmbench" { - deps = append(deps, calmbench(b, name, parts)) - } - // Most remaining bots need a compile task. compileTaskName := deriveCompileTaskName(name, parts) compileTaskParts, err := jobNameSchema.ParseJobName(compileTaskName) if err != nil { glog.Fatal(err) } + compileParentName := getParentRevisionName(compileTaskName, compileTaskParts) + compileParentParts, err := jobNameSchema.ParseJobName(compileParentName) + if err != nil { + glog.Fatal(err) + } + // These bots do not need a compile task. - if parts["role"] != "Build" && parts["role"] != "Calmbench" && + if parts["role"] != "Build" && name != "Housekeeper-PerCommit-BundleRecipes" && name != "Housekeeper-PerCommit-InfraTests" && name != "Housekeeper-PerCommit-CheckGeneratedFiles" && @@ -1167,6 +1177,9 @@ func process(b *specs.TasksCfgBuilder, name string) { !strings.Contains(name, "-CT_") && !strings.Contains(name, "Housekeeper-PerCommit-Isolate") { compile(b, compileTaskName, compileTaskParts) + if (parts["role"] == "Calmbench") { + compile(b, compileParentName, compileParentParts) + } } // Housekeepers. @@ -1224,6 +1237,11 @@ func process(b *specs.TasksCfgBuilder, name string) { deps = append(deps, perf(b, name, parts, compileTaskName, pkgs)) } + // Calmbench bots. + if parts["role"] == "Calmbench" { + deps = append(deps, calmbench(b, name, parts, compileTaskName, compileParentName)) + } + // Add the Job spec. j := &specs.JobSpec{ Priority: 0.8, @@ -1364,3 +1382,4 @@ func (s *JobNameSchema) MakeJobName(parts map[string]string) (string, error) { } return strings.Join(rvParts, s.Sep), nil } + diff --git a/infra/bots/recipe_modules/vars/api.py b/infra/bots/recipe_modules/vars/api.py index 2106645781..ac67f8f209 100644 --- a/infra/bots/recipe_modules/vars/api.py +++ b/infra/bots/recipe_modules/vars/api.py @@ -41,8 +41,6 @@ class SkiaVarsApi(recipe_api.RecipeApi): # Compile bots keep a persistent checkout. if self.is_compile_bot: self.persistent_checkout = True - if 'Calmbench' in self.builder_name: - self.persistent_checkout = True if 'Housekeeper' in self.builder_name: self.persistent_checkout = True if '-CT_' in self.builder_name: diff --git a/infra/bots/recipe_modules/vars/examples/full.py b/infra/bots/recipe_modules/vars/examples/full.py index d2a5c44fc2..319d6bd406 100644 --- a/infra/bots/recipe_modules/vars/examples/full.py +++ b/infra/bots/recipe_modules/vars/examples/full.py @@ -34,7 +34,7 @@ TEST_BUILDERS = [ 'Perf-Ubuntu14-GCC-GCE-CPU-AVX2-x86_64-Release-All-CT_BENCH_1k_SKPs', 'Upload-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-Coverage', 'Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All', - "Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All" + 'Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All' ] diff --git a/infra/bots/recipes/calmbench.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json b/infra/bots/recipes/calmbench.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json index fa390436c2..a6e90a7972 100644 --- a/infra/bots/recipes/calmbench.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json +++ b/infra/bots/recipes/calmbench.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json @@ -9,100 +9,6 @@ "ensure-directory", "--mode", "0777", - "[CUSTOM_/_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_/_B_WORK]/.gclient_entries" - ], - "infra_step": true, - "name": "remove [CUSTOM_/_B_WORK]/.gclient_entries" - }, - { - "cmd": [ - "python", - "-u", - "RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py", - "--spec-path", - "cache_dir = '[CUSTOM_/_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_/_B_CACHE]", - "--cleanup-dir", - "[CLEANUP]/bot_update", - "--output_json", - "/path/to/tmp/json", - "--revision", - "skia@abc123" - ], - "cwd": "[CUSTOM_/_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, @@ -116,7 +22,7 @@ "--json-output", "/path/to/tmp/json", "copy", - "[CUSTOM_/_B_WORK]/skia/infra/bots/assets/skp/VERSION", + "[START_DIR]/skia/infra/bots/assets/skp/VERSION", "/path/to/tmp/" ], "infra_step": true, @@ -144,7 +50,7 @@ "--json-output", "/path/to/tmp/json", "copy", - "[CUSTOM_/_B_WORK]/skia/infra/bots/assets/svg/VERSION", + "[START_DIR]/skia/infra/bots/assets/svg/VERSION", "/path/to/tmp/" ], "infra_step": true, @@ -167,69 +73,23 @@ { "cmd": [ "python", - "-u", - "[CUSTOM_/_B_WORK]/skia/bin/fetch-gn" - ], - "cwd": "[CUSTOM_/_B_WORK]/skia", - "env": { - "BUILDTYPE": "Release", - "CHROME_HEADLESS": "1", - "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", - "SKIA_OUT": "[START_DIR]/out" - }, - "infra_step": true, - "name": "fetch-gn" - }, - { - "cmd": [ - "[CUSTOM_/_B_WORK]/skia/bin/gn", - "gen", - "[START_DIR]/out/Release", - "--args=cc=\"[START_DIR]/clang_linux/bin/clang\" cxx=\"[START_DIR]/clang_linux/bin/clang++\" extra_cflags=[\"-B[START_DIR]/clang_linux/bin\"] extra_ldflags=[\"-B[START_DIR]/clang_linux/bin\", \"-fuse-ld=lld\"] is_debug=false" - ], - "cwd": "[CUSTOM_/_B_WORK]/skia", - "env": { - "BUILDTYPE": "Release", - "CHROME_HEADLESS": "1", - "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", - "SKIA_OUT": "[START_DIR]/out" - }, - "name": "gn gen" - }, - { - "cmd": [ - "ninja", - "-k", - "0", - "-C", - "[START_DIR]/out/Release" - ], - "cwd": "[CUSTOM_/_B_WORK]/skia", - "env": { - "BUILDTYPE": "Release", - "CHROME_HEADLESS": "1", - "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", - "SKIA_OUT": "[START_DIR]/out" - }, - "name": "ninja" - }, - { - "cmd": [ - "python", - "tools/calmbench/calmbench.py", + "[START_DIR]/skia/tools/calmbench/ab.py", + "[CUSTOM_[SWARM_OUT_DIR]]", "modified", - "--config", - "8888", - "--ninjadir", - "[START_DIR]/out/Release", - "--extraarg", + "master", + "[START_DIR]/out/Release/nanobench", + "[START_DIR]/ParentRevision/out/Release/nanobench", "--svgs [START_DIR]/svg --skps [START_DIR]/skp --mpd false", - "--writedir", - "[CUSTOM_[SWARM_OUT_DIR]]", - "--concise", + "--svgs [START_DIR]/svg --skps [START_DIR]/skp --mpd false", + "2", + "false", + "8888", + "-1", + "false", "--githash", - "9046e2e693bb92a76e972b694580e5d17ad10748", - "--key", + "abc123", + "--concise", + "--keys", "arch", "x86_64", "compiler", @@ -243,7 +103,7 @@ "os", "Debian9" ], - "cwd": "[CUSTOM_/_B_WORK]/skia", + "cwd": "[START_DIR]/skia", "env": { "BUILDTYPE": "Release", "CHROME_HEADLESS": "1", diff --git a/infra/bots/recipes/calmbench.expected/Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All.json b/infra/bots/recipes/calmbench.expected/Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All.json index 23becb88ea..6c09aa6476 100644 --- a/infra/bots/recipes/calmbench.expected/Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All.json +++ b/infra/bots/recipes/calmbench.expected/Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All.json @@ -9,100 +9,6 @@ "ensure-directory", "--mode", "0777", - "[CUSTOM_/_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_/_B_WORK]/.gclient_entries" - ], - "infra_step": true, - "name": "remove [CUSTOM_/_B_WORK]/.gclient_entries" - }, - { - "cmd": [ - "python", - "-u", - "RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py", - "--spec-path", - "cache_dir = '[CUSTOM_/_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_/_B_CACHE]", - "--cleanup-dir", - "[CLEANUP]/bot_update", - "--output_json", - "/path/to/tmp/json", - "--revision", - "skia@abc123" - ], - "cwd": "[CUSTOM_/_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, @@ -116,7 +22,7 @@ "--json-output", "/path/to/tmp/json", "copy", - "[CUSTOM_/_B_WORK]/skia/infra/bots/assets/skp/VERSION", + "[START_DIR]/skia/infra/bots/assets/skp/VERSION", "/path/to/tmp/" ], "infra_step": true, @@ -144,7 +50,7 @@ "--json-output", "/path/to/tmp/json", "copy", - "[CUSTOM_/_B_WORK]/skia/infra/bots/assets/svg/VERSION", + "[START_DIR]/skia/infra/bots/assets/svg/VERSION", "/path/to/tmp/" ], "infra_step": true, @@ -167,69 +73,23 @@ { "cmd": [ "python", - "-u", - "[CUSTOM_/_B_WORK]/skia/bin/fetch-gn" - ], - "cwd": "[CUSTOM_/_B_WORK]/skia", - "env": { - "BUILDTYPE": "Release", - "CHROME_HEADLESS": "1", - "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", - "SKIA_OUT": "[START_DIR]/out" - }, - "infra_step": true, - "name": "fetch-gn" - }, - { - "cmd": [ - "[CUSTOM_/_B_WORK]/skia/bin/gn", - "gen", - "[START_DIR]/out/Release", - "--args=cc=\"[START_DIR]/clang_linux/bin/clang\" cxx=\"[START_DIR]/clang_linux/bin/clang++\" extra_cflags=[\"-B[START_DIR]/clang_linux/bin\"] extra_ldflags=[\"-B[START_DIR]/clang_linux/bin\", \"-fuse-ld=lld\"] is_debug=false" - ], - "cwd": "[CUSTOM_/_B_WORK]/skia", - "env": { - "BUILDTYPE": "Release", - "CHROME_HEADLESS": "1", - "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", - "SKIA_OUT": "[START_DIR]/out" - }, - "name": "gn gen" - }, - { - "cmd": [ - "ninja", - "-k", - "0", - "-C", - "[START_DIR]/out/Release" - ], - "cwd": "[CUSTOM_/_B_WORK]/skia", - "env": { - "BUILDTYPE": "Release", - "CHROME_HEADLESS": "1", - "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", - "SKIA_OUT": "[START_DIR]/out" - }, - "name": "ninja" - }, - { - "cmd": [ - "python", - "tools/calmbench/calmbench.py", + "[START_DIR]/skia/tools/calmbench/ab.py", + "[CUSTOM_[SWARM_OUT_DIR]]", "modified", - "--config", - "gl", - "--ninjadir", - "[START_DIR]/out/Release", - "--extraarg", + "master", + "[START_DIR]/out/Release/nanobench", + "[START_DIR]/ParentRevision/out/Release/nanobench", "--svgs [START_DIR]/svg --skps [START_DIR]/skp", - "--writedir", - "[CUSTOM_[SWARM_OUT_DIR]]", - "--concise", + "--svgs [START_DIR]/svg --skps [START_DIR]/skp", + "2", + "false", + "gl", + "-1", + "false", "--githash", - "9046e2e693bb92a76e972b694580e5d17ad10748", - "--key", + "abc123", + "--concise", + "--keys", "arch", "x86_64", "compiler", @@ -243,7 +103,7 @@ "os", "Ubuntu17" ], - "cwd": "[CUSTOM_/_B_WORK]/skia", + "cwd": "[START_DIR]/skia", "env": { "BUILDTYPE": "Release", "CHROME_HEADLESS": "1", diff --git a/infra/bots/recipes/calmbench.py b/infra/bots/recipes/calmbench.py index 17e3dd864a..e2fd31f149 100644 --- a/infra/bots/recipes/calmbench.py +++ b/infra/bots/recipes/calmbench.py @@ -20,14 +20,9 @@ DEPS = [ 'vars', ] -# TODO (liyuqian): Currently, this recipe combines both compile and nanobench -# functions. In the future, we may want to break it into two recipes, which -# would be useful for Android/iOS tests. To do that, I also have to add compile- -# only option to tools/calmbench/calmbench.py. def RunSteps(api): api.core.setup() api.flavor.install(skps=True, svgs=True) - api.flavor.compile("most") with api.context(cwd=api.vars.skia_dir): extra_arg = '--svgs %s --skps %s' % (api.flavor.device_dirs.svg_dir, api.flavor.device_dirs.skp_dir) @@ -40,17 +35,25 @@ def RunSteps(api): config = "gl" command = [ - 'python', 'tools/calmbench/calmbench.py', 'modified', - '--config', config, - '--ninjadir', api.vars.skia_out.join("Release"), - '--extraarg', extra_arg, - '--writedir', api.vars.swarming_out_dir, - '--concise', - '--githash', api.vars.got_revision, + 'python', + api.vars.skia_dir.join('tools', 'calmbench', 'ab.py'), + api.vars.swarming_out_dir, + 'modified', 'master', + api.path['start_dir'].join("out", api.vars.configuration, 'nanobench'), + api.path['start_dir'].join("ParentRevision", "out", + api.vars.configuration, 'nanobench'), + extra_arg, extra_arg, + 2, # reps + "false", # skipbase + config, + -1, # threads; let ab.py decide the threads + "false", # noinit + "--githash", api.vars.got_revision, + "--concise" ] keys_blacklist = ['configuration', 'role', 'test_filter'] - command.append('--key') + command.append('--keys') for k in sorted(api.vars.builder_cfg.keys()): if not k in keys_blacklist: command.extend([k, api.vars.builder_cfg[k]]) diff --git a/infra/bots/recipes/upload_calmbench_results.expected/normal_bot.json b/infra/bots/recipes/upload_calmbench_results.expected/normal_bot.json index 322bf4f8be..774b1e82a9 100644 --- a/infra/bots/recipes/upload_calmbench_results.expected/normal_bot.json +++ b/infra/bots/recipes/upload_calmbench_results.expected/normal_bot.json @@ -9,100 +9,6 @@ "ensure-directory", "--mode", "0777", - "[CUSTOM_/_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_/_B_WORK]/.gclient_entries" - ], - "infra_step": true, - "name": "remove [CUSTOM_/_B_WORK]/.gclient_entries" - }, - { - "cmd": [ - "python", - "-u", - "RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py", - "--spec-path", - "cache_dir = '[CUSTOM_/_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_/_B_CACHE]", - "--cleanup-dir", - "[CLEANUP]/bot_update", - "--output_json", - "/path/to/tmp/json", - "--revision", - "skia@abc123" - ], - "cwd": "[CUSTOM_/_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, @@ -153,7 +59,7 @@ "-z", "json", "[START_DIR]/bench_modified_master.json", - "gs://skia-calmbench/calmbench-v1/2012/05/14/12/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All/bench_modified_master_9046e2e693bb92a76e972b694580e5d17ad10748_1337000001.json" + "gs://skia-calmbench/calmbench-v1/2012/05/14/12/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All/bench_modified_master_abc123_1337000001.json" ], "infra_step": true, "name": "upload json" @@ -165,7 +71,7 @@ "-z", "csv", "[START_DIR]/bench_modified_master.csv", - "gs://skia-calmbench/calmbench-v1/2012/05/14/12/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All/bench_modified_master_9046e2e693bb92a76e972b694580e5d17ad10748_1337000001.csv" + "gs://skia-calmbench/calmbench-v1/2012/05/14/12/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All/bench_modified_master_abc123_1337000001.csv" ], "infra_step": true, "name": "upload csv" diff --git a/infra/bots/recipes/upload_calmbench_results.expected/trybot.json b/infra/bots/recipes/upload_calmbench_results.expected/trybot.json index 1da9bbbcec..c03beda2dd 100644 --- a/infra/bots/recipes/upload_calmbench_results.expected/trybot.json +++ b/infra/bots/recipes/upload_calmbench_results.expected/trybot.json @@ -9,104 +9,6 @@ "ensure-directory", "--mode", "0777", - "[CUSTOM_/_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_/_B_WORK]/.gclient_entries" - ], - "infra_step": true, - "name": "remove [CUSTOM_/_B_WORK]/.gclient_entries" - }, - { - "cmd": [ - "python", - "-u", - "RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py", - "--spec-path", - "cache_dir = '[CUSTOM_/_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_/_B_CACHE]", - "--cleanup-dir", - "[CLEANUP]/bot_update", - "--gerrit_repo", - "https://skia.googlesource.com/skia.git", - "--gerrit_ref", - "refs/changes/89/456789/12", - "--output_json", - "/path/to/tmp/json", - "--revision", - "skia@abc123" - ], - "cwd": "[CUSTOM_/_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, @@ -157,7 +59,7 @@ "-z", "json", "[START_DIR]/bench_modified_master.json", - "gs://skia-calmbench/trybot/calmbench-v1/2012/05/14/12/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All/456789/12/bench_modified_master_9046e2e693bb92a76e972b694580e5d17ad10748_1337000001.json" + "gs://skia-calmbench/trybot/calmbench-v1/2012/05/14/12/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All/456789/12/bench_modified_master_abc123_1337000001.json" ], "infra_step": true, "name": "upload json" @@ -169,7 +71,7 @@ "-z", "csv", "[START_DIR]/bench_modified_master.csv", - "gs://skia-calmbench/trybot/calmbench-v1/2012/05/14/12/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All/456789/12/bench_modified_master_9046e2e693bb92a76e972b694580e5d17ad10748_1337000001.csv" + "gs://skia-calmbench/trybot/calmbench-v1/2012/05/14/12/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All/456789/12/bench_modified_master_abc123_1337000001.csv" ], "infra_step": true, "name": "upload csv" diff --git a/infra/bots/tasks.json b/infra/bots/tasks.json index 7bfc7b3bc8..dee469d5b7 100644 --- a/infra/bots/tasks.json +++ b/infra/bots/tasks.json @@ -5595,6 +5595,8 @@ } ], "dependencies": [ + "Build-Debian9-Clang-x86_64-Release", + "Build-Debian9-Clang-x86_64-Release-ParentRevision", "Housekeeper-PerCommit-IsolateSKP", "Housekeeper-PerCommit-IsolateSVG" ], @@ -5616,7 +5618,7 @@ "patch_issue=<(ISSUE)", "patch_set=<(PATCHSET)" ], - "isolate": "infra_skia.isolate", + "isolate": "calmbench.isolate", "priority": 0.8 }, "Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All": { @@ -5628,6 +5630,8 @@ } ], "dependencies": [ + "Build-Debian9-Clang-x86_64-Release", + "Build-Debian9-Clang-x86_64-Release-ParentRevision", "Housekeeper-PerCommit-IsolateSKP", "Housekeeper-PerCommit-IsolateSVG" ], @@ -5649,7 +5653,7 @@ "patch_issue=<(ISSUE)", "patch_set=<(PATCHSET)" ], - "isolate": "infra_skia.isolate", + "isolate": "calmbench.isolate", "priority": 0.8 }, "Housekeeper-Nightly-Bookmaker": { diff --git a/tools/calmbench/ab.py b/tools/calmbench/ab.py index b5b5c8d5e1..22c28e23f0 100644 --- a/tools/calmbench/ab.py +++ b/tools/calmbench/ab.py @@ -28,6 +28,7 @@ import time import json import subprocess import shlex +import multiprocessing from argparse import ArgumentParser from multiprocessing import Process from threading import Thread @@ -58,7 +59,6 @@ timesB = {} def parse_args(): parser = ArgumentParser(description=HELP) - parser.add_argument('skiadir', type=str, help="skia directory") parser.add_argument('outdir', type=str, help="output directory") parser.add_argument('a', type=str, help="name of A") parser.add_argument('b', type=str, help="name of B") @@ -87,6 +87,11 @@ def parse_args(): args.skip_b = args.skip_b == "true" args.noinit = args.noinit == "true" + if args.threads == -1: + args.threads = 1 + if args.config in ["8888", "565"]: # multi-thread for CPU only + args.threads = max(1, multiprocessing.cpu_count() / 2) + return args def append_dict_sorted_array(dict_array, key, value): diff --git a/tools/calmbench/calmbench.py b/tools/calmbench/calmbench.py index 6ddd96b5e1..3459a34e2e 100644 --- a/tools/calmbench/calmbench.py +++ b/tools/calmbench/calmbench.py @@ -181,7 +181,6 @@ def main(): command = [ 'python', temp_ab_name, - args.skiadir, args.writedir, args.branch + ("_A" if args.branch == args.baseline else ""), args.baseline + ("_B" if args.branch == args.baseline else ""), |