Skip to content

Commit 08017f8

Browse files
author
cyberfly
committed
fix
1 parent d1371aa commit 08017f8

2 files changed

Lines changed: 25 additions & 21 deletions

File tree

.github/workflows/docker-build-push.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ env:
1313
BACKEND_IMAGE_NAME: cyberfly/cyberfly_node
1414

1515
jobs:
16-
# =========================
17-
# Build MNN (NO OpenMP)
18-
# =========================
16+
# ==================================================
17+
# Build MNN (NO OpenMP, bookworm glibc)
18+
# ==================================================
1919
build-mnn:
2020
runs-on: ubuntu-latest
21-
container: ubuntu:22.04
21+
container: debian:bookworm-slim
2222

2323
steps:
24-
- name: Install MNN build deps
24+
- name: Install MNN build dependencies
2525
run: |
2626
apt-get update
2727
apt-get install -y \
@@ -48,13 +48,13 @@ jobs:
4848
name: libmnn
4949
path: /out/libMNN.so
5050

51-
# =========================
52-
# Build Rust binaries
53-
# =========================
51+
# ==================================================
52+
# Build Rust binaries (bookworm glibc)
53+
# ==================================================
5454
build-rust-binaries:
5555
needs: build-mnn
5656
runs-on: ubuntu-latest
57-
container: ubuntu:22.04
57+
container: debian:bookworm-slim
5858

5959
strategy:
6060
matrix:
@@ -67,11 +67,11 @@ jobs:
6767
steps:
6868
- uses: actions/checkout@v4
6969

70-
- name: Install Rust deps
70+
- name: Install Rust build deps
7171
run: |
7272
apt-get update
7373
apt-get install -y \
74-
build-essential curl git cmake clang pkg-config \
74+
build-essential curl clang pkg-config \
7575
libssl-dev \
7676
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
7777
@@ -105,9 +105,9 @@ jobs:
105105
name: cyberfly-rust-node-${{ matrix.arch }}
106106
path: target/${{ matrix.target }}/release/cyberfly-rust-node
107107

108-
# =========================
109-
# Build & Push Docker image
110-
# =========================
108+
# ==================================================
109+
# Build & Push Docker image (bookworm-slim runtime)
110+
# ==================================================
111111
build-and-push:
112112
needs: [build-mnn, build-rust-binaries]
113113
runs-on: ubuntu-latest
@@ -123,15 +123,18 @@ jobs:
123123
- uses: actions/download-artifact@v4
124124
with:
125125
name: cyberfly-rust-node-amd64
126-
path: .
126+
path: ./bin-amd64
127127

128128
- uses: actions/download-artifact@v4
129129
with:
130130
name: cyberfly-rust-node-arm64
131-
path: .
131+
path: ./bin-arm64
132132

133-
- name: Verify artifacts
133+
- name: Prepare Docker build context
134134
run: |
135+
mv bin-amd64/cyberfly-rust-node cyberfly-rust-node-amd64
136+
mv bin-arm64/cyberfly-rust-node cyberfly-rust-node-arm64
137+
chmod +x cyberfly-rust-node-*
135138
ls -lah libMNN.so cyberfly-rust-node-amd64 cyberfly-rust-node-arm64
136139
137140
- uses: docker/setup-qemu-action@v3

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
FROM ubuntu:22.04
1+
FROM debian:bookworm-slim
22

33
RUN apt-get update && \
44
apt-get install -y --no-install-recommends \
55
ca-certificates \
66
libssl3 \
77
libstdc++6 \
8+
libgomp1 \
89
&& rm -rf /var/lib/apt/lists/*
910

1011
WORKDIR /app
1112
RUN mkdir -p /app/data/iroh/models
1213

13-
# Copy Rust binary
14+
# Copy Rust binary (selected by Buildx)
1415
ARG TARGETARCH
1516
COPY cyberfly-rust-node-${TARGETARCH} /app/cyberfly-rust-node
1617
COPY schema.graphql /app/schema.graphql
1718

18-
# 🔥 Copy MNN built in CI (NO OpenMP)
19+
# 🔥 Copy MNN built WITHOUT OpenMP (from CI)
1920
COPY libMNN.so /usr/local/lib/libMNN.so
2021
ENV LD_LIBRARY_PATH=/usr/local/lib
2122

2223
RUN chmod +x /app/cyberfly-rust-node
2324

24-
# Runtime safety
25+
# ===== Runtime safety =====
2526
ENV MNN_BACKEND=cpu
2627
ENV MNN_DISABLE_GPU=1
2728
ENV MNN_USE_OPENMP=0

0 commit comments

Comments
 (0)