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

Unified Diff: appengine/swarming/handlers_bot.py

Issue 2689483004: swarming: Add server-side implementation for supplemental bot_config (Closed)
Patch Set: rebase Created 3 years, 10 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/handlers_bot.py
diff --git a/appengine/swarming/handlers_bot.py b/appengine/swarming/handlers_bot.py
index 06d30e62bf66d0c6195839969569d2282618ac87..bfb52da06778f05dc51966cd85f169ee3bc70ad9 100644
--- a/appengine/swarming/handlers_bot.py
+++ b/appengine/swarming/handlers_bot.py
@@ -240,6 +240,8 @@ class _ProcessResult(object):
dimensions = None
# Instance of BotGroupConfig with server-side bot config (from bots.cfg).
bot_group_cfg = None
+ # Supplemental bot_config to inject into the bot.
+ bot_config = None
# Bot quarantine message (or None if the bot is not in a quarantine).
quarantined_msg = None
@@ -437,6 +439,20 @@ class BotHandshakeHandler(_BotBaseHandler):
'dimensions': res.bot_group_cfg.dimensions,
},
}
+ if res.bot_group_cfg.bot_config_script:
+ _, script = config.config.get_self_config(
+ 'scripts/' + res.bot_group_cfg.bot_config_script,
+ store_last_good=True)
+ logging.info(
+ 'Injecting %s: %d bytes',
+ res.bot_group_cfg.bot_config_script,
+ len(script or ''))
+ if not script:
+ # Return an internal error, so that the bot retries slowly.
+ msg = 'Failed to find %s' % res.bot_group_cfg.bot_config_script
Vadim Sh. 2017/02/09 22:22:00 these will most probably happen when adding comple
M-A Ruel 2017/02/10 18:33:26 At least we'll get errors about these and the time
+ logging.error(msg)
+ self.abort(503, msg)
+ data['bot_config'] = script
self.send_response(data)
« no previous file with comments | « no previous file | appengine/swarming/handlers_bot_test.py » ('j') | appengine/swarming/server/bot_groups_config.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698