Reducing duplicated values on values files for SiaB

Reduced the amount of duplicated values between seba-ponsim values file.
To deploy, for example, the latest of seba-ponsim, now both seba-ponsim.yaml and seba-pomsim-latest.yaml values files need to be used with the specified order.
Makefile for SiaB is modified accordingly in the patch https://gerrit.opencord.org/#/c/16743/.
Also:
- removed stratumEnabled value from Mininet chart and added mnStratumSwitchCount
- moved bngAppUrl and bngAppVersion values on root of values file

Change-Id: I26b8e91f868646adc06f2c1feea72b333defd487
diff --git a/configs/seba-ponsim-latest.yaml b/configs/seba-ponsim-latest.yaml
index 128f92f..211b390 100644
--- a/configs/seba-ponsim-latest.yaml
+++ b/configs/seba-ponsim-latest.yaml
@@ -14,13 +14,11 @@
 # limitations under the License.
 
 # Values file for deploying SEBA with Ponsim
-# Use this file to deploy the 'master' (dev) versions of all services.
+# Use this file together to deploy the 'master' (dev) versions of all services.
+# This file can be used together with seba-ponsim.yaml, seba-ponsim-stratum.yaml
+# or seba-ponsim-sdbng.yaml
 # This is mainly useful for testing.
 
-# voltha
-etcd-cluster:
-  clusterSize: 1
-
 # in xos-core chart and other charts with multiple images
 images:
   xos_core:
@@ -105,24 +103,14 @@
   image:
     tag: 'master'
 
-  # this is mandatory, it's needed to correctly configure the kafka endpoint
-  kafkaService: cord-kafka
-
 # in workflow/tt-workflow service chart
 tt-workflow-driver:
   image:
     tag: 'master'
 
-  # this is mandatory, it's needed to correctly configure the kafka endpoint
-  kafkaService: cord-kafka
-
-# in mininet chart
-vlanMatchDepth: 2
-enableMulticast: True
-
-# in ponsim-pod chart
-bandwidthProfiles: True
-legacyPonsim: False
+dt-workflow-driver:
+  image:
+    tag: "master"
 
 # ONOS applications
 aaaAppUrl: "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opencord&a=aaa-app&v=2.0.1-SNAPSHOT&e=oar"
@@ -139,3 +127,6 @@
 
 kafkaAppUrl: "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opencord&a=kafka&v=2.0.1-SNAPSHOT&e=oar"
 kafkaAppVersion: "2.0.1.SNAPSHOT"
+
+bngAppUrl: "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opencord&a=bng-app&v=1.0.0-SNAPSHOT&e=oar"
+bngAppVersion: "1.0.0.SNAPSHOT"
diff --git a/configs/seba-ponsim-sdbng.yaml b/configs/seba-ponsim-sdbng.yaml
index 4508fd5..0bf332b 100644
--- a/configs/seba-ponsim-sdbng.yaml
+++ b/configs/seba-ponsim-sdbng.yaml
@@ -14,77 +14,32 @@
 # limitations under the License.
 
 # Values file for deploying SEBA with Ponsim and Stratum
-# Use this file to deploy the service versions specified in the Helm charts.
+# Use this file together with seba-ponsim.yaml to deploy the service versions
+# specified in the Helm charts.
+
+# --------------- Values modified or added wrt seba-ponsim.yaml ----------------
 
 images:
-  # Mininet image
   mininet:
     repository: 'opencord/mn-stratum-siab'
     tag: 'master'
-    pullPolicy: Always
-  onos:
-    repository: 'onosproject/onos'
-    tag: '2.2-latest'
-    pullPolicy: Always
-  rg:
-#    TODO: Modify when this docker image is published
-    repository: 'dmoro92/voltha-tester'
-    tag: 'latest'
-    pullPolicy: Always
 
-# ONOS activate debug
-onos_env:
-  - name: JAVA_DEBUG_PORT
-    value: "0.0.0.0:5005"
-
-# voltha
-etcd-cluster:
-  clusterSize: 1
-
-# Set topics for KPI-exporter, adding the bng.stats
-kpi_exporter:
 # Select DT-Workflow
 workflow: dt-workflow
 
