summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2023-11-15just-mr: Update to using the static methods of ServeApiPaul Cristian Sarbu
2023-11-15define AbsentTargetMap for handling export targets in absent repositoriesAlberto Sartori
2023-11-15just-serve: Extend client and API for services Target and ConfigurationPaul Cristian Sarbu
Co-authored-by: Alberto Sartori <alberto.sartori@huawei.com>
2023-11-15just-serve: initial server-side implementation of "Target" and ↵Alberto Sartori
"Configuration" services. The RPC ServeTarget has not implemented the orchestration of remote build yet. If the TargetCacheKey is not found in the target cache, the response contains status == grpc::StatusCode::UNIMPLEMENTED. Co-authored-by: Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com>
2023-11-15just-serve: start a just-execute instance if the user does not provide...Alberto Sartori
...a remote execution end-point for just-serve.
2023-11-15just_serve.proto: add Configuration serviceAlberto Sartori
This service allows to query the configuration of the just-serve instance. In particular, it is used to double-check that the associated remote end point is the same used by the interrogating client.
2023-11-15just_serve.proto: define service TargetAlberto Sartori
It defines two RPC: - ServeTarget: Given a target-level caching key, returns the computed value. - ServeTargetVariables: Given the target-level root tree and the name of an export target, returns the list of flexible variables from that target's description. Co-authored-by: Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com>
2023-11-15ReadConfiguredTarget: handle absent target rootsAlberto Sartori
2023-11-15just main: Extend root parsing to allow absent rootsPaul Cristian Sarbu
2023-11-15FileRoot: Add new absent root underlying type variantPaul Cristian Sarbu
Absent roots are characterised only by a Git tree hash, so a new variant of the underlying stored information was added in the form of a plain string. In order to avoid unwanted implicit conversions when instantiating via literal strings, we force callers of the constructors to explicitly differentiate between plain strings and filesystem paths. Existing tests were updated to reflect this. Co-authored-by: Alberto Sartori <alberto.sartori@huawei.com>
2023-11-15serve api config: Fix missing header guardPaul Cristian Sarbu
2023-11-15just-mr json parsing: Add missing check for items type in listsPaul Cristian Sarbu
2023-11-15TargetCache: add new member function WithShard(shard) that returns a new ↵Alberto Sartori
TargetCache... ...backed by the same CAS, but the FileStorage uses the given shard. This is particularly useful for the just-serve server implementation, since the sharding must be performed according to the client's request and not following the server configuration.
2023-11-15TargetCacheKey: make TargetCacheKey(Artifact::ObjectInfo) constructor publicAlberto Sartori
This constructor is used by TargetService::ServeTarget
2023-11-15source_tree: add missing depAlberto Sartori
2023-11-15artifact.hpp: make ToJson and FromJson consistentAlberto Sartori
The function ToJson used `file_type` key to express the type of the artifact, on the other hand, FromJson was expecting `type`. This patch makes the two functions consistent, prefering `file_type` for historical reasons.
2023-11-15git tree repository: Creating absent roots should not run the commandPaul Cristian Sarbu
Also extended absent-roots test with this scenario.
2023-11-15just-execute: verify the validity of all the hashes received over the wireAlberto Sartori
2023-11-15utils/cpp: add IsAHash functionAlberto Sartori
This function is mainly used to check that the hash of a Digest received over the wire is a real hash, to prevent a malicious attack.
2023-11-14Fix serialization of the target cache keyOliver Reiche
... which was accidentially a list of (a single) object, instead of only a single JSON object.
2023-11-14just-mr archives fetch: Add logic for local mirrors and preferred hostnamesPaul Cristian Sarbu
2023-11-14just-mr git fetch: Add logic for local mirrors and preferred hostnamesPaul Cristian Sarbu
2023-11-14curl_url_handle: Add method to replace the hostname of a URLPaul Cristian Sarbu
Also adds a section in the curl_url test suite.
2023-11-14curl_url_handle: Allow permissive parsing and URL extraction to be non-fatalPaul Cristian Sarbu
2023-11-14curl_url_handle: Improve documentationPaul Cristian Sarbu
2023-11-14just-mr: Add utility getters for alternative mirrors specificationsPaul Cristian Sarbu
2023-11-14just-mr: Parse mirrors specification from checkout locations filePaul Cristian Sarbu
2023-11-14just-mr: Add 'mirrors' field to archive-like repositoriesPaul Cristian Sarbu
Also extends 'distdir' repositories logic accordingly.
2023-11-14curl_easy_handle: Allow non-fatal logging of errors in curl operationsPaul Cristian Sarbu
In order to allow non-fatal retries of fetches, be it from same remote or not (e.g., mirrors), the handle now reports with a caller-defined LogLevel.
2023-11-14DistdirCheckout: Improve log messagesPaul Cristian Sarbu
2023-11-14just-mr: Add 'mirrors' field to 'git' repositoriesPaul Cristian Sarbu
2023-11-14just_mr utils: Add missing nodiscard attributesPaul Cristian Sarbu
2023-11-14fs_utils: Only accept strings as 'checkouts' map valuesPaul Cristian Sarbu
While we don't want to fail if the 'checkouts' map values are not strings, we shouldn't just accept non-string values either, instead we should warn the user and continue without them.
2023-11-14commit_git_map fix: Fetch from correct location if fetch URL is a pathPaul Cristian Sarbu
2023-11-13bugfix: Also unlink symlinks before installingOliver Reiche
Make sure that all CopyFile, WriteFile, and CreateSymlink functions properly unlink the target file (if it exists and overwrite requested) to avoid interferences of the install command. With this change, the clean up step for install-cas and the within GraphTraverser can new be omitted.
2023-11-13"git tree" repositories: honor "inherit env"Klaus Aehlig
In the specification of the action generating a fixed git tree, also honor "inherit env", i.e., inherit the environment variables specified in this field from the environment just-mr is invoked in. As the expected output is fixed ahead of time anyway, this lack of isolation does not affect correctness.
2023-11-07Bazel API: implement ParallelRetrieveToCasKlaus Aehlig
... using thread-based parallelism for the blobs of each tree.
2023-11-07artifacts sync: use parallelism if providedKlaus Aehlig
Use parallelism if provided by the build API when synchronizing artifacts of export targets and when synchronizing artifacts due to the --remember option. Do so at build parallelism as this the parallelism suitable for the build API.
2023-11-07remote api: support otpional parallel CAS synchronisationKlaus Aehlig
Allow implementations to use a given number of threads to carry out the synchronisation. In this way parallelism can be achieved even in situations where batch reading degrades as objects of unknown size have to be fetched; this situation typically occurs if a tree object has a large number of direct children that are blobs. If no implementation is provided, the default implementation is to fall back to the normal (sequential) CAS synchronisation.
2023-11-07Fetch export targets sequentially when creating local backupKlaus Aehlig
Typically, the number of export targets is small compared to the size of the respective export targets. Moreover, export targets are often chained, resulting in overlapping artifacts that we want to fetch only once. Therefore, fetch export targets sequentially, giving room to introduce parallelism in the individual fetch steps later. While there, also log the beginning of the artifact synchronisation for the export targets.
2023-11-02just-mr fetch: Add handling of --fetch-absent optionPaul Cristian Sarbu
2023-11-02content git map: Add handling of --fetch-absent optionPaul Cristian Sarbu
2023-11-02content git map: Move handling of --fetch-absent flag from checkout to the ↵Paul Cristian Sarbu
map itself
2023-11-02Move content archive helper functions in own libraryPaul Cristian Sarbu
2023-11-02remote serve: Extend client and API with tree-of-archive service callsPaul Cristian Sarbu
2023-11-02just serve: Implement service to get Git tree of an archive contentPaul Cristian Sarbu
Also adds missing TARGETS file in serve_api folder and ensures code comments are consistent with the proto file.
2023-11-02just serve: Fix inconsistenciesPaul Cristian Sarbu
- add missing serve_api TARGETS file - rename service client to align with server naming scheme - fix inconsistencies in comments between implementation and protocol
2023-11-02Decoupling symlinks map and CAS utilities from just-mrPaul Cristian Sarbu
This is required in order to make them available to 'just serve' in a minimal just installation.
2023-11-02ArchiveOps: Move libarchive utilities outside other_toolsPaul Cristian Sarbu
This way they can be used by 'just serve'.
2023-11-02GitRepo: Add method for async fetch from local repositoryPaul Cristian Sarbu
This avoids using the more geenric GitRepoRemote method which has libcurl as a dependency, something that is not needed for this Git operation.