File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8282 cargo build \
8383 --release \
8484 --target ${{ matrix.target }} \
85- --features jemalloc \
8685 -j$(nproc)
8786
8887 - name : Strip binary
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ RUN apt-get update && \
99 && rm -rf /var/lib/apt/lists/*
1010
1111WORKDIR /app
12-
1312RUN mkdir -p /app/data/iroh/models
1413
1514ARG TARGETARCH
@@ -28,8 +27,9 @@ ENV KMP_AFFINITY=disabled
2827ENV GOMP_CPU_AFFINITY=0
2928
3029ENV MALLOC_ARENA_MAX=1
30+ ENV LD_PRELOAD=
31+
3132ENV SLED_CACHE_MB=256
3233
3334EXPOSE 31001 31002 31003 31006
34-
3535ENTRYPOINT ["/app/docker-entrypoint.sh" ]
Original file line number Diff line number Diff line change 1+ FROM ubuntu:22.04
2+
3+ # Install build dependencies
4+ RUN apt-get update && apt-get install -y \
5+ build-essential \
6+ curl \
7+ pkg-config \
8+ libssl-dev \
9+ cmake \
10+ clang \
11+ ca-certificates \
12+ libgomp1 \
13+ libstdc++6 \
14+ && rm -rf /var/lib/apt/lists/*
15+
16+ # Install Rust
17+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
18+ ENV PATH="/root/.cargo/bin:${PATH}"
19+
20+ WORKDIR /build
21+
22+ # Copy source code
23+ COPY Cargo.toml ./
24+ COPY src ./src
25+ COPY schema.graphql ./
26+
27+ # Build release binary
28+ RUN cargo build --release
29+
30+ # Create runtime directory
31+ RUN mkdir -p /app/data/iroh/models
32+
33+ # Copy binary to app directory
34+ RUN cp target/release/cyberfly-rust-node /app/cyberfly-rust-node && \
35+ cp schema.graphql /app/schema.graphql && \
36+ chmod +x /app/cyberfly-rust-node
37+
38+ WORKDIR /app
39+
40+ # Create entrypoint script
41+ RUN printf '#!/bin/sh\nset -e\nmkdir -p /app/data/iroh/models\nexec /app/cyberfly-rust-node "$@"\n' > /app/docker-entrypoint.sh && \
42+ chmod +x /app/docker-entrypoint.sh
43+
44+ # MNN configuration
45+ ENV MNN_BACKEND=cpu
46+ ENV MNN_DISABLE_GPU=1
47+
48+ # OpenMP configuration
49+ ENV OMP_NUM_THREADS=1
50+ ENV OMP_WAIT_POLICY=PASSIVE
51+ ENV KMP_AFFINITY=disabled
52+ ENV GOMP_CPU_AFFINITY=0
53+
54+ # Memory configuration
55+ ENV MALLOC_ARENA_MAX=1
56+ ENV LD_PRELOAD=
57+ ENV SLED_CACHE_MB=256
58+
59+ EXPOSE 31001 31002 31003 31006
60+
61+ ENTRYPOINT ["/app/docker-entrypoint.sh"]
Original file line number Diff line number Diff line change @@ -18,11 +18,6 @@ mod storage;
1818mod sync; // Data synchronization with CRDT
1919mod inference; // AI inference execution
2020
21- // Use jemalloc on Linux for better multi-threaded allocation performance
22- #[ cfg( all( target_os = "linux" , feature = "jemalloc" ) ) ]
23- #[ global_allocator]
24- static GLOBAL : tikv_jemallocator:: Jemalloc = tikv_jemallocator:: Jemalloc ;
25-
2621use anyhow:: Result ;
2722use axum:: { routing:: get, Router } ;
2823use iroh:: discovery:: pkarr:: dht:: DhtDiscovery ;
@@ -92,9 +87,6 @@ async fn main() -> Result<()> {
9287 )
9388 . init ( ) ;
9489
95- #[ cfg( all( target_os = "linux" , feature = "jemalloc" ) ) ]
96- tracing:: info!( "Using jemalloc allocator for improved performance" ) ;
97-
9890 tracing:: info!( "Starting decentralized database node..." ) ;
9991
10092 // Fetch and set node region on startup (same as JS implementation)
You can’t perform that action at this time.
0 commit comments