Commit 681a0e18 authored by Kenneth Russell's avatar Kenneth Russell Committed by Commit Bot

Add Swarming trigger script for GPU tests.

This script takes in multiple Swarming dimension sets, specified as a
JSON string which decodes to a list of dictionaries. The script queries
the Swarming pool for the live bots for each dimension and spreads the
shard(s) for the given tests across them according to an algorithm
defined in the script.

This allows two or more GPU configurations to be specified for a single
bot. This way, during upgrades of the fleet, jobs can temporarily be
targeted at both the old and the new configurations, avoiding
temporarily losing half of the capacity.

The trigger script is enabled on these four bots:

  chromium.gpu:Win7 Release (NVIDIA)
  chromium.gpu.fyi:Win7 Release (NVIDIA)
  chromium.gpu.fyi:Win7 dEQP Release (NVIDIA)
  chromium.gpu.fyi:Optional Win7 Release (NVIDIA)

which are mirrored to the following trybots:

  tryserver.chromium.win:win7_chromium_rel_ng
  tryserver.chromium.win:win_optional_gpu_tests_rel
  tryserver.chromium.angle:win_angle_rel_ng
  tryserver.chromium.angle:win_angle_deqp_rel_ng

Once the upgrade to Win10 begins, Win10 will be set as an alternate
Swarming dimension for these bots. When the upgrade is complete, the
bots will be targeted solely at Win10, with Win7 only being tested on
the waterfalls.

