Skip to content

Commit

Permalink
fix: subs event derive and remove upx
Browse files Browse the repository at this point in the history
  • Loading branch information
leon3s committed Dec 30, 2023
1 parent c470038 commit 32bb4f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# stage 1 - Setup cargo-chef
FROM --platform=$BUILDPLATFORM rust:1.74.0-alpine3.17 as planner
FROM --platform=$BUILDPLATFORM rust:1.75.0-alpine3.19 as planner

WORKDIR /app
RUN apk add gcc g++ make
Expand All @@ -13,7 +13,7 @@ COPY ./bin/metrsd/Cargo.toml ./bin/metrsd/Cargo.toml
RUN cargo chef prepare --recipe-path recipe.json --bin ./bin/metrsd

# stage 2 - Cook our dependencies
FROM --platform=$BUILDPLATFORM rust:1.74.0-alpine3.17 as cacher
FROM --platform=$BUILDPLATFORM rust:1.75.0-alpine3.19 as cacher

WORKDIR /app
COPY --from=planner /usr/local/cargo/bin/cargo-chef /usr/local/cargo/bin/cargo-chef
Expand All @@ -24,7 +24,7 @@ RUN export ARCH=$(uname -m) \
&& cargo chef cook --release --target=$ARCH-unknown-linux-musl --recipe-path recipe.json --bin metrsd

# stage 3 - Build our project
FROM --platform=$BUILDPLATFORM rust:1.74.0-alpine3.17 as builder
FROM --platform=$BUILDPLATFORM rust:1.75.0-alpine3.19 as builder

## Build our metrs daemon binary
WORKDIR /app
Expand All @@ -40,7 +40,6 @@ RUN export ARCH=$(uname -m) \

## Compress the binary
RUN export ARCH=$(uname -m) \
&& upx --lzma --best /app/target/$ARCH-unknown-linux-musl/release/metrsd \
&& cp /app/target/$ARCH-unknown-linux-musl/release/metrsd /bin/metrsd

# stage 4 - Create runtime image
Expand Down
5 changes: 3 additions & 2 deletions crates/metrs_stubs/src/event.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::{CpuInfo, DiskInfo, MemoryInfo, NetworkInfo};

#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "PascalCase")]
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "PascalCase"))]
pub struct MetrsdEvent {
pub memory: MemoryInfo,
pub cpus: Vec<CpuInfo>,
Expand Down

0 comments on commit 32bb4f9

Please sign in to comment.