Chromium Code Reviews| 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: |