diff options
-rw-r--r-- | src/other_tools/just_mr/setup.cpp | 1 | ||||
-rw-r--r-- | src/other_tools/ops_maps/TARGETS | 1 | ||||
-rw-r--r-- | src/other_tools/ops_maps/git_tree_fetch_map.cpp | 12 | ||||
-rw-r--r-- | src/other_tools/ops_maps/git_tree_fetch_map.hpp | 1 |
4 files changed, 15 insertions, 0 deletions
diff --git a/src/other_tools/just_mr/setup.cpp b/src/other_tools/just_mr/setup.cpp index b82993ab..4f4b6b11 100644 --- a/src/other_tools/just_mr/setup.cpp +++ b/src/other_tools/just_mr/setup.cpp @@ -122,6 +122,7 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config, &import_to_git_map, common_args.git_path->string(), *common_args.local_launcher, + serve_api_exists, local_api ? &(*local_api) : nullptr, remote_api ? &(*remote_api) : nullptr, common_args.jobs); diff --git a/src/other_tools/ops_maps/TARGETS b/src/other_tools/ops_maps/TARGETS index f77ac3e9..8a6a905e 100644 --- a/src/other_tools/ops_maps/TARGETS +++ b/src/other_tools/ops_maps/TARGETS @@ -108,6 +108,7 @@ [ ["src/other_tools/ops_maps", "critical_git_op_map"] , ["src/buildtool/execution_api/common", "common"] , ["src/buildtool/file_system", "file_system_manager"] + , ["src/buildtool/serve_api/remote", "serve_api"] , ["src/buildtool/storage", "config"] , ["src/buildtool/storage", "fs_utils"] , ["src/buildtool/system", "system_command"] diff --git a/src/other_tools/ops_maps/git_tree_fetch_map.cpp b/src/other_tools/ops_maps/git_tree_fetch_map.cpp index e928fb2f..bd3e32bd 100644 --- a/src/other_tools/ops_maps/git_tree_fetch_map.cpp +++ b/src/other_tools/ops_maps/git_tree_fetch_map.cpp @@ -19,6 +19,7 @@ #include "fmt/core.h" #include "src/buildtool/execution_api/common/execution_common.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" +#include "src/buildtool/serve_api/remote/serve_api.hpp" #include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/fs_utils.hpp" #include "src/buildtool/system/system_command.hpp" @@ -31,6 +32,7 @@ auto CreateGitTreeFetchMap( gsl::not_null<ImportToGitMap*> const& import_to_git_map, std::string const& git_bin, std::vector<std::string> const& launcher, + bool serve_api_exists, IExecutionApi* local_api, IExecutionApi* remote_api, std::size_t jobs) -> GitTreeFetchMap { @@ -38,6 +40,7 @@ auto CreateGitTreeFetchMap( import_to_git_map, git_bin, launcher, + serve_api_exists, local_api, remote_api](auto ts, auto setter, @@ -62,6 +65,7 @@ auto CreateGitTreeFetchMap( import_to_git_map, git_bin, launcher, + serve_api_exists, local_api, remote_api, key, @@ -104,6 +108,14 @@ auto CreateGitTreeFetchMap( return; } JustMRProgress::Instance().TaskTracker().Start(key.origin); + // check if content is known to remote serve service + if (serve_api_exists) { + // as we anyway interrogate the remote execution endpoint, + // we're only interested here in the serve endpoint making + // an attempt to upload the tree, if known, to remote CAS + [[maybe_unused]] auto _ = + ServeApi::TreeInRemoteCAS(key.hash); + } // check if tree is in remote CAS, if a remote is given auto digest = ArtifactDigest{key.hash, 0, /*is_tree=*/true}; if (remote_api != nullptr and local_api != nullptr and diff --git a/src/other_tools/ops_maps/git_tree_fetch_map.hpp b/src/other_tools/ops_maps/git_tree_fetch_map.hpp index f84056a8..b32b074f 100644 --- a/src/other_tools/ops_maps/git_tree_fetch_map.hpp +++ b/src/other_tools/ops_maps/git_tree_fetch_map.hpp @@ -57,6 +57,7 @@ using GitTreeFetchMap = AsyncMapConsumer<GitTreeInfo, bool>; gsl::not_null<ImportToGitMap*> const& import_to_git_map, std::string const& git_bin, std::vector<std::string> const& launcher, + bool serve_api_exists, IExecutionApi* local_api, IExecutionApi* remote_api, std::size_t jobs) -> GitTreeFetchMap; |