Commit graph

2972 commits

Author SHA1 Message Date
Florian Klink
6068d044b3 feat(tvix/nix-daemon): instrument for TvixDaemon
This makes it easier to see what's being communicated, by setting
`RUST_LOG=nix_daemon=debug`.

Change-Id: Ifcd89ff6c5c1727e97569e29d4f63993cc37ed8e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12884
Tested-by: BuildkiteCI
Reviewed-by: Vladimir Kryachko <v.kryachko@gmail.com>
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: flokli <flokli@flokli.de>
2024-12-15 18:14:10 +00:00
Ilan Joselevich
1cc4200b3e feat(tvix/boot/tests): Replace GNU parallel with rush
rush is like GNU parallel, but in Go, and most importantly, without
the annoying citation.

Change-Id: Id4737e6dee43037c1c2bc814738416410a603e07
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12887
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: BuildkiteCI
2024-12-10 10:17:15 +00:00
Florian Klink
b4ab3b45d7 docs(tvix/boot): update docstring
mkBootTest is not limited to only listing files, it can also be used (is
used) to boot init.

Change-Id: Iaa0d2b5bad3be856aa8a0172450efe166620ba41
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12882
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
2024-12-09 22:11:50 +00:00
Florian Klink
12c9db5a9a refactor(tvix/nix-daemon): use if let Some(_) = …
This makes it a bit less verbose.

Change-Id: I41835f43628d7a10855b9d89816e8d20eb7546d2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12881
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Reviewed-by: Domen Kožar <domen@cachix.org>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
2024-12-09 14:51:49 +00:00
Florian Klink
adf9c47626 docs(nix-compat/nix_daemon): fix typo
Change-Id: I9bc9982faa0abc8212e15916a3435dd0cfd0e54d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12880
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: Domen Kožar <domen@cachix.org>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2024-12-09 14:51:49 +00:00
Florian Klink
5b278cc6ab refactor(nix-compat/nix-daemon): s/result/results/
There's more than one result in there.

Change-Id: I5d519db51fda050ed293bfb52215a643882e0116
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12879
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2024-12-09 14:51:49 +00:00
Florian Klink
2879969f1b chore(tvix): bump tower-otel-http-metrics, enable axum feature
Move back to a proper release containing the opentelemetry bump. Also
enable the `axum` feature, which will give us a per-route accounting.

Change-Id: Icdf4dc73588ef45b6596b320c14d9f44946327b3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12865
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-12-04 21:52:42 +00:00
Vova Kryachko
88d51c9c16 chore(tvix/nix-compat): basic daemon handler tests
This change adds tests for basic request/response handling as per nix
daemon STDERR_* protocol.

Change-Id: Ia6a1904e14955551b11f776b6ccb595fa8984513
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12852
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: Vladimir Kryachko <v.kryachko@gmail.com>
2024-12-01 17:58:17 +00:00
Florian Klink
8d4a0ac008 refactor(tvix/glue): make user-agent more granular
Use the crate name in the user-agent, similar to tvix-[ca]store.

Change-Id: I10527fb1f29006dbfd8630d8bb1f00d7905efdd3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12851
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Vladimir Kryachko <v.kryachko@gmail.com>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-11-29 08:09:50 +00:00
Florian Klink
9fabf8a1b5 feat(tvix/castore): set user-agent for object_store blob/directorysvc
Change-Id: I9fcebffb19174cba2e9001398419d3041266400c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12850
Reviewed-by: Vladimir Kryachko <v.kryachko@gmail.com>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: flokli <flokli@flokli.de>
2024-11-29 08:09:50 +00:00
Florian Klink
fa305dea90 feat(tvix/store): set user-agent for NixHTTPPathInfoService
Change-Id: I8eb74c5a9457b88ab51bd88084591a4c7c5cdbcc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12849
Reviewed-by: Domen Kožar <domen@cachix.org>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2024-11-29 08:09:50 +00:00
Vova Kryachko
b59561b9b1 chore(tvix/glue): Fix fetchTarball for github urls.
GitHub does not allow downloads by clients without a User-Agent set.
This changes sets the client User-Agent to "tvix".

Change-Id: I829b37e63bcedb5ea785b55eff5b10175f5caaa6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12845
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2024-11-28 17:16:28 +00:00
Vova Kryachko
e9acde3c42 feat(tvix/nix-daemon): New operation AddToStoreNar
This operation is particularly used when invoking the following
nix commands:

