From c8a0a1b6c2f831246f41cd258812984d0a3972f3 Mon Sep 17 00:00:00 2001 From: Joseph Moore <26410038+jgmoore-or@users.noreply.github.com> Date: Thu, 4 Jan 2024 06:41:14 -0700 Subject: [PATCH] DAOS-14746 test: Update CI provision scripts to correctly install MOFED. (#13505) Update CI provisioning scripts to correctly install latest MOFED. Signed-off-by: Joseph Moore --- ci/provisioning/post_provision_config.sh | 26 ++++++++++++------- .../post_provision_config_common.sh | 22 ++++++---------- .../post_provision_config_nodes_EL_8.sh | 26 ++++++++++++------- 3 files changed, 41 insertions(+), 33 deletions(-) diff --git a/ci/provisioning/post_provision_config.sh b/ci/provisioning/post_provision_config.sh index ef68e4c02a1..11b308f513e 100755 --- a/ci/provisioning/post_provision_config.sh +++ b/ci/provisioning/post_provision_config.sh @@ -19,6 +19,9 @@ source ci/provisioning/post_provision_config_common_functions.sh # shellcheck disable=SC1091 source ci/junit.sh + +: "${MLNX_VER_NUM:=latest-5.8}" + : "${DISTRO:=EL_7}" DSL_REPO_var="DAOS_STACK_${DISTRO}_LOCAL_REPO" DSG_REPO_var="DAOS_STACK_${DISTRO}_GROUP_REPO" @@ -42,11 +45,12 @@ if ! retry_cmd 2400 clush -B -S -l root -w "$NODESTRING" \ DAOS_STACK_GROUP_REPO=\"${!DSG_REPO_var:-}\" DAOS_STACK_EL_8_APPSTREAM_REPO=\"${!DSA_REPO_var:-}\" DISTRO=\"$DISTRO\" - DAOS_STACK_RETRY_DELAY_SECONDS=\"${DAOS_STACK_RETRY_DELAY_SECONDS}\" - DAOS_STACK_RETRY_COUNT=\"${DAOS_STACK_RETRY_COUNT}\" - BUILD_URL=\"${BUILD_URL}\" - STAGE_NAME=\"${STAGE_NAME}\" - OPERATIONS_EMAIL=\"${OPERATIONS_EMAIL}\" + DAOS_STACK_RETRY_DELAY_SECONDS=\"$DAOS_STACK_RETRY_DELAY_SECONDS\" + DAOS_STACK_RETRY_COUNT=\"$DAOS_STACK_RETRY_COUNT\" + MLNX_VER_NUM=\"$MLNX_VER_NUM\" + BUILD_URL=\"$BUILD_URL\" + STAGE_NAME=\"$STAGE_NAME\" + OPERATIONS_EMAIL=\"$OPERATIONS_EMAIL\" COMMIT_MESSAGE=\"$sanitized_commit_message\" REPO_FILE_URL=\"$REPO_FILE_URL\" ARTIFACTORY_URL=\"${ARTIFACTORY_URL:-}\" @@ -54,20 +58,22 @@ if ! retry_cmd 2400 clush -B -S -l root -w "$NODESTRING" \ CHANGE_TARGET=\"${CHANGE_TARGET:-}\" CI_RPM_TEST_VERSION=\"${CI_RPM_TEST_VERSION:-}\" CI_PR_REPOS=\"${CI_PR_REPOS:-}\" + REPO_PATH=\"${REPO_PATH:-}\" + ARTIFACTS_URL=\"${ARTIFACTS_URL:-}\" $(cat ci/stacktrace.sh) $(cat ci/junit.sh) $(cat ci/provisioning/post_provision_config_common_functions.sh) $(cat ci/provisioning/post_provision_config_common.sh) - $(cat ci/provisioning/post_provision_config_nodes_"${DISTRO}".sh) + $(cat ci/provisioning/post_provision_config_nodes_"$DISTRO".sh) $(cat ci/provisioning/post_provision_config_nodes.sh)"; then report_junit post_provision_config.sh results.xml "$NODESTRING" exit 1 fi -git log --format=%s -n 1 HEAD | \ +git log --format=%B -n 1 HEAD | sed -ne '1s/^\([A-Z][A-Z]*-[0-9][0-9]*\) .*/\1/p' \ + -e '/^Fixes:/{s/^Fixes: *//;s/ /\ +/g;p}' | \ retry_cmd 60 ssh -i ci_key -l jenkins "${NODELIST%%,*}" \ - "cat >/tmp/commit_title" + "cat >/tmp/commit_fixes" git log --pretty=format:%h --abbrev-commit --abbrev=7 | retry_cmd 60 ssh -i ci_key -l jenkins "${NODELIST%%,*}" "cat >/tmp/commit_list" -retry_cmd 600 ssh root@"${NODELIST%%,*}" "mkdir -p /scratch && " \ - "mount wolf-2:/export/scratch /scratch" diff --git a/ci/provisioning/post_provision_config_common.sh b/ci/provisioning/post_provision_config_common.sh index b7724eacdc4..06ad80b984a 100755 --- a/ci/provisioning/post_provision_config_common.sh +++ b/ci/provisioning/post_provision_config_common.sh @@ -24,31 +24,28 @@ if [ -n "$repo_files_pr" ]; then REPO_FILE_URL="${JENKINS_URL:-https://build.hpdd.intel.com/}job/daos-do/job/repo-files/job/$branch/$build_number/artifact/" fi -id=$(lsb_release -si) -release=$(lsb_release -sr) +. /etc/os-release # shellcheck disable=SC2034 EXCLUDE_UPGRADE=mercury,daos,daos-\* if rpm -qa | grep mlnx; then # packages not to allow upgrading if MLNX OFED is installed EXCLUDE_UPGRADE+=,openmpi,\*mlnx\*,\*ucx\* fi -case "$id" in - CentOS|Rocky|AlmaLinux|RedHatEnterpriseServer) - if [ "${release%%.*}" = 7 ]; then - DISTRO_NAME=centos${release%%.*} +case "$ID_LIKE" in + *rhel*) + if [ "$VERSION_ID" = "7" ]; then + DISTRO_NAME=centos"$VERSION_ID" EXCLUDE_UPGRADE+=,fuse else - DISTRO_NAME=el${release%%.*} + DISTRO_NAME=el${VERSION_ID%%.*} EXCLUDE_UPGRADE+=,dpdk\* fi REPOS_DIR=/etc/yum.repos.d DISTRO_GENERIC=el - # shellcheck disable=SC2034 - LSB_RELEASE=redhat-lsb-core ;; - openSUSE) + *suse*) # shellcheck disable=SC2034 - DISTRO_NAME=leap${release%%.*} + DISTRO_NAME=leap${VERSION_ID%%.*} # shellcheck disable=SC2034 DISTRO_GENERIC=sl # shellcheck disable=SC2034 @@ -56,6 +53,3 @@ case "$id" in EXCLUDE_UPGRADE+=,fuse,fuse-libs,fuse-devel ;; esac - -# shellcheck disable=SC2034 -MLNX_VER_NUM=5.8-3.0.7.0 \ No newline at end of file diff --git a/ci/provisioning/post_provision_config_nodes_EL_8.sh b/ci/provisioning/post_provision_config_nodes_EL_8.sh index 57f5af8cabc..0c73e1d0c96 100644 --- a/ci/provisioning/post_provision_config_nodes_EL_8.sh +++ b/ci/provisioning/post_provision_config_nodes_EL_8.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# (C) Copyright 2021-2022 Intel Corporation. +# (C) Copyright 2021-2023 Intel Corporation. # # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -16,8 +16,14 @@ group_repo_post() { distro_custom() { # install avocado - dnf -y install python3-avocado{,-plugins-{output-html,varianter-yaml-to-mux}} \ - clustershell + local avocado_rpms=(python3-avocado{,-plugins-{output-html,varianter-yaml-to-mux}}) + if [ -z "$(dnf repoquery "${avocado_rpms[@]}")" ]; then + avocado_rpms=() + pip install "avocado-framework<83.0" + pip install "avocado-framework-plugin-result-html<83.0" + pip install "avocado-framework-plugin-varianter-yaml-to-mux<83.0" + fi + dnf -y install "${avocado_rpms[@]}" clustershell # for Launchable's pip install dnf -y install python3-setuptools.noarch @@ -47,21 +53,23 @@ install_mofed() { stream=false - gversion="$(lsb_release -sr)" + gversion="$VERSION_ID" if [ "$gversion" == "8" ]; then - gversion="8.6" + # Mellanox does not have a release for 8.9 yet. + gversion="8.8" stream=true elif [[ $gversion = *.*.* ]]; then gversion="${gversion%.*}" fi # Add a repo to install MOFED RPMS - repo_url=https://artifactory.dc.hpdd.intel.com/artifactory/mlnx_ofed/"$MLNX_VER_NUM-rhel$gversion"-x86_64/ + artifactory_base_url="https://artifactory.dc.hpdd.intel.com/artifactory/" + mellanox_proxy="${artifactory_base_url}mellanox-proxy/mlnx_ofed/" + mellanox_key_url="${artifactory_base_url}mlnx_ofed/RPM-GPG-KEY-Mellanox" + rpm --import "$mellanox_key_url" + repo_url="$mellanox_proxy$MLNX_VER_NUM/rhel$gversion/x86_64/" dnf -y config-manager --add-repo="$repo_url" - curl -L -O "$repo_url"RPM-GPG-KEY-Mellanox dnf -y config-manager --save --setopt="$(url_to_repo "$repo_url")".gpgcheck=1 - rpm --import RPM-GPG-KEY-Mellanox - rm -f RPM-GPG-KEY-Mellanox dnf repolist || true time dnf -y install mlnx-ofed-basic ucx-cma ucx-ib ucx-knem ucx-rdmacm ucx-xpmem