Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
b496bbd459
!29 add dockerfile for Kmesh
From: @weli1 
Reviewed-by: @supercharge 
Signed-off-by: @supercharge
2024-11-25 06:18:20 +00:00
weli-l
5178f09b8b add dockerfile for Kmesh
Signed-off-by: weli-l <1289113577@qq.com>
2024-11-25 11:35:50 +08:00
openeuler-ci-bot
6722a7fc14
!22 Init Kmesh v0.4.1
From: @weli1 
Reviewed-by: @supercharge 
Signed-off-by: @supercharge
2024-09-05 06:46:24 +00:00
weli-l
e5a37b418c Init Kmesh v0.4.1 2024-09-04 09:19:51 +08:00
openeuler-ci-bot
a08b5532a0
!13 [sync] PR-11: update spec for file permission and add oncn-mda file
From: @openeuler-sync-bot 
Reviewed-by: @supercharge 
Signed-off-by: @supercharge
2023-08-23 08:50:35 +00:00
kwb0523
d14bd3b53d update spec for file permission and add oncn-mda file
(cherry picked from commit fa7bc946cfdcddbbd86d57a0905adb6316899cdf)
2023-08-23 15:19:48 +08:00
openeuler-ci-bot
8ecda4fe42
!12 [sync] PR-10: update 0.3.0 base src
From: @openeuler-sync-bot 
Reviewed-by: @supercharge 
Signed-off-by: @supercharge
2023-08-23 07:18:24 +00:00
kwb0523
c303b648e8 update 0.3.0 base src
(cherry picked from commit 20768249404441b5e0b6a33789e055e72cdf2391)
2023-08-22 09:40:09 +08:00
openeuler-ci-bot
1d78b6bf51
!9 init package for master branch
From: @kwb0523 
Reviewed-by: @supercharge 
Signed-off-by: @supercharge
2023-08-02 03:39:53 +00:00
kwb0523
472702dd33 init package for master branch 2023-08-02 10:16:12 +08:00
8 changed files with 1245 additions and 73 deletions

File diff suppressed because it is too large Load Diff

8
Kmesh.dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM openeuler/openeuler:24.03
WORKDIR /kmesh
RUN \
yum install -y kmod util-linux iptables Kmesh && \
mkdir -p /usr/share/oncn-mda && \
mkdir -p /etc/oncn-mda

138
Kmesh.spec Normal file
View File

