Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • willsalmon/buildstream
  • CumHoleZH/buildstream
  • tchaik/buildstream
  • DCotyPortfolio/buildstream
  • jesusoctavioas/buildstream
  • patrickmmartin/buildstream
  • franred/buildstream
  • tintou/buildstream
  • alatiera/buildstream
  • martinblanchard/buildstream
  • neverdie22042524/buildstream
  • Mattlk13/buildstream
  • PServers/buildstream
  • phamnghia610909/buildstream
  • chiaratolentino/buildstream
  • eysz7-x-x/buildstream
  • kerrick1/buildstream
  • matthew-yates/buildstream
  • twofeathers/buildstream
  • mhadjimichael/buildstream
  • pointswaves/buildstream
  • Mr.JackWilson/buildstream
  • Tw3akG33k/buildstream
  • AlexFazakas/buildstream
  • eruidfkiy/buildstream
  • clamotion2/buildstream
  • nanonyme/buildstream
  • wickyjaaa/buildstream
  • nmanchev/buildstream
  • bojorquez.ja/buildstream
  • mostynb/buildstream
  • highpit74/buildstream
  • Demo112/buildstream
  • ba2014sheer/buildstream
  • tonimadrino/buildstream
  • usuario2o/buildstream
  • Angelika123456/buildstream
  • neo355/buildstream
  • corentin-ferlay/buildstream
  • coldtom/buildstream
  • wifitvbox81/buildstream
  • 358253885/buildstream
  • seanborg/buildstream
  • SotK/buildstream
  • DouglasWinship/buildstream
  • karansthr97/buildstream
  • louib/buildstream
  • bwh-ct/buildstream
  • robjh/buildstream
  • we88c0de/buildstream
  • zhengxian5555/buildstream
51 results
Show changes
Commits on Source (2)
......@@ -26,6 +26,7 @@ from functools import partial
import grpc
from buildstream._message import Message, MessageType
from buildstream import utils
from . import Sandbox, SandboxCommandError
from .sandbox import _SandboxBatch
......@@ -40,7 +41,7 @@ from .._protos.google.longrunning import operations_pb2, operations_pb2_grpc
from .._artifactcache.cascache import CASRemote, CASRemoteSpec
class RemoteExecutionSpec(namedtuple('RemoteExecutionSpec', 'exec_service storage_service')):
class RemoteExecutionSpec(namedtuple('RemoteExecutionSpec', 'exec_service storage_service action_service')):
pass
......@@ -60,6 +61,10 @@ 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
self.storage_remote_spec = CASRemoteSpec(self.storage_url, push=True,
server_cert=config.storage_service['server-cert'],
......@@ -67,6 +72,9 @@ class SandboxRemote(Sandbox):
client_cert=config.storage_service['client-cert'])
self.operation_name = None
def info(self, msg):
self._get_context().message(Message(None, MessageType.INFO, msg))
@staticmethod
def specs_from_config_node(config_node, basedir):
......@@ -89,12 +97,17 @@ class SandboxRemote(Sandbox):
tls_keys = ['client-key', 'client-cert', 'server-cert']
_yaml.node_validate(remote_config, ['execution-service', 'storage-service', 'url'])
_yaml.node_validate(remote_config, ['execution-service', 'storage-service', 'url', 'action-service'])
remote_exec_service_config = require_node(remote_config, 'execution-service')
remote_exec_storage_config = require_node(remote_config, 'storage-service')
remote_exec_action_config = remote_config.get('action-service')
_yaml.node_validate(remote_exec_service_config, ['url'])
_yaml.node_validate(remote_exec_storage_config, ['url'] + tls_keys)
if remote_exec_action_config:
_yaml.node_validate(remote_exec_action_config, ['url'])
else:
remote_config['action-service'] = None
if 'url' in remote_config:
if 'execution-service' not in remote_config:
......@@ -115,7 +128,9 @@ class SandboxRemote(Sandbox):
"remote-execution configuration. Your config is missing '{}'."
.format(str(provenance), tls_keys, key))
spec = RemoteExecutionSpec(remote_config['execution-service'], remote_config['storage-service'])
spec = RemoteExecutionSpec(remote_config['execution-service'],
remote_config['storage-service'],
remote_config['action-service'])
return spec
def run_remote_command(self, channel, action_digest):
......@@ -277,7 +292,7 @@ class SandboxRemote(Sandbox):
"and '{}' was supplied.".format(url.scheme))
# check action cache download and download if there
action_result = self._check_action_cache(channel, action_digest)
action_result = self._check_action_cache(action_digest)
if not action_result:
casremote = CASRemote(self.storage_remote_spec)
......@@ -318,21 +333,28 @@ class SandboxRemote(Sandbox):
return 0
def _check_action_cache(self, channel, action_digest):
def _check_action_cache(self, action_digest):
# Checks the action cache to see if this artifact has already been built
#
# Should return either the action response or None if not found, raise
# Sandboxerror if other grpc error was raised
if not self.action_url:
return None
url = urlparse(self.action_url)
channel = grpc.insecure_channel('{}:{}'.format(url.hostname, url.port))
request = remote_execution_pb2.GetActionResultRequest(action_digest=action_digest)
stub = remote_execution_pb2_grpc.ActionCacheStub(channel)
try:
return stub.GetActionResult(request)
result = stub.GetActionResult(request)
except grpc.RpcError as e:
if e.code() != grpc.StatusCode.NOT_FOUND:
raise SandboxError("Failed to query action cache: {} ({})"
.format(e.code(), e.details()))
else:
return None
else:
self.info("Action result found in action cache")
return result
def _create_command(self, command, working_directory, environment):
# Creates a command proto
......
......@@ -238,6 +238,8 @@ using the `remote-execution` option:
server-cert: server.crt
client-cert: client.crt
client-key: client.key
action-service:
url: http://bar.action.com:50052
The execution-service part of remote execution does not support encrypted
connections yet, so the protocol must always be http.
......@@ -245,6 +247,10 @@ connections yet, so the protocol must always be http.
storage-service specifies a remote CAS store and the parameters are the
same as those used to specify an :ref:`artifact server <artifacts>`.
The action-service specifies where built actions are cached, allowing
buildstream to check whether an action has already been executed and download it
if so. This is similar to the artifact cache but REAPI specified.
The storage service may be the same endpoint used for artifact
caching. Remote execution cannot work without push access to the
storage endpoint, so you must specify a client certificate and key,
......