summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/serve_service/source_tree.hpp
AgeCommit message (Collapse)Author
2025-02-14code structure: rename symlinks_map folder to symlinksPaul Cristian Sarbu
...to remove the unnecessary link between folder name and the logic of resolve_symlinks_map.
2025-01-22Source-tree service: accept lock referenceKlaus Aehlig
... so that tagging in the associated git root can be synchronized with other services provided by just serve.
2025-01-21TreeStructure: Compute on serveMaksim Denisov
2025-01-15Use GitRepo::IsTreeInRepo in SourceTreeServiceMaksim Denisov
2025-01-15Use GitRepo::ImportToGit in SourceTreeServiceMaksim Denisov
2025-01-07source tree service: Ensure the Git cache existsPaul Cristian Sarbu
Similarly to just-mr, each SourceTree RPC must ensure that the Git cache folder exists and the Git cache repository is initialized before using it. While there, fix missing shared locks on the Git cache root.
2024-11-20Serve service: properly lock git operations against each otherKlaus Aehlig
... by using an exclusive lock. A lock of which only ever shared instances are requested has no synchronisation effect. Fix this.
2024-11-14serve_api: Implement IWYU suggestionsPaul Cristian Sarbu
2024-10-25serve service: Set correct protocol-aware digests in responsesPaul Cristian Sarbu
When returning digests in responses, ensure they are of the type the remote would know. Compatible digests can be found vis the stored mappings from Git digests to bazel objects.
2024-10-25serve service: Use digest when requesting serve to set up a treePaul Cristian Sarbu
...instead of passing just the Git hash, which imposes the remote to always be native. The serve service proto file is updated accordingly.
2024-10-25serve service: Give SourceTreeService access to both local storagesPaul Cristian Sarbu
...native and compatible, even if currently only native is active. While there, be more explicit in which storage instance is being used.
2024-08-07Remove code duplication from SourceTreeServiceMaksim Denisov
2024-07-30Use LocalContext in execution and serve servicesPaul Cristian Sarbu
The context is passed by not_null const pointer in order to avoid binding to temporaries, and it or parts of it get stored by const ref where needed.
2024-07-05Pass StorageConfig and Storage to ServeMaksim Denisov
2024-06-28Use (un)expected for serve serviceOliver Reiche
2024-06-27Pass RemoteServeConfig by pointer for capturingMaksim Denisov
2024-06-25Pass ApiBundle to SourceTreeServiceMaksim Denisov
2024-06-25Instantiate LocalApi and BazelApi at onceMaksim Denisov
...to properly fallback to local api if needed.
2024-06-18Pass RemoteServeConfig to ServeServerImpl by referenceMaksim Denisov
...instead of using singleton calls.
2024-04-25just_serve.proto: Cleanup of specification documentationPaul Cristian Sarbu
Also aligning comments in server-side headers with the proto file documentation.
2024-04-10resolve_symlinks_map: Allow separate source and target repositoriesPaul Cristian Sarbu
In certain cases, e.g., on the serve endpoint, an unresolved tree might lie in a repository other than the Git cache, therefore we cannot create any new entries there, as it would violate our guarantee that we only write under our local build root. Therefore, the resolve_symlinks_map now receives pointers to both the source and target Git databases and ensures that: 1. any tree created on-the-fly is stored exclusively in the target repository, and 2. any other entry required for those trees is made available in the target repository by copying it from the source repository. Note that in our use case the target repository is always our Git cache and passing a pointer to that object database is done to avoid the overhead of otherwise opening the database very often.
2024-03-26Add missing system includesPaul Cristian Sarbu
Main culprits: - std::size_t, std::nullptr_t, and NULL require <cstddef> - std::move and std::forward require <utility> - unordered maps and sets require respective includes - std::for_each and std::all_of require <algorithm>
2024-03-04serve protocol: support executable distfilesKlaus Aehlig
As serve and just-mr share their caching of description-tree association, we also have to change this cache. Thanks to json encoding before hashing, we know that the old and new hash keys do not overlap, so the change is save. As distdirs also keep the respective files in the git root, no new downlaoding will happen either, hence no warning in the CHANGELOG is needed.
2024-01-31serve source tree: Increase server-side granularity in response statusesPaul Cristian Sarbu
For archives and Git repositories we should ensure that not finding the witnessing entity (archive content blob or Git commit, respectively) results in a distinct status in the response to a request that sets up roots on the serve endpoint. This will allow just-mr to better handle its interaction with the serve endpoint.
2024-01-26serve source tree: Server-side implementation of to_git pragma-related RPCsPaul Cristian Sarbu
2024-01-26serve source tree: Distdir tree should end up in Git cachePaul Cristian Sarbu
The purpose of the requests for the tree of an archive, commit, or distdir also includes making those trees available for future builds on the serve endpoint, which currently means being in a known Git repository. This commit ensures the distdir tree reqeust also includes the import of the resulting tree from CAS into the Git cache (if the tree is not already in a Git repsoitory).
2024-01-08serve distdir tree: Server-side implementationPaul Cristian Sarbu
2023-12-07just serve: Implement server-side ServeTree RPCPaul Cristian Sarbu
2023-11-27Refactoring RepositoryConfigPaul Cristian Sarbu
With the introduction of 'just serve', export targets can now be built also independently from one another based on their corresponding minimal repository configuration, as stored in the target cache key. In this context, this commit changes the RepositoryConfig usage from one global (static) instance to pointers passed as necessary throughout the code.
2023-11-21just serve: Implement server-side ServeContent RPCPaul 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-10-06CreateExecutionApi: define a new library to avoid code duplicationAlberto Sartori
2023-09-22RemoteServeConfig: Remove problematic inheritancePaul Cristian Sarbu
This was causing the remote serve address to overwrite the one set for remote execution. Also, to keep things clean, some common remote server-related methods and definitions were moved into their own library.
2023-09-19just serve protocol: clean upKlaus Aehlig
Just like the remote-execution protocol has several services (Execution, ActionCache, ContentAddressableStorage, etc), so will the serve protocol: the actual target-level caching, as well auxilliary services, like the service to obtain the tree for a given root. Already follow that scheme, before the protocol gets part of any release. Also, move the status enum into the respective answer messages. In this way, we can have different enums for different requests without causing conflicts on the named enum constants.