aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules/swarming
diff options
context:
space:
mode:
authorGravatar Eric Boren <borenet@google.com>2016-12-12 08:41:34 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-13 12:53:00 +0000
commit3b3bdafa8e3ac9421d895b1b978a148ed010de71 (patch)
treecb0a325df6ea1e5ed95911c0bc1c28c925144ae1 /infra/bots/recipe_modules/swarming
parentb399e38518c7c28e94579ce382e64fdf0697a7e9 (diff)
Delete swarm_trigger recipe
Delete no-longer-used parts of swarming module and add "pragma: no cover" where applicable. BUG=skia: Change-Id: I0f516d7be520a4d4b4efbfa97bd383a5f124e713 Reviewed-on: https://skia-review.googlesource.com/5790 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Eric Boren <borenet@google.com>
Diffstat (limited to 'infra/bots/recipe_modules/swarming')
-rw-r--r--infra/bots/recipe_modules/swarming/api.py80
1 files changed, 2 insertions, 78 deletions
diff --git a/infra/bots/recipe_modules/swarming/api.py b/infra/bots/recipe_modules/swarming/api.py
index 8f602bd179..0a2377fe7f 100644
--- a/infra/bots/recipe_modules/swarming/api.py
+++ b/infra/bots/recipe_modules/swarming/api.py
@@ -66,41 +66,6 @@ class SkiaSwarmingApi(recipe_api.RecipeApi):
source=luci_go_dir,
dest=dest)
- def isolate_and_trigger_task(
- self, isolate_path, isolate_base_dir, task_name, isolate_vars,
- swarm_dimensions, isolate_blacklist=None, extra_isolate_hashes=None,
- idempotent=False, store_output=True, extra_args=None, expiration=None,
- hard_timeout=None, io_timeout=None, cipd_packages=None):
- """Isolate inputs and trigger the task to run."""
- os_type = swarm_dimensions.get('os', 'linux')
- isolated_hash = self.isolate_task(
- isolate_path, isolate_base_dir, os_type, task_name, isolate_vars,
- blacklist=isolate_blacklist, extra_hashes=extra_isolate_hashes)
- tasks = self.trigger_swarming_tasks([(task_name, isolated_hash)],
- swarm_dimensions,
- idempotent=idempotent,
- store_output=store_output,
- extra_args=extra_args,
- expiration=expiration,
- hard_timeout=hard_timeout,
- io_timeout=io_timeout,
- cipd_packages=cipd_packages)
- assert len(tasks) == 1
- return tasks[0]
-
- def isolate_task(self, isolate_path, base_dir, os_type, task_name,
- isolate_vars, blacklist=None, extra_hashes=None):
- """Isolate inputs for the given task."""
- self.create_isolated_gen_json(isolate_path, base_dir, os_type,
- task_name, isolate_vars,
- blacklist=blacklist)
- hashes = self.batcharchive([task_name])
- assert len(hashes) == 1
- isolated_hash = hashes[0][1]
- if extra_hashes:
- isolated_hash = self.add_isolated_includes(task_name, extra_hashes)
- return isolated_hash
-
def create_isolated_gen_json(self, isolate_path, base_dir, os_type,
task_name, extra_variables, blacklist=None):
"""Creates an isolated.gen.json file (used by the isolate recipe module).
@@ -123,7 +88,7 @@ class SkiaSwarmingApi(recipe_api.RecipeApi):
'--isolated', isolated_path,
'--config-variable', 'OS', os_type,
]
- if blacklist:
+ if blacklist: # pragma: no cover
for b in blacklist:
isolate_args.extend(['--blacklist', b])
for k, v in extra_variables.iteritems():
@@ -156,36 +121,6 @@ class SkiaSwarmingApi(recipe_api.RecipeApi):
build_dir=self.swarming_temp_dir,
targets=targets).presentation.properties['swarm_hashes'].items()
- def add_isolated_includes(self, task_name, include_hashes):
- """Add the hashes to the task's .isolated file, return new .isolated hash.
-
- Args:
- task: str. Name of the task to which to add the given hash.
- include_hashes: list of str. Hashes of the new includes.
- Returns:
- Updated hash of the .isolated file.
- """
- isolated_file = self.isolated_file_path(task_name)
- self.m.python.inline('add_isolated_input', program="""
- import json
- import sys
- with open(sys.argv[1]) as f:
- isolated = json.load(f)
- if not isolated.get('includes'):
- isolated['includes'] = []
- for h in sys.argv[2:]:
- isolated['includes'].append(h)
- with open(sys.argv[1], 'w') as f:
- json.dump(isolated, f, sort_keys=True)
- """, args=[isolated_file] + include_hashes)
- isolateserver = self.m.swarming_client.path.join('isolateserver.py')
- r = self.m.python('upload new .isolated file for %s' % task_name,
- script=isolateserver,
- args=['archive', '--isolate-server',
- self.m.isolate.isolate_server, isolated_file],
- stdout=self.m.raw_io.output())
- return shlex.split(r.stdout)[0]
-
def trigger_swarming_tasks(
self, swarm_hashes, dimensions, idempotent=False, store_output=True,
extra_args=None, expiration=None, hard_timeout=None, io_timeout=None,
@@ -227,7 +162,7 @@ class SkiaSwarmingApi(recipe_api.RecipeApi):
hard_timeout if hard_timeout else DEFAULT_TASK_TIMEOUT)
swarming_task.io_timeout = (
io_timeout if io_timeout else DEFAULT_IO_TIMEOUT)
- if extra_args:
+ if extra_args: # pragma: no cover
swarming_task.extra_args = extra_args
revision = self.m.properties.get('revision')
if revision:
@@ -264,17 +199,6 @@ class SkiaSwarmingApi(recipe_api.RecipeApi):
self._add_log_links(step_result)
return rv
- def collect_swarming_task_isolate_hash(self, swarming_task):
- """Wait for the given swarming task to finish and return its output hash.
-
- Args:
- swarming_task: An instance of swarming.SwarmingTask.
- Returns:
- the hash of the isolate output of the task.
- """
- res = self.collect_swarming_task(swarming_task)
- return res.json.output['shards'][0]['isolated_out']['isolated']
-
def _add_log_links(self, step_result):
"""Add Milo log links to all shards in the step."""
ids = []