[canvaskit] Add perf jobs

Of note, the perf results reported are not directly
comparable CPU->GPU because the GPU ones are likely
emulated (no real gpu in the Docker container on an
GCE VM).

Bug: skia:
Change-Id: I52259085f4d9e22c45b67f3e8ce1211a5c6c6d3e
Reviewed-on: https://skia-review.googlesource.com/c/163126
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Kevin Lubick 2018-10-17 14:59:35 -04:00
parent 3a0c66da5f
commit f2a146c6ad
18 changed files with 1349 additions and 31 deletions

View File

@ -34,9 +34,9 @@ fi
mkdir -p $BUILD_DIR
GN_GPU="skia_enable_gpu=true"
GN_GPU_FLAGS="\"-DSK_DISABLE_AAA\", \"-DSK_DISABLE_DAA\", \"-DIS_WEBGL=1\","
GN_GPU_FLAGS="\"-DSK_DISABLE_AAA\", \"-DSK_DISABLE_DAA\", \"-DIS_WEBGL=1\", \"-DSK_DISABLE_LEGACY_SHADERCONTEXT\","
WASM_GPU="-lEGL -lGLESv2 -DSK_SUPPORT_GPU=1 -DSK_DISABLE_AAA -DSK_DISABLE_DAA \
--pre-js $BASE_DIR/gpu.js"
-DSK_DISABLE_LEGACY_SHADERCONTEXT --pre-js $BASE_DIR/gpu.js"
if [[ $@ == *cpu* ]]; then
echo "Using the CPU backend instead of the GPU backend"
GN_GPU="skia_enable_gpu=false"

View File

@ -0,0 +1,90 @@
const isDocker = require('is-docker')();
module.exports = function(config) {
// Set the default values to be what are needed when testing the
// WebAssembly build locally.
let cfg = {
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
{ pattern: 'canvaskit/bin/canvaskit.wasm', included:false, served:true},
{ pattern: 'perf/assets/*', included:false, served:true},
'../../modules/pathkit/perf/perfReporter.js',
'canvaskit/bin/canvaskit.js',
'perf/*.bench.js'
],
proxies: {
'/canvaskit/': '/base/canvaskit/bin/',
'/assets/': '/base/perf/assets/'
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
// web server port
port: 4444,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
browserDisconnectTimeout: 15000,
browserNoActivityTimeout: 15000,
// start these browsers
browsers: ['Chrome'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,
};
if (isDocker) {
// See https://hackernoon.com/running-karma-tests-with-headless-chrome-inside-docker-ae4aceb06ed3
cfg.browsers = ['ChromeHeadlessNoSandbox'],
cfg.customLaunchers = {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: [
// Without this flag, we see an error:
// Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
'--no-sandbox'
],
},
};
}
if (process.env.ASM_JS) {
console.log('asm.js is under test');
cfg.files = [
{ pattern: 'npm-asmjs/bin/pathkit.js.mem', included:false, served:true},
'perf/perfReporter.js',
'npm-asmjs/bin/pathkit.js',
'perf/*.bench.js'
];
cfg.proxies = {
'/pathkit/': '/base/npm-asmjs/bin/'
};
} else {
console.log('wasm is under test');
}
config.set(cfg);
}

View File