-dt-workflow-driver:
-  image:
-#    TODO: modify when DT workflow synchronizer is published
-    repository: "dmoro92/dt-workflow-driver-synchronizer"
-    tag: "1.0.0-dev"
-  # this is mandatory, it's needed to correctly configure the kafka endpoint
-  kafkaService: cord-kafka
-
-# in mininet chart
-# FIXME: make multicast working
+# In mininet chart
+# FIXME: check if multicast is working
 enableMulticast: false
 topoScript: '/toposcripts/topo_sdbng.py'
-stratumEnabled: true
+mnStratumSwitchCount: 1
 
-# in ponsim-pod chart
-bandwidthProfiles: true
-legacyPonsim: false
-
-# fabric
 fabric:
-  enabled: true
   stratum:
-    # BMv2 drivers will activate also stratum drivers
-    driverAppId: 'org.onosproject.drivers.bmv2'
-    # Enable stratum
     enabled: true
-    # Use BMv2 pipeconf (already in ONOS)
-    pipeconfAppExternal: false
-    pipeconfAppId: 'org.onosproject.pipelines.fabric'
+
+# Activate SD-BNG
 bng:
   external:
     enabled: false
   embedded:
     enabled: true
-    # ONOS app to provide the BNG control plane
-    bngAppId: "org.opencord.bng"
-    bngAppUrl: "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opencord&a=bng-app&v=1.0.0-SNAPSHOT&e=oar"
-    bngAppVersion: "1.0.0.SNAPSHOT"
-
-# ONOS applications
-kafkaAppUrl: "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opencord&a=kafka&v=2.0.1-SNAPSHOT&e=oar"
-kafkaAppVersion: "2.0.1.SNAPSHOT"
diff --git a/configs/seba-ponsim-stratum.yaml b/configs/seba-ponsim-stratum.yaml
index 171a582..08d38e4 100644
--- a/configs/seba-ponsim-stratum.yaml
+++ b/configs/seba-ponsim-stratum.yaml
@@ -14,50 +14,22 @@
 # limitations under the License.
 
 # Values file for deploying SEBA with Ponsim and Stratum
-# Use this file to deploy the service versions specified in the Helm charts.
+# Use this file together with seba-ponsim.yaml to deploy the service versions
+# specified in the Helm charts.
+
+# ----------- Values modified or added wrt seba-ponsim.yaml --------------------
 
 images:
-  # Mininet image
   mininet:
     repository: 'opencord/mn-stratum-siab'
     tag: 'master'
-    pullPolicy: Always
 
-# voltha
-etcd-cluster:
-  clusterSize: 1
-
-# in workflow/att-workflow service chart
-att-workflow-driver:
-  # this is mandatory, it's needed to correctly configure the kafka endpoint
-  kafkaService: cord-kafka
-
-# in workflow/tt-workflow service chart
-tt-workflow-driver:
-  image:
-    repository: andybavier/test-image-synchronizer
-    tag: tt-workflow-driver
-
-  # this is mandatory, it's needed to correctly configure the kafka endpoint
-  kafkaService: cord-kafka
-
-# in mininet chart
+# In mininet chart
 # FIXME: check if multicast is working
 enableMulticast: false
 topoScript: '/toposcripts/topo_stratum.py'
-stratumEnabled: true
+mnStratumSwitchCount: 1
 
-# in ponsim-pod chart
-bandwidthProfiles: true
-legacyPonsim: false
-
-# fabric
 fabric:
-  enabled: true
   stratum:
-    driverAppId: 'org.onosproject.drivers.bmv2'
-    # Enable stratum
     enabled: true
-    # Use BMv2 pipeconf (already in ONOS)
-    pipeconfAppExternal: false
-    pipeconfAppId: 'org.onosproject.pipelines.fabric'
diff --git a/configs/seba-ponsim.yaml b/configs/seba-ponsim.yaml
index 9db7634..d4b1365 100644
--- a/configs/seba-ponsim.yaml
+++ b/configs/seba-ponsim.yaml
@@ -14,7 +14,13 @@
 # limitations under the License.
 
 # Values file for deploying SEBA with Ponsim