```
nix-store --add-fixed some-path
nix-store --add-fixed --recursive some-path
```

Change-Id: I0f9b129c838c00e10415881f1e6e0d7bc1d7a3a6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12800
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2024-11-24 22:21:20 +00:00
Vova Kryachko
8ef9ba82a8 feat(tvix/store): Add CAHash validation
Validation is done inside ingest_nar_and_hash and
is used by Fetch::NAR and the nar-bridge.

Change-Id: I7e2be4cc13d2447035f1e5a444f44b62339988bf
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12836
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2024-11-24 20:24:43 +00:00
Florian Klink
f6aee3534b feat(tvix/nar-bridge): support zstd content-encoding
We previously didn't handle compression in nar-bridge, and left it up to
a fronting reverse proxy.

However, at least nginx with http2 enabled pins each connection to a
single core, causing compression to be limited by the throughput of a
single CPU.

Change-Id: Ia11c2ff5c012192b25eb8ad05dae5542a2d2f777
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12834
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Reviewed-by: Jörg Thalheim <joerg@thalheim.io>
2024-11-24 18:34:04 +00:00
Florian Klink
25fb9e32f6 chore(tvix/nix-compat-derive-tests): update fixtures
With more implementing NixDeserialize, this error message changed.

Fixtures were regenerated by running:

```
TRYBUILD=overwrite cargo test -p nix-compat-derive-tests --all-features
```

Unfortunately, it's not possible to loop this into CI, as trybuild
invokes cargo during the build.

Change-Id: Ia0ab07d0907d21366845fe06e01df9fb1fe3e7cb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12831
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: BuildkiteCI
2024-11-23 20:23:53 +00:00
Florian Klink
378a6faec2 fix(tvix/nar-bridge): explicitly select fields to add to span
We got some double-quoted strings at narinfo_str, and it didn't align
well with our other field names.

Change-Id: I5c08786d2c4435542bf39ff44b9d4ada5400550d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12826
Tested-by: BuildkiteCI
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2024-11-23 09:40:21 +00:00
Florian Klink
12d1dcbfcc fix(tvix/castore): instrument blob uploads with current span
Change-Id: I67e18486c48f06787fad8be506e95eecc23e994d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12825
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
2024-11-23 09:40:21 +00:00
Florian Klink
0b1068677e fix(tvix/nar-bridge): set correct service name
We should be able to distinguish tvix-store and nar-bridge.

Change-Id: I616c8e0c1ce2dbacab92975582dd36141b673aa2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12824
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: BuildkiteCI
2024-11-23 09:40:21 +00:00
Florian Klink
02903133f4 feat(tvix/nar-bridge): wire up metrics layer
This provides some global HTTP statistics.

Change-Id: I8bd3e034123154a49d94720b0c8d0c3babde5ae3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12557
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2024-11-23 09:40:21 +00:00
Florian Klink
5f670a2f67 feat(tvix/tracing): configure metrics support
This creates and registers a global meter provider, which uses the same
mechanism to get notified of flushes.

Change-Id: I856a67f0b282d494de3b2c2a1b79c06ae8ffe252
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12556
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-11-23 09:40:21 +00:00
Florian Klink
0715163779 chore(tvix): bump opentelemetry to 0.27
Change-Id: I3afbd8c94e0bc2cdf30da1886ae05b922f8a718f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12822
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Reviewed-by: edef <edef@edef.eu>
Tested-by: BuildkiteCI
2024-11-23 09:40:21 +00:00
Florian Klink
dc21f5e543 feat(tvix/store): add xp-store-composition-cli feature flag
This can be used to transitively enable the `xp-composition-cli` feature
flag in the `tvix-store` crate, which is unnecessarily hard to do with
crate2nix.

Change-Id: I3f7c505a3fd505561c9a7b2f063b6540532cdfd4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12809
Tested-by: BuildkiteCI
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2024-11-23 09:40:21 +00:00
Vova Kryachko
654cc3e43a chore(tvix/nix-daemon): Implement framed protocol
When sending nars over the wire to the nix-daemon, nix protocol versions
>= 1.23 use this framing protocol.

This change implements an AsyncRead for this protocol, to be used in
AddToStoreNar and any other operations when necessary.

Change-Id: I5f7972fe1c9ea145780bf449321bd3efeb833d18
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12814
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2024-11-20 17:36:26 +00:00
Vova Kryachko
db13b6c092 chore(tvix/nix-daemon): Implement STDERR_READ protocol
When sending nars over the wire to the nix-daemon, nix protocol versions
1.21 to 1.23 use this framing protocol.

