about summary refs log tree commit diff
path: root/tvix/store/src/tests/utils.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-06-12 r/6273 refactor(tvix/store): use Arc instead of BoxFlorian Klink1-6/+8
This allows us to blob services without closing them before putting them in a box. We currently need to use Arc<_>, not Rc<_>, because the GRPC wrappers require Sync. Change-Id: I679c5f06b62304f5b0456cfefe25a0a881de7c84 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8738 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
2023-06-12 r/6272 refactor(tvix/store): use Box<dyn DirectoryService>Florian Klink1-4/+4
Once we support configuring services at runtime, we don't know what DirectoryService we're using at compile time. This also means, we can't explicitly use the is_closed method from GRPCPutter, without making it part of the DirectoryPutter itself. Change-Id: Icd2a1ec4fc5649a6cd15c9cc7db4c2b473630431 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8727 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2023-06-12 r/6271 feat(tvix/store/pathinfosvc): add calculate_nar methodFlorian Klink1-2/+5
Putting this in the PathInfoService trait makes much more sense, we can have direct control over where/how to cache the results in the implementation. This now requires each PathInfoService to hold pointers to BlobService and DirectoryService. Change-Id: I4faae780d43eae4beeb57bd5e190e6d1a5d3314e Reviewed-on: https://cl.tvl.fyi/c/depot/+/8724 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su>
2023-06-12 r/6269 feat(tvix/store): eliminate generics in BlobStoreFlorian Klink1-2/+2
To construct various stores at runtime, we need to eliminate associated types from the BlobService trait, and return Box<dyn …> instead of specific types. This also means we can't consume self in the close() method, so everything we write to is put in an Option<>, and during the first close we take from there. Change-Id: Ia523b6ab2f2a5276f51cb5d17e81a5925bce69b6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8647 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2023-05-11 r/6133 refactor(tvix/store): remove ChunkServiceFlorian Klink1-5/+0
Whether chunking is involved or not, is an implementation detail of each Blobstore. Consumers of a whole blob shouldn't need to worry about that. It currently is not visible in the gRPC interface either. It shouldn't bleed into everything. Let the BlobService trait provide `open_read` and `open_write` methods, which return handles providing io::Read or io::Write, and leave the details up to the implementation. This means, our custom BlobReader module can go away, and all the chunking bits in there, too. In the future, we might still want to add more chunking-aware syncing, but as a syncing strategy some stores can expose, not as a fundamental protocol component. This currently needs "SyncReadIntoAsyncRead", taken and vendored in from https://github.com/tokio-rs/tokio/pull/5669. It provides a AsyncRead for a sync Read, which is necessary to connect our (sync) BlobReader interface to a GRPC server implementation. As an alternative, we could also make the BlobReader itself async, and let consumers of the trait (EvalIO) deal with the async-ness, but this is less of a change for now. In terms of vendoring, I initially tried to move our tokio crate to these commits, but ended up in version incompatibilities, so let's vendor it in for now. Change-Id: I5969ebbc4c0e1ceece47981be3b9e7cfb3f59ad0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8551 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2023-03-10 r/5943 refactor(tvix/store): impl Default for MemoryBlobServiceFlorian Klink1-1/+1
Change-Id: I78a4cd86cb364b970e99393579808e773db5ceb2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8237 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
2023-03-10 r/5942 refactor(tvix/store): impl Default for MemoryChunkServiceFlorian Klink1-1/+1
Change-Id: If1ceb870e9e5d03b651923a3a786350a8663e990 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8236 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2023-03-10 r/5941 refactor(tvix/store): impl Default for MemoryDirectoryServiceFlorian Klink1-1/+1
Change-Id: Ie75a1e67c8c0499ff10f60d90251b768937dad3a Reviewed-on: https://cl.tvl.fyi/c/depot/+/8235 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
2023-03-10 r/5940 refactor(tvix/store): impl Default for MemoryPathInfoServiceFlorian Klink1-1/+1
Change-Id: I07f83f8aaa6312cc37ce7e7ee2b713e60df23782 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8234 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2023-03-10 r/5935 feat(tvix/store): use Memory*Service instead of temporary sledFlorian Klink1-8/+8
Change-Id: I65d2030aa643b6937dd92baa85db033bdce38b02 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8208 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
2023-03-10 r/5934 feat(tvix/store): add new_temporary for all Sled servicesFlorian Klink1-10/+8
This provides a service using /dev/shm, that's deleted once the reference is dropped. Refactor all tests to use these, which allows getting rid of most TempDir usage in the tests. The only place where we still use TempDir is in the importer tests, which work on a filesystem path. Change-Id: I08a950aa774bf9b46d9f5c92edf5efba36053242 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8193 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
2023-03-10 r/5928 refactor(tvix/store/tests): move gen_*_service() into helperFlorian Klink1-0/+24
This allows hiding to tests what exact implementation we're using, when testing things that do something with a store, but don't care what's used for underlying storage. Change-Id: I7cdf60fd73c25d5050159cb31ec177db2bc2a7f1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8155 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>