COMAC-97 Apply the latest changes to comac-in-a-box

Tested with the latest patch: https://gerrit.opencord.org/#/c/15057/

Change-Id: I584df922cddc739142d4bf6435b2223354101527
diff --git a/comac-in-a-box/Makefile b/comac-in-a-box/Makefile
index c163e8a..6e1fb1a 100644
--- a/comac-in-a-box/Makefile
+++ b/comac-in-a-box/Makefile
@@ -8,10 +8,10 @@
 VENV		?= $(BUILD)/venv/ciab
 CIABVALUES	?= $(MAKEDIR)/comac-in-a-box-values.yaml
 
-KUBESPRAY_VERSION ?= release-2.10
-DOCKER_VERSION	?= 18.06
-K8S_VERSION	?= v1.14.3
-HELM_VERSION	?= v2.13.1
+KUBESPRAY_VERSION ?= release-2.11
+DOCKER_VERSION	?= 18.09
+K8S_VERSION	?= v1.15.3
+HELM_VERSION	?= v2.14.2
 
 # used to start logging/monitoring and other infrastructure charts
 INFRA_CHARTS	?=
@@ -32,14 +32,14 @@
 os_vendor	:= $(shell lsb_release -i -s)
 os_release	:= $(shell lsb_release -r -s)
 
-ciab: $(M)/system_check $(M)/omec $(M)/oaisim $(M)/comac-platform
+ciab: $(M)/system-check $(M)/omec $(M)/oaisim
 
 .PHONY: ciab run-test reset-test clean
 
 $(M):
 	mkdir -p $(M)
 
-$(M)/system_check: | $(M)
+$(M)/system-check: | $(M)
 	@if [[ $(cpu_family) -eq 6 ]]; then \
 		if [[ $(cpu_model) -lt 60 ]]; then \
 			echo "FATAL: haswell CPU or newer is required."; \
@@ -149,9 +149,18 @@
 /opt/cni/bin/simpleovs: | $(M)/k8s-ready
 	sudo cp $(RESOURCEDIR)/simpleovs /opt/cni/bin/
 
-$(M)/omec: | $(M)/ovs-setup $(M)/helm-ready $(WORKSPACE)/cord/helm-charts /opt/cni/bin/simpleovs
-	cd $(WORKSPACE)/cord/helm-charts/mcord-release; \
-	helm upgrade --install $(HELM_GLOBAL_ARGS) mcord-services mcord-services -f $(CIABVALUES)
+/opt/cni/bin/static: | $(M)/k8s-ready
+	mkdir -p $(BUILD)/cni-plugins; cd $(BUILD)/cni-plugins; \
+	wget https://github.com/containernetworking/plugins/releases/download/v0.8.2/cni-plugins-linux-amd64-v0.8.2.tgz && \
+	tar xvfz cni-plugins-linux-amd64-v0.8.2.tgz
+	sudo cp $(BUILD)/cni-plugins/static /opt/cni/bin/
+
+$(M)/omec: | $(M)/ovs-setup $(M)/helm-ready $(WORKSPACE)/cord/helm-charts /opt/cni/bin/simpleovs /opt/cni/bin/static
+	cd $(WORKSPACE)/cord/helm-charts/omec; \
+	helm dep up omec-data-plane && \
+	helm dep up omec-control-plane && \
+	helm upgrade --install $(HELM_GLOBAL_ARGS) omec-data-plane omec-data-plane -f $(CIABVALUES) && \
+	helm upgrade --install $(HELM_GLOBAL_ARGS) omec-control-plane omec-control-plane -f $(CIABVALUES)
 	$(WORKSPACE)/cord/helm-charts/scripts/wait_for_pods.sh default
 	touch $@
 
@@ -174,7 +183,7 @@
 	$(eval mme_iface=$(shell ip -4 route list default | awk -F 'dev' '{ print $$2; exit }' | awk '{ print $$1 }'))
 	cd $(WORKSPACE)/cord/helm-charts; \
 	helm upgrade --install $(HELM_GLOBAL_ARGS) oaisim oaisim -f $(CIABVALUES) \
-		--set conf.enb.networks.s1_mme.interface=$(mme_iface)
+		--set config.enb.networks.s1_mme.interface=$(mme_iface)
 	$(WORKSPACE)/cord/helm-charts/scripts/wait_for_pods.sh default
 	@timeout 60s bash -c \
 	"until ip addr show oip1 | grep -q inet; \
@@ -186,15 +195,15 @@
 
 $(M)/router: | /opt/cni/bin/simpleovs $(M)/ovs-setup
 	kubectl apply -f $(RESOURCEDIR)/quagga.yaml
-	kubectl wait pod --for=condition=Ready -l app=quagga
+	kubectl wait pod --for=condition=Ready -l app=quagga --timeout=60s
 	$(eval spgwu_ip=$(shell kubectl get pod -ojson spgwu-0 2>/dev/null | \
 		jq -r '.metadata.annotations["k8s.v1.cni.cncf.io/networks-status"]' | \
 		jq -r '.[] | select(.name=="sgi-net") | .ips[0]'))
 	kubectl exec router ip route add 16.0.0.0/8 via $(spgwu_ip)
 	touch $@
 
-test: | $(M)/router
-	@timeout 60s bash -c \
+test: | $(M)/omec $(M)/oaisim $(M)/router
+	@timeout 120s bash -c \
 	"until timeout 3 ping -I oip1 13.1.1.254 -c 1 > /dev/null 2>&1; do \
 		echo 'Waiting for DP to be ready'; \
 	done"
@@ -203,7 +212,8 @@
 reset-test:
 	kubectl delete po router || true
 	helm delete --purge oaisim || true
-	helm delete --purge mcord-services || true
+	helm delete --purge omec-control-plane || true
+	helm delete --purge omec-data-plane || true
 	cd $(M); rm -f router oaisim omec
 
 clean: reset-test