@ -0,0 +1,138 @@
%global codepath kmesh
Name: Kmesh
Version: 0.4.1
Release: 2
Summary: %{name} is a eBPF-based service mesh kernel solution
License: ASL 2.0 and GPL-2.0
URL: https://github.com/kmesh-net
Source0: https://github.com/kmesh-net/kmesh/archive/refs/tags/v%{version}.tar.gz
BuildRequires: cmake make pkgconf dracut
BuildRequires: protobuf protobuf-c protobuf-c-devel
BuildRequires: golang >= 1.21.4
BuildRequires: clang >= 10.0.1 llvm >= 10.0.1
BuildRequires: libbpf-devel kernel-devel >= 5.10
BuildRequires: libboundscheck
BuildRequires: uname-build-checks
Requires: bpftool
Requires: libbpf
Requires: libboundscheck
Patch0001: Downgrade-go-version-to-v1.21.4.patch
Patch0002: Remove-useless-tag-in-Makefile.patch
Patch0003: Support-uid-gid.patch
%description
%{name} is a eBPF-based service mesh kernel solution.
ExclusiveArch: x86_64 aarch64
%prep
%autosetup -n %{codepath}-%{version} -p1
%build
cd %{_builddir}/%{codepath}-%{version}
export GOPROXY=https://repo.huaweicloud.com/repository/goproxy/
export GONOSUMDB=*
export GO111MODULE=on
go mod tidy
./build.sh -b
%install
mkdir -p %{buildroot}%{_bindir}
install %{_builddir}/%{codepath}-%{version}/kmesh-daemon %{buildroot}%{_bindir}
install %{_builddir}/%{codepath}-%{version}/kmesh-cni %{buildroot}%{_bindir}
install %{_builddir}/%{codepath}-%{version}/build/kmesh-start-pre.sh %{buildroot}%{_bindir}
install %{_builddir}/%{codepath}-%{version}/build/kmesh-stop-post.sh %{buildroot}%{_bindir}
install %{_builddir}/%{codepath}-%{version}/oncn-mda/deploy/mdacore %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datarootdir}/oncn-mda
install %{_builddir}/%{codepath}-%{version}/oncn-mda/build/ebpf_src/CMakeFiles/sock_ops.dir/sock_ops.c.o %{buildroot}%{_datarootdir}/oncn-mda
install %{_builddir}/%{codepath}-%{version}/oncn-mda/build/ebpf_src/CMakeFiles/sock_redirect.dir/sock_redirect.c.o %{buildroot}%{_datarootdir}/oncn-mda
mkdir -p %{buildroot}/kmesh
install %{_builddir}/%{codepath}-%{version}/build/docker/start_kmesh.sh %{buildroot}/kmesh
mkdir -p %{buildroot}/usr/lib64
install %{_builddir}/%{codepath}-%{version}/bpf/deserialization_to_bpf_map/libkmesh_deserial.so %{buildroot}/usr/lib64
install %{_builddir}/%{codepath}-%{version}/api/v2-c/libkmesh_api_v2_c.so %{buildroot}/usr/lib64
mkdir -p %{buildroot}/lib/modules/kmesh
if [ -f "%{_builddir}/%{codepath}-%{version}/kernel/ko/kmesh.ko" ]; then
install %{_builddir}/%{codepath}-%{version}/kernel/ko/kmesh.ko %{buildroot}/lib/modules/kmesh
fi
mkdir -p %{buildroot}/%{_sysconfdir}/oncn-mda
install %{_builddir}/%{codepath}-%{version}/oncn-mda/etc/oncn-mda.conf %{buildroot}/%{_sysconfdir}/oncn-mda/
mkdir -p %{buildroot}/usr/lib/systemd/system
install %{_builddir}/%{codepath}-%{version}/build/kmesh.service %{buildroot}/usr/lib/systemd/system
%check
cd %{_builddir}/%{codepath}-%{version}
#make
#make test
%post
echo "installing ..."
if [ -f "/lib/modules/kmesh/kmesh.ko" ]; then
ln -sf /lib/modules/kmesh/kmesh.ko /lib/modules/`uname -r`
depmod -a
fi
%preun
if [ "$1" == "1" ]; then
systemctl status kmesh | grep "active (running)"
if [ "$?" == "0" ]; then
systemctl restart kmesh.service
fi
else
systemctl stop kmesh.service
fi
%postun
if [ "$1" -ne "1" ]; then
rm -rf /lib/modules/`uname -r`/kmesh.ko
fi
depmod -a
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%attr(0500,root,root) %{_bindir}/kmesh-daemon
%attr(0500,root,root) %{_bindir}/kmesh-cni
%attr(0500,root,root) %{_bindir}/mdacore
%attr(0500,root,root) /usr/lib64/libkmesh_deserial.so
%attr(0500,root,root) /usr/lib64/libkmesh_api_v2_c.so
%attr(0500,root,root) %dir /usr/share/oncn-mda
%attr(0500,root,root) /usr/share/oncn-mda/sock_ops.c.o
%attr(0500,root,root) /usr/share/oncn-mda/sock_redirect.c.o
%attr(0700,root,root) %dir %{_sysconfdir}/oncn-mda
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/oncn-mda/oncn-mda.conf
%config(noreplace) %attr(0600,root,root) /usr/lib/systemd/system/kmesh.service
%attr(0500,root,root) /usr/bin/kmesh-start-pre.sh
%attr(0500,root,root) /usr/bin/kmesh-stop-post.sh
%attr(0500,root,root) /kmesh/start_kmesh.sh
%changelog
* Mon Nov 25 2024 weli-l<1289113577@qq.com> - 0.4.1-2
- add dockerfile for Kmesh
* Mon Sep 02 2024 weli-l<1289113577@qq.com> - 0.4.1-1
- init Kmesh 0.4.1
* Fri Aug 18 2023 JofDiamonds <kwb0523@163.com> - 0.3.0-3
- update spec
* Thu Aug 17 2023 JofDiamonds <kwb0523@163.com> - 0.3.0-2
- update package
* Mon Jul 31 2023 JofDiamonds <kwb0523@163.com> - 0.3.0-1
- init package