@ -0,0 +1,168 @@
// The increased timeout is especially needed with larger binaries
// like in the debug/gpu build
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
describe('CanvasKit\'s Animation', function() {
// Note, don't try to print the CanvasKit object - it can cause Karma/Jasmine to lock up.
var CanvasKit = null;
const LoadCanvasKit = new Promise(function(resolve, reject) {
if (CanvasKit) {
resolve();
} else {
CanvasKitInit({
locateFile: (file) => '/canvaskit/'+file,
}).then((_CanvasKit) => {
CanvasKit = _CanvasKit;
CanvasKit.initFonts();
resolve();
});
}
});
const LOTTIE_ANIMATIONS = ['lego_loader', 'drinks', 'confetti', 'onboarding'];
let container = document.createElement('div');
document.body.appendChild(container);
beforeEach(function() {
container.innerHTML = `
<canvas width=600 height=600 id=test></canvas>`;
});
afterEach(function() {
container.innerHTML = '';
});
function fetchAndText(url) {
return new Promise(function(resolve, reject) {
fetch(url).then((resp) => {
resp.text().then((str) => {
expect(str).toBeTruthy();
resolve(str);
});
}).catch(reject);
});
}
LOTTIE_ANIMATIONS.forEach((animStr) => {
let promises = [fetchAndText(`/assets/${animStr}.json`), LoadCanvasKit];
it(`animation loading for ${animStr}`, function(done) {
let jsonStr = '';
function setup(ctx) {
expect(jsonStr).toBeTruthy();
}
function test(ctx) {
const animation = CanvasKit.MakeAnimation(jsonStr);
animation.delete();
}
function teardown(ctx) {}
Promise.all(promises).then((responses) => {
// The result from the first promise, that is, the JSON string
// fetched by fetchAndText
jsonStr = responses[0];
benchmarkAndReport(`${animStr}_animation_load`, setup, test, teardown).then(() => {
done();
}).catch(reportError(done));
});
});
it(`animation frames in order for ${animStr}`, function(done) {
let jsonStr = '';
function setup(ctx) {
expect(jsonStr).toBeTruthy();
ctx.animation = CanvasKit.MakeAnimation(jsonStr);
expect(ctx.animation).toBeTruthy();
ctx.timer = 0;
}
function test(ctx) {
ctx.animation.seek(ctx.timer);
ctx.timer += 0.01;
if (ctx.timer > 1.0) {
ctx.timer = 0;
}
}
function teardown(ctx) {
ctx.animation.delete();
}
Promise.all(promises).then((responses) => {
// The result from the first promise, that is, the JSON string
// fetched by fetchAndText
jsonStr = responses[0];
benchmarkAndReport(`${animStr}_animation_in_order`, setup, test, teardown).then(() => {
done();
}).catch(reportError(done));
});
});
it(`animation frames in random order for ${animStr}`, function(done) {
let jsonStr = '';
function setup(ctx) {
expect(jsonStr).toBeTruthy();
ctx.animation = CanvasKit.MakeAnimation(jsonStr);
expect(ctx.animation).toBeTruthy();
}
function test(ctx) {
ctx.animation.seek(Math.random());
}
function teardown(ctx) {
ctx.animation.delete();
}
Promise.all(promises).then((responses) => {
// The result from the first promise, that is, the JSON string
// fetched by fetchAndText
jsonStr = responses[0];
benchmarkAndReport(`${animStr}_animation_random_order`, setup, test, teardown).then(() => {
done();
}).catch(reportError(done));
});
});
it(`renders to an HTML canvas ${animStr}`, function(done) {
let jsonStr = '';
function setup(ctx) {
expect(jsonStr).toBeTruthy();
ctx.animation = CanvasKit.MakeAnimation(jsonStr);
expect(ctx.animation).toBeTruthy();
ctx.animation.seek(0.5);
ctx.surface = CanvasKit.MakeCanvasSurface('test');
ctx.canvas = ctx.surface.getCanvas();
ctx.clear = CanvasKit.Color(255, 255, 255, 0.0); // transparent
}
function test(ctx) {
// This emulates what would need to be done do accurately
// draw one frame.
ctx.canvas.clear(ctx.clear);
ctx.animation.render(ctx.canvas);
ctx.surface.flush();
}
function teardown(ctx) {
ctx.animation.delete();
ctx.surface.dispose(); // ctx.canvas will also be cleaned up
}
Promise.all(promises).then((responses) => {
// The result from the first promise, that is, the JSON string
// fetched by fetchAndText
jsonStr = responses[0];
benchmarkAndReport(`${animStr}_animation_render_flush`, setup, test, teardown).then(() => {
done();
}).catch(reportError(done));
});
});
});
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1151,6 +1151,8 @@ func perf(b *specs.TasksCfgBuilder, name string, parts map[string]string, compil
isolate = relpath("skpbench_skia_bundled.isolate")
} else if strings.Contains(name, "PathKit") {
recipe = "perf_pathkit"
} else if strings.Contains(name, "CanvasKit") {
recipe = "perf_canvaskit"
}
task := kitchenTask(name, recipe, isolate, "", swarmDimensions(parts), nil, OUTPUT_PERF)
task.CipdPackages = append(task.CipdPackages, pkgs...)

View File

@ -225,7 +225,9 @@
"Perf-Debian9-Clang-ShuttleA-GPU-IntelHD2000-x86_64-Debug-All",
"Perf-Debian9-Clang-ShuttleA-GPU-IntelHD2000-x86_64-Release-All",
"Perf-Debian9-EMCC-GCE-CPU-AVX2-asmjs-Release-All-PathKit",
"Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit",
"Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-PathKit",
"Perf-Debian9-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit",
"Perf-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All",
"Perf-Debian9-GCC-GCE-CPU-AVX2-x86_64-Debug-All",
"Perf-Mac-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Debug-All",

View File

@ -0,0 +1,233 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"ensure-directory",
"--mode",
"0777",
"[START_DIR]/cache/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",
"[START_DIR]/cache/work/.gclient_entries"
],
"infra_step": true,
"name": "remove [START_DIR]/cache/work/.gclient_entries"
},
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
"cache_dir = '[START_DIR]/cache/git'\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",
"[START_DIR]/cache/git",
"--cleanup-dir",
"[CLEANUP]/bot_update",
"--output_json",
"/path/to/tmp/json",
"--revision",
"skia@abc123"
],
"cwd": "[START_DIR]/cache/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]/[SWARM_OUT_DIR]"
],
"infra_step": true,
"name": "mkdirs out_dir"
},
{
"cmd": [
"python",
"-u",
"import errno\nimport os\nimport shutil\nimport sys\n\ncopy_dest = sys.argv[1]\nbase_dir = sys.argv[2]\nbundle_name = sys.argv[3]\nout_dir = sys.argv[4]\n\n# Clean out old binaries (if any)\ntry:\n shutil.rmtree(copy_dest)\nexcept OSError as e:\n if e.errno != errno.ENOENT:\n raise\n\n# Make folder\ntry:\n os.makedirs(copy_dest)\nexcept OSError as e:\n if e.errno != errno.EEXIST:\n raise\n\n# Copy binaries (canvaskit.js and canvaskit.wasm) to where the karma tests\n# expect them ($SKIA_ROOT/experimental/canvaskit/canvaskit/bin/)\ndest = os.path.join(copy_dest, 'canvaskit.js')\nshutil.copyfile(os.path.join(base_dir, 'canvaskit.js'), dest)\nos.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\nif bundle_name:\n dest = os.path.join(copy_dest, bundle_name)\n shutil.copyfile(os.path.join(base_dir, bundle_name), dest)\n os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\nos.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't write.\n",
"[START_DIR]/cache/work/skia/experimental/canvaskit/canvaskit/bin",
"[START_DIR]/build",
"canvaskit.wasm",
"[START_DIR]/[SWARM_OUT_DIR]"
],
"infra_step": true,
"name": "Set up for docker",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@import errno@@@",
"@@@STEP_LOG_LINE@python.inline@import os@@@",
"@@@STEP_LOG_LINE@python.inline@import shutil@@@",
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@copy_dest = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@base_dir = sys.argv[2]@@@",
"@@@STEP_LOG_LINE@python.inline@bundle_name = sys.argv[3]@@@",
"@@@STEP_LOG_LINE@python.inline@out_dir = sys.argv[4]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Clean out old binaries (if any)@@@",
"@@@STEP_LOG_LINE@python.inline@try:@@@",
"@@@STEP_LOG_LINE@python.inline@ shutil.rmtree(copy_dest)@@@",
"@@@STEP_LOG_LINE@python.inline@except OSError as e:@@@",
"@@@STEP_LOG_LINE@python.inline@ if e.errno != errno.ENOENT:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Make folder@@@",
"@@@STEP_LOG_LINE@python.inline@try:@@@",
"@@@STEP_LOG_LINE@python.inline@ os.makedirs(copy_dest)@@@",
"@@@STEP_LOG_LINE@python.inline@except OSError as e:@@@",
"@@@STEP_LOG_LINE@python.inline@ if e.errno != errno.EEXIST:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Copy binaries (canvaskit.js and canvaskit.wasm) to where the karma tests@@@",
"@@@STEP_LOG_LINE@python.inline@# expect them ($SKIA_ROOT/experimental/canvaskit/canvaskit/bin/)@@@",
"@@@STEP_LOG_LINE@python.inline@dest = os.path.join(copy_dest, 'canvaskit.js')@@@",
"@@@STEP_LOG_LINE@python.inline@shutil.copyfile(os.path.join(base_dir, 'canvaskit.js'), dest)@@@",
"@@@STEP_LOG_LINE@python.inline@os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@if bundle_name:@@@",
"@@@STEP_LOG_LINE@python.inline@ dest = os.path.join(copy_dest, bundle_name)@@@",
"@@@STEP_LOG_LINE@python.inline@ shutil.copyfile(os.path.join(base_dir, bundle_name), dest)@@@",
"@@@STEP_LOG_LINE@python.inline@ os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Prepare output folder, api.file.ensure_directory doesn't touch@@@",
"@@@STEP_LOG_LINE@python.inline@# the permissions of the out directory if it already exists.@@@",
"@@@STEP_LOG_LINE@python.inline@os.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't write.@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"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@@@"
]
},
{
"cmd": [
"docker",
"run",
"--shm-size=2gb",
"--rm",
"--volume",
"[START_DIR]/cache/work:/SRC",
"--volume",
"[START_DIR]/[SWARM_OUT_DIR]:/OUT",
"gcr.io/skia-public/perf-karma-chrome-tests:68.0.3440.106_v6",
"/SRC/skia/infra/canvaskit/perf_canvaskit.sh",
"--builder",
"Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit",
"--git_hash",
"abc123",
"--buildbucket_build_id",
"",
"--bot_id",
"",
"--task_id",
"",
"--browser",
"Chrome",
"--config",
"Release",
"--source_type",
"canvaskit"
],
"env": {
"CHROME_HEADLESS": "1",
"PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "Performance tests of canvaskit with Docker"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

View File

@ -0,0 +1,241 @@
[
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"ensure-directory",
"--mode",
"0777",
"[START_DIR]/cache/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",
"[START_DIR]/cache/work/.gclient_entries"
],
"infra_step": true,
"name": "remove [START_DIR]/cache/work/.gclient_entries"
},
{
"cmd": [
"python",
"-u",
"RECIPE_MODULE[depot_tools::bot_update]/resources/bot_update.py",
"--spec-path",
"cache_dir = '[START_DIR]/cache/git'\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",
"[START_DIR]/cache/git",
"--cleanup-dir",
"[CLEANUP]/bot_update",
"--output_json",
"/path/to/tmp/json",
"--patch_ref",
"https://skia.googlesource.com/skia.git@89/456789/12",
"--revision",
"skia@abc123"
],
"cwd": "[START_DIR]/cache/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]/[SWARM_OUT_DIR]"
],
"infra_step": true,
"name": "mkdirs out_dir"
},
{
"cmd": [
"python",
"-u",
"import errno\nimport os\nimport shutil\nimport sys\n\ncopy_dest = sys.argv[1]\nbase_dir = sys.argv[2]\nbundle_name = sys.argv[3]\nout_dir = sys.argv[4]\n\n# Clean out old binaries (if any)\ntry:\n shutil.rmtree(copy_dest)\nexcept OSError as e:\n if e.errno != errno.ENOENT:\n raise\n\n# Make folder\ntry:\n os.makedirs(copy_dest)\nexcept OSError as e:\n if e.errno != errno.EEXIST:\n raise\n\n# Copy binaries (canvaskit.js and canvaskit.wasm) to where the karma tests\n# expect them ($SKIA_ROOT/experimental/canvaskit/canvaskit/bin/)\ndest = os.path.join(copy_dest, 'canvaskit.js')\nshutil.copyfile(os.path.join(base_dir, 'canvaskit.js'), dest)\nos.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\nif bundle_name:\n dest = os.path.join(copy_dest, bundle_name)\n shutil.copyfile(os.path.join(base_dir, bundle_name), dest)\n os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\nos.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't write.\n",
"[START_DIR]/cache/work/skia/experimental/canvaskit/canvaskit/bin",
"[START_DIR]/build",
"canvaskit.wasm",
"[START_DIR]/[SWARM_OUT_DIR]"
],
"infra_step": true,
"name": "Set up for docker",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@import errno@@@",
"@@@STEP_LOG_LINE@python.inline@import os@@@",
"@@@STEP_LOG_LINE@python.inline@import shutil@@@",
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@copy_dest = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@base_dir = sys.argv[2]@@@",
"@@@STEP_LOG_LINE@python.inline@bundle_name = sys.argv[3]@@@",
"@@@STEP_LOG_LINE@python.inline@out_dir = sys.argv[4]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Clean out old binaries (if any)@@@",
"@@@STEP_LOG_LINE@python.inline@try:@@@",
"@@@STEP_LOG_LINE@python.inline@ shutil.rmtree(copy_dest)@@@",
"@@@STEP_LOG_LINE@python.inline@except OSError as e:@@@",
"@@@STEP_LOG_LINE@python.inline@ if e.errno != errno.ENOENT:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Make folder@@@",
"@@@STEP_LOG_LINE@python.inline@try:@@@",
"@@@STEP_LOG_LINE@python.inline@ os.makedirs(copy_dest)@@@",
"@@@STEP_LOG_LINE@python.inline@except OSError as e:@@@",
"@@@STEP_LOG_LINE@python.inline@ if e.errno != errno.EEXIST:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Copy binaries (canvaskit.js and canvaskit.wasm) to where the karma tests@@@",
"@@@STEP_LOG_LINE@python.inline@# expect them ($SKIA_ROOT/experimental/canvaskit/canvaskit/bin/)@@@",
"@@@STEP_LOG_LINE@python.inline@dest = os.path.join(copy_dest, 'canvaskit.js')@@@",
"@@@STEP_LOG_LINE@python.inline@shutil.copyfile(os.path.join(base_dir, 'canvaskit.js'), dest)@@@",
"@@@STEP_LOG_LINE@python.inline@os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@if bundle_name:@@@",
"@@@STEP_LOG_LINE@python.inline@ dest = os.path.join(copy_dest, bundle_name)@@@",
"@@@STEP_LOG_LINE@python.inline@ shutil.copyfile(os.path.join(base_dir, bundle_name), dest)@@@",
"@@@STEP_LOG_LINE@python.inline@ os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Prepare output folder, api.file.ensure_directory doesn't touch@@@",
"@@@STEP_LOG_LINE@python.inline@# the permissions of the out directory if it already exists.@@@",
"@@@STEP_LOG_LINE@python.inline@os.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't write.@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"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@@@"
]
},
{
"cmd": [
"docker",
"run",
"--shm-size=2gb",
"--rm",
"--volume",
"[START_DIR]/cache/work:/SRC",
"--volume",
"[START_DIR]/[SWARM_OUT_DIR]:/OUT",
"gcr.io/skia-public/perf-karma-chrome-tests:68.0.3440.106_v6",
"/SRC/skia/infra/canvaskit/perf_canvaskit.sh",
"--builder",
"Perf-Debian9-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit",
"--git_hash",
"abc123",
"--buildbucket_build_id",
"",
"--bot_id",
"",
"--task_id",
"",
"--browser",
"Chrome",
"--config",
"Release",
"--source_type",
"canvaskit",
"--issue",
"1234",
"--patchset",
"7",
"--patch_storage",
"gerrit"
],
"env": {
"CHROME_HEADLESS": "1",
"PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "Performance tests of canvaskit with Docker"
},
{
"name": "$result",
"recipe_result": null,
"status_code": 0
}
]

