about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/Cargo.lock14
-rw-r--r--tvix/Cargo.nix53
-rw-r--r--tvix/store/Cargo.toml1
-rw-r--r--tvix/store/src/bin/tvix-store.rs3
4 files changed, 71 insertions, 0 deletions
diff --git a/tvix/Cargo.lock b/tvix/Cargo.lock
index 2c67116cd83c..5d5208b7e2d8 100644
--- a/tvix/Cargo.lock
+++ b/tvix/Cargo.lock
@@ -4527,6 +4527,19 @@ dependencies = [
 ]
 
 [[package]]
+name = "tonic-health"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e1e10e6a96ee08b6ce443487d4368442d328d0e746f3681f81127f7dc41b4955"
+dependencies = [
+ "async-stream",
+ "prost 0.13.1",
+ "tokio",
+ "tokio-stream",
+ "tonic 0.12.1",
+]
+
+[[package]]
 name = "tonic-reflection"
 version = "0.12.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5001,6 +5014,7 @@ dependencies = [
  "toml 0.8.15",
  "tonic 0.12.1",
  "tonic-build 0.12.1",
+ "tonic-health",
  "tonic-reflection",
  "tower",
  "tower-http",
diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix
index 12d111bed17f..64d0adabfdd4 100644
--- a/tvix/Cargo.nix
+++ b/tvix/Cargo.nix
@@ -14489,6 +14489,54 @@ rec {
         };
         resolvedDefaultFeatures = [ "default" "prost" "prost-build" "transport" ];
       };
+      "tonic-health" = rec {
+        crateName = "tonic-health";
+        version = "0.12.1";
+        edition = "2021";
+        sha256 = "0ma93g27szqjh4gniws6wz82ils2hhvd91rl8k7bc27fjrm0xqg1";
+        authors = [
+          "James Nugent <james@jen20.com>"
+        ];
+        dependencies = [
+          {
+            name = "async-stream";
+            packageId = "async-stream";
+          }
+          {
+            name = "prost";
+            packageId = "prost 0.13.1";
+          }
+          {
+            name = "tokio";
+            packageId = "tokio";
+            features = [ "sync" ];
+          }
+          {
+            name = "tokio-stream";
+            packageId = "tokio-stream";
+          }
+          {
+            name = "tonic";
+            packageId = "tonic 0.12.1";
+            usesDefaultFeatures = false;
+            features = [ "codegen" "prost" ];
+          }
+        ];
+        devDependencies = [
+          {
+            name = "tokio";
+            packageId = "tokio";
+            features = [ "rt-multi-thread" "macros" ];
+          }
+          {
+            name = "tokio-stream";
+            packageId = "tokio-stream";
+          }
+        ];
+        features = {
+          "default" = [ "transport" ];
+        };
+      };
       "tonic-reflection" = rec {
         crateName = "tonic-reflection";
         version = "0.12.1";
@@ -16428,6 +16476,11 @@ rec {
             features = [ "tls" "tls-roots" ];
           }
           {
+            name = "tonic-health";
+            packageId = "tonic-health";
+            usesDefaultFeatures = false;
+          }
+          {
             name = "tonic-reflection";
             packageId = "tonic-reflection";
             optional = true;
diff --git a/tvix/store/Cargo.toml b/tvix/store/Cargo.toml
index e70ed0e39674..964fc9be2e1a 100644
--- a/tvix/store/Cargo.toml
+++ b/tvix/store/Cargo.toml
@@ -44,6 +44,7 @@ tracing = "0.1.40"
 tracing-indicatif = "0.3.6"
 hyper-util = "0.1.6"
 toml = { version = "0.8.15", optional = true }
+tonic-health = { version = "0.12.1", default-features = false }
 
 [dependencies.tonic-reflection]
 optional = true
diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs
index 5401f67b3f7e..37e1672c79df 100644
--- a/tvix/store/src/bin/tvix-store.rs
+++ b/tvix/store/src/bin/tvix-store.rs
@@ -178,8 +178,11 @@ async fn run_cli(cli: Cli) -> Result<(), Box<dyn std::error::Error + Send + Sync
                     .map_request(tvix_tracing::propagate::tonic::accept_trace),
             );
 
+            let (_health_reporter, health_service) = tonic_health::server::health_reporter();
+
             #[allow(unused_mut)]
             let mut router = server
+                .add_service(health_service)
                 .add_service(BlobServiceServer::new(GRPCBlobServiceWrapper::new(
                     blob_service,
                 )))