Replace older BMRA docker image with new one & add 13/71613/4
authorRihab Banday <rihab.banday@ericsson.com>
Thu, 3 Dec 2020 19:53:32 +0000 (20:53 +0100)
committerRihab Banday <rihab.banday@ericsson.com>
Tue, 15 Dec 2020 15:23:42 +0000 (15:23 +0000)
changes for running it in CentOS 7

This change updates the Docker file of the BMRA
container & replaces the old image by the new one.
Additionally, it introduces changes needed to deploy
BMRA on CentOS 7.

Change-Id: I3f951bd147b457606719243d95fe48df14ecd449
Signed-off-by: Rihab Banday <rihab.banday@ericsson.com>
Reviewed-on: https://gerrit.opnfv.org/gerrit/c/kuberef/+/71613
Tested-by: jenkins-ci <jenkins-opnfv-ci@opnfv.org>
Reviewed-by: Michael Pedersen <michaelx.pedersen@intel.com>
functions.sh
playbooks/roles/bmra-config/templates/inventory.j2
sw_config/bmra/Dockerfile

index 88d6c09..62c9199 100755 (executable)
@@ -194,9 +194,9 @@ provision_k8s() {
     ansible_cmd="/bin/bash -c '"
     if [[ "$DEPLOYMENT" == "k8s" ]]; then
         ansible-playbook -i "$CURRENTPATH"/sw_config/bmra/inventory.ini "$CURRENTPATH"/playbooks/pre-install.yaml
-        ansible_cmd+="pip install --upgrade pip==9.0.3; pip install ansible==2.9.6;"
+        ansible_cmd+="pip install --upgrade pip==9.0.3; pip install ansible==2.9.6; ansible-playbook -i /bmra/inventory.ini /bmra/playbooks/k8s/patch_kubespray.yml;"
     fi
-    ansible_cmd+="ansible-playbook -i /bmra/inventory.ini /bmra/playbooks/k8s/patch_kubespray.yml; ansible-playbook -i /bmra/inventory.ini /bmra/playbooks/${BMRA_PROFILE}.yml'"
+    ansible_cmd+="ansible-playbook -i /bmra/inventory.ini /bmra/playbooks/${BMRA_PROFILE}.yml'"
 
     # shellcheck disable=SC2087
     ssh -o StrictHostKeyChecking=no -tT "$USERNAME"@"$(get_vm_ip)" << EOF
@@ -212,10 +212,13 @@ fi
 if [ ! -d "${PROJECT_ROOT}/container-experience-kits" ]; then
     git clone --recurse-submodules --depth 1 https://github.com/intel/container-experience-kits.git -b v2.0.0 ${PROJECT_ROOT}/container-experience-kits/
     cp -r ${PROJECT_ROOT}/container-experience-kits/examples/${BMRA_PROFILE}/group_vars ${PROJECT_ROOT}/container-experience-kits/
-#TODO Remove this once the reported issue is fixed in the next BMRA Release
+# NOTE The following condition/workaround will be removed once the reported issue https://github.com/intel/container-experience-kits/issues/68
+# is fixed upstream
     if [[ "$DEPLOYMENT" == "full" ]]; then
-        sed -i '/\openshift/a \    extra_args: --ignore-installed PyYAML' \
-        ${PROJECT_ROOT}/container-experience-kits/roles/net-attach-defs-create/tasks/main.yml
+       echo "- name: install Python packages
+  pip:
+    name:
+      - pip==9.0.3" >> ${PROJECT_ROOT}/container-experience-kits/roles/bootstrap/install_packages/tasks/rhel.yml
     fi
 fi
 cp ${PROJECT_ROOT}/${INSTALLER}/inventory.ini \
@@ -226,7 +229,7 @@ sudo docker run --rm \
 -e ANSIBLE_CONFIG=/bmra/ansible.cfg \
 -e PROFILE=${BMRA_PROFILE} \
 -v ${PROJECT_ROOT}/container-experience-kits:/bmra \
--v ~/.ssh/:/root/.ssh/ rihabbanday/bmra-install:centos \
+-v ~/.ssh/:/root/.ssh/ rihabbanday/bmra2.0-install:centos \
 ${ansible_cmd}
 EOF
 }
index 48e953c..28581e0 100644 (file)
@@ -19,5 +19,7 @@ kube-node
 
 [calico-rr]
 
+{% if deployment_type == 'k8s' %}
 [all:vars]
 ansible_python_interpreter=/usr/bin/python3
+{% endif %}
index 2402764..7b30ba5 100644 (file)
@@ -5,6 +5,7 @@ MAINTAINER "Rihab Banday <rihab.banday@ericsson.com>"
 RUN yum -y update && \
     yum -y install git epel-release python36 python-netaddr && \
     yum -y install python-pip && \
+    pip install pip==9.0.3 && \
     pip install ansible==2.9.6 jmespath && \
     pip install jinja2 --upgrade