This change implements an AsyncRead for this protocol, to be used in
AddToStoreNar and any other operations when necessary.

Change-Id: I571f1adbb2343c14c98503d1a2c12eea4c783ec9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12813
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-11-20 17:36:26 +00:00
Florian Klink
a01760fcee refactor(tvix/tracing): simplify flushing channel
The TracingHandle::flush function allowed a user to pass in their
own (optional) oneshot::Sender<()> to get notified once the flush is
completed, but that's making things unnecessary complicated.

By simply having the flush() function await the flush, we make its
interface more intuitive, and callsites (only inside tvix-tracing itself
so far) simpler.

We can also remove the Option around the oneshot::Sender entirely, as we
now always call it with that.

For some more clarity, we can remove the channel from the struct fields
entirely if otlp support isn't compiled in.

Change-Id: I0870b9e8e88c6be6494a9c201c1c70b87e0f0810
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12801
Reviewed-by: flokli <flokli@flokli.de>
Reviewed-by: Marijan Petričević <marijan.petricevic94@gmail.com>
Tested-by: BuildkiteCI
2024-11-18 22:10:58 +00:00
sterni
5daaaa2f0b chore(3p/sources): bump channels & overlays
* //3p/overlays/tvl: build nixos-option with latest Nix version (2.24)
  as is required now. It would be nice to avoid this somehow to prevent
  NixOS machines in depot having to carry around two versions of Nix.
  Maybe we can at least use a statically linked nixos-option?

* //3p/{gerrit,gerrit_plugins}: update deps hash

* //tvix/eval: adjust our nixVersion “user agent” so that it'll pass the
  new 2.3.17 minimum version nixpkgs prescribes (to check for zstd
  support when substituting from the binary cache).

Change-Id: I4eb715afdc3dbb857340839f08ce86612aa7f117
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12805
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2024-11-18 14:01:20 +00:00
Vova Kryachko
ccecede70b feat(nix-daemon): Implement stubs for QueryReferrers, QueryRealizations
These are required to support certain nix's local-overlay store
operations, it's safer to return empty results for these
operations than failing with "operation not implemented" errors.

Change-Id: Ic9b69d75dd52af5a826bfb6a8b283b082a0f6bcf
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12766
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2024-11-14 13:39:48 +00:00
Vova Kryachko
fa9c067dc9 feat(nix-daemon): Implement more nix daemon operations.
In particular QueryPathFromHashPart, QueryValidPaths, QueryValidDerivers

Change-Id: Ie6ad83cec5ce9580044b85e201e4e23394f87075
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12762
Tested-by: BuildkiteCI
Reviewed-by: edef <edef@edef.eu>
Reviewed-by: flokli <flokli@flokli.de>
2024-11-13 21:21:57 +00:00
Vova Kryachko
6aada91062 feat(tvix-store): Improve tvix-store copy.
This change contains 2 improvements to the tvix-store copy command:

1. Allows reading the reference graph from stdin, using `-` argument
2. Supports json representation produced by `nix path-info --json`
   command.

In general it makes is easier and faster to import arbitrary closures
from an existing nix store with e.g the following command:

```
nix path-info ./result --json --closure-size --recursive | \
  jq -s '{closure: add}' | \
  tvix-store copy -
```

Change-Id: Id6eea2993da233ecfbdc186f1a8c37735b686264
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12765
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2024-11-12 16:43:21 +00:00
Florian Klink
b1764e1109 refactor(nix-compat/nix_daemon): drop Sync requirement for StorePath
By manually writing out the async function, and moving the owned String
we can avoid for S to be Sync in the NixSerialize for StorePath<S> impl.

Co-Authored-By: edef@edef.eu
Change-Id: I8427b38d2bd61de2818088728cbad79cda69d17d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12764
Reviewed-by: Vladimir Kryachko <v.kryachko@gmail.com>
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: edef <edef@edef.eu>
Tested-by: BuildkiteCI
2024-11-12 14:05:24 +00:00
Florian Klink
0b8ec03797 docs(tvix): document Store configuration
This describes the current composition system used for BlobService /
DirectoryService / PathInfoService, why it's hidden, how to expose it,
and adds some common examples to explain it.

Change-Id: I2ce7da40992cc988947c3e924499f8157c5e4937
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12749
Tested-by: BuildkiteCI
Reviewed-by: yuka <yuka@yuka.dev>
2024-11-12 14:05:16 +00:00
Florian Klink
1428ea4e19 refactor(nix-compat/store_path): use AsRef<str>
Implement PartialEq/Eq ourselves instead of deriving, by proxying to
name.as_ref() (and digest of course).

