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

Unified Diff: appengine/swarming/swarming_bot/bot_code/task_runner.py

Issue 2043853002: Complete CIPD integration (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@run-isolated-cipd
Patch Set: nit Created 4 years, 6 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 | « appengine/swarming/server/task_result_test.py ('k') | appengine/swarming/templates/user_task.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/swarming_bot/bot_code/task_runner.py
diff --git a/appengine/swarming/swarming_bot/bot_code/task_runner.py b/appengine/swarming/swarming_bot/bot_code/task_runner.py
index 40f4208bd5df969cb1a6cc66ff9708528a5928c5..3aacb3b93c8e6ea9a29bab068a2a2ef6a40b0844 100644
--- a/appengine/swarming/swarming_bot/bot_code/task_runner.py
+++ b/appengine/swarming/swarming_bot/bot_code/task_runner.py
@@ -100,11 +100,23 @@ def get_isolated_cmd(
'--isolated', isolated_input,
])
+ if task_details.cipd_input and task_details.cipd_input.get('packages'):
+ to_pkg = lambda p: '%s:%s' % (p['package_name'], p['version'])
+ cmd.extend(
+ [
+ '--cipd-cache', os.path.join(bot_dir, 'cipd_cache'),
+ '--cipd-client-package', to_pkg(
M-A Ruel 2016/06/06 23:54:28 I'd prefer the to_pkg( on the next line then the f
nodir 2016/06/09 23:36:28 Done.
+ task_details.cipd_input.get('client_package')),
+ '--cipd-server', task_details.cipd_input.get('server'),
+ ])
+ for p in task_details.cipd_input['packages']:
+ cmd.extend(['--cipd-package', to_pkg(p)])
+
cmd.extend(
[
'--json', isolated_result,
'--log-file', os.path.join(bot_dir, 'logs', 'run_isolated.log'),
- '--cache', os.path.join(bot_dir, 'cache'),
+ '--cache', os.path.join(bot_dir, 'isolated_cache'),
'--root-dir', os.path.join(work_dir, 'isolated'),
])
if min_free_space:
@@ -140,6 +152,8 @@ class TaskDetails(object):
self.isolated = data['isolated']
self.extra_args = data['extra_args']
+ self.cipd_input = data.get('cipd_input')
+
self.env = {
k.encode('utf-8'): v.encode('utf-8') for k, v in data['env'].iteritems()
}
@@ -466,11 +480,16 @@ def run_command(
'download', {}).get('duration', 0)
params['bot_overhead'] -= run_isolated_result.get(
'upload', {}).get('duration', 0)
+ params['bot_overhead'] -= run_isolated_result.get(
+ 'cipd', {}).get('duration', 0)
if params['bot_overhead'] < 0:
params['bot_overhead'] = 0
isolated_stats = run_isolated_result.get('stats', {}).get('isolated')
if isolated_stats:
params['isolated_stats'] = isolated_stats
+ cipd_stats = run_isolated_result.get('stats', {}).get('cipd')
+ if cipd_stats:
+ params['cipd_stats'] = cipd_stats
except (IOError, OSError, ValueError) as e:
logging.error('Swallowing error: %s', e)
if not must_signal_internal_failure:
« no previous file with comments | « appengine/swarming/server/task_result_test.py ('k') | appengine/swarming/templates/user_task.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698