View File

@ -0,0 +1,142 @@
# 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.
# Recipe which runs the PathKit tests using docker
DEPS = [
'checkout',
'infra',
'recipe_engine/file',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/step',
'run',
'vars',
]
DOCKER_IMAGE = 'gcr.io/skia-public/perf-karma-chrome-tests:68.0.3440.106_v6'
INNER_KARMA_SCRIPT = '/SRC/skia/infra/canvaskit/perf_canvaskit.sh'
def RunSteps(api):
api.vars.setup()
checkout_root = api.checkout.default_checkout_root
out_dir = api.vars.swarming_out_dir
api.checkout.bot_update(checkout_root=checkout_root)
# Make sure this exists, otherwise Docker will make it with root permissions.
api.file.ensure_directory('mkdirs out_dir', out_dir, mode=0777)
# The karma script is configured to look in ./canvaskit/bin/ for
# the test files to load, so we must copy them there (see Set up for docker).
copy_dest = checkout_root.join('skia', 'experimental', 'canvaskit',
'canvaskit', 'bin')
base_dir = api.vars.build_dir
bundle_name = 'canvaskit.wasm'
api.python.inline(
name='Set up for docker',
program='''import errno
import os
import shutil
import sys
copy_dest = sys.argv[1]
base_dir = sys.argv[2]
bundle_name = sys.argv[3]
out_dir = sys.argv[4]
# Clean out old binaries (if any)
try:
shutil.rmtree(copy_dest)
except OSError as e:
if e.errno != errno.ENOENT:
raise
# Make folder
try:
os.makedirs(copy_dest)
except OSError as e:
if e.errno != errno.EEXIST:
raise
# Copy binaries (canvaskit.js and canvaskit.wasm) to where the karma tests
# expect them ($SKIA_ROOT/experimental/canvaskit/canvaskit/bin/)
dest = os.path.join(copy_dest, 'canvaskit.js')
shutil.copyfile(os.path.join(base_dir, 'canvaskit.js'), dest)
os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.
if bundle_name:
dest = os.path.join(copy_dest, bundle_name)
shutil.copyfile(os.path.join(base_dir, bundle_name), dest)
os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.
# Prepare output folder, api.file.ensure_directory doesn't touch
# the permissions of the out directory if it already exists.
os.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't write.
''',
args=[copy_dest, base_dir, bundle_name, out_dir],
infra_step=True)
cmd = ['docker', 'run', '--shm-size=2gb', '--rm',
'--volume', '%s:/SRC' % checkout_root,
'--volume', '%s:/OUT' % out_dir]
cmd.extend([
DOCKER_IMAGE, INNER_KARMA_SCRIPT,
'--builder', api.vars.builder_name,
'--git_hash', api.properties['revision'],
'--buildbucket_build_id', api.properties.get('buildbucket_build_id',
''),
'--bot_id', api.vars.swarming_bot_id,
'--task_id', api.vars.swarming_task_id,
'--browser', 'Chrome',
'--config', api.vars.configuration,
'--source_type', 'canvaskit',
])
if api.vars.is_trybot:
cmd.extend([
'--issue', api.vars.issue,
'--patchset', api.vars.patchset,
'--patch_storage', api.vars.patch_storage,
])
api.run(
api.step,
'Performance tests of canvaskit with Docker',
cmd=cmd)
def GenTests(api):
yield (
api.test('Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit') +
api.properties(buildername=('Perf-Debian9-EMCC-GCE-CPU-AVX2'
'-wasm-Release-All-CanvasKit'),
repository='https://skia.googlesource.com/skia.git',
revision='abc123',
path_config='kitchen',
swarm_out_dir='[SWARM_OUT_DIR]')
)
yield (
api.test('pathkit_trybot') +
api.properties(buildername=('Perf-Debian9-EMCC-GCE-GPU-AVX2'
'-wasm-Release-All-CanvasKit'),
repository='https://skia.googlesource.com/skia.git',
revision='abc123',
path_config='kitchen',
swarm_out_dir='[SWARM_OUT_DIR]',
patch_ref='89/456789/12',
patch_repo='https://skia.googlesource.com/skia.git',
patch_storage='gerrit',
patch_set=7,
patch_issue=1234,
gerrit_project='skia',
gerrit_url='https://skia-review.googlesource.com/')
)

