Commit e3279315 authored by Junji Watanabe's avatar Junji Watanabe Committed by Chromium LUCI CQ

[tools] Use CAS in "mb.py run -s"

Similar to run-swarmed.py https://crrev.com/c/2623734,
"mb.py run -s" will use CAS instead of Isolate server.

Bug: 1163817
Change-Id: Ib0488417a1967736b0d665b49ed6f8d70e01cab6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626807
Auto-Submit: Junji Watanabe <jwata@google.com>
Reviewed-by: default avatarTakuto Ikuta <tikuta@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#843805}
parent 73dc6655
......@@ -608,8 +608,7 @@ class MetaBuildWrapper(object):
self.RemoveDirectory(zip_dir)
def _RunUnderSwarming(self, build_dir, target, isolate_cmd):
isolate_server = 'isolateserver.appspot.com'
namespace = 'default-gzip'
cas_instance = 'chromium-swarm'
swarming_server = 'chromium-swarm.appspot.com'
# TODO(dpranke): Look up the information for the target in
# the //testing/buildbot.json file, if possible, so that we
......@@ -629,12 +628,8 @@ class MetaBuildWrapper(object):
'archive',
'-i',
self.ToSrcRelPath('%s/%s.isolate' % (build_dir, target)),
'-s',
self.ToSrcRelPath('%s/%s.isolated' % (build_dir, target)),
'-I',
isolate_server,
'-namespace',
namespace,
'-cas-instance',
cas_instance,
'-dump-json',
archive_json_path,
]
......@@ -665,7 +660,7 @@ class MetaBuildWrapper(object):
'Failed to read JSON file "%s"' % archive_json_path, file=sys.stderr)
return 1
try:
isolated_hash = archive_hashes[target]
cas_digest = archive_hashes[target]
except Exception:
self.Print(
'Cannot find hash for "%s" in "%s", file content: %s' %
......@@ -681,12 +676,8 @@ class MetaBuildWrapper(object):
cmd = [
self.PathJoin('tools', 'luci-go', 'swarming'),
'trigger',
'-isolated',
isolated_hash,
'-I',
'https://' + isolate_server,
'-namespace',
namespace,
'-digest',
cas_digest,
'-server',
swarming_server,
'-tag=purpose:user-debug-mb',
......
......@@ -243,12 +243,12 @@ def main():
print('Uploading to isolate server, this can take a while...')
isolate = os.path.join(args.out_dir, args.target_name + '.isolate')
digest_json = os.path.join(args.out_dir, args.target_name + '.digest.json')
archive_json = os.path.join(args.out_dir, args.target_name + '.archive.json')
subprocess.check_output([
'tools/luci-go/isolate', 'archive', '-cas-instance', 'chromium-swarm',
'-isolate', isolate, '-dump-json', digest_json
'-isolate', isolate, '-dump-json', archive_json
])
with open(digest_json) as f:
with open(archive_json) as f:
cas_digest = json.load(f).get(args.target_name)
mb_cmd = [
......
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