From 7880ba665e2d594b2eabb0533e6dca52e042ca50 Mon Sep 17 00:00:00 2001 From: Kevin Zhao Date: Wed, 31 Mar 2021 04:58:28 +0000 Subject: [PATCH] openEuler 20.03 LTS SP2 support openEuler is an open-source Linux based operating system. The current openEuler kernel is based on Linux and supports multi arch, such as X86_64 and aarch64. It fully unleashes the potential of computing chips. As an efficient, stable, and secure open-source OS built by global open-source contributors, openEuler applies to database, big data, cloud computing, and AI scenarios. openEuler is using RPM for package management. Note: Currently there is no available package for uwsgi-plugin-python3 and ovn, so that openEuler needs manually install them from source. Website: https://www.openeuler.org/en/ Change-Id: I169a0017998054604a63ac6c177d0f43f8a32ba6 Co-Authored-By: wangxiyuan Signed-off-by: Kevin Zhao --- .zuul.yaml | 25 +++++++++++++++++++++++++ doc/source/index.rst | 2 +- files/rpms/ceph | 2 +- files/rpms/general | 4 +++- files/rpms/nova | 2 +- files/rpms/swift | 2 +- functions-common | 14 ++++++++++++-- lib/apache | 16 +++------------- lib/nova_plugins/functions-libvirt | 2 +- roles/apache-logs-conf/tasks/main.yaml | 1 + stack.sh | 8 +++++++- tools/fixup_stuff.sh | 24 ++++++++++++++++++++++++ 12 files changed, 80 insertions(+), 22 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 3945faf82e..a4385572bc 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -106,6 +106,16 @@ nodes: - controller +- nodeset: + name: devstack-single-node-openeuler-20.03-sp2 + nodes: + - name: controller + label: openEuler-20-03-LTS-SP2 + groups: + - name: tempest + nodes: + - controller + - nodeset: name: openstack-two-node nodes: @@ -683,6 +693,20 @@ # Enable Neutron ML2/OVS services q-agt: true +- job: + name: devstack-platform-openEuler-20.03-SP2 + parent: tempest-full-py3 + description: openEuler 20.03 SP2 platform test + nodeset: devstack-single-node-openeuler-20.03-sp2 + voting: false + timeout: 9000 + vars: + configure_swap_size: 4096 + devstack_localrc: + # NOTE(wxy): OVN package is not supported by openEuler yet. Build it + # from source instead. + OVN_BUILD_FROM_SOURCE: True + - job: name: devstack-no-tls-proxy parent: tempest-full-py3 @@ -788,6 +812,7 @@ - devstack-platform-centos-8-stream - devstack-platform-centos-9-stream - devstack-platform-debian-bullseye + - devstack-platform-openEuler-20.03-SP2 - devstack-multinode - devstack-unit-tests - openstack-tox-bashate diff --git a/doc/source/index.rst b/doc/source/index.rst index 08ce4cb061..feb50ce4e9 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -38,7 +38,7 @@ Install Linux Start with a clean and minimal install of a Linux system. DevStack attempts to support the two latest LTS releases of Ubuntu, the -latest/current Fedora version, CentOS/RHEL 8 and OpenSUSE. +latest/current Fedora version, CentOS/RHEL 8, OpenSUSE and openEuler. If you do not have a preference, Ubuntu 20.04 (Focal Fossa) is the most tested, and will probably go the smoothest. diff --git a/files/rpms/ceph b/files/rpms/ceph index 33a55f80ea..93b5746aa6 100644 --- a/files/rpms/ceph +++ b/files/rpms/ceph @@ -1,3 +1,3 @@ ceph # NOPRIME -redhat-lsb-core # not:rhel9 +redhat-lsb-core # not:rhel9,openEuler-20.03 xfsprogs diff --git a/files/rpms/general b/files/rpms/general index 33da0a5385..163a7c8f24 100644 --- a/files/rpms/general +++ b/files/rpms/general @@ -16,6 +16,7 @@ libjpeg-turbo-devel # Pillow 3.0.0 libxml2-devel # lxml libxslt-devel # lxml libyaml-devel +make # dist:openEuler-20.03 net-tools openssh-server openssl @@ -27,7 +28,8 @@ psmisc python3-devel python3-pip python3-systemd -redhat-rpm-config # missing dep for gcc hardening flags, see rhbz#1217376 +redhat-rpm-config # not:openEuler-20.03 missing dep for gcc hardening flags, see rhbz#1217376 +systemd-devel # dist:openEuler-20.03 tar tcpdump unzip diff --git a/files/rpms/nova b/files/rpms/nova index 9522e5729d..9e8621c628 100644 --- a/files/rpms/nova +++ b/files/rpms/nova @@ -6,7 +6,7 @@ ebtables genisoimage # not:rhel9 required for config_drive iptables iputils -kernel-modules +kernel-modules # not:openEuler-20.03 kpartx parted polkit diff --git a/files/rpms/swift b/files/rpms/swift index b6009a321e..faf0a3175a 100644 --- a/files/rpms/swift +++ b/files/rpms/swift @@ -1,5 +1,5 @@ curl -liberasurecode-devel +liberasurecode-devel # not:openEuler-20.03 memcached rsync-daemon sqlite diff --git a/functions-common b/functions-common index 80f43554d0..e593328f37 100644 --- a/functions-common +++ b/functions-common @@ -388,7 +388,7 @@ function _ensure_lsb_release { elif [[ -x $(command -v zypper 2>/dev/null) ]]; then sudo zypper -n install lsb-release elif [[ -x $(command -v dnf 2>/dev/null) ]]; then - sudo dnf install -y redhat-lsb-core + sudo dnf install -y redhat-lsb-core || sudo dnf install -y openeuler-lsb else die $LINENO "Unable to find or auto-install lsb_release" fi @@ -459,6 +459,10 @@ function GetDistro { # Drop the . release as we assume it's compatible # XXX re-evaluate when we get RHEL10 DISTRO="rhel${os_RELEASE::1}" + elif [[ "$os_VENDOR" =~ (openEuler) ]]; then + # The DISTRO here is `openEuler-20.03`. While, actually only openEuler + # 20.03 LTS SP2 is fully tested. Other SP version maybe have bugs. + DISTRO="openEuler-$os_RELEASE" else # We can't make a good choice here. Setting a sensible DISTRO # is part of the problem, but not the major issue -- we really @@ -510,6 +514,7 @@ function is_fedora { fi [ "$os_VENDOR" = "Fedora" ] || [ "$os_VENDOR" = "Red Hat" ] || \ + [ "$os_VENDOR" = "openEuler" ] || \ [ "$os_VENDOR" = "RedHatEnterpriseServer" ] || \ [ "$os_VENDOR" = "RedHatEnterprise" ] || \ [ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "CentOSStream" ] || \ @@ -558,7 +563,12 @@ function is_ubuntu { [ "$os_PACKAGE" = "deb" ] } - +function is_openeuler { + if [[ -z "$os_PACKAGE" ]]; then + GetOSVersion + fi + [ "$os_VENDOR" = "openEuler" ] +} # Git Functions # ============= diff --git a/lib/apache b/lib/apache index 4bea07dc55..cbe61adf34 100644 --- a/lib/apache +++ b/lib/apache @@ -82,19 +82,10 @@ function install_apache_uwsgi { apxs="apxs" fi - # This varies based on packaged/installed. If we've - # pip_installed, then the pip setup will only build a "python" - # module that will be either python2 or python3 depending on what - # it was built with. - # - # For package installs, the distro ships both plugins and you need - # to select the right one ... it will not be autodetected. - UWSGI_PYTHON_PLUGIN=python3 - if is_ubuntu; then local pkg_list="uwsgi uwsgi-plugin-python3 libapache2-mod-proxy-uwsgi" install_package ${pkg_list} - elif is_fedora; then + elif is_fedora && ! is_openeuler; then # Note httpd comes with mod_proxy_uwsgi and it is loaded by # default; the mod_proxy_uwsgi package actually conflicts now. # See: @@ -122,7 +113,6 @@ function install_apache_uwsgi { popd # delete the temp directory sudo rm -rf $dir - UWSGI_PYTHON_PLUGIN=python fi if is_ubuntu || is_suse ; then @@ -283,7 +273,7 @@ function write_uwsgi_config { # configured after graceful shutdown iniset "$file" uwsgi worker-reload-mercy $WORKER_TIMEOUT iniset "$file" uwsgi enable-threads true - iniset "$file" uwsgi plugins http,${UWSGI_PYTHON_PLUGIN} + iniset "$file" uwsgi plugins http,python3 # uwsgi recommends this to prevent thundering herd on accept. iniset "$file" uwsgi thunder-lock true # Set hook to trigger graceful shutdown on SIGTERM @@ -336,7 +326,7 @@ function write_local_uwsgi_http_config { iniset "$file" uwsgi die-on-term true iniset "$file" uwsgi exit-on-reload false iniset "$file" uwsgi enable-threads true - iniset "$file" uwsgi plugins http,${UWSGI_PYTHON_PLUGIN} + iniset "$file" uwsgi plugins http,python3 # uwsgi recommends this to prevent thundering herd on accept. iniset "$file" uwsgi thunder-lock true # Set hook to trigger graceful shutdown on SIGTERM diff --git a/lib/nova_plugins/functions-libvirt b/lib/nova_plugins/functions-libvirt index 63882e05fe..3e7d2801d6 100644 --- a/lib/nova_plugins/functions-libvirt +++ b/lib/nova_plugins/functions-libvirt @@ -90,7 +90,7 @@ function install_libvirt { install_package libvirt libvirt-devel python3-libvirt if is_arch "aarch64"; then - install_package edk2.git-aarch64 + install_package edk2-aarch64 fi fi diff --git a/roles/apache-logs-conf/tasks/main.yaml b/roles/apache-logs-conf/tasks/main.yaml index bd64574c9b..6b7ea37857 100644 --- a/roles/apache-logs-conf/tasks/main.yaml +++ b/roles/apache-logs-conf/tasks/main.yaml @@ -64,6 +64,7 @@ 'Debian': '/etc/apache2/sites-enabled/' 'Suse': '/etc/apache2/conf.d/' 'RedHat': '/etc/httpd/conf.d/' + 'openEuler': '/etc/httpd/conf.d/' - name: Discover configurations find: diff --git a/stack.sh b/stack.sh index a10e6eff25..cb16fda998 100755 --- a/stack.sh +++ b/stack.sh @@ -227,7 +227,7 @@ write_devstack_version # Warn users who aren't on an explicitly supported distro, but allow them to # override check and attempt installation with ``FORCE=yes ./stack`` -SUPPORTED_DISTROS="bullseye|focal|f34|opensuse-15.2|opensuse-tumbleweed|rhel8|rhel9" +SUPPORTED_DISTROS="bullseye|focal|f34|opensuse-15.2|opensuse-tumbleweed|rhel8|rhel9|openEuler-20.03" if [[ ! ${DISTRO} =~ $SUPPORTED_DISTROS ]]; then echo "WARNING: this script has not been tested on $DISTRO" @@ -278,6 +278,12 @@ chmod 0440 $TEMPFILE sudo chown root:root $TEMPFILE sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh +# TODO(wxy): Currently some base packages are not installed by default in +# openEuler. Remove the code below once the packaged are installed by default +# in the future. +if [[ $DISTRO == "openEuler-20.03" ]]; then + install_package hostname +fi # Configure Distro Repositories # ----------------------------- diff --git a/tools/fixup_stuff.sh b/tools/fixup_stuff.sh index fe5dafa994..750849db68 100755 --- a/tools/fixup_stuff.sh +++ b/tools/fixup_stuff.sh @@ -148,8 +148,32 @@ function fixup_ubuntu { sudo rm -rf /usr/lib/python3/dist-packages/simplejson-*.egg-info } +function fixup_openeuler { + if ! is_openeuler; then + return + fi + + if is_arch "x86_64"; then + arch="x86_64" + elif is_arch "aarch64"; then + arch="aarch64" + fi + + # Some packages' version in openEuler are too old, use the newer ones we + # provide in oepkg. (oepkg is an openEuler third part yum repo which is + # endorsed by openEuler community) + (echo '[openstack-ci]' + echo 'name=openstack' + echo 'baseurl=https://repo.oepkgs.net/openEuler/rpm/openEuler-20.03-LTS-SP2/budding-openeuler/openstack-master-ci/'$arch'/' + echo 'enabled=1' + echo 'gpgcheck=0') | sudo tee -a /etc/yum.repos.d/openstack-master.repo > /dev/null + + yum_install liberasurecode-devel +} + function fixup_all { fixup_ubuntu fixup_fedora fixup_suse + fixup_openeuler }