This is an automated email from the ASF dual-hosted git repository.
guyuqi pushed a commit to branch openEuler-support
in repository https://gitbox.apache.org/repos/asf/bigtop.git
The following commit(s) were added to refs/heads/openEuler-support by this push:
new 60209ced Support openEuler's toolchain and docker images (#1127)
60209ced is described below
commit 60209ced4fca89302237a00f32459b617172c46d
Author: MacChen01 <[email protected]>
AuthorDate: Fri Jul 7 12:01:38 2023 +0800
Support openEuler's toolchain and docker images (#1127)
---
bigtop_toolchain/bin/puppetize.sh | 12 ++++++
bigtop_toolchain/manifests/cleanup.pp | 2 +-
bigtop_toolchain/manifests/env.pp | 2 +-
bigtop_toolchain/manifests/gnupg.pp | 2 +-
bigtop_toolchain/manifests/jdk.pp | 2 +-
bigtop_toolchain/manifests/packages.pp | 68 ++++++++++++++++++++++++++++++++++
bigtop_toolchain/manifests/renv.pp | 11 ++++--
build.gradle | 6 +--
docker/bigtop-puppet/build.sh | 4 ++
docker/bigtop-slaves/build.sh | 8 ++++
10 files changed, 106 insertions(+), 11 deletions(-)
diff --git a/bigtop_toolchain/bin/puppetize.sh
b/bigtop_toolchain/bin/puppetize.sh
index 5b603b07..9b495ecb 100755
--- a/bigtop_toolchain/bin/puppetize.sh
+++ b/bigtop_toolchain/bin/puppetize.sh
@@ -70,6 +70,18 @@ case ${ID}-${VERSION_ID} in
# As a workaround for that, enable the former here in advance of
running the Puppet manifests.
dnf config-manager --set-enabled codeready-builder-for-rhel-8-rhui-rpms
;;
+ openEuler-*)
+ yum -y install hostname curl sudo unzip wget ruby vim patch
systemd-devel rng-tools
+ # openEuler ruby version is 3.X,so use puppet-7.22.0.
+ gem install puppet -v 7.22.0
+ gem install xmlrpc
+ gem install sync
+ gem install puppetmodule-stdlib
+ #openEuler dnf defaulted is not use module,so comment module in
puppet-7.22.0
+ sed -i "91c execute([command(:dnf), 'install', '-d', '0', '-e',
self.class.error_level, '-y', args])"
/usr/local/share/gems/gems/puppet-7.22.0/lib/puppet/provider/package/dnfmodule.rb
+ mkdir -p /etc/puppetlabs/code/modules/stdlib
+ cp -r /usr/local/share/gems/gems/puppetmodule-stdlib-4.0.2/*
/etc/puppetlabs/code/modules/stdlib/
+ ;;
*)
echo "Unsupported OS ${ID}-${VERSION_ID}."
exit 1
diff --git a/bigtop_toolchain/manifests/cleanup.pp
b/bigtop_toolchain/manifests/cleanup.pp
index 6977dc4d..cc1de64b 100644
--- a/bigtop_toolchain/manifests/cleanup.pp
+++ b/bigtop_toolchain/manifests/cleanup.pp
@@ -15,7 +15,7 @@
class bigtop_toolchain::cleanup {
$packager_cleanup = $operatingsystem ? {
- /(?i:(centos|fedora|redhat|amazon|rocky))/ => 'yum clean all',
+ /(?i:(centos|fedora|redhat|amazon|rocky|openEuler))/ => 'yum clean all',
/(?i:(SLES|opensuse))/ => 'zypper clean -a',
/Ubuntu|Debian/ => 'apt-get clean',
}
diff --git a/bigtop_toolchain/manifests/env.pp
b/bigtop_toolchain/manifests/env.pp
index db7865ad..22cf4eea 100644
--- a/bigtop_toolchain/manifests/env.pp
+++ b/bigtop_toolchain/manifests/env.pp
@@ -35,7 +35,7 @@ class bigtop_toolchain::env {
'Ubuntu': {
$javahome = "/usr/lib/jvm/${java}-openjdk-$arch"
}
- 'Fedora','Centos','RedHat','Amazon','Rocky': {
+ 'Fedora','Centos','RedHat','Amazon','Rocky','openEuler': {
$javahome = "/usr/lib/jvm/${java}"
}
'OpenSuSE' : {
diff --git a/bigtop_toolchain/manifests/gnupg.pp
b/bigtop_toolchain/manifests/gnupg.pp
index 2ff5427f..655f55f0 100644
--- a/bigtop_toolchain/manifests/gnupg.pp
+++ b/bigtop_toolchain/manifests/gnupg.pp
@@ -16,7 +16,7 @@
class bigtop_toolchain::gnupg {
case $operatingsystem {
- /(?i:(centos|fedora|redhat|rocky))/: {
+ /(?i:(centos|fedora|redhat|rocky|openEuler))/: {
$pkg = "gnupg2"
$cmd = "gpg2"
}
diff --git a/bigtop_toolchain/manifests/jdk.pp
b/bigtop_toolchain/manifests/jdk.pp
index d40cfc68..89986a6e 100644
--- a/bigtop_toolchain/manifests/jdk.pp
+++ b/bigtop_toolchain/manifests/jdk.pp
@@ -39,7 +39,7 @@ class bigtop_toolchain::jdk {
ensure => present,
}
}
- /(CentOS|Amazon|Fedora|RedHat|Rocky)/: {
+ /(CentOS|Amazon|Fedora|RedHat|Rocky|openEuler)/: {
package { 'java-1.8.0-openjdk-devel' :
ensure => present
}
diff --git a/bigtop_toolchain/manifests/packages.pp
b/bigtop_toolchain/manifests/packages.pp
index 7c558ee2..74a7f832 100644
--- a/bigtop_toolchain/manifests/packages.pp
+++ b/bigtop_toolchain/manifests/packages.pp
@@ -151,6 +151,74 @@ class bigtop_toolchain::packages {
"bzip2-devel",
"libffi-devel"
] }
+ /openEuler/: { $pkgs = [
+ "unzip",
+ "cmake",
+ "rsync",
+ "curl",
+ "wget",
+ "git",
+ "make",
+ "autoconf",
+ "automake",
+ "libtool",
+ "libtool-devel",
+ "gcc",
+ "gcc-c++",
+ "gcc-gfortran",
+ "doxygen",
+ "createrepo_c-devel",
+ "lzo-devel",
+ "fuse-devel",
+ "fuse3-devel",
+ "cppunit-devel",
+ "openssl-devel",
+ "libxml2-devel",
+ "libxslt-devel",
+ "cyrus-sasl-devel",
+ "sqlite-devel",
+ "openldap-devel",
+ "mariadb-devel",
+ "rpm-build",
+ "openEuler-rpm-config",
+ "asciidoc",
+ "xmlto",
+ "libyaml-devel",
+ "gmp-devel",
+ "snappy-devel",
+ "zstd-devel",
+ "boost-devel",
+ "xfsprogs-devel",
+ "libuuid",
+ "bzip2-devel",
+ "readline-devel",
+ "ncurses-devel",
+ "libidn-devel",
+ "libcurl-devel",
+ "libevent-devel",
+ "apr-devel",
+ "bison-devel",
+ "libffi-devel",
+ "krb5-devel",
+ "net-tools",
+ "perl-Digest-SHA",
+ "python3-devel",
+ "libtirpc-devel",
+ "libgit2-devel",
+ "libgit2-glib-devel",
+ "libxml2",
+ "libpng-devel",
+ "libtiff-devel",
+ "libjpeg-turbo-devel",
+ "leveldbjni",
+ "psmisc",
+ "nc",
+ "initscripts",
+ "openeuler-lsb",
+ "pcre-devel",
+ "texlive",
+ "rpmdevtools"
+ ] }
/(Ubuntu|Debian)/: {
$_pkgs = [
"unzip",
diff --git a/bigtop_toolchain/manifests/renv.pp
b/bigtop_toolchain/manifests/renv.pp
index 9ac3138f..484f4ace 100644
--- a/bigtop_toolchain/manifests/renv.pp
+++ b/bigtop_toolchain/manifests/renv.pp
@@ -51,9 +51,11 @@ class bigtop_toolchain::renv {
}
}
- package { $pkgs:
- ensure => installed,
- before => [Exec["install_r_packages"]]
+ if ($operatingsystem != 'openEuler') {
+ package { $pkgs:
+ ensure => installed,
+ before => [Exec["install_r_packages"]]
+ }
}
# BIGTOP-3483:
@@ -61,7 +63,8 @@ class bigtop_toolchain::renv {
#
# Then Install required R packages dependency
if (($operatingsystem == 'Ubuntu' and versioncmp($operatingsystemmajrelease,
'18.04') <= 0) or
- ($operatingsystem == 'Debian' and versioncmp($operatingsystemmajrelease,
'10') < 0)) {
+ ($operatingsystem == 'Debian' and versioncmp($operatingsystemmajrelease,
'10') < 0) or
+ ($operatingsystem == 'openEuler')) {
$url = "https://cran.r-project.org/src/base/R-3/"
$rfile = "R-3.6.3.tar.gz"
$rdir = "R-3.6.3"
diff --git a/build.gradle b/build.gradle
index 90cb1e8f..d6e12801 100644
--- a/build.gradle
+++ b/build.gradle
@@ -268,7 +268,7 @@ Properties:
-Pmemory=[4g|8g|...]
-Pnum_instances=[NUM_INSTANCES]
-Pnexus=[NEXUS_URL] (NEXUS_URL is optional)
- -POS=[centos-7|fedora-35|debian-10|ubuntu-18.04|opensuse-42.3]
+
-POS=[centos-7|fedora-35|debian-10|ubuntu-18.04|opensuse-42.3|openeuler-22.03]
-Pprefix=[trunk|1.2.1|1.2.0|1.1.0|...]
-Prepository=[REPO_URL]
-Prun_smoke_tests (run test components defined in config file)
@@ -563,7 +563,7 @@ task "bigtop-puppet"(type:Exec,
description: '''
Build bigtop/puppet images
Usage:
- $ ./gradlew -POS=[centos-7|fedora-35|debian-10|ubuntu-18.04|opensuse-42.3]
-Pprefix=[trunk|1.2.1|1.2.0|1.1.0|...] bigtop-puppet
+ $ ./gradlew
-POS=[centos-7|fedora-35|debian-10|ubuntu-18.04|opensuse-42.3|openeuler-22.03]
-Pprefix=[trunk|1.2.1|1.2.0|1.1.0|...] bigtop-puppet
Example:
$ ./gradlew -POS=debian-10 -Pprefix=3.0.0 bigtop-puppet
The built image name: bigtop/puppet:3.0.0-debian-10
@@ -582,7 +582,7 @@ task "bigtop-slaves"(type:Exec,
description: '''
Build bigtop/slaves images
Usage:
- $ ./gradlew -POS=[centos-7|fedora-35|debian-10|ubuntu-18.04|opensuse-42.3]
-Pprefix=[trunk|1.2.1|1.2.0|1.1.0|...] bigtop-slaves
+ $ ./gradlew
-POS=[centos-7|fedora-35|debian-10|ubuntu-18.04|opensuse-42.3|openeuler-22.03]
-Pprefix=[trunk|1.2.1|1.2.0|1.1.0|...] bigtop-slaves
Example:
$ ./gradlew -POS=debian-10 -Pprefix=3.0.0 bigtop-slaves
The built image name: bigtop/slaves:3.0.0-debian-10
diff --git a/docker/bigtop-puppet/build.sh b/docker/bigtop-puppet/build.sh
index 660ba236..8a85120c 100755
--- a/docker/bigtop-puppet/build.sh
+++ b/docker/bigtop-puppet/build.sh
@@ -59,6 +59,10 @@ case "${OS}-${VERSION}" in
# add initd
sed -i -e "s|RUN bash /tmp/puppetize.sh|RUN bash /tmp/puppetize.sh\nRUN
dnf install -y initscripts|" Dockerfile
;;
+ openeuler-22.03*)
+ OPENEULER_OS="${OS}/${OS}"
+ sed -i -e "s|${OS}:${VERSION}|$OPENEULER_OS:${VERSION}|" ./Dockerfile
+ ;;
*)
;;
esac
diff --git a/docker/bigtop-slaves/build.sh b/docker/bigtop-slaves/build.sh
index 6514e1cb..7215d4fe 100755
--- a/docker/bigtop-slaves/build.sh
+++ b/docker/bigtop-slaves/build.sh
@@ -76,6 +76,10 @@ case ${OS} in
PUPPET_MODULES="/etc/puppet/modules/bigtop_toolchain"
UPDATE_SOURCE="zypper clean \&\& zypper refresh"
;;
+ openeuler)
+ PUPPET_MODULES="/etc/puppet/modules/bigtop_toolchain"
+ UPDATE_SOURCE="yum clean all \&\& yum updateinfo"
+ ;;
*)
echo "[ERROR] Specified distro [${OS}] is not supported!"
exit 1
@@ -89,5 +93,9 @@ fi
sed -e "s|PREFIX|${PREFIX}|;s|OS|${OS}|;s|VERSION|${VERSION}|"
Dockerfile.template | \
sed -e
"s|PUPPET_MODULES|${PUPPET_MODULES}|;s|UPDATE_SOURCE|${UPDATE_SOURCE}|" >
Dockerfile
+if [ $OS == "openeuler" ];then
+ sed -i "s|\"include bigtop_toolchain::installer\"|\"include
bigtop_toolchain::installer\" --modulepath=/etc/puppet/modules/|g" Dockerfile
+fi
+
docker build ${NETWORK} --rm -t bigtop/slaves:${PREFIX}-${OS}-${VERSION} -f
Dockerfile ../..
rm -f Dockerfile