Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
8ee6a2fb2d
!14 Add riscv64 support
From: @misaka00251 
Reviewed-by: @pangbanme 
Signed-off-by: @pangbanme
2023-09-25 08:25:23 +00:00
misaka00251
c02fe5fc5e
Add riscv64 support 2023-09-15 18:17:01 +08:00
openeuler-ci-bot
25ffea6672
!9 [sync] PR-8: Fix not stripped problem
From: @openeuler-sync-bot 
Reviewed-by: @zhu-yuncheng, @Poorunga 
Signed-off-by: @Poorunga
2023-03-08 01:17:12 +00:00
caodongxia
09f795558d Fix not stripped problem
(cherry picked from commit a8a6bc5abb92e2c4044b5db7d4d826cac014da23)
2023-03-07 20:21:50 +08:00
openeuler-ci-bot
124a44a638
!4 更新spec修复22.03环境编译失败问题
From: @zhu-yuncheng 
Reviewed-by: @Poorunga, @DCCooper, @wangyx0704 
Signed-off-by: @wangyx0704
2022-02-14 09:01:20 +00:00
王记棒棒猪
2a9b000615 update kubeedge.spec to fix compile error 2022-02-14 09:28:36 +08:00
openeuler-ci-bot
7926b51694 !2 add mosquitto require
From: @Poorunga
Reviewed-by: @DCCooper,@innost
Signed-off-by: @innost
2021-09-27 09:12:42 +00:00
Poorunga
f45c5e3e42 add mosquitto require 2021-09-27 11:53:53 +08:00
openeuler-ci-bot
0242cff9b0 !1 add kubeedge rpm source pkg
From: @Poorunga
Reviewed-by: @innost,@innost
Signed-off-by: @innost
2021-09-26 06:55:22 +00:00
Poorunga
bfd6b469c4 init kubeedge rpm build source 2021-09-18 14:28:01 +08:00
4 changed files with 404 additions and 0 deletions

View File

