feat(tvix/castore): upload blobs concurrently when ingesting archives

Ingesting tarballs with a lot of small files is very slow because of the
round trip time to the `BlobService`. To mitigate this, small blobs can
be buffered into memory and uploaded concurrently in the background.

Change-Id: I3376d11bb941ae35377a089b96849294c9c139e6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11497
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Autosubmit: Connor Brewster <cbrewster@hey.com>
This commit is contained in:
Connor Brewster 2024-04-20 16:41:49 -05:00 committed by clbot
parent fa69becf4d
commit 79698c470c
2 changed files with 92 additions and 12 deletions

View file

@ -168,7 +168,7 @@ async fn hash<D: Digest + std::io::Write>(
impl<BS, DS, PS> Fetcher<BS, DS, PS>
where
BS: AsRef<(dyn BlobService + 'static)> + Send + Sync,
BS: AsRef<(dyn BlobService + 'static)> + Clone + Send + Sync + 'static,
DS: AsRef<(dyn DirectoryService + 'static)>,
PS: PathInfoService,
{
@ -242,7 +242,7 @@ where
// Ingest the archive, get the root node
let node = tvix_castore::import::archive::ingest_archive(
&self.blob_service,
self.blob_service.clone(),
&self.directory_service,
archive,
)