From d445e606f56f8da7045576b4eef5ab057223c45b Mon Sep 17 00:00:00 2001 From: Zhonghu Xu Date: Sat, 12 Oct 2024 16:11:54 +0800 Subject: [PATCH 1/2] Fix github action arm image built: without this the kmesh-daemon built is x86-64 arch Signed-off-by: Zhonghu Xu --- .github/workflows/release-master.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-master.yaml b/.github/workflows/release-master.yaml index 74eb73448..a33c14b28 100644 --- a/.github/workflows/release-master.yaml +++ b/.github/workflows/release-master.yaml @@ -43,19 +43,15 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - - name: Build - run: | - ./kmesh_compile.sh - - name: Push by digest + - name: Build and Push by digest id: build uses: docker/build-push-action@v6 with: context: . platforms: ${{ matrix.platform }} labels: ${{ steps.meta.outputs.labels }} - file: build/docker/dockerfile + file: build/docker/github.dockerfile tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=${{ env.REGISTRY_IMAGE }},name-canonical=true,push=true From 6884bde44f9a78fce4f5018b0ecd973d3115e948 Mon Sep 17 00:00:00 2001 From: Zhonghu Xu Date: Sat, 12 Oct 2024 16:13:40 +0800 Subject: [PATCH 2/2] Fix github action arm image built: without this the kmesh-daemon built is x86-64 arch Signed-off-by: Zhonghu Xu --- build/docker/github.dockerfile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 build/docker/github.dockerfile diff --git a/build/docker/github.dockerfile b/build/docker/github.dockerfile new file mode 100644 index 000000000..ed5f21160 --- /dev/null +++ b/build/docker/github.dockerfile @@ -0,0 +1,26 @@ +FROM ghcr.io/kmesh-net/kmesh-build:latest AS builder +COPY . /kmesh +WORKDIR /kmesh +RUN ./build.sh && ./build.sh -i +# Copy the kmesh.ko to /kmesh +RUN if [ -f /lib/modules/kmesh/kmesh.ko ]; then cp /lib/modules/kmesh/kmesh.ko /kmesh; fi + +FROM openeuler/openeuler:23.09 +WORKDIR /kmesh +RUN \ + --mount=type=cache,target=/var/cache/dnf \ + yum install -y kmod util-linux iptables && \ + mkdir -p /usr/share/oncn-mda && \ + mkdir -p /etc/oncn-mda +COPY --from=builder /usr/lib64/libbpf.so* /usr/lib64/ +COPY --from=builder /usr/lib64/libprotobuf-c.so* /usr/lib64/ +COPY --from=builder /usr/lib64/libkmesh_api_v2_c.so /usr/lib64/ +COPY --from=builder /usr/lib64/libkmesh_deserial.so /usr/lib64/ +COPY --from=builder /usr/lib64/libboundscheck.so /usr/lib64/ +COPY --from=builder /kmesh/*.ko /kmesh +COPY --from=builder /kmesh/oncn-mda/build/ebpf_src/CMakeFiles/sock_redirect.dir/sock_redirect.c.o /usr/share/oncn-mda/ +COPY --from=builder /kmesh/oncn-mda/etc/oncn-mda.conf /usr/share/oncn-mda/ +COPY --from=builder /usr/bin/kmesh-daemon /usr/bin/ +COPY --from=builder /usr/bin/kmesh-cni /usr/bin/ +COPY --from=builder /usr/bin/mdacore /usr/bin/ +COPY build/docker/start_kmesh.sh /kmesh \ No newline at end of file