Skip to content

Commit

Permalink
Merge pull request #546 from near/main
Browse files Browse the repository at this point in the history
Prod Release 06/02/24
  • Loading branch information
darunrs authored Feb 6, 2024
2 parents 2872008 + fd64a8c commit 34017d3
Show file tree
Hide file tree
Showing 31 changed files with 1,815 additions and 467 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/target

19 changes: 19 additions & 0 deletions block-streamer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM rust:1.75 AS build
ARG CARGO_BUILD_MODE=release
WORKDIR /tmp/
COPY block-streamer/ block-streamer/
COPY registry/types/ registry/types/
WORKDIR /tmp/block-streamer/
RUN apt update && apt install -yy protobuf-compiler
RUN if [ "$CARGO_BUILD_MODE" = "debug" ]; then \
cargo build --package block-streamer; \
else \
cargo build --release --package block-streamer; \
fi

FROM ubuntu:22.04
ARG CARGO_BUILD_MODE=release
RUN apt update && apt install -yy openssl ca-certificates
USER nobody
COPY --from=build /tmp/block-streamer/target/$CARGO_BUILD_MODE/block-streamer /block-streamer
ENTRYPOINT ["/block-streamer"]
2 changes: 2 additions & 0 deletions block-streamer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ async fn main() -> anyhow::Result<()> {

tracing::info!("Starting Block Streamer Service...");

tracing::info!("Connecting to Redis...");
let redis_client = std::sync::Arc::new(redis::RedisClient::connect(&redis_url).await?);

let aws_config = aws_config::from_env().load().await;
let s3_config = aws_sdk_s3::Config::from(&aws_config);
let s3_client = crate::s3_client::S3Client::new(s3_config.clone());

tracing::info!("Connecting to Delta Lake...");
let delta_lake_client =
std::sync::Arc::new(crate::delta_lake_client::DeltaLakeClient::new(s3_client));

Expand Down
2 changes: 1 addition & 1 deletion block-streamer/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub async fn init(
delta_lake_client: std::sync::Arc<crate::delta_lake_client::DeltaLakeClient>,
lake_s3_config: aws_sdk_s3::Config,
) -> anyhow::Result<()> {
let addr = format!("[::1]:{}", port).parse()?;
let addr = format!("0.0.0.0:{}", port).parse()?;

tracing::info!("Starting RPC server at {}", addr);

Expand Down
Loading

0 comments on commit 34017d3

Please sign in to comment.