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

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: rebased and 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
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 8f05f735fa01c4c86f1a183eb97eb46b9635b1f6..689b79835e0ad33d8e4bb523bd14aef5815f6dc2 100644
--- a/appengine/swarming/swarming_bot/bot_code/task_runner.py
+++ b/appengine/swarming/swarming_bot/bot_code/task_runner.py
@@ -103,11 +103,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(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)])
M-A Ruel 2016/06/10 02:06:42 (FYI only) Eventually we may have to pass this inf
+
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'),
M-A Ruel 2016/06/17 17:38:32 Oh, this is problematic, now all the bots have a s
nodir 2016/06/17 18:58:57 I should not have done that
'--root-dir', os.path.join(work_dir, 'isolated'),
])
if min_free_space:
@@ -143,6 +155,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()
}
@@ -517,11 +531,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:

Powered by Google App Engine
This is Rietveld 408576698