Parakeet is a Rust-based Bluesky AppServer aiming to implement most of the functionality required to support the Bluesky client
appview atproto bluesky rust appserver
66
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(index): grpc health checks

Mia 0c4dc291 3d7f9463

+23 -2
+14
Cargo.lock
··· 2580 2580 "tokio", 2581 2581 "tonic", 2582 2582 "tonic-build", 2583 + "tonic-health", 2583 2584 "tracing", 2584 2585 "tracing-subscriber", 2585 2586 ] ··· 3895 3896 "futures-core", 3896 3897 "pin-project-lite", 3897 3898 "tokio", 3899 + "tokio-util", 3898 3900 ] 3899 3901 3900 3902 [[package]] ··· 3999 4001 "prost-types", 4000 4002 "quote", 4001 4003 "syn", 4004 + ] 4005 + 4006 + [[package]] 4007 + name = "tonic-health" 4008 + version = "0.13.1" 4009 + source = "registry+https://github.com/rust-lang/crates.io-index" 4010 + checksum = "cb87334d340313fefa513b6e60794d44a86d5f039b523229c99c323e4e19ca4b" 4011 + dependencies = [ 4012 + "prost", 4013 + "tokio", 4014 + "tokio-stream", 4015 + "tonic", 4002 4016 ] 4003 4017 4004 4018 [[package]]
+2 -1
parakeet-index/Cargo.toml
··· 17 17 serde = { version = "1.0.217", features = ["derive"], optional = true } 18 18 sled = { version = "0.34.7", optional = true } 19 19 tokio = { version = "1.42.0", features = ["full"], optional = true } 20 + tonic-health = { version = "0.13.0", optional = true } 20 21 tracing = { version = "0.1.40", optional = true } 21 22 tracing-subscriber = { version = "0.3.18", optional = true } 22 23 ··· 24 25 tonic-build = "0.13.0" 25 26 26 27 [features] 27 - server = ["dep:eyre", "dep:figment", "dep:itertools", "dep:serde", "dep:sled", "dep:tokio", "dep:tracing", "dep:tracing-subscriber"] 28 + server = ["dep:eyre", "dep:figment", "dep:itertools", "dep:serde", "dep:sled", "dep:tokio", "dep:tonic-health", "dep:tracing", "dep:tracing-subscriber"]
+3 -1
parakeet-index/Dockerfile
··· 1 1 FROM rust:1.85-slim-bookworm AS builder 2 2 WORKDIR /work 3 - RUN apt-get update && apt-get install -y --no-install-recommends libssl-dev protobuf-compiler pkg-config && rm -rf /var/lib/apt/lists/* 3 + RUN apt-get update && apt-get install -y --no-install-recommends wget libssl-dev protobuf-compiler pkg-config && rm -rf /var/lib/apt/lists/* 4 + RUN /bin/bash -c 'wget -qO /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.38/grpc_health_probe-linux-$(uname -m)' 4 5 COPY . . 5 6 WORKDIR /work/parakeet-index 6 7 ENV CARGO_HTTP_TIMEOUT=1 ··· 9 10 FROM debian:bookworm-slim 10 11 RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/* 11 12 COPY --from=builder /work/target/release/parakeet-index /usr/local/bin/parakeet-index 13 + COPY --from=builder /bin/grpc_health_probe /usr/local/bin/grpc_health_probe 12 14 CMD ["parakeet-index"]
+4
parakeet-index/src/main.rs
··· 14 14 let addr = std::net::SocketAddr::new(conf.server.bind_address.parse()?, conf.server.port); 15 15 let state = Arc::new(GlobalState::new(db_root)?); 16 16 17 + let (reporter, health_service) = tonic_health::server::health_reporter(); 18 + reporter.set_serving::<IndexServer<Service>>().await; 19 + 17 20 let service = Service::new(state.clone()); 18 21 Server::builder() 22 + .add_service(health_service) 19 23 .add_service(IndexServer::new(service)) 20 24 .serve(addr) 21 25 .await?;