OSM Client Installation Fix 78/10678/1
authorbeierlm <mark.beierl@canonical.com>
Wed, 21 Apr 2021 09:13:53 +0000 (05:13 -0400)
committerbeierlm <mark.beierl@canonical.com>
Wed, 21 Apr 2021 09:13:53 +0000 (05:13 -0400)
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 <mark.beierl@canonical.com>
installers/full_install_osm.sh
jenkins/ci-pipelines/ci_stage_3.groovy

index 04605da..eb92ba2 100755 (executable)
@@ -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
index a62b8c9..87f1c83 100644 (file)
@@ -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"