From 2ffcab9020513bc9ceade892fd989e9a9989ced0 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Thu, 27 Nov 2025 10:32:37 +0100 Subject: [PATCH] Feature 11077: update installer to remove osm-devops deb package installation Change-Id: I85ff7554de78ce96e3b3ee844cab8b7541cded81 Signed-off-by: garciadeblas --- installers/00-default-install-options.rc | 3 - installers/01-export-osm-install-options.sh | 3 - installers/full_install_osm.sh | 26 ++------ installers/install_osm.sh | 72 ++++----------------- jenkins/ci-pipelines/ci_stage_3.groovy | 27 +------- jenkins/public-clouds-tests/Jenkinsfile | 2 +- 6 files changed, 18 insertions(+), 115 deletions(-) diff --git a/installers/00-default-install-options.rc b/installers/00-default-install-options.rc index 6159a524..4b057ca0 100644 --- a/installers/00-default-install-options.rc +++ b/installers/00-default-install-options.rc @@ -20,9 +20,6 @@ export APT_PROXY_URL="" export K8S_CLUSTER_ENGINE="k3s" export DEBUG_INSTALL="" export RELEASE="testing-daily" -export REPOSITORY="testing" -export REPOSITORY_KEY="OSM%20ETSI%20Release%20Key.gpg" -export REPOSITORY_BASE="https://osm-download.etsi.org/repository/osm/debian" export INSTALL_AUX_CLUSTER="y" export INSTALL_MGMT_CLUSTER="y" export OSM_NAMESPACE=osm diff --git a/installers/01-export-osm-install-options.sh b/installers/01-export-osm-install-options.sh index a69eb640..069a446a 100755 --- a/installers/01-export-osm-install-options.sh +++ b/installers/01-export-osm-install-options.sh @@ -36,9 +36,6 @@ export APT_PROXY_URL=${APT_PROXY_URL} export K8S_CLUSTER_ENGINE=${K8S_CLUSTER_ENGINE} export DEBUG_INSTALL=${DEBUG_INSTALL} export RELEASE=${RELEASE} -export REPOSITORY=${REPOSITORY} -export REPOSITORY_KEY=${REPOSITORY_KEY} -export REPOSITORY_BASE=${REPOSITORY_BASE} export INSTALL_AUX_CLUSTER=${INSTALL_AUX_CLUSTER} export INSTALL_MGMT_CLUSTER=${INSTALL_MGMT_CLUSTER} export OSM_NAMESPACE=${OSM_NAMESPACE} diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 589fffab..e9a0611a 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -20,10 +20,7 @@ function usage(){ echo -e " OPTIONS" echo -e " -h / --help: print this help" echo -e " -y: do not prompt for confirmation, assumes yes" - echo -e " -r : use specified repository name for osm packages" - echo -e " -R : use specified release for osm binaries (deb packages, ...)" - echo -e " -u : use specified repository url for osm packages" - echo -e " -k : use specified repository public key url" + echo -e " -S : use a specific devops gerrit refspec (branch, tag, commit), default is master" echo -e " -a : use this apt proxy url when downloading apt packages (air-gapped installation)" echo -e " -c : use a specific kubernetes engine (options: kubeadm, k3s), default is kubeadm" echo -e " -t specify osm docker tag (default is latest)" @@ -52,8 +49,11 @@ echo "Load default options and export user installation options" source $OSM_DEVOPS/installers/00-default-install-options.rc RE_CHECK='^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' -while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do +while getopts ":a:c:e:S:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do case "${o}" in + S) + DEVOPS_GERRIT_REFSPEC="${OPTARG}" + ;; a) APT_PROXY_URL=${OPTARG} ;; @@ -67,22 +67,6 @@ while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do e) OSM_K8S_EXTERNAL_IP="${OPTARG}" ;; - r) - REPOSITORY="${OPTARG}" - REPO_ARGS+=(-r "$REPOSITORY") - ;; - k) - REPOSITORY_KEY="${OPTARG}" - REPO_ARGS+=(-k "$REPOSITORY_KEY") - ;; - u) - REPOSITORY_BASE="${OPTARG}" - REPO_ARGS+=(-u "$REPOSITORY_BASE") - ;; - R) - RELEASE="${OPTARG}" - REPO_ARGS+=(-R "$RELEASE") - ;; D) OSM_DEVOPS="${OPTARG}" ;; diff --git a/installers/install_osm.sh b/installers/install_osm.sh index a70b05eb..03559a7e 100755 --- a/installers/install_osm.sh +++ b/installers/install_osm.sh @@ -12,11 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -REPOSITORY_BASE=https://osm-download.etsi.org/repository/osm/debian -RELEASE=ReleaseEIGHTEEN -REPOSITORY=stable + +DEVOPS_GERRIT_REFSPEC="master" DOCKER_TAG="testing-daily" -DEVOPS_PATH=/usr/share/osm-devops function usage(){ [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function @@ -25,10 +23,7 @@ function usage(){ echo -e " OPTIONS" echo -e " -h / --help: print this help" echo -e " -y: do not prompt for confirmation, assumes yes" - echo -e " -r : use specified repository name for osm packages" - echo -e " -R : use specified release for osm binaries (deb packages, ...)" - echo -e " -u : use specified repository url for osm packages" - echo -e " -k : use specified repository public key url" + echo -e " -S : use a specific devops gerrit refspec (branch, tag, commit), default is master" echo -e " -a : use this apt proxy url when downloading apt packages (air-gapped installation)" echo -e " -c : use a specific kubernetes engine (options: kubeadm, k3s), default is kubeadm" echo -e " -t specify osm docker tag (default is latest)" @@ -49,43 +44,6 @@ function usage(){ [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function } -add_repo() { - REPO_CHECK="^$1" - grep "${REPO_CHECK/\[arch=amd64\]/\\[arch=amd64\\]}" /etc/apt/sources.list > /dev/null 2>&1 - if [ $? -ne 0 ] - then - need_packages_lw="software-properties-common apt-transport-https" - echo -e "Checking required packages to add ETSI OSM debian repo: $need_packages_lw" - dpkg -l $need_packages_lw &>/dev/null \ - || ! echo -e "One or several required packages are not installed. Updating apt cache requires root privileges." \ - || sudo apt-get -qy update \ - || ! echo "failed to run apt-get update" \ - || exit 1 - dpkg -l $need_packages_lw &>/dev/null \ - || ! echo -e "Installing $need_packages_lw requires root privileges." \ - || sudo apt-get install -y $need_packages_lw \ - || ! echo "failed to install $need_packages_lw" \ - || exit 1 - curl -s -o OSM-ETSI-Release-key.gpg "$REPOSITORY_BASE/$RELEASE/OSM%20ETSI%20Release%20Key.gpg" - sudo APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add OSM-ETSI-Release-key.gpg \ - || ! echo -e "Could not add GPG key $REPOSITORY_BASE/$RELEASE/OSM%20ETSI%20Release%20Key.gpg" \ - || exit 1 - sudo DEBIAN_FRONTEND=noninteractive add-apt-repository -y "$1" - sudo DEBIAN_FRONTEND=noninteractive apt-get -y update - return 0 - fi - - return 1 -} - -clean_old_repo() { -dpkg -s 'osm-devops' &> /dev/null -if [ $? -eq 0 ]; then - # Clean the previous repos that might exist - sudo sed -i "/osm-download.etsi.org/d" /etc/apt/sources.list -fi -} - function configure_apt_proxy() { [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function OSM_APT_PROXY=$1 @@ -102,19 +60,10 @@ EOF" [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function } -while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do +while getopts ":a:c:e:S:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do case "${o}" in - D) - DEVOPS_PATH="${OPTARG}" - ;; - r) - REPOSITORY="${OPTARG}" - ;; - R) - RELEASE="${OPTARG}" - ;; - u) - REPOSITORY_BASE="${OPTARG}" + S) + DEVOPS_GERRIT_REFSPEC="${OPTARG}" ;; t) DOCKER_TAG="${OPTARG}" @@ -138,8 +87,9 @@ while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do esac done -clean_old_repo -add_repo "deb [arch=amd64] $REPOSITORY_BASE/$RELEASE $REPOSITORY devops" sudo DEBIAN_FRONTEND=noninteractive apt-get -qy update -sudo DEBIAN_FRONTEND=noninteractive apt-get -y install osm-devops -$DEVOPS_PATH/installers/full_install_osm.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D $DEVOPS_PATH -t $DOCKER_TAG "$@" +sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git +DEVOPS_PATH=$(mktemp -d /tmp/osm-devops-XXXXXX) +git clone https://osm.etsi.org/gerrit/osm/devops.git $DEVOPS_PATH +git -C $DEVOPS_PATH checkout $DEVOPS_GERRIT_REFSPEC +$DEVOPS_PATH/installers/full_install_osm.sh -t $DOCKER_TAG "$@" diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index 7bb9c0c9..411fc79e 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -960,24 +960,6 @@ node("${params.NODE}") { repo_key_name = '' release = '' - if (params.COMMIT_ID) { - commit_id = "-b ${params.COMMIT_ID}" - } - if (params.REPO_DISTRO) { - repo_distro = "-r ${params.REPO_DISTRO}" - } - if (params.REPO_KEY_NAME) { - repo_key_name = "-k ${params.REPO_KEY_NAME}" - } - if (params.RELEASE) { - release = "-R ${params.RELEASE}" - } - if (params.REPOSITORY_BASE) { - repo_base_url = "-u ${params.REPOSITORY_BASE}" - } else { - repo_base_url = "-u http://${NODE_IP_ADDRESS}:${repo_port}" - } - remote = [ name: containerName, host: IP_ADDRESS, @@ -989,7 +971,7 @@ node("${params.NODE}") { ] sshCommand remote: remote, command: ''' - wget https://osm-download.etsi.org/ftp/osm-18.0-eighteen/install_osm.sh + wget https://osm-download.etsi.org/ftp/osm-19.0-nineteen/install_osm.sh chmod +x ./install_osm.sh sed -i '1 i\\export PATH=/snap/bin:\$PATH' ~/.bashrc ''' @@ -1011,10 +993,6 @@ node("${params.NODE}") { withCredentials([gitlabCredentialsMap]) { sshCommand remote: remote, command: """ ./install_osm.sh -y \ - ${repo_base_url} \ - ${repo_key_name} \ - ${release} -r unstable \ - --charmed \ --registry ${USERNAME}:${PASSWORD}@${INTERNAL_DOCKER_REGISTRY} \ --tag ${containerName} """ @@ -1034,9 +1012,6 @@ node("${params.NODE}") { withCredentials([gitlabCredentialsMap]) { sshCommand remote: remote, command: """ ./install_osm.sh -y \ - ${repo_base_url} \ - ${repo_key_name} \ - ${release} -r unstable \ -d ${USERNAME}:${PASSWORD}@${INTERNAL_DOCKER_REGISTRY} \ -p ${INTERNAL_DOCKER_PROXY} \ -t ${containerName} \ diff --git a/jenkins/public-clouds-tests/Jenkinsfile b/jenkins/public-clouds-tests/Jenkinsfile index 5739d082..caea6dfd 100644 --- a/jenkins/public-clouds-tests/Jenkinsfile +++ b/jenkins/public-clouds-tests/Jenkinsfile @@ -21,7 +21,7 @@ pipeline { // Parameters to define the specific OSM version to test // --> Defaults to latest stable version of Release FOURTEEN - string(defaultValue: 'https://osm-download.etsi.org/ftp/osm-18.0-eighteen/install_osm.sh', description: 'URL to OSM installer', name: 'INSTALLER_URL') + string(defaultValue: 'https://osm-download.etsi.org/ftp/osm-19.0-nineteen/install_osm.sh', description: 'URL to OSM installer', name: 'INSTALLER_URL') string(defaultValue: 'testing-daily', description: 'Release for OSM binaries (REPO_BASE)', name: 'REPO_BASE') string(defaultValue: 'testing-daily', description: 'OSM docker tag (DOCKER_TAG)', name: 'DOCKER_TAG') string(defaultValue: 'testing', description: 'Repository name for OSM packages (REPO_NAME)', name: 'REPO_NAME') -- 2.25.1