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

Unified Diff: appengine/swarming/handlers_bot.py

Issue 2689483004: swarming: Add server-side implementation for supplemental bot_config (Closed)
Patch Set: Bot side fix 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
« no previous file with comments | « no previous file | appengine/swarming/handlers_bot_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
Vadim Sh. 2017/02/10 22:08:00 I've realized there's no mechanism that triggers a
+ _, 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
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698