View File

@ -112,7 +112,7 @@
"cmd": [
"python",
"-u",
"import errno\nimport os\nimport shutil\nimport sys\n\ncopy_dest = sys.argv[1]\nbase_dir = sys.argv[2]\nbundle_name = sys.argv[3]\nout_dir = sys.argv[4]\n\n# Clean out old binaries (if any)\ntry:\n shutil.rmtree(copy_dest)\nexcept OSError as e:\n if e.errno != errno.ENOENT:\n raise\n\n# Make folder\ntry:\n os.makedirs(copy_dest)\nexcept OSError as e:\n if e.errno != errno.EEXIST:\n raise\n\n# Copy binaries (pathkit.js and pathkit.wasm) to where the karma tests\n# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/)\ndest = os.path.join(copy_dest, 'pathkit.js')\nshutil.copyfile(os.path.join(base_dir, 'pathkit.js'), dest)\nos.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\nif bundle_name:\n dest = os.path.join(copy_dest, bundle_name)\n shutil.copyfile(os.path.join(base_dir, bundle_name), dest)\n os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\nos.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't write.\n",
"import errno\nimport os\nimport shutil\nimport sys\n\ncopy_dest = sys.argv[1]\nbase_dir = sys.argv[2]\nbundle_name = sys.argv[3]\nout_dir = sys.argv[4]\n\n# Clean out old binaries (if any)\ntry:\n shutil.rmtree(copy_dest)\nexcept OSError as e:\n if e.errno != errno.ENOENT:\n raise\n\n# Make folder\ntry:\n os.makedirs(copy_dest)\nexcept OSError as e:\n if e.errno != errno.EEXIST:\n raise\n\n# Copy binaries (pathkit.js and pathkit.wasm) to where the karma tests\n# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/bin/)\ndest = os.path.join(copy_dest, 'pathkit.js')\nshutil.copyfile(os.path.join(base_dir, 'pathkit.js'), dest)\nos.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\nif bundle_name:\n dest = os.path.join(copy_dest, bundle_name)\n shutil.copyfile(os.path.join(base_dir, bundle_name), dest)\n os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\nos.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't write.\n",
"[START_DIR]/cache/work/skia/modules/pathkit/npm-asmjs/bin",
"[START_DIR]/build",
"pathkit.js.mem",
@ -146,7 +146,7 @@
"@@@STEP_LOG_LINE@python.inline@ raise@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Copy binaries (pathkit.js and pathkit.wasm) to where the karma tests@@@",
"@@@STEP_LOG_LINE@python.inline@# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/)@@@",
"@@@STEP_LOG_LINE@python.inline@# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/bin/)@@@",
"@@@STEP_LOG_LINE@python.inline@dest = os.path.join(copy_dest, 'pathkit.js')@@@",
"@@@STEP_LOG_LINE@python.inline@shutil.copyfile(os.path.join(base_dir, 'pathkit.js'), dest)@@@",
"@@@STEP_LOG_LINE@python.inline@os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.@@@",
@ -196,11 +196,11 @@
"run",
"--shm-size=2gb",
"--rm",
"-v",
"--volume",
"[START_DIR]/cache/work:/SRC",
"-v",
"--volume",
"[START_DIR]/[SWARM_OUT_DIR]:/OUT",
"-e",
"--env",
"ASM_JS=1",
"gcr.io/skia-public/perf-karma-chrome-tests:68.0.3440.106_v6",
"/SRC/skia/infra/pathkit/perf_pathkit.sh",

View File

@ -112,7 +112,7 @@
"cmd": [
"python",
"-u",
"import errno\nimport os\nimport shutil\nimport sys\n\ncopy_dest = sys.argv[1]\nbase_dir = sys.argv[2]\nbundle_name = sys.argv[3]\nout_dir = sys.argv[4]\n\n# Clean out old binaries (if any)\ntry:\n shutil.rmtree(copy_dest)\nexcept OSError as e:\n if e.errno != errno.ENOENT:\n raise\n\n# Make folder\ntry:\n os.makedirs(copy_dest)\nexcept OSError as e:\n if e.errno != errno.EEXIST:\n raise\n\n# Copy binaries (pathkit.js and pathkit.wasm) to where the karma tests\n# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/)\ndest = os.path.join(copy_dest, 'pathkit.js')\nshutil.copyfile(os.path.join(base_dir, 'pathkit.js'), dest)\nos.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\nif bundle_name:\n dest = os.path.join(copy_dest, bundle_name)\n shutil.copyfile(os.path.join(base_dir, bundle_name), dest)\n os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\nos.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't write.\n",
"import errno\nimport os\nimport shutil\nimport sys\n\ncopy_dest = sys.argv[1]\nbase_dir = sys.argv[2]\nbundle_name = sys.argv[3]\nout_dir = sys.argv[4]\n\n# Clean out old binaries (if any)\ntry:\n shutil.rmtree(copy_dest)\nexcept OSError as e:\n if e.errno != errno.ENOENT:\n raise\n\n# Make folder\ntry:\n os.makedirs(copy_dest)\nexcept OSError as e:\n if e.errno != errno.EEXIST:\n raise\n\n# Copy binaries (pathkit.js and pathkit.wasm) to where the karma tests\n# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/bin/)\ndest = os.path.join(copy_dest, 'pathkit.js')\nshutil.copyfile(os.path.join(base_dir, 'pathkit.js'), dest)\nos.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\nif bundle_name:\n dest = os.path.join(copy_dest, bundle_name)\n shutil.copyfile(os.path.join(base_dir, bundle_name), dest)\n os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\nos.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't write.\n",
"[START_DIR]/cache/work/skia/modules/pathkit/npm-wasm/bin",
"[START_DIR]/build",
"pathkit.wasm",
@ -146,7 +146,7 @@
"@@@STEP_LOG_LINE@python.inline@ raise@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Copy binaries (pathkit.js and pathkit.wasm) to where the karma tests@@@",
"@@@STEP_LOG_LINE@python.inline@# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/)@@@",
"@@@STEP_LOG_LINE@python.inline@# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/bin/)@@@",
"@@@STEP_LOG_LINE@python.inline@dest = os.path.join(copy_dest, 'pathkit.js')@@@",
"@@@STEP_LOG_LINE@python.inline@shutil.copyfile(os.path.join(base_dir, 'pathkit.js'), dest)@@@",
"@@@STEP_LOG_LINE@python.inline@os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.@@@",
@ -196,9 +196,9 @@
"run",
"--shm-size=2gb",
"--rm",
"-v",
"--volume",
"[START_DIR]/cache/work:/SRC",
"-v",
"--volume",
"[START_DIR]/[SWARM_OUT_DIR]:/OUT",
"gcr.io/skia-public/perf-karma-chrome-tests:68.0.3440.106_v6",
"/SRC/skia/infra/pathkit/perf_pathkit.sh",

View File

@ -114,7 +114,7 @@
"cmd": [
"python",
"-u",
"import errno\nimport os\nimport shutil\nimport sys\n\ncopy_dest = sys.argv[1]\nbase_dir = sys.argv[2]\nbundle_name = sys.argv[3]\nout_dir = sys.argv[4]\n\n# Clean out old binaries (if any)\ntry:\n shutil.rmtree(copy_dest)\nexcept OSError as e:\n if e.errno != errno.ENOENT:\n raise\n\n# Make folder\ntry:\n os.makedirs(copy_dest)\nexcept OSError as e:\n if e.errno != errno.EEXIST:\n raise\n\n# Copy binaries (pathkit.js and pathkit.wasm) to where the karma tests\n# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/)\ndest = os.path.join(copy_dest, 'pathkit.js')\nshutil.copyfile(os.path.join(base_dir, 'pathkit.js'), dest)\nos.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\nif bundle_name:\n dest = os.path.join(copy_dest, bundle_name)\n shutil.copyfile(os.path.join(base_dir, bundle_name), dest)\n os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\nos.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't write.\n",
"import errno\nimport os\nimport shutil\nimport sys\n\ncopy_dest = sys.argv[1]\nbase_dir = sys.argv[2]\nbundle_name = sys.argv[3]\nout_dir = sys.argv[4]\n\n# Clean out old binaries (if any)\ntry:\n shutil.rmtree(copy_dest)\nexcept OSError as e:\n if e.errno != errno.ENOENT:\n raise\n\n# Make folder\ntry:\n os.makedirs(copy_dest)\nexcept OSError as e:\n if e.errno != errno.EEXIST:\n raise\n\n# Copy binaries (pathkit.js and pathkit.wasm) to where the karma tests\n# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/bin/)\ndest = os.path.join(copy_dest, 'pathkit.js')\nshutil.copyfile(os.path.join(base_dir, 'pathkit.js'), dest)\nos.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\nif bundle_name:\n dest = os.path.join(copy_dest, bundle_name)\n shutil.copyfile(os.path.join(base_dir, bundle_name), dest)\n os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\nos.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't write.\n",
"[START_DIR]/cache/work/skia/modules/pathkit/npm-wasm/bin",
"[START_DIR]/build",
"pathkit.wasm",
@ -148,7 +148,7 @@
"@@@STEP_LOG_LINE@python.inline@ raise@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Copy binaries (pathkit.js and pathkit.wasm) to where the karma tests@@@",
"@@@STEP_LOG_LINE@python.inline@# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/)@@@",
"@@@STEP_LOG_LINE@python.inline@# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/bin/)@@@",
"@@@STEP_LOG_LINE@python.inline@dest = os.path.join(copy_dest, 'pathkit.js')@@@",
"@@@STEP_LOG_LINE@python.inline@shutil.copyfile(os.path.join(base_dir, 'pathkit.js'), dest)@@@",
"@@@STEP_LOG_LINE@python.inline@os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.@@@",
@ -198,9 +198,9 @@
"run",
"--shm-size=2gb",
"--rm",
"-v",
"--volume",
"[START_DIR]/cache/work:/SRC",
"-v",
"--volume",
"[START_DIR]/[SWARM_OUT_DIR]:/OUT",
"gcr.io/skia-public/perf-karma-chrome-tests:68.0.3440.106_v6",
"/SRC/skia/infra/pathkit/perf_pathkit.sh",

View File

@ -70,7 +70,7 @@ except OSError as e:
raise
# Copy binaries (pathkit.js and pathkit.wasm) to where the karma tests
# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/)
# expect them ($SKIA_ROOT/modules/pathkit/npm-wasm/bin/)
dest = os.path.join(copy_dest, 'pathkit.js')
shutil.copyfile(os.path.join(base_dir, 'pathkit.js'), dest)
os.chmod(dest, 0o644) # important, otherwise non-privileged docker can't read.
@ -87,26 +87,25 @@ os.chmod(out_dir, 0o777) # important, otherwise non-privileged docker can't writ
args=[copy_dest, base_dir, bundle_name, out_dir],
infra_step=True)
cmd = ['docker', 'run', '--shm-size=2gb', '--rm',
'-v', '%s:/SRC' % checkout_root, '-v', '%s:/OUT' % out_dir]
'--volume', '%s:/SRC' % checkout_root,
'--volume', '%s:/OUT' % out_dir]
if 'asmjs' in api.vars.builder_name:
cmd.extend(['-e', 'ASM_JS=1']) # -e sets environment variables
cmd.extend(['--env', 'ASM_JS=1'])
cmd.extend([
DOCKER_IMAGE, INNER_KARMA_SCRIPT,
'--builder', api.vars.builder_name,
'--git_hash', api.properties['revision'],
'--buildbucket_build_id', api.properties.get('buildbucket_build_id',
''),
'--bot_id', api.vars.swarming_bot_id,
'--task_id', api.vars.swarming_task_id,
'--browser', 'Chrome',
'--config', api.vars.configuration,
'--source_type', 'pathkit',
])
DOCKER_IMAGE, INNER_KARMA_SCRIPT,
'--builder', api.vars.builder_name,
'--git_hash', api.properties['revision'],
'--buildbucket_build_id', api.properties.get('buildbucket_build_id',
''),
'--bot_id', api.vars.swarming_bot_id,
'--task_id', api.vars.swarming_task_id,
'--browser', 'Chrome',
'--config', api.vars.configuration,
'--source_type', 'pathkit',
])
if 'asmjs' in api.vars.builder_name:
cmd.extend(['--compiled_language', 'asmjs']) # the default is wasm

