skia2/infra/bots/add_isolated_input.py
borenet f1215a537f Swarming bots: setup for skipping download of build products
Turns out it's pretty easy to pass the compile outputs to the test task by just adding the hash to the "includes" list in the .isolated file.  So the flow is:
1. Isolate skia repo
2. Run compile task, record hash of results
3. Isolate test inputs for DM. This writes a .isolated file
4. Edit the .isolated file from #3 to include the hash from #2
5. Upload the modified .isolated file to the isolate server
6. Trigger the swarming task for DM
7. Wait for DM task to finish, download results from isolate server
8. Upload results to GS as normal

I expect the swarming bots to break when this is committed due to the moved out directory.  The associated recipe change will fix them.

NOTRY=true
BUG=skia:4763
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1759553003

Review URL: https://codereview.chromium.org/1759553003
2016-03-04 04:55:26 -08:00

34 lines
770 B
Python

#!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import json
"""Add the given hash to the includes section of the given isolated file."""
def add_isolated_hash(isolated_file, hash_str):
with open(isolated_file) as f:
isolated = json.load(f)
isolated['includes'].append(hash_str)
with open(isolated_file, 'w') as f:
json.dump(isolated, f, sort_keys=True)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--isolated_file', required=True)
parser.add_argument('--hash', required=True)
args = parser.parse_args()
add_isolated_hash(args.isolated_file, args.hash)
if __name__ == '__main__':
main()