summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/buildtool/execution_api/common/TARGETS4
-rw-r--r--src/buildtool/execution_api/common/api_bundle.cpp6
-rw-r--r--src/buildtool/execution_api/common/api_bundle.hpp5
-rw-r--r--src/buildtool/main/main.cpp4
-rw-r--r--src/buildtool/serve_api/serve_service/TARGETS1
-rw-r--r--src/buildtool/serve_api/serve_service/target.cpp2
-rw-r--r--src/other_tools/just_mr/TARGETS2
-rw-r--r--src/other_tools/just_mr/fetch.cpp2
-rw-r--r--src/other_tools/just_mr/setup.cpp2
-rw-r--r--test/buildtool/build_engine/target_map/TARGETS1
-rw-r--r--test/buildtool/build_engine/target_map/target_map.test.cpp9
-rw-r--r--test/buildtool/graph_traverser/TARGETS1
-rw-r--r--test/buildtool/graph_traverser/graph_traverser.test.hpp11
13 files changed, 45 insertions, 5 deletions
diff --git a/src/buildtool/execution_api/common/TARGETS b/src/buildtool/execution_api/common/TARGETS
index 01c152c8..a7cfd64c 100644
--- a/src/buildtool/execution_api/common/TARGETS
+++ b/src/buildtool/execution_api/common/TARGETS
@@ -45,14 +45,14 @@
, ["src/buildtool/auth", "auth"]
, ["src/buildtool/common", "config"]
, ["src/buildtool/common/remote", "remote_common"]
+ , ["src/buildtool/common/remote", "retry_config"]
, ["src/buildtool/execution_api/local", "config"]
, ["src/buildtool/execution_api/remote", "config"]
, ["src/buildtool/storage", "config"]
, ["src/buildtool/storage", "storage"]
]
, "private-deps":
- [ ["src/buildtool/common/remote", "retry_config"]
- , ["src/buildtool/execution_api/bazel_msg", "bazel_msg"]
+ [ ["src/buildtool/execution_api/bazel_msg", "bazel_msg"]
, ["src/buildtool/execution_api/local", "local"]
, ["src/buildtool/execution_api/remote", "bazel"]
]
diff --git a/src/buildtool/execution_api/common/api_bundle.cpp b/src/buildtool/execution_api/common/api_bundle.cpp
index ba4a434c..38255f9a 100644
--- a/src/buildtool/execution_api/common/api_bundle.cpp
+++ b/src/buildtool/execution_api/common/api_bundle.cpp
@@ -25,13 +25,15 @@ ApiBundle::ApiBundle(
gsl::not_null<LocalExecutionConfig const*> const& local_exec_config,
RepositoryConfig const* repo_config,
gsl::not_null<Auth const*> const& authentication,
+ gsl::not_null<RetryConfig const*> const& retry_config,
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_config{*remote_exec_config}, // needed by remote
+ retry_config{*retry_config}, // needed by remote
+ remote_config{*remote_exec_config},
remote{CreateRemote(remote_exec_config->remote_address)} {}
auto ApiBundle::CreateRemote(std::optional<ServerAddress> const& address) const
@@ -43,7 +45,7 @@ auto ApiBundle::CreateRemote(std::optional<ServerAddress> const& address) const
address->host,
address->port,
&auth,
- &RetryConfig::Instance(),
+ &retry_config,
config);
}
return local;
diff --git a/src/buildtool/execution_api/common/api_bundle.hpp b/src/buildtool/execution_api/common/api_bundle.hpp
index 017154c1..5414423e 100644
--- a/src/buildtool/execution_api/common/api_bundle.hpp
+++ b/src/buildtool/execution_api/common/api_bundle.hpp
@@ -21,6 +21,7 @@
#include "gsl/gsl"
#include "src/buildtool/auth/authentication.hpp"
#include "src/buildtool/common/remote/remote_common.hpp"
+#include "src/buildtool/common/remote/retry_config.hpp"
#include "src/buildtool/common/repository_config.hpp"
#include "src/buildtool/execution_api/common/execution_api.hpp"
#include "src/buildtool/execution_api/local/config.hpp"
@@ -38,6 +39,7 @@ struct ApiBundle final {
gsl::not_null<LocalExecutionConfig const*> const& local_exec_config,
RepositoryConfig const* repo_config,
gsl::not_null<Auth const*> const& authentication,
+ gsl::not_null<RetryConfig const*> const& retry_config,
gsl::not_null<RemoteExecutionConfig const*> const& remote_exec_config);
[[nodiscard]] auto CreateRemote(std::optional<ServerAddress> const& address)
@@ -45,7 +47,8 @@ struct ApiBundle final {
gsl::not_null<IExecutionApi::Ptr> const local; // needed by remote
Auth const& auth; // needed by remote
- RemoteExecutionConfig const& remote_config; // needed by remote
+ RetryConfig const& retry_config; // needed by remote
+ RemoteExecutionConfig const& remote_config;
gsl::not_null<IExecutionApi::Ptr> const remote;
};
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp
index 1d6dafeb..3960d6e6 100644
--- a/src/buildtool/main/main.cpp
+++ b/src/buildtool/main/main.cpp
@@ -70,6 +70,7 @@
#ifndef BOOTSTRAP_BUILD_TOOL
#include "fmt/core.h"
#include "src/buildtool/auth/authentication.hpp"
+#include "src/buildtool/common/remote/retry_config.hpp"
#include "src/buildtool/execution_api/common/api_bundle.hpp"
#include "src/buildtool/execution_api/execution_service/server_implementation.hpp"
#include "src/buildtool/execution_api/remote/config.hpp"
@@ -839,6 +840,7 @@ auto main(int argc, char* argv[]) -> int {
&*local_exec_config,
/*repo_config=*/nullptr,
&*auth_config,
+ &RetryConfig::Instance(),
&remote_exec_config};
if (not ServerImpl::Instance().Run(*storage_config,
storage,
@@ -893,6 +895,7 @@ auto main(int argc, char* argv[]) -> int {
&*local_exec_config,
/*repo_config=*/nullptr,
&*auth_config,
+ &RetryConfig::Instance(),
&*remote_exec_config};
auto serve =
ServeApi::Create(*serve_config, &storage, &serve_apis);
@@ -984,6 +987,7 @@ auto main(int argc, char* argv[]) -> int {
&*local_exec_config,
&repo_config,
&*auth_config,
+ &RetryConfig::Instance(),
&*remote_exec_config};
GraphTraverser const traverser{
{jobs,
diff --git a/src/buildtool/serve_api/serve_service/TARGETS b/src/buildtool/serve_api/serve_service/TARGETS
index 69cdb5ae..936ccc43 100644
--- a/src/buildtool/serve_api/serve_service/TARGETS
+++ b/src/buildtool/serve_api/serve_service/TARGETS
@@ -105,6 +105,7 @@
, ["src/buildtool/build_engine/target_map", "configured_target"]
, ["src/buildtool/build_engine/target_map", "result_map"]
, ["src/buildtool/common/remote", "remote_common"]
+ , ["src/buildtool/common/remote", "retry_config"]
, ["src/buildtool/execution_api/remote", "config"]
, ["src/buildtool/file_system", "file_system_manager"]
, ["src/buildtool/graph_traverser", "graph_traverser"]
diff --git a/src/buildtool/serve_api/serve_service/target.cpp b/src/buildtool/serve_api/serve_service/target.cpp
index dd430ace..45c78946 100644
--- a/src/buildtool/serve_api/serve_service/target.cpp
+++ b/src/buildtool/serve_api/serve_service/target.cpp
@@ -25,6 +25,7 @@
#include "src/buildtool/build_engine/target_map/configured_target.hpp"
#include "src/buildtool/build_engine/target_map/result_map.hpp"
#include "src/buildtool/common/artifact.hpp"
+#include "src/buildtool/common/remote/retry_config.hpp"
#include "src/buildtool/common/repository_config.hpp"
#include "src/buildtool/common/statistics.hpp"
#include "src/buildtool/execution_api/remote/config.hpp"
@@ -480,6 +481,7 @@ auto TargetService::ServeTarget(
&local_exec_config_,
&repository_config,
&apis_.auth,
+ &apis_.retry_config,
&apis_.remote_config};
GraphTraverser const traverser{
std::move(traverser_args),
diff --git a/src/other_tools/just_mr/TARGETS b/src/other_tools/just_mr/TARGETS
index 3b4a3df6..62cef00f 100644
--- a/src/other_tools/just_mr/TARGETS
+++ b/src/other_tools/just_mr/TARGETS
@@ -117,6 +117,7 @@
[ ["@", "fmt", "", "fmt"]
, ["@", "json", "", "json"]
, ["src/buildtool/auth", "auth"]
+ , ["src/buildtool/common/remote", "retry_config"]
, ["src/buildtool/logging", "logging"]
, ["src/buildtool/multithreading", "task_system"]
, "exit_codes"
@@ -177,6 +178,7 @@
, "private-deps":
[ ["@", "json", "", "json"]
, ["src/buildtool/auth", "auth"]
+ , ["src/buildtool/common/remote", "retry_config"]
, ["src/buildtool/logging", "logging"]
, ["src/buildtool/multithreading", "task_system"]
, ["src/buildtool/storage", "fs_utils"]
diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp
index 8798c371..9774f0d6 100644
--- a/src/other_tools/just_mr/fetch.cpp
+++ b/src/other_tools/just_mr/fetch.cpp
@@ -21,6 +21,7 @@
#include "fmt/core.h"
#include "nlohmann/json.hpp"
#include "src/buildtool/auth/authentication.hpp"
+#include "src/buildtool/common/remote/retry_config.hpp"
#include "src/buildtool/execution_api/common/api_bundle.hpp"
#include "src/buildtool/execution_api/common/execution_api.hpp"
#include "src/buildtool/execution_api/local/config.hpp"
@@ -423,6 +424,7 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config,
&*local_exec_config,
/*repo_config=*/nullptr,
&*auth_config,
+ &RetryConfig::Instance(),
&*remote_exec_config};
bool const has_remote_api =
diff --git a/src/other_tools/just_mr/setup.cpp b/src/other_tools/just_mr/setup.cpp
index 228c0ee0..40bdf3ad 100644
--- a/src/other_tools/just_mr/setup.cpp
+++ b/src/other_tools/just_mr/setup.cpp
@@ -23,6 +23,7 @@
#include "nlohmann/json.hpp"
#include "src/buildtool/auth/authentication.hpp"
+#include "src/buildtool/common/remote/retry_config.hpp"
#include "src/buildtool/execution_api/common/api_bundle.hpp"
#include "src/buildtool/execution_api/common/execution_api.hpp"
#include "src/buildtool/execution_api/local/config.hpp"
@@ -141,6 +142,7 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
&*local_exec_config,
/*repo_config=*/nullptr,
&*auth_config,
+ &RetryConfig::Instance(),
&*remote_exec_config};
bool const has_remote_api =
diff --git a/test/buildtool/build_engine/target_map/TARGETS b/test/buildtool/build_engine/target_map/TARGETS
index 953f9ea6..3bbc42c3 100644
--- a/test/buildtool/build_engine/target_map/TARGETS
+++ b/test/buildtool/build_engine/target_map/TARGETS
@@ -31,6 +31,7 @@
, ["@", "src", "src/buildtool/build_engine/base_maps", "targets_file_map"]
, ["@", "src", "src/buildtool/build_engine/target_map", "target_map"]
, ["@", "src", "src/buildtool/common", "common"]
+ , ["@", "src", "src/buildtool/common/remote", "retry_config"]
, ["@", "src", "src/buildtool/execution_api/local", "config"]
, ["@", "src", "src/buildtool/execution_api/remote", "config"]
, ["@", "src", "src/buildtool/file_system", "file_root"]
diff --git a/test/buildtool/build_engine/target_map/target_map.test.cpp b/test/buildtool/build_engine/target_map/target_map.test.cpp
index 4d7cef75..48424bc5 100644
--- a/test/buildtool/build_engine/target_map/target_map.test.cpp
+++ b/test/buildtool/build_engine/target_map/target_map.test.cpp
@@ -26,6 +26,7 @@
#include "src/buildtool/build_engine/base_maps/targets_file_map.hpp"
#include "src/buildtool/build_engine/expression/expression.hpp"
#include "src/buildtool/build_engine/target_map/target_map.hpp"
+#include "src/buildtool/common/remote/retry_config.hpp"
#include "src/buildtool/common/repository_config.hpp"
#include "src/buildtool/common/statistics.hpp"
#include "src/buildtool/execution_api/common/api_bundle.hpp"
@@ -114,6 +115,7 @@ TEST_CASE("simple targets", "[target_map]") {
&local_exec_config,
/*repo_config=*/nullptr,
&auth,
+ &RetryConfig::Instance(),
&remote_exec_config};
auto serve = ServeApi::Create(*serve_config, &storage, &apis);
AnalyseContext ctx{.repo_config = &repo_config,
@@ -566,6 +568,7 @@ TEST_CASE("configuration deduplication", "[target_map]") {
&local_exec_config,
/*repo_config=*/nullptr,
&auth,
+ &RetryConfig::Instance(),
&remote_exec_config};
auto serve = ServeApi::Create(*serve_config, &storage, &apis);
AnalyseContext ctx{.repo_config = &repo_config,
@@ -663,6 +666,7 @@ TEST_CASE("generator functions in string arguments", "[target_map]") {
&local_exec_config,
/*repo_config=*/nullptr,
&auth,
+ &RetryConfig::Instance(),
&remote_exec_config};
auto serve = ServeApi::Create(*serve_config, &storage, &apis);
AnalyseContext ctx{.repo_config = &repo_config,
@@ -772,6 +776,7 @@ TEST_CASE("built-in rules", "[target_map]") {
&local_exec_config,
/*repo_config=*/nullptr,
&auth,
+ &RetryConfig::Instance(),
&remote_exec_config};
auto serve = ServeApi::Create(*serve_config, &storage, &apis);
AnalyseContext ctx{.repo_config = &repo_config,
@@ -991,6 +996,7 @@ TEST_CASE("target reference", "[target_map]") {
&local_exec_config,
/*repo_config=*/nullptr,
&auth,
+ &RetryConfig::Instance(),
&remote_exec_config};
auto serve = ServeApi::Create(*serve_config, &storage, &apis);
AnalyseContext ctx{.repo_config = &repo_config,
@@ -1143,6 +1149,7 @@ TEST_CASE("trees", "[target_map]") {
&local_exec_config,
/*repo_config=*/nullptr,
&auth,
+ &RetryConfig::Instance(),
&remote_exec_config};
auto serve = ServeApi::Create(*serve_config, &storage, &apis);
AnalyseContext ctx{.repo_config = &repo_config,
@@ -1259,6 +1266,7 @@ TEST_CASE("RESULT error reporting", "[target_map]") {
&local_exec_config,
/*repo_config=*/nullptr,
&auth,
+ &RetryConfig::Instance(),
&remote_exec_config};
auto serve = ServeApi::Create(*serve_config, &storage, &apis);
AnalyseContext ctx{.repo_config = &repo_config,
@@ -1434,6 +1442,7 @@ TEST_CASE("wrong arguments", "[target_map]") {
&local_exec_config,
/*repo_config=*/nullptr,
&auth,
+ &RetryConfig::Instance(),
&remote_exec_config};
auto serve = ServeApi::Create(*serve_config, &storage, &apis);
AnalyseContext ctx{.repo_config = &repo_config,
diff --git a/test/buildtool/graph_traverser/TARGETS b/test/buildtool/graph_traverser/TARGETS
index 23a2814f..4b1a531f 100644
--- a/test/buildtool/graph_traverser/TARGETS
+++ b/test/buildtool/graph_traverser/TARGETS
@@ -7,6 +7,7 @@
, ["@", "json", "", "json"]
, ["@", "src", "src/buildtool/auth", "auth"]
, ["@", "src", "src/buildtool/common", "common"]
+ , ["@", "src", "src/buildtool/common/remote", "retry_config"]
, ["@", "src", "src/buildtool/execution_api/local", "config"]
, ["@", "src", "src/buildtool/execution_api/remote", "config"]
, ["@", "src", "src/buildtool/file_system", "file_system_manager"]
diff --git a/test/buildtool/graph_traverser/graph_traverser.test.hpp b/test/buildtool/graph_traverser/graph_traverser.test.hpp
index b0187392..86be3110 100644
--- a/test/buildtool/graph_traverser/graph_traverser.test.hpp
+++ b/test/buildtool/graph_traverser/graph_traverser.test.hpp
@@ -29,6 +29,7 @@
#include "gsl/gsl"
#include "nlohmann/json.hpp"
#include "src/buildtool/auth/authentication.hpp"
+#include "src/buildtool/common/remote/retry_config.hpp"
#include "src/buildtool/common/statistics.hpp"
#include "src/buildtool/execution_api/common/api_bundle.hpp"
#include "src/buildtool/execution_api/local/config.hpp"
@@ -174,6 +175,7 @@ class TestProject {
&local_exec_config,
p.GetRepoConfig(),
auth,
+ &RetryConfig::Instance(),
remote_config};
GraphTraverser const gt{clargs.gtargs,
p.GetRepoConfig(),
@@ -206,6 +208,7 @@ class TestProject {
&local_exec_config,
p.GetRepoConfig(),
auth,
+ &RetryConfig::Instance(),
remote_config};
GraphTraverser const gt_get_exec{clargs_exec.gtargs,
p.GetRepoConfig(),
@@ -250,6 +253,7 @@ class TestProject {
&local_exec_config,
p.GetRepoConfig(),
auth,
+ &RetryConfig::Instance(),
remote_config};
GraphTraverser const gt{clargs.gtargs,
p.GetRepoConfig(),
@@ -289,6 +293,7 @@ class TestProject {
&local_exec_config,
p.GetRepoConfig(),
auth,
+ &RetryConfig::Instance(),
remote_config};
GraphTraverser const gt{clargs.gtargs,
p.GetRepoConfig(),
@@ -348,6 +353,7 @@ class TestProject {
&local_exec_config,
full_hello_world.GetRepoConfig(),
auth,
+ &RetryConfig::Instance(),
remote_config};
GraphTraverser const gt_upload{clargs_update_cpp.gtargs,
full_hello_world.GetRepoConfig(),
@@ -413,6 +419,7 @@ static void TestBlobsUploadedAndUsed(
&local_exec_config,
p.GetRepoConfig(),
auth,
+ &RetryConfig::Instance(),
remote_config};
GraphTraverser gt{clargs.gtargs,
p.GetRepoConfig(),
@@ -460,6 +467,7 @@ static void TestEnvironmentVariablesSetAndUsed(
&local_exec_config,
p.GetRepoConfig(),
auth,
+ &RetryConfig::Instance(),
remote_config};
GraphTraverser gt{clargs.gtargs,
p.GetRepoConfig(),
@@ -507,6 +515,7 @@ static void TestTreesUsed(
&local_exec_config,
p.GetRepoConfig(),
auth,
+ &RetryConfig::Instance(),
remote_config};
GraphTraverser gt{clargs.gtargs,
p.GetRepoConfig(),
@@ -554,6 +563,7 @@ static void TestNestedTreesUsed(
&local_exec_config,
p.GetRepoConfig(),
auth,
+ &RetryConfig::Instance(),
remote_config};
GraphTraverser gt{clargs.gtargs,
p.GetRepoConfig(),
@@ -600,6 +610,7 @@ static void TestFlakyHelloWorldDetected(
&local_exec_config,
p.GetRepoConfig(),
auth,
+ &RetryConfig::Instance(),
remote_config};
{