From 920d756bbe87609b2f51d44279b269ff6f8ff746 Mon Sep 17 00:00:00 2001 From: beierlm Date: Wed, 21 Apr 2021 05:13:53 -0400 Subject: [PATCH] OSM Client Installation Fix Updates stage 3 to present osmclient and IM debian packages. Updates installer to also install pip requirements.txt if those files are present from the osmclient .deb package Fixes bug 1510 Change-Id: I9ee44b265615935fee6c869c6c3c261739370183 Signed-off-by: beierlm --- installers/full_install_osm.sh | 13 ++++++++++--- jenkins/ci-pipelines/ci_stage_3.groovy | 14 +++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 04605da7..eb92ba2d 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -220,7 +220,7 @@ function uninstall_lightweight() { remove_stack osm_elk fi echo "Now osm docker images and volumes will be deleted" - # TODO: clean-up of images should take into account if other tags were used for specific modules + # TODO: clean-up of images should take into account if other tags were used for specific modules newgrp docker << EONG for module in ro lcm keystone nbi mon pol pla osmclient; do docker image rm ${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module}:${OSM_DOCKER_TAG} @@ -339,6 +339,13 @@ function install_osmclient(){ sudo -H LC_ALL=C python3 -m pip install -U pip sudo -H LC_ALL=C python3 -m pip install -U python-magic pyangbind verboselogs sudo apt-get install -y python3-osm-im python3-osmclient + if [ -f /usr/lib/python3/dist-packages/osm_im/requirements.txt ]; then + sudo -H LC_ALL=C python3 -m pip install -r /usr/lib/python3/dist-packages/osm_im/requirements.txt + fi + if [ -f /usr/lib/python3/dist-packages/osmclient/requirements.txt ]; then + sudo apt-get install -y libcurl4-openssl-dev libssl-dev + sudo -H LC_ALL=C python3 -m pip install -r /usr/lib/python3/dist-packages/osmclient/requirements.txt + fi #sed 's,OSM_SOL005=[^$]*,OSM_SOL005=True,' -i ${HOME}/.bashrc #echo 'export OSM_HOSTNAME=localhost' >> ${HOME}/.bashrc #echo 'export OSM_SOL005=True' >> ${HOME}/.bashrc @@ -578,11 +585,11 @@ function generate_docker_images() { if [ $module == "PLA" -a ! -n "$INSTALL_PLA" ]; then continue fi - module_tag="${OSM_DOCKER_TAG}" + module_tag="${OSM_DOCKER_TAG}" if [ -n "${MODULE_DOCKER_TAG}" ] && echo $TO_REBUILD | grep -q $module ; then module_tag="${MODULE_DOCKER_TAG}" fi - echo "Pulling ${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module_lower}:${module_tag} docker image" + echo "Pulling ${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module_lower}:${module_tag} docker image" sg docker -c "docker pull ${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module_lower}:${module_tag}" || FATAL "cannot pull $module docker image" done else diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index a62b8c9f..87f1c83e 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -251,11 +251,15 @@ node("${params.NODE}") { /////////////////////////////////////////////////////////////////////////////////////// // Create Devops APT repository /////////////////////////////////////////////////////////////////////////////////////// - sh "mv devops/pool/ pool" - sh "dpkg-sig --sign builder -k ${GPG_KEY_NAME} pool/devops/*" - sh "mkdir -p dists/${params.REPO_DISTRO}/devops/binary-amd64/" - sh "apt-ftparchive packages pool/devops > dists/${params.REPO_DISTRO}/devops/binary-amd64/Packages" - sh "gzip -9fk dists/${params.REPO_DISTRO}/devops/binary-amd64/Packages" + sh "mkdir -p pool" + for (component in [ "devops", "IM", "osmclient" ]) { + sh "ls -al ${component}/pool/" + sh "cp -r ${component}/pool/* pool/" + sh "dpkg-sig --sign builder -k ${GPG_KEY_NAME} pool/${component}/*" + sh "mkdir -p dists/${params.REPO_DISTRO}/${component}/binary-amd64/" + sh "apt-ftparchive packages pool/${component} > dists/${params.REPO_DISTRO}/${component}/binary-amd64/Packages" + sh "gzip -9fk dists/${params.REPO_DISTRO}/${component}/binary-amd64/Packages" + } // create and sign the release file sh "apt-ftparchive release dists/${params.REPO_DISTRO} > dists/${params.REPO_DISTRO}/Release" -- 2.25.1