kmesh-net / kmesh

High Performance ServiceMesh Data Plane Based on Programmable Kernel
https://kmesh.net
Apache License 2.0
362 stars 46 forks source link

Make build very slow #408

Closed Okabe-Rintarou-0 closed 4 weeks ago

Okabe-Rintarou-0 commented 1 month ago

Please provide an in-depth description of the question you have: Make build very slow image What do you think about this question?:

Environment: Ubuntu 22.04

hzxuzhonghu commented 1 month ago

what is it doing, since https://github.com/kmesh-net/kmesh/pull/382 it is much quicker for me

Okabe-Rintarou-0 commented 1 month ago

I switch to a new Ubuntu22.04 cloud server.

image each item takes a long time, is it due to network problem?

Not sure which part of build process it belongs to.

LiZhenCheng9527 commented 1 month ago

The 0.0B/s in the graph should be the result of the slow network rate. Perhaps you could docker pull ghcr.io/kmesh-net/kmesh-build-x86:latest. Once the image has been downloaded, then try to compile Kmesh

Okabe-Rintarou-0 commented 1 month ago

docker pull ghcr.io/kmesh-net/kmesh-build-x86:latest

Already pulled: root@test:~/kmesh# docker pull ghcr.io/kmesh-net/kmesh-build-x86:latest latest: Pulling from kmesh-net/kmesh-build-x86 Digest: sha256:0274dfb7dee34054bc3ca15c6842dc2d34dbec57252823043ffd9709020a8052 Status: Image is up to date for ghcr.io/kmesh-net/kmesh-build-x86:latest ghcr.io/kmesh-net/kmesh-build-x86:latest

Okabe-Rintarou-0 commented 1 month ago

Seems to be stuck here:

root@test:~/kmesh# bash -x ./kmesh_compile.sh 
+ prepare
+ local arch
++ get_arch
+++ arch
++ '[' x86_64 == x86_64 ']'
++ echo x86
+ arch=x86
+ docker pull ghcr.io/kmesh-net/kmesh-build-x86:latest
latest: Pulling from kmesh-net/kmesh-build-x86
Digest: sha256:0274dfb7dee34054bc3ca15c6842dc2d34dbec57252823043ffd9709020a8052
Status: Image is up to date for ghcr.io/kmesh-net/kmesh-build-x86:latest
ghcr.io/kmesh-net/kmesh-build-x86:latest
++ run_docker_container
++ local arch
+++ get_arch
++++ arch
+++ '[' x86_64 == x86_64 ']'
+++ echo x86
++ arch=x86
++ local container_id
++++ pwd
++++ go env GOCACHE
++++ go env GOMODCACHE
+++ docker run -itd --privileged=true -v /usr/src:/usr/src -v /usr/include/linux/bpf.h:/kmesh/config/linux-bpf.h -v /etc/cni/net.d:/etc/cni/net.d -v /opt/cni/bin:/opt/cni/bin -v /mnt:/mnt -v /sys/fs/bpf:/sys/fs/bpf -v /lib/modules:/lib/modules -v /root/kmesh:/kmesh -v /root/.cache/go-build:/root/.cache/go-build -v /root/go/pkg/mod:/go/pkg/mod --name kmesh-build ghcr.io/kmesh-net/kmesh-build-x86:latest
++ container_id=d42d2a1e85198f07988ca0d3dbd8b930a791f515367aceb4b2a820ccf809fed5
++ echo d42d2a1e85198f07988ca0d3dbd8b930a791f515367aceb4b2a820ccf809fed5
+ container_id=d42d2a1e85198f07988ca0d3dbd8b930a791f515367aceb4b2a820ccf809fed5
+ build_kmesh d42d2a1e85198f07988ca0d3dbd8b930a791f515367aceb4b2a820ccf809fed5
+ local container_id=d42d2a1e85198f07988ca0d3dbd8b930a791f515367aceb4b2a820ccf809fed5
+ docker exec d42d2a1e85198f07988ca0d3dbd8b930a791f515367aceb4b2a820ccf809fed5 git config --global --add safe.directory /kmesh
+ docker exec d42d2a1e85198f07988ca0d3dbd8b930a791f515367aceb4b2a820ccf809fed5 sh /kmesh/build.sh
Okabe-Rintarou-0 commented 1 month ago

directly running build.sh is fast.

BTW, my server is a brand new one. I need a higher kernel version so I create a new Ubuntu 22.04 server.

LiZhenCheng9527 commented 1 month ago

This is unrelated to the kernel version. I'm also running Ubuntu 22.04.

Okabe-Rintarou-0 commented 1 month ago

Stuck here image

hzxuzhonghu commented 1 month ago

Seems your network is slow, maybe try using make docker

LiZhenCheng9527 commented 1 month ago

image Install dependency pkg. If you're ubuntu, why isn't it installed use apt.

Okabe-Rintarou-0 commented 1 month ago

image Install dependency pkg. If you're ubuntu, why isn't it installed use apt.

It's in kmesh-build docker. image

bfforever commented 1 month ago

maybe could try add one line before yum install package? which is sed -i 's#http://repo.openeuler.org#https://mirrors.tuna.tsinghua.edu.cn/openeuler#g' /etc/yum.repos.d/openEuler.repo

Okabe-Rintarou-0 commented 1 month ago

It's network problem. Seems that inside container i cannot access internet, wired.

Okabe-Rintarou-0 commented 4 weeks ago

Problem solved, it's because the nic mtu not compatible with docker: https://www.zeng.dev/post/2022-the-docker-mtu-problem/