Merge "Improving tag_and_push script"
diff --git a/seba-in-a-box/Makefile b/seba-in-a-box/Makefile
index ecef5ea..0789c21 100644
--- a/seba-in-a-box/Makefile
+++ b/seba-in-a-box/Makefile
@@ -5,13 +5,27 @@
 WORKSPACE       ?= $(HOME)
 VIRTUALENV      ?= $(WORKSPACE)/cord/test
 SEBAVALUES      ?= configs/seba-ponsim.yaml
+TESTTAGS        ?= stable
+
+# used to start logging/monitoring and other infrastructure charts
+INFRA_CHARTS    ?=
+INFRA_PREREQS   = $(foreach chart,$(INFRA_CHARTS),$(M)/$(chart))
 
 HELM_VERSION    ?= "2.10.0"
 HELM_SHA256SUM  ?= "0fa2ed4983b1e4a3f90f776d08b88b0c73fd83f305b5b634175cb15e61342ffe"
 HELM_PLATFORM   ?= "linux-amd64"
 
+KAFKA_CHART_VERSION  ?= 0.8.8
+
 all: $(M)/siab
 
+# https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_6.html#SEC69
+latest: SEBAVALUES := configs/seba-ponsim-latest.yaml
+latest: all
+
+stable: SEBAVALUES := configs/seba-ponsim.yaml
+stable: all
+
 $(M)/setup:
 	mkdir -p $(M)
 	sudo apt update
@@ -58,6 +72,7 @@
 		echo "Waiting for Helm to be ready"; \
 		sleep 5; \
 	done
+	helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
 	touch $@
 
 $(WORKSPACE)/cord/helm-charts: | $(M)/setup
@@ -65,21 +80,35 @@
 	cd $(WORKSPACE)/cord; git clone https://gerrit.opencord.org/helm-charts
 
 $(M)/kafka: | $(WORKSPACE)/cord/helm-charts $(M)/helm-init
-	helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
-	cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install cord-kafka -f examples/kafka-single.yaml incubator/kafka
+	cd $(WORKSPACE)/cord/helm-charts && \
+	helm upgrade --install cord-kafka --version $(KAFKA_CHART_VERSION) -f examples/kafka-single.yaml incubator/kafka
 	touch $@
 
 $(M)/kafka-running: | $(M)/kafka
 	kubectl wait pod/cord-kafka-0 --for condition=Ready --timeout=180s
 	touch $@
 
+$(M)/nem-monitoring: | $(M)/kafka-running
+	cd $(WORKSPACE)/cord/helm-charts && \
+	helm dep up nem-monitoring  && \
+	helm upgrade --install nem-monitoring nem-monitoring
+	$(WORKSPACE)/cord/helm-charts/scripts/wait_for_pods.sh
+	touch $@
+
+$(M)/logging: | $(M)/kafka-running
+	cd $(WORKSPACE)/cord/helm-charts && \
+	helm dep up logging && \
+	helm upgrade --install logging -f examples/logging-single.yaml logging
+	$(WORKSPACE)/cord/helm-charts/scripts/wait_for_pods.sh
+	touch $@
+
 # Dependency on NEM is there to force ordering for parallel install
 # The idea is to install VOLTHA / ONOS / Mininet while NEM is initializing
-$(M)/onos: | $(M)/kafka-running $(M)/nem
+$(M)/onos: | $(M)/kafka-running $(M)/nem $(INFRA_PREREQS)
 	cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install onos onos -f configs/onos.yaml -f $(SEBAVALUES)
 	touch $@
 
-$(M)/voltha: | $(M)/kafka-running
+$(M)/voltha: | $(M)/kafka-running $(INFRA_PREREQS)
 	cd $(WORKSPACE)/cord/helm-charts; helm dep up voltha
 	cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install voltha -f $(SEBAVALUES) \
     	--set etcd-operator.customResources.createEtcdClusterCRD=false \
@@ -103,6 +132,7 @@
 	cd $(WORKSPACE)/cord/helm-charts; helm upgrade voltha -f $(SEBAVALUES) \
     	--set etcd-operator.customResources.createEtcdClusterCRD=true \
     	voltha
+	timeout 180s bash -c "until kubectl wait pod/etcd-cluster-0000 --for condition=ready; do echo 'Waiting for etcd-cluster-0000 to be ready'; done"
 	touch $@
 
 $(M)/voltha-running: | $(M)/etcd-cluster
@@ -130,9 +160,9 @@
 	cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install mininet mininet
 	touch $@
 
-$(M)/nem: $(M)/kafka-running
+$(M)/nem: $(M)/kafka-running $(INFRA_PREREQS)
 	cd $(WORKSPACE)/cord/helm-charts; helm dep update xos-core
-	cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install xos-core xos-core
+	cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install xos-core xos-core -f $(SEBAVALUES)
 	cd $(WORKSPACE)/cord/helm-charts; helm dep update xos-profiles/att-workflow
 	cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install att-workflow xos-profiles/att-workflow -f $(SEBAVALUES)
 	touch $@
@@ -145,7 +175,7 @@
 	timeout 60s bash -c "until ! http -a admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/core/serviceinstanceattributes|jq '.items[].backend_status'|grep -v OK; do echo 'waiting for ONOS config to sync'; sleep 5; done"
 	timeout 60s bash -c "until ! http -a admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/onos/onosapps|jq '.items[].backend_status'|grep -v OK; do echo 'waiting for ONOS apps to sync'; sleep 5; done"
 	timeout 60s bash -c "until http -a karaf:karaf GET http://127.0.0.1:30120/onos/v1/applications/org.opencord.kafka|jq '.state'|grep -q ACTIVE; do echo 'Waiting for Kafka app to become ACTIVE'; sleep 5; done"
-	cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install ponsim-pod xos-profiles/ponsim-pod
+	cd $(WORKSPACE)/cord/helm-charts; helm upgrade --install ponsim-pod xos-profiles/ponsim-pod -f $(SEBAVALUES)
 	$(WORKSPACE)/cord/helm-charts/scripts/wait_for_pods.sh
 	touch $@
 
@@ -181,7 +211,7 @@
 		WORKSPACE=$(VIRTUALENV) bash ./setup_venv.sh && \
 		source $(VIRTUALENV)/venv-cord-tester/bin/activate && \
 		cd Tests/WorkflowValidations/ && \
-		pybot -e notready SIAB.robot
+		pybot -e notready -i $(TESTTAGS) SIAB.robot
 	touch $@
 
 remove-chart-milestones: