summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/execution_api')
-rw-r--r--src/buildtool/execution_api/execution_service/TARGETS4
-rw-r--r--src/buildtool/execution_api/execution_service/ac_server.cpp11
-rw-r--r--src/buildtool/execution_api/execution_service/ac_server.hpp18
-rw-r--r--src/buildtool/execution_api/execution_service/capabilities_server.cpp15
-rw-r--r--src/buildtool/execution_api/execution_service/capabilities_server.hpp12
-rw-r--r--src/buildtool/execution_api/execution_service/cas_server.cpp22
-rw-r--r--src/buildtool/execution_api/execution_service/cas_server.hpp41
-rw-r--r--src/buildtool/execution_api/execution_service/execution_server.cpp60
-rw-r--r--src/buildtool/execution_api/execution_service/execution_server.hpp48
9 files changed, 97 insertions, 134 deletions
diff --git a/src/buildtool/execution_api/execution_service/TARGETS b/src/buildtool/execution_api/execution_service/TARGETS
index eaaffcca..f7764987 100644
--- a/src/buildtool/execution_api/execution_service/TARGETS
+++ b/src/buildtool/execution_api/execution_service/TARGETS
@@ -8,6 +8,7 @@
, "deps":
[ ["src/buildtool/execution_api/local", "local"]
, ["src/buildtool/logging", "logging"]
+ , ["src/buildtool/common", "bazel_types"]
]
, "private-deps":
[ ["src/buildtool/compatibility", "compatibility"]
@@ -25,6 +26,7 @@
, "deps":
[ ["src/buildtool/execution_api/local", "local"]
, ["src/buildtool/logging", "logging"]
+ , ["src/buildtool/common", "bazel_types"]
]
, "private-deps":
[ ["src/buildtool/execution_api/local", "garbage_collector"]
@@ -41,6 +43,7 @@
, "deps":
[ ["src/buildtool/execution_api/local", "local"]
, ["src/buildtool/logging", "logging"]
+ , ["src/buildtool/common", "bazel_types"]
]
, "private-deps":
[ ["src/buildtool/compatibility", "compatibility"]
@@ -94,6 +97,7 @@
, "srcs": ["capabilities_server.cpp"]
, "proto": [["@", "bazel_remote_apis", "", "remote_execution_proto"]]
, "stage": ["src", "buildtool", "execution_api", "execution_service"]
+ , "deps": [["src/buildtool/common", "bazel_types"]]
, "private-deps":
[ ["src/buildtool/logging", "logging"]
, ["src/buildtool/compatibility", "compatibility"]
diff --git a/src/buildtool/execution_api/execution_service/ac_server.cpp b/src/buildtool/execution_api/execution_service/ac_server.cpp
index 40407711..16dbdf3b 100644
--- a/src/buildtool/execution_api/execution_service/ac_server.cpp
+++ b/src/buildtool/execution_api/execution_service/ac_server.cpp
@@ -20,10 +20,8 @@
auto ActionCacheServiceImpl::GetActionResult(
::grpc::ServerContext* /*context*/,
- const ::build::bazel::remote::execution::v2::GetActionResultRequest*
- request,
- ::build::bazel::remote::execution::v2::ActionResult* response)
- -> ::grpc::Status {
+ const ::bazel_re::GetActionResultRequest* request,
+ ::bazel_re::ActionResult* response) -> ::grpc::Status {
logger_.Emit(LogLevel::Trace,
"GetActionResult: {}",
NativeSupport::Unprefix(request->action_digest().hash()));
@@ -46,10 +44,9 @@ auto ActionCacheServiceImpl::GetActionResult(
auto ActionCacheServiceImpl::UpdateActionResult(
::grpc::ServerContext* /*context*/,
- const ::build::bazel::remote::execution::v2::UpdateActionResultRequest*
+ const ::bazel_re::UpdateActionResultRequest*
/*request*/,
- ::build::bazel::remote::execution::v2::ActionResult* /*response*/)
- -> ::grpc::Status {
+ ::bazel_re::ActionResult* /*response*/) -> ::grpc::Status {
auto const* str = "UpdateActionResult not implemented";
logger_.Emit(LogLevel::Error, str);
return ::grpc::Status{grpc::StatusCode::UNIMPLEMENTED, str};
diff --git a/src/buildtool/execution_api/execution_service/ac_server.hpp b/src/buildtool/execution_api/execution_service/ac_server.hpp
index 8e4b993b..bea61841 100644
--- a/src/buildtool/execution_api/execution_service/ac_server.hpp
+++ b/src/buildtool/execution_api/execution_service/ac_server.hpp
@@ -16,11 +16,11 @@
#define AC_SERVER_HPP
#include "build/bazel/remote/execution/v2/remote_execution.grpc.pb.h"
+#include "src/buildtool/common/bazel_types.hpp"
#include "src/buildtool/execution_api/local/local_ac.hpp"
#include "src/buildtool/logging/logger.hpp"
-class ActionCacheServiceImpl final
- : public build::bazel::remote::execution::v2::ActionCache::Service {
+class ActionCacheServiceImpl final : public bazel_re::ActionCache::Service {
public:
// Retrieve a cached execution result.
//
@@ -34,11 +34,9 @@ class ActionCacheServiceImpl final
// Errors:
//
// * `NOT_FOUND`: The requested `ActionResult` is not in the cache.
- auto GetActionResult(
- ::grpc::ServerContext* context,
- const ::build::bazel::remote::execution::v2::GetActionResultRequest*
- request,
- ::build::bazel::remote::execution::v2::ActionResult* response)
+ auto GetActionResult(::grpc::ServerContext* context,
+ const ::bazel_re::GetActionResultRequest* request,
+ ::bazel_re::ActionResult* response)
-> ::grpc::Status override;
// Upload a new execution result.
//
@@ -58,10 +56,8 @@ class ActionCacheServiceImpl final
// entry to the cache.
auto UpdateActionResult(
::grpc::ServerContext* context,
- const ::build::bazel::remote::execution::v2::UpdateActionResultRequest*
- request,
- ::build::bazel::remote::execution::v2::ActionResult* response)
- -> ::grpc::Status override;
+ const ::bazel_re::UpdateActionResultRequest* request,
+ ::bazel_re::ActionResult* response) -> ::grpc::Status override;
private:
LocalCAS<ObjectType::File> cas_{};
diff --git a/src/buildtool/execution_api/execution_service/capabilities_server.cpp b/src/buildtool/execution_api/execution_service/capabilities_server.cpp
index 198d1fb6..ea480301 100644
--- a/src/buildtool/execution_api/execution_service/capabilities_server.cpp
+++ b/src/buildtool/execution_api/execution_service/capabilities_server.cpp
@@ -19,21 +19,19 @@
auto CapabilitiesServiceImpl::GetCapabilities(
::grpc::ServerContext* /*context*/,
- const ::build::bazel::remote::execution::v2::GetCapabilitiesRequest*
+ const ::bazel_re::GetCapabilitiesRequest*
/*request*/,
- ::build::bazel::remote::execution::v2::ServerCapabilities* response)
- -> ::grpc::Status {
+ ::bazel_re::ServerCapabilities* response) -> ::grpc::Status {
if (!Compatibility::IsCompatible()) {
auto const* str = "GetCapabilities not implemented";
Logger::Log(LogLevel::Error, str);
return ::grpc::Status{grpc::StatusCode::UNIMPLEMENTED, str};
}
- ::build::bazel::remote::execution::v2::CacheCapabilities cache;
- ::build::bazel::remote::execution::v2::ExecutionCapabilities exec;
+ ::bazel_re::CacheCapabilities cache;
+ ::bazel_re::ExecutionCapabilities exec;
cache.add_digest_function(
- ::build::bazel::remote::execution::v2::DigestFunction_Value::
- DigestFunction_Value_SHA256);
+ ::bazel_re::DigestFunction_Value::DigestFunction_Value_SHA256);
cache.mutable_action_cache_update_capabilities()->set_update_enabled(false);
static constexpr std::size_t kMaxBatchTransferSize = 1024 * 1024;
cache.set_max_batch_total_size_bytes(kMaxBatchTransferSize);
@@ -42,8 +40,7 @@ auto CapabilitiesServiceImpl::GetCapabilities(
*(response->mutable_cache_capabilities()) = cache;
exec.set_digest_function(
- ::build::bazel::remote::execution::v2::DigestFunction_Value::
- DigestFunction_Value_SHA256);
+ ::bazel_re::DigestFunction_Value::DigestFunction_Value_SHA256);
exec.set_exec_enabled(true);
*(response->mutable_execution_capabilities()) = exec;
diff --git a/src/buildtool/execution_api/execution_service/capabilities_server.hpp b/src/buildtool/execution_api/execution_service/capabilities_server.hpp
index 62bc4852..57c49fc9 100644
--- a/src/buildtool/execution_api/execution_service/capabilities_server.hpp
+++ b/src/buildtool/execution_api/execution_service/capabilities_server.hpp
@@ -16,9 +16,9 @@
#define CAPABILITIES_SERVER_HPP
#include "build/bazel/remote/execution/v2/remote_execution.grpc.pb.h"
+#include "src/buildtool/common/bazel_types.hpp"
-class CapabilitiesServiceImpl final
- : public build::bazel::remote::execution::v2::Capabilities::Service {
+class CapabilitiesServiceImpl final : public bazel_re::Capabilities::Service {
public:
// GetCapabilities returns the server capabilities configuration of the
// remote endpoint.
@@ -28,11 +28,9 @@ class CapabilitiesServiceImpl final
// CacheCapabilities and ExecutionCapabilities.
// * Execution only endpoints should return ExecutionCapabilities.
// * CAS + Action Cache only endpoints should return CacheCapabilities.
- auto GetCapabilities(
- ::grpc::ServerContext* context,
- const ::build::bazel::remote::execution::v2::GetCapabilitiesRequest*
- request,
- ::build::bazel::remote::execution::v2::ServerCapabilities* response)
+ auto GetCapabilities(::grpc::ServerContext* context,
+ const ::bazel_re::GetCapabilitiesRequest* request,
+ ::bazel_re::ServerCapabilities* response)
-> ::grpc::Status override;
};
#endif
diff --git a/src/buildtool/execution_api/execution_service/cas_server.cpp b/src/buildtool/execution_api/execution_service/cas_server.cpp
index 3afde937..53ba5e9d 100644
--- a/src/buildtool/execution_api/execution_service/cas_server.cpp
+++ b/src/buildtool/execution_api/execution_service/cas_server.cpp
@@ -20,10 +20,8 @@
auto CASServiceImpl::FindMissingBlobs(
::grpc::ServerContext* /*context*/,
- const ::build::bazel::remote::execution::v2::FindMissingBlobsRequest*
- request,
- ::build::bazel::remote::execution::v2::FindMissingBlobsResponse* response)
- -> ::grpc::Status {
+ const ::bazel_re::FindMissingBlobsRequest* request,
+ ::bazel_re::FindMissingBlobsResponse* response) -> ::grpc::Status {
auto lock = GarbageCollector::SharedLock();
if (!lock) {
auto str = fmt::format("Could not acquire SharedLock");
@@ -51,10 +49,8 @@ auto CASServiceImpl::FindMissingBlobs(
auto CASServiceImpl::BatchUpdateBlobs(
::grpc::ServerContext* /*context*/,
- const ::build::bazel::remote::execution::v2::BatchUpdateBlobsRequest*
- request,
- ::build::bazel::remote::execution::v2::BatchUpdateBlobsResponse* response)
- -> ::grpc::Status {
+ const ::bazel_re::BatchUpdateBlobsRequest* request,
+ ::bazel_re::BatchUpdateBlobsResponse* response) -> ::grpc::Status {
auto lock = GarbageCollector::SharedLock();
if (!lock) {
auto str = fmt::format("Could not acquire SharedLock");
@@ -90,9 +86,8 @@ auto CASServiceImpl::BatchUpdateBlobs(
auto CASServiceImpl::BatchReadBlobs(
::grpc::ServerContext* /*context*/,
- const ::build::bazel::remote::execution::v2::BatchReadBlobsRequest* request,
- ::build::bazel::remote::execution::v2::BatchReadBlobsResponse* response)
- -> ::grpc::Status {
+ const ::bazel_re::BatchReadBlobsRequest* request,
+ ::bazel_re::BatchReadBlobsResponse* response) -> ::grpc::Status {
auto lock = GarbageCollector::SharedLock();
if (!lock) {
auto str = fmt::format("Could not acquire SharedLock");
@@ -128,9 +123,8 @@ auto CASServiceImpl::BatchReadBlobs(
auto CASServiceImpl::GetTree(
::grpc::ServerContext* /*context*/,
- const ::build::bazel::remote::execution::v2::GetTreeRequest* /*request*/,
- ::grpc::ServerWriter<
- ::build::bazel::remote::execution::v2::GetTreeResponse>* /*writer*/)
+ const ::bazel_re::GetTreeRequest* /*request*/,
+ ::grpc::ServerWriter< ::bazel_re::GetTreeResponse>* /*writer*/)
-> ::grpc::Status {
auto const* str = "GetTree not implemented";
logger_.Emit(LogLevel::Error, str);
diff --git a/src/buildtool/execution_api/execution_service/cas_server.hpp b/src/buildtool/execution_api/execution_service/cas_server.hpp
index 29045a0c..e0ef0267 100644
--- a/src/buildtool/execution_api/execution_service/cas_server.hpp
+++ b/src/buildtool/execution_api/execution_service/cas_server.hpp
@@ -15,11 +15,12 @@
#ifndef CAS_SERVER_HPP
#define CAS_SERVER_HPP
#include "build/bazel/remote/execution/v2/remote_execution.grpc.pb.h"
+#include "src/buildtool/common/bazel_types.hpp"
#include "src/buildtool/execution_api/local/local_storage.hpp"
#include "src/buildtool/logging/logger.hpp"
-class CASServiceImpl final : public build::bazel::remote::execution::v2::
- ContentAddressableStorage::Service {
+class CASServiceImpl final
+ : public bazel_re::ContentAddressableStorage::Service {
public:
// Determine if blobs are present in the CAS.
//
@@ -27,12 +28,10 @@ class CASServiceImpl final : public build::bazel::remote::execution::v2::
// are already present in the CAS and do not need to be uploaded again.
//
// There are no method-specific errors.
- auto FindMissingBlobs(
- ::grpc::ServerContext* context,
- const ::build::bazel::remote::execution::v2::FindMissingBlobsRequest*
- request,
- ::build::bazel::remote::execution::v2::FindMissingBlobsResponse*
- response) -> ::grpc::Status override;
+ auto FindMissingBlobs(::grpc::ServerContext* context,
+ const ::bazel_re::FindMissingBlobsRequest* request,
+ ::bazel_re::FindMissingBlobsResponse* response)
+ -> ::grpc::Status override;
// Upload many blobs at once.
//
// The server may enforce a limit of the combined total size of blobs
@@ -58,12 +57,10 @@ class CASServiceImpl final : public build::bazel::remote::execution::v2::
// * `INVALID_ARGUMENT`: The
// [Digest][build.bazel.remote.execution.v2.Digest] does not match the
// provided data.
- auto BatchUpdateBlobs(
- ::grpc::ServerContext* context,
- const ::build::bazel::remote::execution::v2::BatchUpdateBlobsRequest*
- request,
- ::build::bazel::remote::execution::v2::BatchUpdateBlobsResponse*
- response) -> ::grpc::Status override;
+ auto BatchUpdateBlobs(::grpc::ServerContext* context,
+ const ::bazel_re::BatchUpdateBlobsRequest* request,
+ ::bazel_re::BatchUpdateBlobsResponse* response)
+ -> ::grpc::Status override;
// Download many blobs at once.
//
// The server may enforce a limit of the combined total size of blobs
@@ -84,11 +81,9 @@ class CASServiceImpl final : public build::bazel::remote::execution::v2::
//
// Every error on individual read will be returned in the corresponding
// digest status.
- auto BatchReadBlobs(
- ::grpc::ServerContext* context,
- const ::build::bazel::remote::execution::v2::BatchReadBlobsRequest*
- request,
- ::build::bazel::remote::execution::v2::BatchReadBlobsResponse* response)
+ auto BatchReadBlobs(::grpc::ServerContext* context,
+ const ::bazel_re::BatchReadBlobsRequest* request,
+ ::bazel_re::BatchReadBlobsResponse* response)
-> ::grpc::Status override;
// Fetch the entire directory tree rooted at a node.
//
@@ -114,11 +109,9 @@ class CASServiceImpl final : public build::bazel::remote::execution::v2::
// Errors:
//
// * `NOT_FOUND`: The requested tree root is not present in the CAS.
- auto GetTree(
- ::grpc::ServerContext* context,
- const ::build::bazel::remote::execution::v2::GetTreeRequest* request,
- ::grpc::ServerWriter<
- ::build::bazel::remote::execution::v2::GetTreeResponse>* writer)
+ auto GetTree(::grpc::ServerContext* context,
+ const ::bazel_re::GetTreeRequest* request,
+ ::grpc::ServerWriter< ::bazel_re::GetTreeResponse>* writer)
-> ::grpc::Status override;
private:
diff --git a/src/buildtool/execution_api/execution_service/execution_server.cpp b/src/buildtool/execution_api/execution_service/execution_server.cpp
index 6d4f791d..d203e733 100644
--- a/src/buildtool/execution_api/execution_service/execution_server.cpp
+++ b/src/buildtool/execution_api/execution_service/execution_server.cpp
@@ -24,11 +24,9 @@
#include "src/buildtool/compatibility/native_support.hpp"
#include "src/buildtool/execution_api/local/garbage_collector.hpp"
-auto ExecutionServiceImpl::GetAction(
- ::build::bazel::remote::execution::v2::ExecuteRequest const* request)
- const noexcept
- -> std::pair<std::optional<::build::bazel::remote::execution::v2::Action>,
- std::optional<std::string>> {
+auto ExecutionServiceImpl::GetAction(::bazel_re::ExecuteRequest const* request)
+ const noexcept -> std::pair<std::optional<::bazel_re::Action>,
+ std::optional<std::string>> {
// get action description
auto path = storage_.BlobPath(request->action_digest(), false);
if (!path) {
@@ -38,7 +36,7 @@ auto ExecutionServiceImpl::GetAction(
logger_.Emit(LogLevel::Error, str);
return {std::nullopt, str};
}
- ::build::bazel::remote::execution::v2::Action action{};
+ ::bazel_re::Action action{};
{
std::ifstream f(*path);
if (!action.ParseFromIstream(&f)) {
@@ -64,10 +62,9 @@ auto ExecutionServiceImpl::GetAction(
return {std::move(action), std::nullopt};
}
-auto ExecutionServiceImpl::GetCommand(
- ::build::bazel::remote::execution::v2::Action const& action) const noexcept
- -> std::pair<std::optional<::build::bazel::remote::execution::v2::Command>,
- std::optional<std::string>> {
+auto ExecutionServiceImpl::GetCommand(::bazel_re::Action const& action)
+ const noexcept -> std::pair<std::optional<::bazel_re::Command>,
+ std::optional<std::string>> {
auto path = storage_.BlobPath(action.command_digest(), false);
if (!path) {
@@ -78,7 +75,7 @@ auto ExecutionServiceImpl::GetCommand(
return {std::nullopt, str};
}
- ::build::bazel::remote::execution::v2::Command c{};
+ ::bazel_re::Command c{};
{
std::ifstream f(*path);
if (!c.ParseFromIstream(&f)) {
@@ -92,7 +89,7 @@ auto ExecutionServiceImpl::GetCommand(
return {c, std::nullopt};
}
-static auto GetEnvVars(::build::bazel::remote::execution::v2::Command const& c)
+static auto GetEnvVars(::bazel_re::Command const& c)
-> std::map<std::string, std::string> {
std::map<std::string, std::string> env_vars{};
std::transform(c.environment_variables().begin(),
@@ -105,8 +102,8 @@ static auto GetEnvVars(::build::bazel::remote::execution::v2::Command const& c)
}
auto ExecutionServiceImpl::GetIExecutionAction(
- ::build::bazel::remote::execution::v2::ExecuteRequest const* request,
- ::build::bazel::remote::execution::v2::Action const& action) const
+ ::bazel_re::ExecuteRequest const* request,
+ ::bazel_re::Action const& action) const
-> std::pair<std::optional<IExecutionAction::Ptr>,
std::optional<std::string>> {
@@ -137,26 +134,24 @@ auto ExecutionServiceImpl::GetIExecutionAction(
return {std::move(i_execution_action), std::nullopt};
}
-static void AddOutputPaths(
- ::build::bazel::remote::execution::v2::ExecuteResponse* response,
- IExecutionResponse::Ptr const& execution) noexcept {
+static void AddOutputPaths(::bazel_re::ExecuteResponse* response,
+ IExecutionResponse::Ptr const& execution) noexcept {
auto const& size = static_cast<int>(execution->Artifacts().size());
response->mutable_result()->mutable_output_files()->Reserve(size);
response->mutable_result()->mutable_output_directories()->Reserve(size);
for (auto const& [path, info] : execution->Artifacts()) {
- auto dgst = static_cast<::build::bazel::remote::execution::v2::Digest>(
- info.digest);
+ auto dgst = static_cast<::bazel_re::Digest>(info.digest);
if (info.type == ObjectType::Tree) {
- ::build::bazel::remote::execution::v2::OutputDirectory out_dir;
+ ::bazel_re::OutputDirectory out_dir;
*(out_dir.mutable_path()) = path;
*(out_dir.mutable_tree_digest()) = std::move(dgst);
response->mutable_result()->mutable_output_directories()->Add(
std::move(out_dir));
}
else {
- ::build::bazel::remote::execution::v2::OutputFile out_file;
+ ::bazel_re::OutputFile out_file;
*(out_file.mutable_path()) = path;
*(out_file.mutable_digest()) = std::move(dgst);
out_file.set_is_executable(info.type == ObjectType::Executable);
@@ -167,7 +162,7 @@ static void AddOutputPaths(
}
auto ExecutionServiceImpl::AddResult(
- ::build::bazel::remote::execution::v2::ExecuteResponse* response,
+ ::bazel_re::ExecuteResponse* response,
IExecutionResponse::Ptr const& i_execution_response,
std::string const& action_hash) const noexcept
-> std::optional<std::string> {
@@ -199,8 +194,7 @@ auto ExecutionServiceImpl::AddResult(
return std::nullopt;
}
-static void AddStatus(
- ::build::bazel::remote::execution::v2::ExecuteResponse* response) noexcept {
+static void AddStatus(::bazel_re::ExecuteResponse* response) noexcept {
::google::rpc::Status status{};
// we run the action locally, so no communication issues should happen
status.set_code(grpc::StatusCode::OK);
@@ -208,13 +202,12 @@ static void AddStatus(
}
auto ExecutionServiceImpl::GetResponse(
- ::build::bazel::remote::execution::v2::ExecuteRequest const* request,
+ ::bazel_re::ExecuteRequest const* request,
IExecutionResponse::Ptr const& i_execution_response) const noexcept
- -> std::pair<
- std::optional<::build::bazel::remote::execution::v2::ExecuteResponse>,
- std::optional<std::string>> {
+ -> std::pair<std::optional<::bazel_re::ExecuteResponse>,
+ std::optional<std::string>> {
- ::build::bazel::remote::execution::v2::ExecuteResponse response{};
+ ::bazel_re::ExecuteResponse response{};
AddStatus(&response);
auto err =
AddResult(&response,
@@ -228,9 +221,9 @@ auto ExecutionServiceImpl::GetResponse(
}
auto ExecutionServiceImpl::WriteResponse(
- ::build::bazel::remote::execution::v2::ExecuteRequest const* request,
+ ::bazel_re::ExecuteRequest const* request,
IExecutionResponse::Ptr const& i_execution_response,
- ::build::bazel::remote::execution::v2::Action const& action,
+ ::bazel_re::Action const& action,
::grpc::ServerWriter<::google::longrunning::Operation>* writer)
const noexcept -> std::optional<std::string> {
@@ -267,7 +260,7 @@ auto ExecutionServiceImpl::WriteResponse(
auto ExecutionServiceImpl::Execute(
::grpc::ServerContext* /*context*/,
- const ::build::bazel::remote::execution::v2::ExecuteRequest* request,
+ const ::bazel_re::ExecuteRequest* request,
::grpc::ServerWriter<::google::longrunning::Operation>* writer)
-> ::grpc::Status {
@@ -302,8 +295,7 @@ auto ExecutionServiceImpl::Execute(
auto ExecutionServiceImpl::WaitExecution(
::grpc::ServerContext* /*context*/,
- const ::build::bazel::remote::execution::v2::
- WaitExecutionRequest* /*request*/,
+ const ::bazel_re::WaitExecutionRequest* /*request*/,
::grpc::ServerWriter<::google::longrunning::Operation>* /*writer*/)
-> ::grpc::Status {
auto const* str = "WaitExecution not implemented";
diff --git a/src/buildtool/execution_api/execution_service/execution_server.hpp b/src/buildtool/execution_api/execution_service/execution_server.hpp
index 365858bd..e151ffc2 100644
--- a/src/buildtool/execution_api/execution_service/execution_server.hpp
+++ b/src/buildtool/execution_api/execution_service/execution_server.hpp
@@ -16,12 +16,12 @@
#define EXECUTION_SERVER_HPP
#include "build/bazel/remote/execution/v2/remote_execution.grpc.pb.h"
+#include "src/buildtool/common/bazel_types.hpp"
#include "src/buildtool/execution_api/local/local_api.hpp"
#include "src/buildtool/execution_api/local/local_storage.hpp"
#include "src/buildtool/logging/logger.hpp"
-class ExecutionServiceImpl final
- : public build::bazel::remote::execution::v2::Execution::Service {
+class ExecutionServiceImpl final : public bazel_re::Execution::Service {
public:
ExecutionServiceImpl() = default;
// Execute an action remotely.
@@ -88,10 +88,9 @@ class ExecutionServiceImpl final
// where, for each requested blob not present in the CAS, there is a
// `Violation` with a `type` of `MISSING` and a `subject` of
// `"blobs/{hash}/{size}"` indicating the digest of the missing blob.
- auto Execute(
- ::grpc::ServerContext* context,
- const ::build::bazel::remote::execution::v2::ExecuteRequest* request,
- ::grpc::ServerWriter<::google::longrunning::Operation>* writer)
+ auto Execute(::grpc::ServerContext* context,
+ const ::bazel_re::ExecuteRequest* request,
+ ::grpc::ServerWriter<::google::longrunning::Operation>* writer)
-> ::grpc::Status override;
// Wait for an execution operation to complete. When the client initially
@@ -103,46 +102,39 @@ class ExecutionServiceImpl final
// execution.
auto WaitExecution(
::grpc::ServerContext* context,
- const ::build::bazel::remote::execution::v2::WaitExecutionRequest*
- request,
+ const ::bazel_re::WaitExecutionRequest* request,
::grpc::ServerWriter<::google::longrunning::Operation>* writer)
-> ::grpc::Status override;
private:
- [[nodiscard]] auto GetAction(
- ::build::bazel::remote::execution::v2::ExecuteRequest const* request)
- const noexcept -> std::pair<
- std::optional<::build::bazel::remote::execution::v2::Action>,
- std::optional<std::string>>;
- [[nodiscard]] auto GetCommand(
- ::build::bazel::remote::execution::v2::Action const& action)
- const noexcept -> std::pair<
- std::optional<::build::bazel::remote::execution::v2::Command>,
- std::optional<std::string>>;
+ [[nodiscard]] auto GetAction(::bazel_re::ExecuteRequest const* request)
+ const noexcept -> std::pair<std::optional<::bazel_re::Action>,
+ std::optional<std::string>>;
+ [[nodiscard]] auto GetCommand(::bazel_re::Action const& action)
+ const noexcept -> std::pair<std::optional<::bazel_re::Command>,
+ std::optional<std::string>>;
[[nodiscard]] auto GetIExecutionAction(
- ::build::bazel::remote::execution::v2::ExecuteRequest const* request,
- ::build::bazel::remote::execution::v2::Action const& action) const
+ ::bazel_re::ExecuteRequest const* request,
+ ::bazel_re::Action const& action) const
-> std::pair<std::optional<IExecutionAction::Ptr>,
std::optional<std::string>>;
[[nodiscard]] auto GetResponse(
- ::build::bazel::remote::execution::v2::ExecuteRequest const* request,
+ ::bazel_re::ExecuteRequest const* request,
IExecutionResponse::Ptr const& i_execution_response) const noexcept
- -> std::pair<
- std::optional<
- ::build::bazel::remote::execution::v2::ExecuteResponse>,
- std::optional<std::string>>;
+ -> std::pair<std::optional<::bazel_re::ExecuteResponse>,
+ std::optional<std::string>>;
[[nodiscard]] auto WriteResponse(
- ::build::bazel::remote::execution::v2::ExecuteRequest const* request,
+ ::bazel_re::ExecuteRequest const* request,
IExecutionResponse::Ptr const& i_execution_response,
- ::build::bazel::remote::execution::v2::Action const& action,
+ ::bazel_re::Action const& action,
::grpc::ServerWriter<::google::longrunning::Operation>* writer)
const noexcept -> std::optional<std::string>;
[[nodiscard]] auto AddResult(
- ::build::bazel::remote::execution::v2::ExecuteResponse* response,
+ ::bazel_re::ExecuteResponse* response,
IExecutionResponse::Ptr const& i_execution_response,
std::string const& hash) const noexcept -> std::optional<std::string>;
LocalStorage storage_{};