Also implement Hash on our own, clippy doesn't like this to be derived,
while Eq/PartialEq is not.

Change-Id: Idbe289a23ba3bc8dabf893d4d8752792ae2778c3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12744
Tested-by: BuildkiteCI
Reviewed-by: edef <edef@edef.eu>
Autosubmit: flokli <flokli@flokli.de>
2024-11-12 11:55:48 +00:00
Florian Klink
1474471327 docs(tvix/eval): update string context document
NixString doesn't contain a `HashSet<BuildReference>` anymore, there's a
more packed internal data structure. We don't need to be overly specific
in the docs, just say we expose an API.

Change-Id: I13380c49293f9a86d1916909fdfeefbe64d9024b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12755
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: edef <edef@edef.eu>
2024-11-12 11:55:36 +00:00
Florian Klink
2af30c8c7f refactor(tvix/eval): rm From<(T, Option<Box<NixContext>>)> for NixString
This conversion was a bit too magic, and we can just use
`NixString::new_context_from` without having to worry about the
distinction between an empty context or no context, as
NixString::new_context_from already deals with that internally.

Change-Id: I3e5d57ecfa0f7456aa6c526863e49f2523afaec3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12754
Tested-by: BuildkiteCI
Reviewed-by: edef <edef@edef.eu>
Autosubmit: flokli <flokli@flokli.de>
2024-11-12 11:16:08 +00:00
Florian Klink
1bc092b063 refactor(tvix/castore/digest): stop using bytes::Bytes internally
Change-Id: I07a13da0ae4aee4298025fca4345d738f40cfe5a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12757
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Reviewed-by: edef <edef@edef.eu>
Tested-by: BuildkiteCI
2024-11-12 11:09:11 +00:00
Florian Klink
ef3a51b38d docs(tvix): document more components
Change-Id: I0e75445a34d3ee11e535e6948c6d762f4fb15105
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12760
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: Domen Kožar <domen@cachix.org>
Reviewed-by: flokli <flokli@flokli.de>
2024-11-12 09:42:50 +00:00
Vova Kryachko
9d114bf040 feat(nix-daemon): Implement QueryPathInfo and IsValidPath.
Change-Id: Ia601e2eae24a2bc13d8851b2e8ed9d6c1808bb35
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12745
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: Vladimir Kryachko <v.kryachko@gmail.com>
Tested-by: BuildkiteCI
2024-11-12 03:06:54 +00:00
Vova Kryachko
b564ed9d43 feat(nix-daemon): Implement client handler.
This change includes only the basic nix handshake protocol handling and
sets up a client session. The only supported operation at this point is
SetOptions.

Additional operations will be implemented in subsequent cls.

Change-Id: I3eccd9e0ceb270c3865929543c702f1491768852
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12743
Autosubmit: Vladimir Kryachko <v.kryachko@gmail.com>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Reviewed-by: edef <edef@edef.eu>
Reviewed-by: Brian Olsen <me@griff.name>
2024-11-12 02:15:04 +00:00
Florian Klink
72bc4e0270 fix(tvix): use tracing::field::Empty for all indicatif.pb_show
This prevents the field from getting printed to stderr, apparently.

Change-Id: Ia9860e4ff37224003154db88ee5f83103060e626
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12756
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2024-11-12 00:28:32 +00:00
Florian Klink
0c5ad94914 feat(tvix/nar-bridge): make root_nodes_cache_capacity configurable
Allow this to be overridden via the CLI, also getting rid of the unsafe
because this doesn't need to be const anymore.

Change-Id: I5e51b52e42522a21f59ef69628b464477c0764d1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12753
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2024-11-12 00:27:31 +00:00
Florian Klink
85de9b8dab feat(tvix/nar-bridge): avoid unnecessary NAR uploads
When uploading a Store Path to a Nix HTTP Binary Cache, Nix first does a
HEAD request for $outhash.narinfo, and if that's not found, for
`{narhash}.nar[.compression_suffix]`.

If the NAR is already present, only the NARInfo is uploaded.

Even though we don't have a service allowing to globally look up from
NARHash to root node, `root_nodes` in `AppState` at least contains
recently uploaded NARHashes.

