summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/setup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/just_mr/setup.cpp')
-rw-r--r--src/other_tools/just_mr/setup.cpp42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/other_tools/just_mr/setup.cpp b/src/other_tools/just_mr/setup.cpp
index 40607b00..88bd0ca5 100644
--- a/src/other_tools/just_mr/setup.cpp
+++ b/src/other_tools/just_mr/setup.cpp
@@ -29,6 +29,7 @@
#include "src/buildtool/execution_api/local/config.hpp"
#include "src/buildtool/execution_api/local/context.hpp"
#include "src/buildtool/execution_api/remote/config.hpp"
+#include "src/buildtool/execution_api/remote/context.hpp"
#include "src/buildtool/file_system/symlinks_map/resolve_symlinks_map.hpp"
#include "src/buildtool/logging/log_level.hpp"
#include "src/buildtool/logging/logger.hpp"
@@ -124,42 +125,45 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
"Found {} repositories to set up",
setup_repos->to_setup.size());
- // setup remote execution config
- auto remote_exec_config = JustMR::Utils::CreateRemoteExecutionConfig(
- common_args.remote_execution_address, common_args.remote_serve_address);
- if (not remote_exec_config) {
+ // setup local execution config
+ auto local_exec_config =
+ JustMR::Utils::CreateLocalExecutionConfig(common_args);
+ if (not local_exec_config) {
return std::nullopt;
}
+ // pack the local context instances to be passed to ApiBundle
+ LocalContext const local_context{.exec_config = &*local_exec_config,
+ .storage_config = &storage_config,
+ .storage = &storage};
+
// setup authentication config
auto auth_config = JustMR::Utils::CreateAuthConfig(auth_args);
if (not auth_config) {
return std::nullopt;
}
- // setup local execution config
- auto local_exec_config =
- JustMR::Utils::CreateLocalExecutionConfig(common_args);
- if (not local_exec_config) {
- return std::nullopt;
- }
-
// setup the retry config
auto retry_config = CreateRetryConfig(retry_args);
if (not retry_config) {
return std::nullopt;
}
- // pack the local context instances to be passed to ApiBundle
- LocalContext const local_context{.exec_config = &*local_exec_config,
- .storage_config = &storage_config,
- .storage = &storage};
+ // setup remote execution config
+ auto remote_exec_config = JustMR::Utils::CreateRemoteExecutionConfig(
+ common_args.remote_execution_address, common_args.remote_serve_address);
+ if (not remote_exec_config) {
+ return std::nullopt;
+ }
+
+ // pack the remote context instances to be passed to ApiBundle
+ RemoteContext const remote_context{.auth = &*auth_config,
+ .retry_config = &*retry_config,
+ .exec_config = &*remote_exec_config};
ApiBundle const apis{&local_context,
- /*repo_config=*/nullptr,
- &*auth_config,
- &*retry_config,
- &*remote_exec_config};
+ &remote_context,
+ /*repo_config=*/nullptr};
bool const has_remote_api =
apis.local != apis.remote and not common_args.compatible;