-# Use this file to deploy the service versions speecified in the Helm charts.
+# Use this file to deploy the service versions specified in the Helm charts.
+
+images:
+  rg:
+    # TODO: Modify when this docker image is published with a release tag
+    repository: 'dmoro92/voltha-tester'
+    tag: 'latest'
 
 # voltha
 etcd-cluster:
@@ -30,7 +36,10 @@
   image:
     repository: andybavier/test-image-synchronizer
     tag: tt-workflow-driver
+  # this is mandatory, it's needed to correctly configure the kafka endpoint
+  kafkaService: cord-kafka
 
+dt-workflow-driver:
   # this is mandatory, it's needed to correctly configure the kafka endpoint
   kafkaService: cord-kafka
 
@@ -42,3 +51,27 @@
 bandwidthProfiles: True
 legacyPonsim: False
 
+# in seba-services profile
+fabric:
+  stratum:
+    enabled: false
+    # BMv2 drivers will activate also stratum drivers
+    driverAppId: 'org.onosproject.drivers.bmv2'
+    # Use BMv2 pipeconf (already in ONOS)
+    pipeconfAppExternal: false
+    pipeconfAppId: 'org.onosproject.pipelines.fabric'
+
+bng:
+  external:
+    enabled: true
+  embedded:
+    enabled: false
+
+# ONOS applications
+# TODO: remove when 2.0.1 is released (update the value definition in seba-services)
+kafkaAppUrl: "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opencord&a=kafka&v=2.0.1-SNAPSHOT&e=oar"
+kafkaAppVersion: "2.0.1.SNAPSHOT"
+
+# TODO: remove when app is released (rely on seba-services value definition)
+bngAppUrl: "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opencord&a=bng-app&v=1.0.0-SNAPSHOT&e=oar"
+bngAppVersion: "1.0.0.SNAPSHOT"
diff --git a/mininet/Chart.yaml b/mininet/Chart.yaml
index c668bcb..9f2322d 100644
--- a/mininet/Chart.yaml
+++ b/mininet/Chart.yaml
@@ -17,4 +17,4 @@
 appVersion: 1.0.0
 description: A Helm chart for Mininet
 name: mininet
-version: 1.1.1
+version: 1.1.2
diff --git a/mininet/templates/deployment.yaml b/mininet/templates/deployment.yaml
index 90d54b2..ba653b7 100644
--- a/mininet/templates/deployment.yaml
+++ b/mininet/templates/deployment.yaml
@@ -40,7 +40,7 @@
         - name: {{ .Chart.Name }}
           image: "{{ .Values.global.registry }}{{ .Values.images.mininet.repository }}:{{ tpl .Values.images.mininet.tag . }}"
           imagePullPolicy: {{ .Values.images.mininet.pullPolicy }}
-{{- if $.Values.stratumEnabled }}
+{{- if gt ($.Values.mnStratumSwitchCount|int) 0 }}
           command: ["python"]
 {{- end }}
           args: [{{ .Values.topoScript }}]
diff --git a/mininet/templates/mn-stratum-service.yaml b/mininet/templates/mn-stratum-service.yaml
index 0cf7d86..55fe517 100644
--- a/mininet/templates/mn-stratum-service.yaml
+++ b/mininet/templates/mn-stratum-service.yaml
@@ -16,7 +16,7 @@
 # Service that exposes the gRPC port to control the stratum_bmv2 instance(s)
 # running inside Mininet
 
-{{- if $.Values.stratumEnabled }}
+{{- if gt (.Values.mnStratumSwitchCount|int) 0 }}
 apiVersion: v1
 kind: Service
 metadata:
@@ -30,8 +30,10 @@
 spec:
   type: ClusterIP
   ports:
-  - name: stratum-1
-    port: 50001
+  {{- range $j, $junk := until (.Values.mnStratumSwitchCount|int) }}
+  - name: stratum-{{ add $j 1 }}
+    port: {{ add $j 50001 }}
+  {{- end}}
   selector:
     app: {{ template "mininet.name" . }}
     release: {{ .Release.Name }}
