From 8c194dfadaa9a2f5aced696fa3aab3d321b8d956 Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Wed, 2 Sep 2020 19:38:22 -0300 Subject: [PATCH] Stop using shaman Shaman packages are not stable and generates breakages in our gates quite frequently. Use packages available in download.ceph.com instead. Change-Id: I0eab8ad25112511b0c4dd4b7796b4cda821bca8b --- devstack/lib/ceph | 169 +++++++++++++++++++++++++++++----------------- 1 file changed, 108 insertions(+), 61 deletions(-) diff --git a/devstack/lib/ceph b/devstack/lib/ceph index 85f0d9c5..1596f080 100755 --- a/devstack/lib/ceph +++ b/devstack/lib/ceph @@ -30,9 +30,7 @@ CEPH_RELEASE=${CEPH_RELEASE:-nautilus} CEPH_RELEASE_STABLE=${CEPH_RELEASE_STABLE:-luminous} -GANESHA_RELEASE=${GANESHA_RELEASE:-ceph_nautilus} - -GANESHA_RELEASE_STABLE=${GANESHA_RELEASE_STABLE:-ceph_luminous} +GANESHA_RELEASE=${GANESHA_RELEASE:-deb-V2.7-stable} # Deploy a Ceph demo container instead of a non-containerized version CEPH_CONTAINERIZED=$(trueorfalse False CEPH_CONTAINERIZED) @@ -789,7 +787,7 @@ EOF function cleanup_nfs_ganesha { sudo systemctl stop nfs-ganesha sudo systemctl disable nfs-ganesha - sudo uninstall_package nfs-ganesha nfs-ganesha-ceph + sudo uninstall_package nfs-ganesha nfs-ganesha-ceph libntirpc1 } function configure_ceph_embedded_manila { @@ -879,101 +877,153 @@ function install_ceph_remote { fi } +function dnf_add_repository_ceph { + local ceph_release=$1 + local distro_release=$2 + + cat >/etc/yum.repos.d/ceph.repo </etc/yum.repos.d/nfs-ganesha.repo < \ # [] # - package_manager: apt-get or yum # - ceph_release: luminous, ... -# - distro_type: centos, ubuntu # - distro_release: 7, xenial, bionic -# - repo_type: latest, stable (only latest is supported right now) function configure_repo_ceph { local package_manager="$1" local ceph_release="$2" - local distro_type="$3" - local distro_release="$4" - local repo_type="${5:-latest}" + local distro_release="$3" - local repo_file_name="" - if [ "${package_manager}" = "apt-get" ]; then - repo_file_name="/etc/apt/sources.list.d/ceph.list" - elif [ "${package_manager}" = "yum" ]; then - repo_file_name="/etc/yum.repos.d/ext-ceph.repo" + if is_ubuntu; then + sudo apt-add-repository -y "deb https://download.ceph.com/debian-${ceph_release}/ ${distro_release} main" + elif is_fedora; then + dnf_add_repository_ceph ${ceph_release} ${distro_release} fi - if [ -n "${repo_file_name}" ]; then - repo=$(curl -L "https://shaman.ceph.com/api/search/?project=ceph&status=ready&distros=${distro_type}/${distro_release}&ref=${ceph_release}&sha1=${repo_type}" | \ - jq '.[0] | .chacra_url' | tr -d '"' | awk '{print $1"repo"}') - curl -L $repo | sudo tee ${repo_file_name} - sudo ${package_manager} -y update - fi + sudo ${package_manager} -y update } # cleanup_repo_ceph() - Remove Ceph repositories # Usage: cleanup_repo_ceph function cleanup_repo_ceph { if is_ubuntu; then - sudo rm -rf /etc/apt/sources.list.d/ceph.list + if [[ $os_CODENAME =~ (xenial) ]]; then + sudo apt-add-repository -r -y "deb https://download.ceph.com/debian-${CEPH_RELEASE_STABLE}/ ${os_CODENAME} main" + fi + sudo apt-add-repository -r -y "deb https://download.ceph.com/debian-${CEPH_RELEASE}/ ${os_CODENAME} main" elif is_fedora; then - sudo rm -rf /etc/yum.repos.d/ext-ceph.repo + sudo rm -rf /etc/yum.repos.d/ceph.repo fi } # configure_repo_nfsganesha() - Configure NFS Ganesha repositories # Usage: configure_repo_nfsganesha \ # [] -# - package_manager: apt-get or yum -# - flavor: ceph_luminous, ceph_master, ... -# - distro_type: centos, ubuntu -# - distro_release: 7, xenial, bionic -# - repo_type: latest (only latest is supported right now) +# - package_manager: apt-get or dnf +# - ganesha_release: 2.5, 2.5 +# - ceph_release: ceph_luminous, ceph_nautilus function configure_repo_nfsganesha { local package_manager="$1" - local ganesha_flavor="$2" - local distro_type="$3" - local distro_release="$4" - local repo_type="${5:-latest}" + local ganesha_release="$2" + local ceph_release="$3" - local repo_file_name="" - if [ "${package_manager}" = "apt-get" ]; then - repo_file_name="/etc/apt/sources.list.d/ext-nfs-ganesha.list" - elif [ "${package_manager}" = "yum" ]; then - repo_file_name="/etc/yum.repos.d/ext-nfs-ganesha.repo" + if is_ubuntu; then + # FIXME(vkmc) We need to use community ppa's because there is no build available + # for ubuntu xenial and above for nfs-ganesha-2.7. + # Remove this when they provide the build in download.ceph.com + sudo add-apt-repository -y ppa:nfs-ganesha/libntirpc-1.7 + sudo add-apt-repository -y ppa:nfs-ganesha/nfs-ganesha-2.7 + elif is_fedora; then + dnf_add_repository_nfsganesha ${ganesha_release} ${ceph_release} fi - if [ -n "${repo_file_name}" ]; then - repo=$(curl -L "https://shaman.ceph.com/api/search/?project=nfs-ganesha-stable&distros=${distro_type}/${distro_release}&flavor=${ganesha_flavor}&sha1=${repo_type}" | \ - jq '.[0] | .chacra_url' | tr -d '"' | awk '{print $1"repo"}') - curl -L $repo | sudo tee ${repo_file_name} - sudo ${package_manager} -y update - fi + sudo ${package_manager} -y update } # cleanup_repo_nfsganesha() - Remove NFS Ganesha repositories # Usage: cleanup_repo_nfsganesha function cleanup_repo_nfsganesha { if is_ubuntu; then - sudo rm -rf /etc/apt/sources.list.d/ext-nfs-ganesha.list + # FIXME(vkmc) We need to use community ppa's because there is no build available + # for ubuntu xenial and above for nfs-ganesha-2.7. + # Remove this when they provide the build in download.ceph.com + sudo rm -rf /etc/apt/sources.list.d/nfs-ganesha-ubuntu-libntirpc-1_7-*.list + sudo rm -rf /etc/apt/sources.list.d/nfs-ganesha-ubuntu-nfs-ganesha-2_7-*.list elif is_fedora; then - sudo rm -rf /etc/yum.repos.d/ext-nfs-ganesha.repo + sudo rm -rf /etc/yum.repos.d/nfs-ganesha.repo fi } function setup_packages_for_manila_on_ubuntu { - # The 'apt-get' package manager needs the following package to access - # HTTPS enabled repositories such as the Ceph repos hosted by the - # shaman/chacra system. - install_package apt-transport-https - CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs2" if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then if [[ $os_CODENAME =~ (xenial) ]]; then - configure_repo_nfsganesha "apt-get" "$GANESHA_RELEASE_STABLE" "ubuntu" "$os_CODENAME" + configure_repo_nfsganesha "apt-get" "$GANESHA_RELEASE" "$CEPH_RELEASE_STABLE" else - configure_repo_nfsganesha "apt-get" "$GANESHA_RELEASE" "ubuntu" "$os_CODENAME" + configure_repo_nfsganesha "apt-get" "$GANESHA_RELEASE" "$CEPH_RELEASE" fi - CEPH_PACKAGES="${CEPH_PACKAGES} nfs-ganesha nfs-ganesha-ceph" + CEPH_PACKAGES="${CEPH_PACKAGES} libntirpc1 nfs-ganesha nfs-ganesha-ceph" fi if python3_enabled; then @@ -983,15 +1033,13 @@ function setup_packages_for_manila_on_ubuntu { function setup_packages_for_manila_on_fedora_family { if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then - # NOTE(vkmc) shaman currently does not build for Fedora - # we need to stick to CentOS 7 packages - configure_repo_nfsganesha "yum" "$CEPH_RELEASE" "centos" "7" + # NOTE(vkmc) el7 packages work on Fedora + configure_repo_nfsganesha "dnf" "$GANESHA_RELEASE" "$CEPH_RELEASE" CEPH_PACKAGES="${CEPH_PACKAGES} nfs-ganesha nfs-ganesha-ceph" fi } function install_ceph { - install_package jq if is_ubuntu; then if ! [[ $os_CODENAME =~ (focal|xenial|bionic) ]]; then @@ -1002,9 +1050,9 @@ function install_ceph { install_package software-properties-common if [[ $os_CODENAME =~ (xenial) ]]; then - configure_repo_ceph "apt-get" "$CEPH_RELEASE_STABLE" "ubuntu" "$os_CODENAME" + configure_repo_ceph "apt-get" "$CEPH_RELEASE_STABLE" "$os_CODENAME" else - configure_repo_ceph "apt-get" "$CEPH_RELEASE" "ubuntu" "$os_CODENAME" + configure_repo_ceph "apt-get" "$CEPH_RELEASE" "$os_CODENAME" fi CEPH_PACKAGES="ceph libnss3-tools" @@ -1036,9 +1084,8 @@ function install_ceph { die $LINENO "Supported for Fedora 31 and 32. Not supported for other releases." fi - # NOTE(vkmc) shaman currently does not build for Fedora - # we need to stick to CentOS 7 packages - configure_repo_ceph "yum" "$CEPH_RELEASE" "centos" "7" + # NOTE(vkmc) el7 packages work on Fedora + configure_repo_ceph "dnf" "$CEPH_RELEASE" "el7" CEPH_PACKAGES="ceph"