From 32f41458c0a0f62bf906021ef096c465ccc45581 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 21 Sep 2023 22:32:44 +0300 Subject: refactor(tvix): move castore into tvix-castore crate This splits the pure content-addressed layers from tvix-store into a `castore` crate, and only leaves PathInfo related things, as well as the CLI entrypoint in the tvix-store crate. Notable changes: - `fixtures` and `utils` had to be moved out of the `test` cfg, so they can be imported from tvix-store. - Some ad-hoc fixtures in the test were moved to proper fixtures in the same step. - The protos are now created by a (more static) recipe in the protos/ directory. The (now two) golang targets are commented out, as it's not possible to update them properly in the same CL. This will be done by a followup CL once this is merged (and whitby deployed) Bug: https://b.tvl.fyi/issues/301 Change-Id: I8d675d4bf1fb697eb7d479747c1b1e3635718107 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9370 Reviewed-by: tazjin Reviewed-by: flokli Autosubmit: flokli Tested-by: BuildkiteCI Reviewed-by: Connor Brewster --- tvix/store/protos/rpc_directory.proto | 48 ----------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 tvix/store/protos/rpc_directory.proto (limited to 'tvix/store/protos/rpc_directory.proto') diff --git a/tvix/store/protos/rpc_directory.proto b/tvix/store/protos/rpc_directory.proto deleted file mode 100644 index 0aeed5c3c0e1..000000000000 --- a/tvix/store/protos/rpc_directory.proto +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: MIT -// Copyright © 2022 The Tvix Authors -syntax = "proto3"; - -package tvix.store.v1; - -import "tvix/store/protos/castore.proto"; - -option go_package = "code.tvl.fyi/tvix/store/protos;storev1"; - -service DirectoryService { - // Get retrieves a stream of Directory messages, by using the lookup - // parameters in GetDirectoryRequest. - // Keep in mind multiple DirectoryNodes in different parts of the graph might - // have the same digest if they have the same underlying contents, - // so sending subsequent ones can be omitted. - rpc Get(GetDirectoryRequest) returns (stream Directory); - - // Put uploads a graph of Directory messages. - // Individual Directory messages need to be send in an order walking up - // from the leaves to the root - a Directory message can only refer to - // Directory messages previously sent in the same stream. - // Keep in mind multiple DirectoryNodes in different parts of the graph might - // have the same digest if they have the same underlying contents, - // so sending subsequent ones can be omitted. - // We might add a separate method, allowing to send partial graphs at a later - // time, if requiring to send the full graph turns out to be a problem. - rpc Put(stream Directory) returns (PutDirectoryResponse); -} - -message GetDirectoryRequest { - oneof by_what { - // The blake3 hash of the (root) Directory message, serialized in - // protobuf canonical form. - // Keep in mind this can be a subtree of another root. - bytes digest = 1; - } - - // If set to true, recursively resolve all child Directory messages. - // Directory messages SHOULD be streamed in a recursive breadth-first walk, - // but other orders are also fine, as long as Directory messages are only - // sent after they are referred to from previously sent Directory messages. - bool recursive = 2; -} - -message PutDirectoryResponse { - bytes root_digest = 1; -} -- cgit 1.4.1