@ -0,0 +1,85 @@
From 8278a8637da3f4572c2310ecf1e137f802bcdbc4 Mon Sep 17 00:00:00 2001
From: CooperLi <a710905118@163.com>
Date: Tue, 31 Aug 2021 20:51:09 +0800
Subject: [PATCH] rpminstaller:add support for openEuler
keadm will install epel-release when edge node want to join cluster,
openEuler does not provide epel-release, it's better to support keadm
join on openEuler ^.^
openEuler is an innovative platform nurtured by community collaboration.
It aims to build a unified and open OS that supports multiple processor architectures,
and to advance the hardware/software application ecosystem.
Signed-off-by: CooperLi <a710905118@163.com>
---
keadm/cmd/keadm/app/cmd/util/rpminstaller.go | 32 ++++++++++++++++++--
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/keadm/cmd/keadm/app/cmd/util/rpminstaller.go b/keadm/cmd/keadm/app/cmd/util/rpminstaller.go
index 24a55042..0e8fa4b8 100644
--- a/keadm/cmd/keadm/app/cmd/util/rpminstaller.go
+++ b/keadm/cmd/keadm/app/cmd/util/rpminstaller.go
@@ -18,12 +18,17 @@ package util
import (
"fmt"
+ "strings"
"github.com/blang/semver"
types "github.com/kubeedge/kubeedge/keadm/cmd/keadm/app/cmd/common"
)
+const (
+ openEulerVendorName = "openEuler"
+)
+
// RpmOS struct objects shall have information of the tools version to be installed
// on Hosts having RpmOS OS.
// It implements OSTypeInstaller interface
@@ -51,13 +56,24 @@ func (r *RpmOS) InstallMQTT() error {
return nil
}
- // install MQTT
- for _, command := range []string{
+ commands := []string{
"yum -y install epel-release",
"yum -y install mosquitto",
"systemctl start mosquitto",
"systemctl enable mosquitto",
- } {
+ }
+
+ vendorName, err := getOSVendorName()
+ if err != nil {
+ fmt.Printf("Get OS vendor name failed: %v\n", err)
+ }
+ // epel-release package does not included in openEuler
+ if vendorName == openEulerVendorName {
+ commands = commands[1:]
+ }
+
+ // install MQTT
+ for _, command := range commands {
cmd := NewCommand(command)
if err := cmd.Exec(); err != nil {
return err
@@ -116,3 +132,13 @@ func (r *RpmOS) IsKubeEdgeProcessRunning(proc string) (bool, error) {
func (r *RpmOS) IsProcessRunning(proc string) (bool, error) {
return isKubeEdgeProcessRunning(proc)
}
+
+func getOSVendorName() (string, error) {
+ cmd := NewCommand("cat /etc/os-release | grep -E \"^NAME=\" | awk -F'=' '{print $2}'")
+ if err := cmd.Exec(); err != nil {
+ return "", err
+ }
+ vendor := strings.Trim(cmd.GetStdOut(), "\"")
+
+ return vendor, nil
+}
--
2.27.0

View File

@ -0,0 +1,137 @@
From ecd04092d1b751367ceb26fa33e0bdd2dcdc9a2f Mon Sep 17 00:00:00 2001
From: misaka00251 <liuxin@iscas.ac.cn>
Date: Fri, 15 Sep 2023 18:15:28 +0800
Subject: [PATCH] Add riscv64 support
---
edge/hack/setup_for_IEF.sh | 4 ++++
keadm/cmd/keadm/app/cmd/util/common.go | 1 +
.../cmd/keadm/app/cmd/util/pacmaninstaller.go | 2 ++
keadm/cmd/keadm/app/cmd/util/rpminstaller.go | 2 ++
.../containerd/platforms/database.go | 3 +++
.../github.com/prometheus/procfs/cpuinfo.go | 1 +
.../prometheus/procfs/cpuinfo_riscv64.go | 19 +++++++++++++++++++
.../seccomp/libseccomp-golang/seccomp.go | 2 ++
8 files changed, 34 insertions(+)
create mode 100644 vendor/github.com/prometheus/procfs/cpuinfo_riscv64.go
diff --git a/edge/hack/setup_for_IEF.sh b/edge/hack/setup_for_IEF.sh
index b265753..61f7cee 100755
--- a/edge/hack/setup_for_IEF.sh
+++ b/edge/hack/setup_for_IEF.sh
@@ -78,6 +78,10 @@ EOF
archInfo="arm64"
sed -i "s/{ARCH}/${archInfo}/g" ${CURRENT_PATH}/conf/system.yaml
;;
+ "riscv64")
+ archInfo="riscv64"
+ sed -i "s/{ARCH}/${archInfo}/g" ${CURRENT_PATH}/conf/system.yaml
+ ;;
"i386")
archInfo="i386"
sed -i "s/{ARCH}/${archInfo}/g" ${CURRENT_PATH}/conf/system.yaml
diff --git a/keadm/cmd/keadm/app/cmd/util/common.go b/keadm/cmd/keadm/app/cmd/util/common.go
index c54918e..7a9d366 100644
--- a/keadm/cmd/keadm/app/cmd/util/common.go
+++ b/keadm/cmd/keadm/app/cmd/util/common.go
@@ -74,6 +74,7 @@ const (
OSArchAMD64 string = "amd64"
OSArchARM64 string = "arm64"
OSArchARM32 string = "arm"
+ OSArchRISCV64 string="riscv64"
APT string = "apt"
YUM string = "yum"
diff --git a/keadm/cmd/keadm/app/cmd/util/pacmaninstaller.go b/keadm/cmd/keadm/app/cmd/util/pacmaninstaller.go
index fed0474..96bf437 100644
--- a/keadm/cmd/keadm/app/cmd/util/pacmaninstaller.go
+++ b/keadm/cmd/keadm/app/cmd/util/pacmaninstaller.go
@@ -67,6 +67,8 @@ func (o *PacmanOS) InstallKubeEdge(options types.InstallOptions) error {
arch = OSArchARM64
case "x86_64":
arch = OSArchAMD64
+ case "riscv64":
+ arch = OSArchRISCV64
default:
return fmt.Errorf("can't support this architecture of PacmanOS: %s", result)
}
diff --git a/keadm/cmd/keadm/app/cmd/util/rpminstaller.go b/keadm/cmd/keadm/app/cmd/util/rpminstaller.go
index 0e8fa4b..058008b 100644
--- a/keadm/cmd/keadm/app/cmd/util/rpminstaller.go
+++ b/keadm/cmd/keadm/app/cmd/util/rpminstaller.go
@@ -106,6 +106,8 @@ func (r *RpmOS) InstallKubeEdge(options types.InstallOptions) error {
arch = OSArchARM64
case "x86_64":
arch = OSArchAMD64
+ case "riscv64":
+ arch = OSArchRISCV64
default:
return fmt.Errorf("can't support this architecture of RpmOS: %s", result)
}
diff --git a/vendor/github.com/containerd/containerd/platforms/database.go b/vendor/github.com/containerd/containerd/platforms/database.go
index 6ede940..6bfae5d 100644
--- a/vendor/github.com/containerd/containerd/platforms/database.go
+++ b/vendor/github.com/containerd/containerd/platforms/database.go
@@ -89,6 +89,9 @@ func normalizeArch(arch, variant string) (string, string) {
case "x86_64", "x86-64":
arch = "amd64"
variant = ""
+ case "riscv64":
+ arch = "riscv64"
+ variant = ""
case "aarch64", "arm64":
arch = "arm64"
switch variant {
diff --git a/vendor/github.com/prometheus/procfs/cpuinfo.go b/vendor/github.com/prometheus/procfs/cpuinfo.go
index b9fb589..edc88b4 100644
--- a/vendor/github.com/prometheus/procfs/cpuinfo.go
+++ b/vendor/github.com/prometheus/procfs/cpuinfo.go
@@ -362,6 +362,7 @@ func parseCPUInfoMips(info []byte) ([]CPUInfo, error) {
return cpuinfo, nil
}
+
func parseCPUInfoPPC(info []byte) ([]CPUInfo, error) {
scanner := bufio.NewScanner(bytes.NewReader(info))
diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_riscv64.go b/vendor/github.com/prometheus/procfs/cpuinfo_riscv64.go
new file mode 100644
index 0000000..e83c2e2
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/cpuinfo_riscv64.go
@@ -0,0 +1,19 @@
+// Copyright 2020 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// +build linux
+// +build riscv riscv64
+
+package procfs
+
+var parseCPUInfo = parseCPUInfoRISCV
diff --git a/vendor/github.com/seccomp/libseccomp-golang/seccomp.go b/vendor/github.com/seccomp/libseccomp-golang/seccomp.go
index a3cc538..08e2e9d 100644
--- a/vendor/github.com/seccomp/libseccomp-golang/seccomp.go
+++ b/vendor/github.com/seccomp/libseccomp-golang/seccomp.go
@@ -196,6 +196,8 @@ func GetArchFromString(arch string) (ScmpArch, error) {
return ArchMIPS, nil
case "mips64":
return ArchMIPS64, nil
+ case "riscv64":
+ return ArchRISCV64, nil
case "mips64n32":
return ArchMIPS64N32, nil
case "mipsel":
--
2.39.2 (Apple Git-143)

182
kubeedge.spec Normal file
View File

@ -0,0 +1,182 @@
%ifarch x86_64
%global gohostarch amd64
%endif
%ifarch aarch64
%global gohostarch arm64
%endif
%ifarch riscv64
%global gohostarch riscv64
%endif
%define debug_package %{nil}
Name: kubeedge
Version: 1.8.0
Release: 4
Summary: Kubernetes Native Edge Computing Framework
License: Apache-2.0
URL: https://github.com/kubeedge/kubeedge
Source0: https://github.com/kubeedge/kubeedge/archive/refs/tags/v%{version}.tar.gz
BuildRequires: golang glibc-static make tar systemd git
Patch0001: 0001-rpminstaller-add-support-for-openEuler.patch
Patch1000: 1000-add-riscv64-support.patch
%description
KubeEdge is an open source system for extending native containerized application
orchestration capabilities to hosts at Edge. It is built upon kubernetes and provides
fundamental infrastructure support for network, app, deployment and metadata
synchronization between cloud and edge.
%package keadm
Summary: Keadm is used to install the cloud and edge components of KubeEdge.
Requires: mosquitto
Provides: keadm = %{version}
%description keadm
Keadm is used to install the cloud and edge components of KubeEdge.
It is not responsible for installing K8s and runtime.
%package cloudcore
Summary: KubeEdge Cloud Agent (CloudCore)
Provides: cloudcore = %{version}
Provides: admission = %{version}
Provides: csidriver = %{version}
%description cloudcore
KubeEdge is built upon Kubernetes and extends native containerized application
orchestration and device management to hosts at the Edge. It consists of cloud
part and edge part, provides core infrastructure support for networking,
application deployment and metadata synchronization between cloud and edge.
This package contains the cloudcore binary for the cloud node.
%package edgecore
Summary: KubeEdge Lightweight Edge Agent (EdgeCore)
Requires: mosquitto
Provides: edgecore = %{version}
%description edgecore
KubeEdge is built upon Kubernetes and extends native containerized application
orchestration and device management to hosts at the Edge. It consists of cloud
part and edge part, provides core infrastructure support for networking,
application deployment and metadata synchronization between cloud and edge.
This package contains the edgecore binary for the edge node.
%package edgesite
Summary: A GRPC agent/server
Requires: mosquitto
Provides: edgesite-agent = %{version}
Provides: edgesite-server = %{version}
%description edgesite
edgesite-agent is a gRPC agent. Connects to the proxy and then allows traffic to be forwarded to it.
edgesite-server is a gRPC proxy server, receives requests from the API server and forwards to the agent.
%prep
%autosetup -Sgit -n %{name}-%{version} -p1
%build
# add git tag since tarball did not contain any git info
git tag -a v%{version} -m "%{version}"
# setup GOPATH
export GOPATH=%{_builddir}
%global workspace $GOPATH/src/github.com/%{name}/%{name}
mkdir -p $GOPATH/src/github.com/%{name}
ln -sf $PWD $GOPATH/src/github.com/%{name}/%{name}
# start to build
cd %{workspace}
# set go flags
export GOLDFLAGS="-buildid=none -buildmode=pie -extldflags=-ftrapv -extldflags=-zrelro -extldflags=-znow -linkmode=external -extldflags=-static -extldflags '-Wl,-s'"
# build binaries
make all
# build csidriver
# TODO: delete after PR3154 is merged in new release(not included in v1.8.0)
go build -v -o _output/local/bin/csidriver -ldflags="${GOLDFLAGS}" github.com/kubeedge/kubeedge/cloud/cmd/csidriver
%install
export GOPATH=%{_builddir}
cd %{workspace}
# create directories
install -dm0750 %{buildroot}%{_sysconfdir}/kubeedge
install -dm0750 %{buildroot}%{_sysconfdir}/kubeedge/config
install -dm0750 %{buildroot}%{_sysconfdir}/kubeedge/tools
# install binaries
install -Dp ./_output/local/bin/keadm %{buildroot}%{_prefix}/local/bin/keadm
install -Dp ./_output/local/bin/cloudcore %{buildroot}%{_prefix}/local/bin/cloudcore
install -Dp ./_output/local/bin/edgecore %{buildroot}%{_prefix}/local/bin/edgecore
install -Dp ./_output/local/bin/admission %{buildroot}%{_prefix}/local/bin/admission
install -Dp ./_output/local/bin/csidriver %{buildroot}%{_prefix}/local/bin/csidriver
install -Dp ./_output/local/bin/edgesite-agent %{buildroot}%{_prefix}/local/bin/edgesite-agent
install -Dp ./_output/local/bin/edgesite-server %{buildroot}%{_prefix}/local/bin/edgesite-server
# generate default configs for both cloudcore and edgecore
./_output/local/bin/cloudcore --defaultconfig > cloudcore.example.yaml
./_output/local/bin/edgecore --defaultconfig > edgecore.example.yaml
install -Dpm0640 ./cloudcore.example.yaml %{buildroot}%{_sysconfdir}/kubeedge/config/cloudcore.example.yaml
install -Dpm0640 ./edgecore.example.yaml %{buildroot}%{_sysconfdir}/kubeedge/config/edgecore.example.yaml
# service file for systemd
install -Dpm0640 ./build/tools/cloudcore.service %{buildroot}%{_unitdir}/cloudcore.service
install -Dpm0640 ./build/tools/edgecore.service %{buildroot}%{_unitdir}/edgecore.service
# install service file in /etc/kubeedge/ as well so that no need to download from internet when they use keadm
install -Dpm0640 ./build/tools/cloudcore.service %{buildroot}%{_sysconfdir}/kubeedge/cloudcore.service
install -Dpm0640 ./build/tools/edgecore.service %{buildroot}%{_sysconfdir}/kubeedge/edgecore.service
# crd yamls for kubernetes
cd ./build && find ./crds -type f -exec install -Dm0644 {} %{buildroot}%{_sysconfdir}/kubeedge/{} \; && cd -
# tool for certificate generation
install -Dpm0550 ./build/tools/certgen.sh %{buildroot}%{_sysconfdir}/kubeedge/tools/certgen.sh
# construct tarball used for keadm
%global tarball_name %{name}-v%{version}-linux-%{gohostarch}
install -Dpm0550 ./_output/local/bin/cloudcore %{tarball_name}/cloud/cloudcore/cloudcore
install -Dpm0550 ./_output/local/bin/admission %{tarball_name}/cloud/admission/admission
install -Dpm0550 ./_output/local/bin/csidriver %{tarball_name}/cloud/csidriver/csidriver
install -Dpm0550 ./_output/local/bin/edgecore %{tarball_name}/edge/edgecore
# like cp -r, but have filemode control here
cd ./build && find ./crds -type f -exec install -Dpm0644 {} ../%{tarball_name}/{} \; && cd -
echo "v%{version}" > %{tarball_name}/version
tar zcf %{tarball_name}.tar.gz %{tarball_name}
# checksum for tarball
sha512sum %{tarball_name}.tar.gz | awk '{print $1}' > checksum_%{tarball_name}.tar.gz.txt
# install tarball
install -Dpm0550 %{tarball_name}.tar.gz %{buildroot}%{_sysconfdir}/kubeedge/%{tarball_name}.tar.gz
install -Dpm0550 checksum_%{tarball_name}.tar.gz.txt %{buildroot}%{_sysconfdir}/kubeedge/checksum_%{tarball_name}.tar.gz.txt
%files keadm
%license LICENSE
%attr(550,root,root) %{_prefix}/local/bin/keadm
%{_sysconfdir}/kubeedge/cloudcore.service
%{_sysconfdir}/kubeedge/edgecore.service
%{_sysconfdir}/kubeedge/%{tarball_name}.tar.gz
%{_sysconfdir}/kubeedge/checksum_%{tarball_name}.tar.gz.txt
%files cloudcore
%license LICENSE
%attr(550,root,root) %{_prefix}/local/bin/cloudcore
%attr(550,root,root) %{_prefix}/local/bin/admission
%attr(550,root,root) %{_prefix}/local/bin/csidriver
%{_unitdir}/cloudcore.service
%{_sysconfdir}/kubeedge/crds
%{_sysconfdir}/kubeedge/tools/certgen.sh
%config(noreplace) %{_sysconfdir}/kubeedge/config/cloudcore.example.yaml
%files edgecore
%license LICENSE
%attr(550,root,root) %{_prefix}/local/bin/edgecore
%{_unitdir}/edgecore.service
%config(noreplace) %{_sysconfdir}/kubeedge/config/edgecore.example.yaml
%files edgesite
%license LICENSE
%attr(550,root,root) %{_prefix}/local/bin/edgesite-agent
%attr(550,root,root) %{_prefix}/local/bin/edgesite-server
%changelog
* Fri Sep 15 2023 misaka00251 <liuxin@iscas.ac.cn> - 1.8.0-4
- Add riscv64 support
* Tue Mar 7 2023 caodongxia<caodongxia@h-partners.com> - 1.8.0-3
- Fix not stripped problem
* Thu Feb 10 2022 Yuncheng Zhu<zhuyuncheng@huawei.com> - 1.8.0-2
- Fix compile error.
* Sat Sep 18 2021 Poorunga<2744323@qq.com> - 1.8.0-1
- Package init

BIN
v1.8.0.tar.gz Normal file

Binary file not shown.