summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/fetch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/just_mr/fetch.cpp')
-rw-r--r--src/other_tools/just_mr/fetch.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp
index 078586b2..49cca32e 100644
--- a/src/other_tools/just_mr/fetch.cpp
+++ b/src/other_tools/just_mr/fetch.cpp
@@ -17,6 +17,8 @@
#include <filesystem>
#include "nlohmann/json.hpp"
+#include "src/buildtool/execution_api/common/execution_api.hpp"
+#include "src/buildtool/execution_api/local/local_api.hpp"
#include "src/buildtool/logging/log_level.hpp"
#include "src/buildtool/logging/logger.hpp"
#include "src/buildtool/multithreading/task_system.hpp"
@@ -24,14 +26,14 @@
#include "src/other_tools/just_mr/progress_reporting/progress.hpp"
#include "src/other_tools/just_mr/progress_reporting/progress_reporter.hpp"
#include "src/other_tools/just_mr/setup_utils.hpp"
-#include "src/other_tools/just_mr/utils.hpp"
#include "src/other_tools/ops_maps/content_cas_map.hpp"
#include "src/other_tools/ops_maps/repo_fetch_map.hpp"
auto MultiRepoFetch(std::shared_ptr<Configuration> const& config,
MultiRepoCommonArguments const& common_args,
MultiRepoSetupArguments const& setup_args,
- MultiRepoFetchArguments const& fetch_args) -> int {
+ MultiRepoFetchArguments const& fetch_args,
+ MultiRepoRemoteAuthArguments const& auth_args) -> int {
// provide report
Logger::Log(LogLevel::Info, "Performing repositories fetch");
@@ -249,9 +251,19 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config,
nr,
nr == 1 ? "archive" : "archives");
+ // setup the APIs for archive fetches
+ auto remote_api = JustMR::Utils::SetupRemoteApi(
+ common_args.remote_execution_address, auth_args);
+ IExecutionApi::Ptr local_api{remote_api ? std::make_unique<LocalApi>()
+ : nullptr};
+
// create async maps
- auto content_cas_map = CreateContentCASMap(
- common_args.just_mr_paths, common_args.ca_info, common_args.jobs);
+ auto content_cas_map =
+ CreateContentCASMap(common_args.just_mr_paths,
+ common_args.ca_info,
+ local_api ? &(*local_api) : nullptr,
+ remote_api ? &(*remote_api) : nullptr,
+ common_args.jobs);
auto repo_fetch_map =
CreateRepoFetchMap(&content_cas_map, *fetch_dir, common_args.jobs);