View File

@ -1141,11 +1141,21 @@
"Upload-Perf-Debian9-EMCC-GCE-CPU-AVX2-asmjs-Release-All-PathKit"
]
},
"Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit": {
"tasks": [
"Upload-Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit"
]
},
"Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-PathKit": {
"tasks": [
"Upload-Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-PathKit"
]
},
"Perf-Debian9-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit": {
"tasks": [
"Upload-Perf-Debian9-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit"
]
},
"Perf-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All": {
"tasks": [
"Perf-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All"
@ -29153,6 +29163,103 @@
"perf"
]
},
"Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit": {
"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",
"perf_canvaskit",
"-properties",
"{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit\",\"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\":\"perf\"}",
"-logdog-annotation-url",
"logdog://logs.chromium.org/skia/<(TASK_ID)/+/annotations"
],
"dependencies": [
"Housekeeper-PerCommit-BundleRecipes",
"Build-Debian9-EMCC-wasm-Release-CanvasKit_CPU"
],
"dimensions": [
"cpu:x86-64-Haswell_GCE",
"machine_type:n1-standard-16",
"os:Debian-9.4",
"pool:Skia"
],
"env_prefixes": {
"PATH": [
"cipd_bin_packages",
"cipd_bin_packages/bin"
],
"VPYTHON_VIRTUALENV_ROOT": [
"cache/vpython"
]
},
"execution_timeout_ns": 14400000000000,
"expiration_ns": 72000000000000,
"extra_tags": {
"log_location": "logdog://logs.chromium.org/skia/<(TASK_ID)/+/annotations"
},
"io_timeout_ns": 14400000000000,
"isolate": "perf_skia_bundled.isolate",
"max_attempts": 1,
"outputs": [
"perf"
]
},
"Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-PathKit": {
"caches": [
{
@ -29250,6 +29357,105 @@
"perf"
]
},
"Perf-Debian9-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit": {
"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",
"perf_canvaskit",
"-properties",
"{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"Perf-Debian9-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit\",\"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\":\"perf\"}",
"-logdog-annotation-url",
"logdog://logs.chromium.org/skia/<(TASK_ID)/+/annotations"
],
"dependencies": [
"Housekeeper-PerCommit-BundleRecipes",
"Build-Debian9-EMCC-wasm-Release-CanvasKit"
],
"dimensions": [
"cpu:x86-64-Haswell_GCE",
"gpu:none",
"machine_type:n1-standard-16",
"os:Debian-9.4",
"pool:Skia",
"docker_installed:true"
],
"env_prefixes": {
"PATH": [
"cipd_bin_packages",
"cipd_bin_packages/bin"
],
"VPYTHON_VIRTUALENV_ROOT": [
"cache/vpython"
]
},
"execution_timeout_ns": 14400000000000,
"expiration_ns": 72000000000000,
"extra_tags": {
"log_location": "logdog://logs.chromium.org/skia/<(TASK_ID)/+/annotations"
},
"io_timeout_ns": 14400000000000,
"isolate": "perf_skia_bundled.isolate",
"max_attempts": 1,
"outputs": [
"perf"
]
},
"Perf-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All": {
"caches": [
{
@ -75393,6 +75599,105 @@
"isolate": "swarm_recipe.isolate",
"service_account": "skia-external-nano-uploader@skia-swarming-bots.iam.gserviceaccount.com"
},
"Upload-Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit": {
"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"
},
{
"name": "infra/gsutil",
"path": "cipd_bin_packages",
"version": "version:4.28"
}
],
"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",
"upload_nano_results",
"-properties",
"{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit\",\"gs_bucket\":\"skia-perf\",\"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",
"Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit"
],
"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",
"service_account": "skia-external-nano-uploader@skia-swarming-bots.iam.gserviceaccount.com"
},
"Upload-Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-PathKit": {
"caches": [
{
@ -75492,6 +75797,105 @@
"isolate": "swarm_recipe.isolate",
"service_account": "skia-external-nano-uploader@skia-swarming-bots.iam.gserviceaccount.com"
},
"Upload-Perf-Debian9-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit": {
"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"
},
{
"name": "infra/gsutil",
"path": "cipd_bin_packages",
"version": "version:4.28"
}
],
"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",
"upload_nano_results",
"-properties",
"{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"Perf-Debian9-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit\",\"gs_bucket\":\"skia-perf\",\"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",
"Perf-Debian9-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit"
],
"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",
"service_account": "skia-external-nano-uploader@skia-swarming-bots.iam.gserviceaccount.com"
},
"Upload-Perf-Mac-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Release-All": {
"caches": [
{

View File

@ -0,0 +1,33 @@
#!/bin/bash
# Copyright 2018 Google LLC
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This assumes it is being run inside a docker container of perf-karma-chrome-tests
# and a Skia checkout has been mounted at /SRC and the output directory
# is mounted at /OUT
# For example:
# docker run -v $SKIA_ROOT:/SRC -v /tmp/dockerout:/OUT gcr.io/skia-public/perf-karma-chrome-tests:68.0.3440.106_v1 /SRC/infra/canvaskit/perf_canvaskit.sh
set -ex
#BASE_DIR is the dir this script is in ($SKIA_ROOT/infra/pathkit)
BASE_DIR=`cd $(dirname ${BASH_SOURCE[0]}) && pwd`
PATHKIT_DIR=$BASE_DIR/../../experimental/canvaskit
# Start the aggregator in the background
/opt/perf-aggregator $@ &
# Run the tests 10 times to get a wide set of data
for i in `seq 1 10`;
do
npx karma start $PATHKIT_DIR/karma.bench.conf.js --single-run
done
# Tell the aggregator to dump the json
# This curl command gets the HTTP code and stores it into $CODE
CODE=`curl -s -o /dev/null -I -w "%{http_code}" -X POST localhost:8081/dump_json`
if [ $CODE -ne 200 ]; then
# If we don't get 200 back, something is wrong with writing to disk, so exit with error
exit 1
fi