View File

@ -1,36 +0,0 @@
# Kmesh
#### Description
Kmesh (kernel mesh) is a data plane software for service grids. It is dedicated to providing infrastructure for service communication and service governance for cloud applications, provides better latency and noise floor performance.
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -1,37 +0,0 @@
# Kmesh
#### 介绍
Kmesh (kernel mesh) is a data plane software for service grids. It is dedicated to providing infrastructure for service communication and service governance for cloud applications, provides better latency and noise floor performance.
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -0,0 +1,31 @@
From d568d16d96230eedc20d3c75da75e41788f8728b Mon Sep 17 00:00:00 2001
From: weli-l <1289113577@qq.com>
Date: Thu, 11 Jul 2024 14:40:52 +0800
Subject: [PATCH] Remove useless tag in Makefile
---
Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 067208b..c65eae9 100644
--- a/Makefile
+++ b/Makefile
@@ -61,10 +61,10 @@ ifeq ($(TARGET),)
endif
# If tag not explicitly set, default to the git sha.
-TAG ?= $(shell git rev-parse --verify HEAD)
-ifeq ($(TAG),)
- $(error "TAG cannot be empty")
-endif
+#TAG ?= $(shell git rev-parse --verify HEAD)
+#ifeq ($(TAG),)
+# $(error "TAG cannot be empty")
+#endif
TMP_FILES := bpf/kmesh/bpf2go/bpf2go.go \
config/kmesh_marcos_def.h \
--
2.34.1

41
Support-uid-gid.patch Normal file
View File

@ -0,0 +1,41 @@
From fe50047ddfc1f1ff775f62b7b8aa9f5fcf396c40 Mon Sep 17 00:00:00 2001
From: weli-l <1289113577@qq.com>
Date: Thu, 18 Jul 2024 10:32:36 +0800
Subject: [PATCH] fix oncn-mda donot support uid in oe24.03
Signed-off-by: weli-l <1289113577@qq.com>
---
kmesh_macros_env.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/kmesh_macros_env.sh b/kmesh_macros_env.sh
index 3b1bfab..01a6934 100644
--- a/kmesh_macros_env.sh
+++ b/kmesh_macros_env.sh
@@ -15,17 +15,17 @@ else
fi
# MDA_NAT_ACCEL
-if grep -q "FN(sk_original_addr)" $KERNEL_HEADER_LINUX_BPF; then
- set_config MDA_NAT_ACCEL 1
+if [[ "$KERNEL_VERSION" < "6.6.0" ]]; then
+ set_config MDA_NAT_ACCEL 0
else
- set_config MDA_NAT_ACCEL 0
+ set_config MDA_NAT_ACCEL 1
fi
# MDA_GID_UID_FILTER
-if grep -q "FN(get_sockops_uid_gid)" $KERNEL_HEADER_LINUX_BPF; then
- set_config MDA_GID_UID_FILTER 1
+if [[ "$KERNEL_VERSION" < "6.6.0" ]]; then
+ set_config MDA_NAT_ACCEL 0
else
- set_config MDA_GID_UID_FILTER 0
+ set_config MDA_NAT_ACCEL 1
fi
# OE_23_03
--
2.34.1

BIN
v0.4.1.tar.gz Normal file

Binary file not shown.