Fix for containers to use /opt/rapid 62/70262/1
authorYury Kylulin <yury.kylulin@intel.com>
Wed, 3 Jun 2020 14:04:25 +0000 (14:04 +0000)
committerYury Kylulin <yury.kylulin@intel.com>
Wed, 3 Jun 2020 14:04:25 +0000 (14:04 +0000)
Fix scripts and build procedure to use /opt/rapid as a main directory for
binaries and config files.

Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
Change-Id: Icb38c37a85a78a6f2de2e751df5fafd624b4f1b3

VNFs/DPPD-PROX/helper-scripts/rapid/Dockerfile
VNFs/DPPD-PROX/helper-scripts/rapid/deploycentostools.sh
VNFs/DPPD-PROX/helper-scripts/rapid/dockerimage.sh
VNFs/DPPD-PROX/helper-scripts/rapid/pod.py
VNFs/DPPD-PROX/helper-scripts/rapid/port_info/Makefile

index 9f2161f..c4a4b06 100644 (file)
@@ -37,7 +37,7 @@ ARG BUILD_DIR=/opt/rapid
 COPY ./deploycentostools.sh ${BUILD_DIR}/
 COPY --from=builder ${BUILD_DIR}/install_components.tgz ${BUILD_DIR}/install_components.tgz
 
-RUN chmod +x ${BUILD_DIR}/deploycentostools.sh \
+RUN chmod a+rwx ${BUILD_DIR} && chmod +x ${BUILD_DIR}/deploycentostools.sh \
  && ${BUILD_DIR}/deploycentostools.sh -k runtime_image
 
 # Expose SSH and PROX ports
index 345b081..0a1a292 100644 (file)
@@ -199,16 +199,16 @@ function port_info_build()
 
        pushd ${BUILD_DIR}/port_info > /dev/null 2>&1
        make
-       ${SUDO} cp ${BUILD_DIR}/port_info/build/app/port_info ${HOME}/port_info
+       ${SUDO} cp ${BUILD_DIR}/port_info/build/app/port_info_app ${BUILD_DIR}/port_info_app
        popd > /dev/null 2>&1
 }
 
 function create_minimal_install()
 {
-       ldd ${HOME}/prox | awk '{ if ($(NF-1) != "=>") print $(NF-1) }' >> ${BUILD_DIR}/list_of_install_components
+       ldd ${BUILD_DIR}/prox | awk '{ if ($(NF-1) != "=>") print $(NF-1) }' >> ${BUILD_DIR}/list_of_install_components
 
-       echo "${HOME}/prox" >> ${BUILD_DIR}/list_of_install_components
-       echo "${HOME}/port_info" >> ${BUILD_DIR}/list_of_install_components
+       echo "${BUILD_DIR}/prox" >> ${BUILD_DIR}/list_of_install_components
+       echo "${BUILD_DIR}/port_info_app" >> ${BUILD_DIR}/list_of_install_components
 
        tar -czvhf ${BUILD_DIR}/install_components.tgz -T ${BUILD_DIR}/list_of_install_components
 }
index 3d77aae..e0f38ad 100755 (executable)
@@ -24,12 +24,14 @@ DOCKER_REGISTRY="localhost:5000"
 
 USE_DOCKER_CACHE="n"
 
+IMAGE_BUILD_LOG="dockerimage-build.log"
+
 function create_ssh_key()
 {
        if [ -f ./${RSA_KEY_FILE_NAME} ]; then
                read -p "RSA key already exist! Do you want to remove it (yYnN)?" -n 1 -r
 
-               if [ "$REPLY" == "y" ] || [ "$REPLY" == "Y" ]; then
+               if [ "${REPLY}" == "y" ] || [ "${REPLY}" == "Y" ]; then
                        echo "Removing existing key..."
                        sleep 3
 
@@ -49,10 +51,10 @@ function build_prox_image()
 {
        if [ "${USE_DOCKER_CACHE}" == "y" ]; then
                echo "Building image using cache..."
-               docker build --rm -t ${PROX_IMAGE_NAME}:latest -f ${DOCKERFILE} ${PROX_DEPLOY_DIR}
+               docker build --rm -t ${PROX_IMAGE_NAME}:latest -f ${DOCKERFILE} ${PROX_DEPLOY_DIR} 2>&1 | tee ./${IMAGE_BUILD_LOG}
        else
                echo "Building image without cache..."
-               docker build --no-cache --rm -t ${PROX_IMAGE_NAME}:latest -f ${DOCKERFILE} ${PROX_DEPLOY_DIR}
+               docker build --no-cache --rm -t ${PROX_IMAGE_NAME}:latest -f ${DOCKERFILE} ${PROX_DEPLOY_DIR} 2>&1 | tee ./${IMAGE_BUILD_LOG}
        fi
 }
 
index 359523a..fdcb6a4 100644 (file)
@@ -167,7 +167,7 @@ class Pod:
         self._log.debug("Using first SRIOV VF %s" % self._sriov_vf)
 
         self._log.info("Getting MAC address for assigned SRIOV VF %s" % self._sriov_vf)
-        self._ssh_client.run_cmd("sudo /home/centos/port_info -n 4 -w %s" % self._sriov_vf)
+        self._ssh_client.run_cmd("sudo /opt/rapid/port_info_app -n 4 -w %s" % self._sriov_vf)
         if ret != 0:
             self._log.error("Failed to get MAC address!"
                             "Error %s" % self._ssh_client.get_error())
index 39ebd35..f91cf15 100644 (file)
@@ -24,7 +24,7 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc
 include $(RTE_SDK)/mk/rte.vars.mk
 
 # binary name
-APP = port_info
+APP = port_info_app
 
 # all source are stored in SRCS-y
 SRCS-y := port_info.c