Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: client/example/2_swarming_run_auto_upload.py

Issue 1337633002: Reapply "Isolated task support in Endpoints API: client side (3/3)" and fixes" (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Final fixes Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/example/2_swarming_run.py ('k') | client/example/3_swarming_trigger_collect.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/example/2_swarming_run_auto_upload.py
diff --git a/client/example/2_swarming_run_auto_upload.py b/client/example/2_swarming_run_auto_upload.py
deleted file mode 100755
index 2fb5d43c5f41dea3b574bebb6b0e75991c09accb..0000000000000000000000000000000000000000
--- a/client/example/2_swarming_run_auto_upload.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2012 The Swarming Authors. All rights reserved.
-# Use of this source code is governed under the Apache License, Version 2.0 that
-# can be found in the LICENSE file.
-
-"""Runs hello_world.py, through hello_world.isolate, remotely on a Swarming
-slave.
-
-It first 'compiles' hello_world.isolate into hello_word.isolated, then requests
-via swarming.py to archives, run and collect results for this task.
-"""
-
-import os
-import shutil
-import subprocess
-import sys
-import tempfile
-
-# Pylint can't find common.py that's in the same directory as this file.
-# pylint: disable=F0401
-import common
-
-
-def main():
- options = common.parse_args(use_isolate_server=True, use_swarming=True)
- tempdir = tempfile.mkdtemp(prefix=u'hello_world')
- try:
- # All the files are put in a temporary directory. This is optional and
- # simply done so the current directory doesn't have the following files
- # created:
- # - hello_world.isolated
- # - hello_world.isolated.state
- isolated = os.path.join(tempdir, 'hello_world.isolated')
-
- common.note(
- 'Creating hello_world.isolated. Note that this doesn\'t archives '
- 'anything.')
- common.run(
- [
- 'isolate.py',
- 'check',
- '--isolate', os.path.join('payload', 'hello_world.isolate'),
- '--isolated', isolated,
- '--config-variable', 'OS', options.swarming_os,
- ], options.verbose)
-
- common.note(
- 'Running the job remotely. This:\n'
- ' - archives to %s\n'
- ' - runs and collect results via %s' %
- (options.isolate_server, options.swarming))
- cmd = [
- 'swarming.py',
- 'run',
- '--swarming', options.swarming,
- '--isolate-server', options.isolate_server,
- '--dimension', 'os', options.swarming_os,
- '--task-name', options.task_name,
- isolated,
- ]
- if options.idempotent:
- cmd.append('--idempotent')
- if options.priority is not None:
- cmd.extend(('--priority', str(options.priority)))
- common.run(cmd, options.verbose)
- return 0
- except subprocess.CalledProcessError as e:
- return e.returncode
- finally:
- shutil.rmtree(tempdir)
-
-
-if __name__ == '__main__':
- sys.exit(main())
« no previous file with comments | « client/example/2_swarming_run.py ('k') | client/example/3_swarming_trigger_collect.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698