summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/execution_api/common/TARGETS1
-rw-r--r--src/buildtool/execution_api/common/api_bundle.cpp5
-rw-r--r--src/buildtool/execution_api/common/api_bundle.hpp4
-rw-r--r--src/buildtool/graph_traverser/graph_traverser.hpp2
-rw-r--r--src/buildtool/main/main.cpp17
-rw-r--r--src/buildtool/serve_api/serve_service/target.cpp2
-rw-r--r--src/other_tools/just_mr/fetch.cpp2
-rw-r--r--src/other_tools/just_mr/setup.cpp2
8 files changed, 19 insertions, 16 deletions
diff --git a/src/buildtool/execution_api/common/TARGETS b/src/buildtool/execution_api/common/TARGETS
index 8237b350..a96727ab 100644
--- a/src/buildtool/execution_api/common/TARGETS
+++ b/src/buildtool/execution_api/common/TARGETS
@@ -46,6 +46,7 @@
, ["src/buildtool/common", "config"]
, ["src/buildtool/common/remote", "remote_common"]
, ["src/buildtool/execution_api/local", "config"]
+ , ["src/buildtool/execution_api/remote", "config"]
, ["src/buildtool/storage", "config"]
, ["src/buildtool/storage", "storage"]
]
diff --git a/src/buildtool/execution_api/common/api_bundle.cpp b/src/buildtool/execution_api/common/api_bundle.cpp
index 0c763493..d9a588a3 100644
--- a/src/buildtool/execution_api/common/api_bundle.cpp
+++ b/src/buildtool/execution_api/common/api_bundle.cpp
@@ -24,13 +24,14 @@ ApiBundle::ApiBundle(
gsl::not_null<LocalExecutionConfig const*> const& local_exec_config,
RepositoryConfig const* repo_config,
gsl::not_null<Auth const*> const& authentication,
- std::optional<ServerAddress> const& remote_address)
+ gsl::not_null<RemoteExecutionConfig const*> const& remote_exec_config)
: local{std::make_shared<LocalApi>(storage_config,
storage,
local_exec_config,
repo_config)}, // needed by remote
auth{*authentication}, // needed by remote
- remote{CreateRemote(remote_address)} {}
+ remote_config{*remote_exec_config}, // needed by remote
+ remote{CreateRemote(remote_exec_config->RemoteAddress())} {}
auto ApiBundle::CreateRemote(std::optional<ServerAddress> const& address) const
-> gsl::not_null<IExecutionApi::Ptr> {
diff --git a/src/buildtool/execution_api/common/api_bundle.hpp b/src/buildtool/execution_api/common/api_bundle.hpp
index ca2e91d1..017154c1 100644
--- a/src/buildtool/execution_api/common/api_bundle.hpp
+++ b/src/buildtool/execution_api/common/api_bundle.hpp
@@ -24,6 +24,7 @@
#include "src/buildtool/common/repository_config.hpp"
#include "src/buildtool/execution_api/common/execution_api.hpp"
#include "src/buildtool/execution_api/local/config.hpp"
+#include "src/buildtool/execution_api/remote/config.hpp"
#include "src/buildtool/storage/config.hpp"
#include "src/buildtool/storage/storage.hpp"
@@ -37,13 +38,14 @@ struct ApiBundle final {
gsl::not_null<LocalExecutionConfig const*> const& local_exec_config,
RepositoryConfig const* repo_config,
gsl::not_null<Auth const*> const& authentication,
- std::optional<ServerAddress> const& remote_address);
+ gsl::not_null<RemoteExecutionConfig const*> const& remote_exec_config);
[[nodiscard]] auto CreateRemote(std::optional<ServerAddress> const& address)
const -> gsl::not_null<IExecutionApi::Ptr>;
gsl::not_null<IExecutionApi::Ptr> const local; // needed by remote
Auth const& auth; // needed by remote
+ RemoteExecutionConfig const& remote_config; // needed by remote
gsl::not_null<IExecutionApi::Ptr> const remote;
};
diff --git a/src/buildtool/graph_traverser/graph_traverser.hpp b/src/buildtool/graph_traverser/graph_traverser.hpp
index 3a4f3d96..796fd042 100644
--- a/src/buildtool/graph_traverser/graph_traverser.hpp
+++ b/src/buildtool/graph_traverser/graph_traverser.hpp
@@ -389,7 +389,7 @@ class GraphTraverser {
std::vector<ArtifactIdentifier> const& artifact_ids) const -> bool {
// setup rebuilder with api for cache endpoint
auto api_cached =
- apis_.CreateRemote(RemoteExecutionConfig::CacheAddress());
+ apis_.CreateRemote(apis_.remote_config.CacheAddress());
Rebuilder executor{repo_config_,
&*apis_.local,
&*apis_.remote,
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp
index a82a6db8..5e296482 100644
--- a/src/buildtool/main/main.cpp
+++ b/src/buildtool/main/main.cpp
@@ -874,7 +874,7 @@ auto main(int argc, char* argv[]) -> int {
&*local_exec_config,
/*repo_config=*/nullptr,
&*auth_config,
- RemoteExecutionConfig::RemoteAddress()};
+ &RemoteExecutionConfig::Instance()};
if (not ServerImpl::Instance().Run(
*storage_config, storage, exec_apis)) {
return kExitFailure;
@@ -901,13 +901,12 @@ auto main(int argc, char* argv[]) -> int {
auto const storage = Storage::Create(&*storage_config);
StoreTargetCacheShard(*storage_config, storage);
- ApiBundle const serve_apis{
- &*storage_config,
- &storage,
- &*local_exec_config,
- /*repo_config=*/nullptr,
- &*auth_config,
- RemoteExecutionConfig::RemoteAddress()};
+ ApiBundle const serve_apis{&*storage_config,
+ &storage,
+ &*local_exec_config,
+ /*repo_config=*/nullptr,
+ &*auth_config,
+ &RemoteExecutionConfig::Instance()};
auto serve =
ServeApi::Create(*serve_config, &storage, &serve_apis);
bool with_execute = not RemoteExecutionConfig::RemoteAddress();
@@ -990,7 +989,7 @@ auto main(int argc, char* argv[]) -> int {
&*local_exec_config,
&repo_config,
&*auth_config,
- RemoteExecutionConfig::RemoteAddress()};
+ &RemoteExecutionConfig::Instance()};
GraphTraverser const traverser{
{jobs,
std::move(arguments.build),
diff --git a/src/buildtool/serve_api/serve_service/target.cpp b/src/buildtool/serve_api/serve_service/target.cpp
index 1e69af63..707ed067 100644
--- a/src/buildtool/serve_api/serve_service/target.cpp
+++ b/src/buildtool/serve_api/serve_service/target.cpp
@@ -480,7 +480,7 @@ auto TargetService::ServeTarget(
&local_exec_config_,
&repository_config,
&apis_.auth,
- address};
+ &RemoteExecutionConfig::Instance()};
GraphTraverser const traverser{
std::move(traverser_args),
&repository_config,
diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp
index 44b9bdb1..e2b7f542 100644
--- a/src/other_tools/just_mr/fetch.cpp
+++ b/src/other_tools/just_mr/fetch.cpp
@@ -419,7 +419,7 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config,
&*local_exec_config,
/*repo_config=*/nullptr,
&*auth_config,
- RemoteExecutionConfig::RemoteAddress()};
+ &RemoteExecutionConfig::Instance()};
bool const has_remote_api =
apis.local != apis.remote and not common_args.compatible;
diff --git a/src/other_tools/just_mr/setup.cpp b/src/other_tools/just_mr/setup.cpp
index 6cf5eaa6..61c3c120 100644
--- a/src/other_tools/just_mr/setup.cpp
+++ b/src/other_tools/just_mr/setup.cpp
@@ -138,7 +138,7 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
&*local_exec_config,
/*repo_config=*/nullptr,
&*auth_config,
- RemoteExecutionConfig::RemoteAddress()};
+ &RemoteExecutionConfig::Instance()};
bool const has_remote_api =
apis.local != apis.remote and not common_args.compatible;