You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ju...@apache.org on 2024/06/22 10:03:56 UTC
(buildstream) 01/02: casdprocessmanager.py: Add stubs for the Remote Execution API
This is an automated email from the ASF dual-hosted git repository.
juergbi pushed a commit to branch juerg/re-proxy
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 39c0a08831139ac51811135dad9ebcb173dd77eb
Author: Jürg Billeter <j...@bitron.ch>
AuthorDate: Sat Jun 22 11:56:31 2024 +0200
casdprocessmanager.py: Add stubs for the Remote Execution API
---
src/buildstream/_cas/casdprocessmanager.py | 37 ++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/src/buildstream/_cas/casdprocessmanager.py b/src/buildstream/_cas/casdprocessmanager.py
index 7093880c2..851ab7239 100644
--- a/src/buildstream/_cas/casdprocessmanager.py
+++ b/src/buildstream/_cas/casdprocessmanager.py
@@ -31,6 +31,7 @@ from .._protos.build.bazel.remote.asset.v1 import remote_asset_pb2_grpc
from .._protos.build.bazel.remote.execution.v2 import remote_execution_pb2_grpc
from .._protos.build.buildgrid import local_cas_pb2_grpc
from .._protos.google.bytestream import bytestream_pb2_grpc
+from .._protos.google.longrunning import operations_pb2_grpc
from .. import _site
from .. import utils
@@ -117,6 +118,9 @@ class CASDProcessManager:
self._local_cas = None
self._asset_fetch = None
self._asset_push = None
+ self._exec_service = None
+ self._operations_service = None
+ self._ac_service = None
self._shutdown_requested = False
self._lock = threading.Lock()
@@ -274,6 +278,9 @@ class CASDProcessManager:
self._shutdown_requested = True
with self._lock:
if self._casd_channel:
+ self._ac_service = None
+ self._operations_service = None
+ self._exec_service = None
self._asset_push = None
self._asset_fetch = None
self._local_cas = None
@@ -366,6 +373,9 @@ class CASDProcessManager:
self._local_cas = local_cas_pb2_grpc.LocalContentAddressableStorageStub(self._casd_channel)
self._asset_fetch = remote_asset_pb2_grpc.FetchStub(self._casd_channel)
self._asset_push = remote_asset_pb2_grpc.PushStub(self._casd_channel)
+ self._exec_service = remote_execution_pb2_grpc.ExecutionStub(self._casd_channel)
+ self._operations_service = operations_pb2_grpc.OperationsStub(self._casd_channel)
+ self._ac_service = remote_execution_pb2_grpc.ActionCacheStub(self._casd_channel)
# get_cas():
#
@@ -407,3 +417,30 @@ class CASDProcessManager:
if self._casd_channel is None:
self._establish_connection()
return self._asset_push
+
+ # get_exec_service():
+ #
+ # Return Remote Execution stub for buildbox-casd channel.
+ #
+ def get_exec_service(self):
+ if self._casd_channel is None:
+ self._establish_connection()
+ return self._exec_service
+
+ # get_operations_service():
+ #
+ # Return Operations stub for buildbox-casd channel.
+ #
+ def get_operations_service(self):
+ if self._casd_channel is None:
+ self._establish_connection()
+ return self._operations_service
+
+ # get_ac_service():
+ #
+ # Return Action Cache stub for buildbox-casd channel.
+ #
+ def get_ac_service(self):
+ if self._casd_channel is None:
+ self._establish_connection()
+ return self._ac_service