diff --git a/rust/otap-dataflow/Cargo.toml b/rust/otap-dataflow/Cargo.toml index 1df533859..308526965 100644 --- a/rust/otap-dataflow/Cargo.toml +++ b/rust/otap-dataflow/Cargo.toml @@ -85,7 +85,7 @@ miette = { version="7.6.0", features = ["fancy"] } mimalloc-rust = "0.2.1" nix = { version = "0.30.1", features = ["process", "signal"] } num_enum = "0.7" -object_store = "0.12.3" +object_store = {version = "0.12.3", default-features = false} once_cell = "1.20.2" opentelemetry = "0.31.0" opentelemetry-proto = { version = "0.31", default-features = false, features = ["gen-tonic-messages", "logs"]} #TODO - use it from submodule instead of crate(?) @@ -150,10 +150,10 @@ zip = "=4.2.0" byte-unit = "5.2.0" # Azure Monnitor Exporter -azure_identity = "0.30.0" +azure_core = {version = "0.30.1", default-features = false } +azure_identity = {version = "0.30.0", default-features = false } flate2 = "1.1.5" -reqwest = "0.12.24" -azure_core = "0.30.1" +reqwest = { version = "0.12.24", default-features = false } time = "0.3.44" wiremock = "0.6.5" diff --git a/rust/otap-dataflow/Dockerfile b/rust/otap-dataflow/Dockerfile index 612eff847..672a6e795 100644 --- a/rust/otap-dataflow/Dockerfile +++ b/rust/otap-dataflow/Dockerfile @@ -22,12 +22,27 @@ COPY --from=otel-arrow /proto/opentelemetry-proto /build/proto/opentelemetry-pro COPY . /build/rust/dataflow/. +# RUSTFLAGS can be used to pass argument to rustc e.g. +# --build-arg RUSTFLAGS="-C target-feature=-gfni" +ARG RUSTFLAGS="-C target-cpu=native" +ENV RUSTFLAGS=${RUSTFLAGS} + +# These are used to enable features and are passed to carg's --features argument +# e.g. --build-arg FEATURES="azure,quiver-persistence" +ARG FEATURES +ENV FEATURES=${FEATURES} + # Build dataflow engine RUN ./cross-arch-build.sh # The runtime image FROM docker.io/alpine:3.22@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 LABEL maintainer="The OpenTelemetry Authors" + +# Passing --build-arg BUILD=1 adds additional debugging features to the image. +ARG DEBUG="0" +RUN if [ "$DEBUG" = "1" ]; then apk add --no-cache gdb; fi + RUN addgroup dataflow \ && adduser \ --ingroup dataflow \ diff --git a/rust/otap-dataflow/crates/otap/Cargo.toml b/rust/otap-dataflow/crates/otap/Cargo.toml index c9aab1221..5aed531a1 100644 --- a/rust/otap-dataflow/crates/otap/Cargo.toml +++ b/rust/otap-dataflow/crates/otap/Cargo.toml @@ -22,7 +22,7 @@ futures-timer.workspace = true http.workspace = true humantime-serde.workspace = true log.workspace = true -object_store.workspace = true +object_store = {workspace = true, features = ["fs"]} parquet.workspace = true thiserror = { workspace = true } serde_with = { workspace = true } @@ -70,8 +70,8 @@ geneva-uploader = { version = "0.3.0", optional = true } # Azure Monitor Exporter dependencies azure_identity = { workspace = true, optional = true } flate2 = { workspace = true, optional = true } -reqwest = { workspace = true, optional = true } -azure_core = { workspace = true, optional = true } +reqwest = { workspace = true, optional = true, features = ["rustls-tls"] } +azure_core = { workspace = true, optional = true, features = ["reqwest"] } # OpenTelemetry proto with tonic feature enabled opentelemetry-proto = { workspace = true, optional = true } diff --git a/rust/otap-dataflow/cross-arch-build.sh b/rust/otap-dataflow/cross-arch-build.sh index b1da50a7c..74b78dd38 100755 --- a/rust/otap-dataflow/cross-arch-build.sh +++ b/rust/otap-dataflow/cross-arch-build.sh @@ -16,5 +16,5 @@ else fi rustup target add "${RUST_TARGET}" -cargo build --release --target="${RUST_TARGET}" -cp "target/${RUST_TARGET}/release/df_engine" . \ No newline at end of file +cargo build --release --features "$FEATURES" --target="${RUST_TARGET}" +cp "target/${RUST_TARGET}/release/df_engine" .