swarming: Update the swarming call to specify the pool.
Changes are being made to swarming to expect the pool dimension.
https://codereview.chromium.org/1778083002
BUG=chromium:599901
TEST=unittest and try job
https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/paladin/builds/885
Change-Id: Ie8407f9ab4d541f38ab866c07556222fab85ff06
Previous-Reviewed-on: https://chromium-review.googlesource.com/336387
(cherry picked from commit d57d0efb09349ed35934e48fea87731607ce596b)
Reviewed-on: https://chromium-review.googlesource.com/336916
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Kevin Cheng <kevcheng@chromium.org>
Tested-by: Kevin Cheng <kevcheng@chromium.org>
diff --git a/cbuildbot/commands.py b/cbuildbot/commands.py
index 5491f86..44de43e 100644
--- a/cbuildbot/commands.py
+++ b/cbuildbot/commands.py
@@ -1069,7 +1069,8 @@
'swarming_server': topology.topology.get(
topology.SWARMING_PROXY_HOST_KEY),
'task_name': '-'.join([build, suite]),
- 'dimension': ('os', 'Linux'),
+ 'dimensions': [('os', 'Ubuntu-14.04'),
+ ('pool', 'default')],
'print_status_updates': True,
'timeout_secs': swarming_timeout,
'io_timeout_secs': swarming_timeout,
@@ -1197,7 +1198,8 @@
'swarming_server': topology.topology.get(
topology.SWARMING_PROXY_HOST_KEY),
'task_name': '-'.join(['abort', substr, suite]),
- 'dimension': ('os', 'Linux'),
+ 'dimensions': [('os', 'Ubuntu-14.04'),
+ ('pool', 'default')],
'print_status_updates': True,
'expiration_secs': _SWARMING_EXPIRATION}
if debug:
diff --git a/cbuildbot/commands_unittest.py b/cbuildbot/commands_unittest.py
index 1dccbd4..c6e7160 100644
--- a/cbuildbot/commands_unittest.py
+++ b/cbuildbot/commands_unittest.py
@@ -299,7 +299,8 @@
'--task-summary-json', self.temp_json_path,
'--raw-cmd',
'--task-name', 'test-build-test-suite',
- '--dimension', 'os', 'Linux',
+ '--dimension', 'os', 'Ubuntu-14.04',
+ '--dimension', 'pool', 'default',
'--print-status-updates',
'--timeout', swarming_timeout_secs,
'--io-timeout', swarming_io_timeout_secs,
diff --git a/cbuildbot/swarming_lib.py b/cbuildbot/swarming_lib.py
index c3d993d..c07571e 100644
--- a/cbuildbot/swarming_lib.py
+++ b/cbuildbot/swarming_lib.py
@@ -26,7 +26,7 @@
def RunSwarmingCommand(cmd, swarming_server, task_name=None,
- dimension=None,
+ dimensions=None,
print_status_updates=False,
timeout_secs=None, io_timeout_secs=None,
hard_timeout_secs=None, expiration_secs=None,
@@ -38,8 +38,9 @@
cmd: Commands to run, represented as a list.
swarming_server: The swarming server to send request to.
task_name: String, represent a task.
- dimension: A tuple with two elements, representing dimension for
- selecting a swarming bots. E.g. ('os', 'Linux')
+ dimensions: A list of tuple with two elements, representing dimension for
+ selecting a swarming bots. E.g. ('os', 'Linux') and pools and
+ other dimension related stuff.
print_status_updates: Boolean, whether to output status updates,
can be used to prevent from hitting
buildbot silent timeout.
@@ -60,8 +61,9 @@
if task_name:
swarming_cmd += ['--task-name', task_name]
- if dimension:
- swarming_cmd += ['--dimension', dimension[0], dimension[1]]
+ if dimensions:
+ for dimension in dimensions:
+ swarming_cmd += ['--dimension', dimension[0], dimension[1]]
if print_status_updates:
swarming_cmd.append('--print-status-updates')