tvl-depot/tvix/nar-bridge
Florian Klink 98c17147c6 refactor(tvix/nar-bridge): have Export return root node
… and nar size / sha256 digest.

Instead of producing sparse PathInfo messages when NARs are sent to
nar-bridge, the nar-bridge http server now keeps a lookup table
(narsha256) -> (rootNode, narSize)

This removes a whole bunch of noise, because we don't need to keep
sparse fields around.

A convenience function
`GenPathInfo(rootNode *castorev1pb.Node, narInfo *narinfo.NarInfo)` is
added, which is used to produce PathInfo messages, either when receiving
a NAR file over http and uploading it to a remote PathInfoService, or to
synthesize the PathInfoMessage to return to the client, if nar-bridge is
acting as a PathInfoService for a remove Nix HTTP Binary cache.

Change-Id: Ibba1ab6238a050816c4fab29cb21ae88877d8613
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9651
Tested-by: BuildkiteCI
Reviewed-by: Brian McGee <brian@bmcgee.ie>
2023-10-11 11:41:50 +00:00
..
cmd fix(tvix/nar-bridge): properly check error during HTTP shutdown 2023-10-05 19:15:00 +00:00
pkg refactor(tvix/nar-bridge): have Export return root node 2023-10-11 11:41:50 +00:00
testdata fix(tvix/nar-bridge): Fix directory stack tracking 2023-09-17 13:34:00 +00:00
.gitignore feat(tvix/nar-bridge): add nar-bridge-pathinfo command 2023-10-05 15:02:12 +00:00
default.nix refactor(tvix/nar-bridge): pass root node to storev1pb.Export 2023-10-11 11:41:50 +00:00
go.mod refactor(tvix/nar-bridge): pass root node to storev1pb.Export 2023-10-11 11:41:50 +00:00
go.sum refactor(tvix/nar-bridge): pass root node to storev1pb.Export 2023-10-11 11:41:50 +00:00
README.md feat(tvix/nar-bridge): init 2023-09-17 13:24:53 +00:00

//tvix/nar-bridge

This exposes a HTTP Binary cache interface (GET/HEAD/PUT requests) for a tvix- store.

It can be used to configure a tvix-store as a substitutor for Nix, or to upload store paths from Nix via nix copy into a tvix-store.