about summary refs log tree commit diff
path: root/tvix/nar-bridge/pkg/server
AgeCommit message (Collapse)AuthorFilesLines
2023-09-22 r/6633 refactor(tvix/nar-bridge): update to new separated protosFlorian Klink7-37/+41
Change-Id: I5eaadc837a4d3a7f635574437127a22de88f556b Reviewed-on: https://cl.tvl.fyi/c/depot/+/9407 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com> Autosubmit: flokli <flokli@flokli.de>
2023-09-18 r/6616 feat(tvix/nar-bridge): graceful shutdownFlorian Klink1-2/+10
This gives existing clients 30s to finish their requests after receiving an interrupt. Change-Id: Ia9b0e662fd1ffbbb6c2d03f3dd6548b13cf3d241 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9365 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2023-09-18 r/6614 refactor(tvix/nar-bridge): don't buffer blob in memoryFlorian Klink1-16/+25
Create a pipe, pass the read end, and have a goroutine write to the write end. Change-Id: I301c273355705e60113b018e7e84b76972200e8c Reviewed-on: https://cl.tvl.fyi/c/depot/+/9361 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2023-09-18 r/6613 refactor(tvix/nar-bridge): simplify CLI interfaceFlorian Klink5-10/+7
Only keep the `serve` subcommand, and make it appear at the root. Introduce a --log-level argument, and be a bit less noisy in normal operation. Change-Id: I86b8abde1869a5c0c947508bcc29f845222aac09 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9360 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
2023-09-18 r/6612 fix(tvix/nar-bridge): don't log error on simple 404sFlorian Klink2-2/+2
`nix copy` checks if NARs and NARInfo files are present, before uploading them. That's not an error, but normal behaviour, so no need to log with level info for these cases. We only want to log if the error is not a 404, and log with Warn level. Change-Id: I762de3b862d070a0f18bc62e324e94ca5c7c3693 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9359 Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
2023-09-18 r/6611 feat(tvix/nar-bridge): buffer request body a bit moreFlorian Klink1-1/+2
Let's make sure we don't end up blocking a client too much when inserting very small blobs. Change-Id: I640dda92efae538c70d32a40e6e85a23e9749e20 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9358 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2023-09-18 r/6610 fix(tvix/nar-bridge): chunk blobsFlorian Klink1-22/+45
Instead of creating one big BlobChunk containing all data, and creating way too large proto messages, chunk blobs up to a reasonable (1MiB) chunk size, and send them to the server like that. Change-Id: Ia45a53956a6d7c0599cc59ac516ba37e9fb1b30e Reviewed-on: https://cl.tvl.fyi/c/depot/+/9357 Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
2023-09-17 r/6601 feat(tvix/nar-bridge): increase timeoutsFlorian Klink1-3/+3
In some cases, Nix is not able to stream the NAR file fast enough. Bump the timeouts for now. We might want to get a better understanding in what's happening here long-term, and/or make the timeouts configurable. Change-Id: Ieaa9c8f04bc73c6ce0679a058d07eaf87126634e Reviewed-on: https://cl.tvl.fyi/c/depot/+/9340 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2023-09-17 r/6600 feat(tvix/nar-bridge): initFlorian Klink8-0/+896
This provides a Nix HTTP Binary Cache interface in front of a tvix-store that's reachable via gRPC. TODOs: - remove import command, move serve up to toplevel. We have nix-copy- closure and tvix-store commands. - loop into CI. We should be able to fetch the protos as a third-party dependency. - Check if we can test nar-bridge slightly easier in an integration test. - Ensure we support connecting to unix sockets and grpc+http at least, using the same syntax as tvix-store. - Don't buffer the entire blob when rendering NAR Co-Authored-By: Connor Brewster <cbrewster@hey.com> Co-Authored-By: Márton Boros <martonboros@gmail.com> Co-Authored-By: Vo Minh Thu <noteed@gmail.com> Change-Id: I6064474e49dfe78cea67676957462d9f28658d4a Reviewed-on: https://cl.tvl.fyi/c/depot/+/9339 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>