diff --git a/mininet/toposcripts/topo_sdbng.py b/mininet/toposcripts/topo_sdbng.py
index 0fb1683..3dae686 100644
--- a/mininet/toposcripts/topo_sdbng.py
+++ b/mininet/toposcripts/topo_sdbng.py
@@ -36,7 +36,7 @@
 
     info( '*** Creating hosts\n' )
     h1 = net.addHost( 'h1' ) # PPPoE Server
-    h2 = net.addHost( 'h2', ip='10.10.10.1/24' ) # Upstream
+    h2 = net.addHost( 'h2', ip='10.10.10.1/24', mac="00:66:77:88:99:AA") # Upstream
     # FIXME: enable multicast
     # h3 = net.addHost( 'h3')
 
diff --git a/mininet/values.yaml b/mininet/values.yaml
index 1916755..8437a3f 100644
--- a/mininet/values.yaml
+++ b/mininet/values.yaml
@@ -49,7 +49,7 @@
             - olt
         topologyKey: kubernetes.io/hostname
 
-stratumEnabled: false
+mnStratumSwitchCount: 0
 topoScript: '/toposcripts/topo.py'
 onosOpenflowSvc: "onos-openflow.default.svc.cluster.local"
 vlanMatchDepth: 2
diff --git a/xos-profiles/seba-services/Chart.yaml b/xos-profiles/seba-services/Chart.yaml
index 5f30e70..aa31042 100644
--- a/xos-profiles/seba-services/Chart.yaml
+++ b/xos-profiles/seba-services/Chart.yaml
@@ -17,7 +17,7 @@
 name: seba-services
 description: A Helm chart for XOS's "SEBA" profile
 icon: https://guide.opencord.org/logos/cord.svg
-version: 1.4.2
+version: 1.4.3
 
 # xosproject/tosca-loader version
 appVersion: 1.3.1
diff --git a/xos-profiles/seba-services/templates/_tosca.tpl b/xos-profiles/seba-services/templates/_tosca.tpl
index cb4a8e8..922fbc6 100644
--- a/xos-profiles/seba-services/templates/_tosca.tpl
+++ b/xos-profiles/seba-services/templates/_tosca.tpl
@@ -178,10 +178,10 @@
     onos_app#bng:
       type: tosca.nodes.ONOSApp
       properties:
-        name: {{ .bng.embedded.bngAppId }}
-        app_id: {{ .bng.embedded.bngAppId }}
-        url: {{ .bng.embedded.bngAppUrl }}
-        version: {{ .bng.embedded.bngAppVersion }}
+        name: org.opencord.bng
+        app_id: org.opencord.bng
+        url: {{ .bngAppUrl }}
+        version: {{ .bngAppVersion }}
         dependencies: {{ .fabric.stratum.pipeconfAppId }}, org.opencord.kafka, org.opencord.sadis
       requirements:
         - owner:
diff --git a/xos-profiles/seba-services/values.yaml b/xos-profiles/seba-services/values.yaml
index 551ae3f..eccad87 100644
--- a/xos-profiles/seba-services/values.yaml
+++ b/xos-profiles/seba-services/values.yaml
@@ -52,6 +52,9 @@
 kafkaAppUrl: "https://oss.sonatype.org/content/groups/public/org/opencord/kafka/2.0.0/kafka-2.0.0.oar"
 kafkaAppVersion: "2.0.0"
 
+bngAppUrl: "https://oss.sonatype.org/content/groups/public/org/opencord/bng/1.0.0/bng-1.0.0.oar"
+bngAppVersion: "1.0.0"
+
 onosRestService: "onos-ui.default.svc.cluster.local"
 kafkaService: "cord-kafka.default.svc.cluster.local:9092"
 
@@ -81,6 +84,3 @@
     enabled: true
   embedded:
     enabled: false
-    bngAppId: "org.opencord.bng"
-    bngAppUrl: "https://oss.sonatype.org/content/groups/public/org/opencord/bng/1.0.0/bng-1.0.0.oar"
-    bngAppVersion: "1.0.0"