BUG=781057

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ie79953dfa023c3a9e4427e651ac6f8c10304b74c
Reviewed-on: https://chromium-review.googlesource.com/833505
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarStephen Martinis <martiniss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529170}
parent 18e85f6b
......@@ -8,55 +8,25 @@ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
"""
def _GetPathsToPrepend(input_api):
current_dir = input_api.PresubmitLocalPath()
chromium_src_dir = input_api.os_path.join(current_dir, '..', '..', '..')
return [
input_api.os_path.join(current_dir, 'gpu_tests'),
input_api.os_path.join(chromium_src_dir, 'tools', 'perf'),
input_api.os_path.join(chromium_src_dir,
'third_party', 'catapult', 'telemetry'),
input_api.os_path.join(chromium_src_dir,
'third_party', 'catapult', 'common', 'py_utils'),
def CommonChecks(input_api, output_api):
commands = [
input_api.Command(
name='run_content_test_gpu_unittests', cmd=[
input_api.python_executable, 'run_unittests.py', 'gpu_tests'],
kwargs={}, message=output_api.PresubmitError),
input_api.Command(
name='trigger_gpu_test_unittest', cmd=[
input_api.python_executable, 'trigger_gpu_test_unittest.py'],
kwargs={}, message=output_api.PresubmitError),
]
def _GpuUnittestsArePassingCheck(input_api, output_api):
if not input_api.AffectedFiles():
return []
cmd = [
input_api.os_path.join(input_api.PresubmitLocalPath(), 'run_unittests.py'),
'gpu_tests',
]
if input_api.platform == 'win32':
cmd = [input_api.python_executable] + cmd
if input_api.is_committing:
message_type = output_api.PresubmitError
else:
message_type = output_api.PresubmitPromptWarning
cmd_name = 'run_content_test_gpu_unittests',
test_cmd = input_api.Command(
name=cmd_name,
cmd=cmd,
kwargs={},
message=message_type,
)
if input_api.verbose:
print 'Running', cmd_name
return input_api.RunTests([test_cmd])
return input_api.RunTests(commands)
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_GpuUnittestsArePassingCheck(input_api, output_api))
return results
return CommonChecks(input_api, output_api)
def CheckChangeOnCommit(input_api, output_api):
results = []
results.extend(_GpuUnittestsArePassingCheck(input_api, output_api))
return results
return CommonChecks(input_api, output_api)
def PostUploadHook(cl, change, output_api):
"""git cl upload will call this hook after the issue is created/modified.
......
......@@ -142,6 +142,7 @@ WATERFALL = {
'build_config': 'Release',
'swarming': True,
'os_type': 'win',
'use_gpu_trigger_script': True,
},
'Win7 Debug (NVIDIA)': {
'swarming_dimensions': [
......@@ -274,6 +275,7 @@ FYI_WATERFALL = {
'build_config': 'Release',
'swarming': True,
'os_type': 'win',
'use_gpu_trigger_script': True,
},
'Win7 Debug (NVIDIA)': {
'swarming_dimensions': [
......@@ -299,6 +301,7 @@ FYI_WATERFALL = {
'swarming': True,
'os_type': 'win',
'type': Types.DEQP,
'use_gpu_trigger_script': True,
},
'Win7 Experimental Release (NVIDIA)': {
'swarming_dimensions': [
......@@ -815,6 +818,7 @@ FYI_WATERFALL = {
'swarming': True,
'os_type': 'win',
'type': Types.OPTIONAL,
'use_gpu_trigger_script': True,
},
'Optional Mac Release (Intel)': {
'swarming_dimensions': [
......@@ -2521,6 +2525,17 @@ def remove_tester_configs_from_result(result):
# Don't print the disabled_tester_configs in the JSON.
result.pop('disabled_tester_configs')
def add_common_test_properties(test, tester_config):
if tester_config.get('use_gpu_trigger_script'):
test['trigger_script'] = {
'script': '//content/test/gpu/trigger_gpu_test.py',
'args': [
'--gpu-trigger-configs',
json.dumps(tester_config['swarming_dimensions'] +
tester_config.get('alternate_swarming_dimensions', []))
],
}
def generate_gtest(waterfall, tester_name, tester_config, test, test_config):
if not should_run_on_tester(
waterfall, tester_name, tester_config, test_config):
......@@ -2590,6 +2605,7 @@ def generate_gtest(waterfall, tester_name, tester_config, test, test_config):
# on the chromium.gpu.fyi waterfall. Still, there is no harm in
# specifying it everywhere.
result['use_xvfb'] = False
add_common_test_properties(result, tester_config)
return result
def generate_gtests(waterfall, tester_name, tester_config, test_dictionary):
......@@ -2661,6 +2677,7 @@ def generate_isolated_test(waterfall, tester_name, tester_config, test,
result['non_precommit_args'] = test_config['non_precommit_args']
if 'precommit_args' in test_config:
result['precommit_args'] = test_config['precommit_args']
add_common_test_properties(result, tester_config)
return result
def generate_telemetry_test(waterfall, tester_name, tester_config,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2807,6 +2807,13 @@
]
},
"test": "angle_unittests",
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
},
"use_xvfb": false
},
{
......@@ -2828,6 +2835,13 @@
]
},
"test": "browser_tests",
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
},
"use_xvfb": false
},
{
......@@ -2846,6 +2860,13 @@
]
},
"test": "gl_tests",
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
},
"use_xvfb": false
},
{
......@@ -2865,6 +2886,13 @@
]
},
"test": "gl_tests",
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
},
"use_xvfb": false
},
{
......@@ -2882,6 +2910,13 @@
]
},
"test": "gl_unittests",
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
},
"use_xvfb": false
},
{
......@@ -2902,6 +2937,13 @@
]
},
"test": "video_decode_accelerator_unittest",
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
},
"use_xvfb": false
}
],
......@@ -2929,6 +2971,13 @@
"pool": "Chrome-GPU"
}
]
},
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
}
},
{
......@@ -2954,6 +3003,13 @@
"pool": "Chrome-GPU"
}
]
},
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
}
},
{
......@@ -2979,6 +3035,13 @@
"pool": "Chrome-GPU"
}
]
},
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
}
},
{
......@@ -3004,6 +3067,13 @@
"pool": "Chrome-GPU"
}
]
},
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
}
},
{
......@@ -3033,6 +3103,13 @@
"pool": "Chrome-GPU"
}
]
},
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
}
},
{
......@@ -3065,6 +3142,13 @@
"pool": "Chrome-GPU"
}
]
},
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
}
},
{
......@@ -3105,6 +3189,13 @@
"pool": "Chrome-GPU"
}
]
},
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
}
},
{
......@@ -3131,6 +3222,13 @@
"pool": "Chrome-GPU"
}
]
},
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
}
},
{
......@@ -3156,6 +3254,13 @@
"pool": "Chrome-GPU"
}
]
},
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
}
},
{
......@@ -3182,6 +3287,13 @@
}
],
"shards": 2
},
"trigger_script": {
"args": [
"--gpu-trigger-configs",
"[{\"gpu\": \"10de:1cb3-23.21.13.8792\", \"os\": \"Windows-2008ServerR2-SP1\", \"pool\": \"Chrome-GPU\"}]"
],
"script": "//content/test/gpu/trigger_gpu_test.py"
}
}
]
......
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