summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>2018-11-14 13:29:18 +0000
committerJim MacArthur <jim.macarthur@codethink.co.uk>2018-12-18 11:13:56 +0000
commitd2105909e0eb4bbad2c30d971aae258bf36e3e22 (patch)
treec95f496865b51443b03c57f92cd4457850a88485
parentb23bec551839e4d652a23a349fed96c885d7f7f5 (diff)
downloadbuildstream-d2105909e0eb4bbad2c30d971aae258bf36e3e22.tar.gz
Add remote execution instance option
This is used when sending execution requests, to specify which instance of the execution server to use. Partial fix for #627.
-rw-r--r--buildstream/sandbox/_sandboxremote.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/buildstream/sandbox/_sandboxremote.py b/buildstream/sandbox/_sandboxremote.py
index 52e450fb5..92add93c0 100644
--- a/buildstream/sandbox/_sandboxremote.py
+++ b/buildstream/sandbox/_sandboxremote.py
@@ -61,11 +61,18 @@ class SandboxRemote(Sandbox):
self.storage_url = config.storage_service['url']
self.exec_url = config.exec_service['url']
+
if config.action_service:
self.action_url = config.action_service['url']
else:
self.action_url = None
+ if 'instance' in config.exec_service:
+ self.server_instance = config.exec_service['instance']
+ else:
+ # Default server instance name is always an empty string
+ self.server_instance = ""
+
self.storage_remote_spec = CASRemoteSpec(self.storage_url, push=True,
server_cert=config.storage_service['server-cert'],
client_key=config.storage_service['client-key'],
@@ -104,7 +111,7 @@ class SandboxRemote(Sandbox):
remote_exec_storage_config = require_node(remote_config, 'storage-service')
remote_exec_action_config = remote_config.get('action-cache-service')
- _yaml.node_validate(remote_exec_service_config, ['url'])
+ _yaml.node_validate(remote_exec_service_config, ['url', 'instance'])
_yaml.node_validate(remote_exec_storage_config, ['url'] + tls_keys)
if remote_exec_action_config:
_yaml.node_validate(remote_exec_action_config, ['url'])
@@ -142,7 +149,8 @@ class SandboxRemote(Sandbox):
# Try to create a communication channel to the BuildGrid server.
stub = remote_execution_pb2_grpc.ExecutionStub(channel)
- request = remote_execution_pb2.ExecuteRequest(action_digest=action_digest,
+ request = remote_execution_pb2.ExecuteRequest(instance_name=self.server_instance,
+ action_digest=action_digest,
skip_cache_lookup=False)
def __run_remote_command(stub, execute_request=None, running_operation=None):