Skip to content

Commit

Permalink
rename to stats service; docker
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxxu committed Jan 11, 2022
1 parent ff1dd7c commit 05da70e
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 20 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,12 @@ jobs:
push: true
tags: fluxxu/flo-observer:${{ github.sha }},fluxxu/flo-observer:latest
file: './build/observer.Dockerfile'
context: './build'

- name: Build and push - flo-stats
uses: docker/build-push-action@v2
with:
push: true
tags: fluxxu/flo-stats:${{ github.sha }},fluxxu/flo-stats:latest
file: './build/stats.Dockerfile'
context: './build'
31 changes: 16 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ members = [
"binaries/flo-worker",
"binaries/flo-worker-ui",
"binaries/flo-ping",
"binaries/flo-live-service",
"binaries/flo-stats-service",

"deps/flo-grpc"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "flo-live-service"
name = "flo-stats-service"
version = "0.1.0"
edition = "2021"

[dependencies]
flo-constants = { path = "../../crates/constants" }
flo-observer-edge = { path = "../../crates/observer-edge" }
flo-log-subscriber = { path = "../../crates/log-subscriber" }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
{
dotenv::dotenv()?;
flo_log_subscriber::init_env_override(
"flo_live_service=debug,flo_observer_edge=debug,flo_observer=debug",
"flo_stats_service=debug,flo_observer_edge=debug,flo_observer=debug",
);
}

Expand All @@ -48,9 +48,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.route("/ws", GraphQLSubscription::new(schema.clone()))
.layer(AddExtensionLayer::new(schema));

println!("Playground: http://localhost:8080");
let bind = format!("0.0.0.0:{}", flo_constants::OBSERVER_GRAPHQL_PORT);

tracing::info!("running at {}", bind);

Server::bind(&"0.0.0.0:8080".parse().unwrap())
Server::bind(&bind.parse().unwrap())
.serve(app.into_make_service())
.await?;
Ok(())
Expand Down
23 changes: 23 additions & 0 deletions build/stats.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM debian:stable

WORKDIR /flo

RUN apt-get update && \
apt-get install \
ca-certificates \
libssl-dev \
-qqy \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

ARG IMAGE_BUILD_DATE=2016-01-01
ENV IMAGE_BUILD_DATE $IMAGE_BUILD_DATE

ENV RUST_BACKTRACE 1

EXPOSE 3557/tcp
EXPOSE 3558/tcp

COPY release/flo-stats-service flo-stats-service

CMD ["/flo/flo-obsestatsrver-service"]
1 change: 1 addition & 0 deletions crates/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ pub const MIN_FLO_VERSION: version::Version = Version {
};
pub const OBSERVER_GRPC_PORT: u16 = 3556;
pub const OBSERVER_SOCKET_PORT: u16 = 3557;
pub const OBSERVER_GRAPHQL_PORT: u16 = 3558;

0 comments on commit 05da70e

Please sign in to comment.