If we find it in there, we can prevent Nix unnecessarily uploading NARs
if the same contents have already been recently uploaded.
We also promote this key, chances are high Nix will subsequently upload
a NARInfo referring to this NARHash.

Change-Id: I34e3fd9b334b695abe945e64cd291e30f303c2a2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12752
Tested-by: BuildkiteCI
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Autosubmit: flokli <flokli@flokli.de>
2024-11-12 00:26:30 +00:00
Florian Klink
8400e523ce refactor(tvix/castore/blob): use near/far for CombinedBlobService
Align this naming with CachePathInfoService.

Change-Id: Ib9a0d73b8ca57a93e9fc027ae907fc6ed370842a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12751
Tested-by: BuildkiteCI
Reviewed-by: yuka <yuka@yuka.dev>
2024-11-11 18:46:33 +00:00
Florian Klink
a218f421b2 refactor(tvix/store): move Cache to cache mod
This being in combinators makes it harder to find.

Change-Id: If7984bdbd43f164c670548639bb4846d859f6695
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12750
Reviewed-by: yuka <yuka@yuka.dev>
Tested-by: BuildkiteCI
2024-11-11 18:46:33 +00:00
Florian Klink
a9f453f6da docs(tvix/[ca]store): improve docstrings, remove wildcard imports
Extend the docstrings of `add_default_services`, and add one for
`addrs_to_configs` as well as the module-wide one at
`tvix_store::composition`.

Change-Id: Ie9b449988eb210cd65b19b174094bbe0c4af2fd6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12748
Tested-by: BuildkiteCI
Reviewed-by: yuka <yuka@yuka.dev>
2024-11-11 18:46:33 +00:00
Florian Klink
e71a857ec8 refactor(tvix/[ca]store): rename store composition feature flags
tvix-castore already supports composition without any additional feature
flags, the only thing that can be explicitly enabled is referring to
other stores via an anonymous url. Rename that feature flag to
"xp-composition-url-refs".

tvix-store effectively only controls the CLI surface, so rename this to
"xp-composition-cli".

The "store" in the feature name was dropped, as it's already apparent
from being in the tvix-[ca]store crate.

Change-Id: I1175dc6280cbba4cbcdfb7fd4b35fce713b45fc4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12747
Tested-by: BuildkiteCI
Reviewed-by: yuka <yuka@yuka.dev>
2024-11-11 18:46:33 +00:00
Florian Klink
d505f03e00 refactor(tvix/store/composition): rename 'default' to 'root'
This becomes the root of the composition. `default` implies we can
directly access anything else, which we cannot. `root` makes this more
understandable, and it's all internal only anyways.

Change-Id: I297511bc05a7c32c59510b9d192b40d1bd937b5f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12746
Reviewed-by: yuka <yuka@yuka.dev>
Tested-by: BuildkiteCI
2024-11-11 18:46:33 +00:00
Vova Kryachko
8df919dcf0 refactor(nix-compat): Move serialization machinery into wire.
This groups most `wire` feature gated logic into a single module.
The nix_daemon module will be gated by a feature that adds
nix-compat-derive as a dependency.

All of this is a way to break the crate2nix dependency cycle between
nix-compat and nix-compat-derive(which depends on nix-compat for its
doctests).

Change-Id: I95938a6f280c11967371ff21f8b5a19e6d3d3805
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12761
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2024-11-10 20:54:12 +00:00
Bob van der Linden
cfa4154131 feat(tvix): add instance_name to instrumentation of *Services
Currently it is not possible to distinguish between tracing of the same
*Service type whenever there are multiple of them. Now the instance_name
of ServiceBuilder is passed into the *Service and used in the existing
instrument as the `instance_name` field.

Places that did not already have a instance_name in its context use
`"default"`. In tests I used `"test"`.

Change-Id: Ia20bf2a7bb849a781e370d087ba7ddb3be79f654
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12739
Tested-by: BuildkiteCI
Autosubmit: Bob van der Linden <bobvanderlinden@gmail.com>
Reviewed-by: flokli <flokli@flokli.de>
2024-11-08 20:16:49 +00:00
Vova Kryachko
951d25676b feat(tvix/tracing): Allow configuring additional layers
This will be used by tvix-daemon to write tracing data into the active
client's connection socket.

Change-Id: I8889dd0a638e004ee2c8cb312946b029c9779313
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12734
Tested-by: BuildkiteCI
Autosubmit: Vladimir Kryachko <v.kryachko@gmail.com>
Reviewed-by: flokli <flokli@flokli.de>
2024-11-07 20:34:27 +00:00