Commit 49b7f262 authored by Mario Bianucci's avatar Mario Bianucci Committed by Commit Bot

Adding 'python' and vpython for Windows to run run-swarmed.py

run-swarmed.py was failing on Windows for two reasons:
1. Windows expects 'python' before calling a python script
2. Tasks on Windows Swarming bots are invoked via vpython, which isn't
   installed by default on them.

This change adds 'python' to the list of arguments for any subprocess,
and adds includes vpython with the isolates uploaded to Swarming
via --cipd-package and --env-prefix args when the target OS is Windows.

Bug: 1013382
Change-Id: I9b8edf9ebc2341cb72f8034ccec044f951745496
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1854462
Commit-Queue: Mario Bianucci <mabian@microsoft.com>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705096}
parent 59a7b9c9
...@@ -46,7 +46,7 @@ def _Spawn(args): ...@@ -46,7 +46,7 @@ def _Spawn(args):
""" """
index, args, isolated_hash = args index, args, isolated_hash = args
json_file = os.path.join(args.results, '%d.json' % index) json_file = os.path.join(args.results, '%d.json' % index)
trigger_args = [ trigger_args = [sys.executable,
'tools/swarming_client/swarming.py', 'trigger', 'tools/swarming_client/swarming.py', 'trigger',
'-S', 'https://chromium-swarm.appspot.com', '-S', 'https://chromium-swarm.appspot.com',
'-I', 'https://isolateserver.appspot.com', '-I', 'https://isolateserver.appspot.com',
...@@ -62,7 +62,9 @@ def _Spawn(args): ...@@ -62,7 +62,9 @@ def _Spawn(args):
'-d', 'gpu', 'none', '-d', 'gpu', 'none',
'-d', 'cpu', args.arch, '-d', 'cpu', args.arch,
] ]
elif args.target_os == 'android': elif args.target_os == 'android' or args.target_os == 'win':
if args.target_os == 'android':
trigger_args += ['-d', 'device_os', args.device_os]
# The canonical version numbers are stored in the infra repository here: # The canonical version numbers are stored in the infra repository here:
# build/scripts/slave/recipe_modules/swarming/api.py # build/scripts/slave/recipe_modules/swarming/api.py
cpython_version = 'version:2.7.15.chromium14' cpython_version = 'version:2.7.15.chromium14'
...@@ -77,7 +79,6 @@ def _Spawn(args): ...@@ -77,7 +79,6 @@ def _Spawn(args):
'.swarming_module:infra/tools/luci/vpython/${platform}:' + '.swarming_module:infra/tools/luci/vpython/${platform}:' +
vpython_version) vpython_version)
trigger_args += [ trigger_args += [
'-d', 'device_os', args.device_os,
'--cipd-package', cpython_pkg, '--cipd-package', cpython_pkg,
'--cipd-package', vpython_native_pkg, '--cipd-package', vpython_native_pkg,
'--cipd-package', vpython_pkg, '--cipd-package', vpython_pkg,
...@@ -104,7 +105,7 @@ def _Spawn(args): ...@@ -104,7 +105,7 @@ def _Spawn(args):
def _Collect(spawn_result): def _Collect(spawn_result):
index, json_file, args = spawn_result index, json_file, args = spawn_result
p = subprocess.Popen([ p = subprocess.Popen([sys.executable,
'tools/swarming_client/swarming.py', 'collect', 'tools/swarming_client/swarming.py', 'collect',
'-S', 'https://chromium-swarm.appspot.com', '-S', 'https://chromium-swarm.appspot.com',
'--json', json_file, '--json', json_file,
...@@ -177,8 +178,8 @@ def main(): ...@@ -177,8 +178,8 @@ def main():
else: else:
args.arch = 'x86-64' args.arch = 'x86-64'
subprocess.check_call( subprocess.check_call([sys.executable, 'tools/mb/mb.py',
['tools/mb/mb.py', 'isolate', '//' + args.out_dir, args.target_name]) 'isolate', '//' + args.out_dir, args.target_name])
print('If you get authentication errors, follow:') print('If you get authentication errors, follow:')
print( print(
...@@ -187,7 +188,7 @@ def main(): ...@@ -187,7 +188,7 @@ def main():
print('Uploading to isolate server, this can take a while...') print('Uploading to isolate server, this can take a while...')
archive_output = subprocess.check_output( archive_output = subprocess.check_output(
['tools/swarming_client/isolate.py', 'archive', [sys.executable,'tools/swarming_client/isolate.py', 'archive',
'-I', 'https://isolateserver.appspot.com', '-I', 'https://isolateserver.appspot.com',
'-i', os.path.join(args.out_dir, args.target_name + '.isolate'), '-i', os.path.join(args.out_dir, args.target_name + '.isolate'),
'-s', os.path.join(args.out_dir, args.target_name + '.isolated')]) '-s', os.path.join(args.out_dir, args.target_name + '.isolated')])
......
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