From ac12f56de737cbc3564868bde4b18d83ac74262f Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 23 Jun 2023 13:01:11 +0200 Subject: RemoteExecutionConfiguration: support dispatch list Extend the configuration data structure by a dispatch list of endpoints to chose based on the first match of the execution properties. --- src/buildtool/execution_api/remote/config.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/buildtool/execution_api/remote/config.hpp') diff --git a/src/buildtool/execution_api/remote/config.hpp b/src/buildtool/execution_api/remote/config.hpp index 0b028035..55c96a46 100644 --- a/src/buildtool/execution_api/remote/config.hpp +++ b/src/buildtool/execution_api/remote/config.hpp @@ -16,12 +16,14 @@ #define INCLUDED_SRC_BUILDTOOL_EXECUTION_API_REMOTE_CONFIG_HPP #include +#include #include #include #include #include #include #include +#include #include #include @@ -84,6 +86,10 @@ class RemoteExecutionConfig { ParseAddress(address)); } + // Set remote-execution dispatch property list + [[nodiscard]] static auto SetRemoteExecutionDispatch( + const std::filesystem::path& filename) noexcept -> bool; + // Set specific cache address, unsets if parsing `address` fails [[nodiscard]] static auto SetCacheAddress( std::string const& address) noexcept -> bool { @@ -114,6 +120,12 @@ class RemoteExecutionConfig { return Instance().cache_address_; } + // Instance dispatch list + [[nodiscard]] static auto DispatchList() noexcept -> std::vector< + std::pair, ServerAddress>> { + return Instance().dispatch_; + } + [[nodiscard]] static auto PlatformProperties() noexcept -> std::map { return Instance().platform_properties_; @@ -123,6 +135,10 @@ class RemoteExecutionConfig { // Server address of remote execution. std::optional remote_address_{}; + // Server dispatch data + std::vector, ServerAddress>> + dispatch_{}; + // Server address of cache endpoint for rebuild. std::optional cache_address_{}; -- cgit v1.2.3