Commit e9cc819f authored by Ye Kuang's avatar Ye Kuang Committed by Commit Bot

Use luci-go isolate client in mb.py

Because go's "check" subcommand doesn't generate isolated file, the '-s' flag is dropped. This is fine because Go isolate doesn't consume isolated file at all. More details in crbug.com/1059668.

#Benchmark

Benchmark is done using the "archive" subcommand. Note that the first invocation will upload to isolate-server, which we want to *exclude*. So the results were taken from the second invocation.

##blink_web_tests:

* PY: 1m15s~1m40s (python tools/swarming_client/isolate.py archive -i out/Release/blink_web_tests.isolate -s out/Release/blink_web_tests.isolated -I https://isolateserver.appspot.com)
* GO: ~8s (tools/luci-go/isolate archive -i out/Release/blink_web_tests.isolate -s out/Release/blink_web_tests.isolated -I https://isolateserver.appspot.com)

##browsers_tests:

* PY: 31s
* GO: 3s

Bug: 1059167
Change-Id: Idffb6c33e2482c2829f54c56e753623f26997a10
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2094482
Commit-Queue: Ye Kuang <yekuang@google.com>
Reviewed-by: default avatarTakuto Ikuta <tikuta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749557}
parent 99e66d37
......@@ -99,6 +99,8 @@ class MetaBuildWrapper(object):
self.masters = {}
self.buckets = {}
self.mixins = {}
self.isolate_exe = 'isolate.exe' if self.platform.startswith(
'win') else 'isolate'
def Main(self, args):
self.ParseArgs(args)
......@@ -564,11 +566,10 @@ class MetaBuildWrapper(object):
try:
zip_dir = self.TempDir()
remap_cmd = [
self.executable,
self.PathJoin(self.chromium_src_dir, 'tools', 'swarming_client',
'isolate.py'), 'remap', '--collapse_symlinks', '-s',
self.PathJoin(self.args.path, self.args.target + '.isolated'), '-o',
zip_dir
self.PathJoin(self.chromium_src_dir, 'tools', 'luci-go',
self.isolate_exe), 'remap', '-i',
self.PathJoin(self.args.path, self.args.target + '.isolate'),
'-outdir', zip_dir
]
self.Run(remap_cmd)
......@@ -647,12 +648,15 @@ class MetaBuildWrapper(object):
dimensions += ['-d', k, v]
cmd = [
self.executable,
self.PathJoin('tools', 'swarming_client', 'isolate.py'),
self.PathJoin(self.chromium_src_dir, 'tools', 'luci-go',
self.isolate_exe),
'archive',
'-s', self.ToSrcRelPath('%s/%s.isolated' % (build_dir, target)),
'-I', isolate_server,
'--namespace', namespace,
'-s',
self.ToSrcRelPath('%s/%s.isolated' % (build_dir, target)),
'-I',
isolate_server,
'-namespace',
namespace,
]
# Talking to the isolateserver may fail because we're not logged in.
......@@ -694,11 +698,11 @@ class MetaBuildWrapper(object):
def _RunLocallyIsolated(self, build_dir, target):
cmd = [
self.executable,
self.PathJoin('tools', 'swarming_client', 'isolate.py'),
self.PathJoin(self.chromium_src_dir, 'tools', 'luci-go',
self.isolate_exe),
'run',
'-s',
self.ToSrcRelPath('%s/%s.isolated' % (build_dir, target)),
'-i',
self.ToSrcRelPath('%s/%s.isolate' % (build_dir, target)),
]
if self.args.extra_args:
cmd += ['--'] + self.args.extra_args
......@@ -1287,13 +1291,12 @@ class MetaBuildWrapper(object):
return ret
ret, _, _ = self.Run([
self.executable,
self.PathJoin('tools', 'swarming_client', 'isolate.py'),
self.PathJoin(self.chromium_src_dir, 'tools', 'luci-go',
self.isolate_exe),
'check',
'-i',
self.ToSrcRelPath('%s/%s.isolate' % (build_dir, target)),
'-s',
self.ToSrcRelPath('%s/%s.isolated' % (build_dir, target))],
],
buffer_output=False)
return ret
......
......@@ -842,7 +842,7 @@ class UnitTest(unittest.TestCase):
}
def run_stub(cmd, **_kwargs):
if 'isolate.py' in cmd[1]:
if os.path.join('tools', 'luci-go', 'isolate') in cmd[0]:
return 0, 'fake_hash base_unittests', ''
else:
return 0, '', ''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment