Merge "CORD-3024 M-CORD profile chart and service charts"
diff --git a/examples/compute-nodes.yaml b/examples/compute-nodes.yaml
new file mode 100644
index 0000000..8bdc80b
--- /dev/null
+++ b/examples/compute-nodes.yaml
@@ -0,0 +1,33 @@
+---
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Information for the cluster's OpenStack compute nodes
+
+computeNodes:
+  master:
+    name: node0.opencord.org
+    bridgeId: of:00000000abcdef01
+    dataPlaneIntf: fabric
+    dataPlaneIp: 10.6.1.1/24
+  node1:
+    name: node1.opencord.org
+    bridgeId: of:00000000abcdef02
+    dataPlaneIntf: fabric
+    dataPlaneIp: 10.6.1.2/24
+  node2:
+    name: node2.opencord.org
+    bridgeId: of:00000000abcdef03
+    dataPlaneIntf: fabric
+    dataPlaneIp: 10.6.1.3/24
\ No newline at end of file
diff --git a/examples/image-tag-candidate.yaml b/examples/image-tag-candidate.yaml
index 71f614a..6c6480e 100644
--- a/examples/image-tag-candidate.yaml
+++ b/examples/image-tag-candidate.yaml
@@ -45,3 +45,5 @@
   rcord_synchronizerImage: 'xosproject/rcord-synchronizer:candidate'
 simpleexampleservice:
   simpleexampleservice_synchronizerImage: 'xosproject/simpleexampleservice-synchronizer:candidate'
+
+hippieOSS_synchronizerImage: 'xosproject/hippie-oss-synchronizer:candidate'
diff --git a/examples/kafka-single.yaml b/examples/kafka-single.yaml
index 31aa36c..5a7e496 100644
--- a/examples/kafka-single.yaml
+++ b/examples/kafka-single.yaml
@@ -16,5 +16,10 @@
 # for development purposes deploy a single instance of kafka
 
 replicas: 1
+enabled: true
+persistence:
+  enabled: false
 zookeeper:
+  persistence:
+    enabled: false
   servers: 1 # NOTE this differs from the zookeper documentation as the kafka chart is still referencing zookeper 0.5.0
\ No newline at end of file
diff --git a/xos-profiles/base-openstack/templates/_tosca.tpl b/xos-profiles/base-openstack/templates/_tosca.tpl
index 962047c..ac429ff 100644
--- a/xos-profiles/base-openstack/templates/_tosca.tpl
+++ b/xos-profiles/base-openstack/templates/_tosca.tpl
@@ -147,4 +147,58 @@
           - slice:
               node: {{ .Values.cordSiteName }}_test
               relationship: tosca.relationships.BelongsToOne
-{{- end -}}
\ No newline at end of file
+{{- end -}}
+
+{{- define "base-openstack.computeNodeTosca" -}}
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+imports:
+  - custom_types/deployment.yaml
+  - custom_types/node.yaml
+  - custom_types/site.yaml
+  - custom_types/sitedeployment.yaml
+
+description: Adds OpenStack compute nodes
+
+topology_template:
+  node_templates:
+
+# Site/Deployment, fully defined in deployment.yaml
+    site:
+      type: tosca.nodes.Site
+      properties:
+        name: {{ .Values.cordSiteName }}
+        must-exist: true
+
+    deployment:
+      type: tosca.nodes.Deployment
+      properties:
+        name: {{ .Values.cordDeploymentName }}
+        must-exist: true
+
+    site_deployment:
+      type: tosca.nodes.SiteDeployment
+      requirements:
+        - site:
+            node: site
+            relationship: tosca.relationships.BelongsToOne
+        - deployment:
+            node: deployment
+            relationship: tosca.relationships.BelongsToOne
+
+# OpenStack compute nodes
+
+    {{- range .Values.computeNodes }}
+    {{ .name }}:
+      type: tosca.nodes.Node
+      properties:
+        name: {{ .name }}
+        bridgeId: {{ .bridgeId }}
+        dataPlaneIntf: {{ .dataPlaneIntf }}
+        dataPlaneIp: {{ .dataPlaneIp }}
+      requirements:
+        - site_deployment:
+            node:  site_deployment
+            relationship: tosca.relationships.BelongsToOne
+    {{- end }}
+{{- end -}}
diff --git a/xos-profiles/base-openstack/templates/tosca-configmap.yaml b/xos-profiles/base-openstack/templates/tosca-configmap.yaml
index 6d4448e..5353086 100644
--- a/xos-profiles/base-openstack/templates/tosca-configmap.yaml
+++ b/xos-profiles/base-openstack/templates/tosca-configmap.yaml
@@ -28,13 +28,11 @@
   040-vtn-service.yaml: |
 {{ include "vtn-service.serviceTosca" (index .Values "vtn-service") | indent 4 }}
   050-openstack-compute.yaml: |
-{{ toYaml .Values.toscaRecipes.openstackCompute | indent 4 }}
+{{ include "base-openstack.computeNodeTosca" . | indent 4 }}
   060-openstack-networks.yaml: |
 {{ include "openstack.networkTosca" .Values | indent 4 }}
   070-onos-service-vtn-app.yaml: |
 {{ include "onos-service.vtnAppTosca" (index .Values "onos-service") | indent 4 }}
   300-service-graph.yaml: |
 {{ include "base-openstack.serviceGraphTosca" . | indent 4 }}
-  400-openstack-test.yaml: |
-{{ include "base-openstack.testTosca" . | indent 4 }}
 
diff --git a/xos-profiles/base-openstack/values.yaml b/xos-profiles/base-openstack/values.yaml
index dbf6a9a..1a28a72 100644
--- a/xos-profiles/base-openstack/values.yaml
+++ b/xos-profiles/base-openstack/values.yaml
@@ -37,79 +37,10 @@
 keystoneAdminTenant: "admin"
 keystoneDomain: "Default"
 
-# TOSCA recipes for the tosca-loader
-toscaRecipes:
-  openstackCompute:
-    tosca_definitions_version: tosca_simple_yaml_1_0
-
-    imports:
-      - custom_types/deployment.yaml
-      - custom_types/node.yaml
-      - custom_types/site.yaml
-      - custom_types/sitedeployment.yaml
-
-    description: Adds OpenStack compute nodes
-
-    topology_template:
-      node_templates:
-
-    # Site/Deployment, fully defined in deployment.yaml
-        site:
-          type: tosca.nodes.Site
-          properties:
-            name: *site
-            must-exist: true
-
-        deployment:
-          type: tosca.nodes.Deployment
-          properties:
-            name: *deployment
-            must-exist: true
-
-        site_deployment:
-          type: tosca.nodes.SiteDeployment
-          requirements:
-            - site:
-                node: site
-                relationship: tosca.relationships.BelongsToOne
-            - deployment:
-                node: deployment
-                relationship: tosca.relationships.BelongsToOne
-
-    # OpenStack compute nodes
-
-        head1:
-          type: tosca.nodes.Node
-          properties:
-            name: head1
-            bridgeId: of:00000000abcdef01
-            dataPlaneIntf: fabricbridge
-            dataPlaneIp: 10.6.1.1/24
-          requirements:
-            - site_deployment:
-                node:  site_deployment
-                relationship: tosca.relationships.BelongsToOne
-
-        compute1:
-          type: tosca.nodes.Node
-          properties:
-            name: compute1
-            bridgeId: of:00000000abcdef02
-            dataPlaneIntf: fabricbond
-            dataPlaneIp: 10.6.1.17/24
-          requirements:
-            - site_deployment:
-                node:  site_deployment
-                relationship: tosca.relationships.BelongsToOne
-
-        compute2:
-          type: tosca.nodes.Node
-          properties:
-            name: compute2
-            bridgeId: of:00000000abcdef03
-            dataPlaneIntf: fabricbond
-            dataPlaneIp: 10.6.1.18/24
-          requirements:
-            - site_deployment:
-                node:  site_deployment
-                relationship: tosca.relationships.BelongsToOne
+# List of compute nodes to add to XOS
+computeNodes:
+  master:
+    name: node0.opencord.org
+    bridgeId: of:00000000abcdef01
+    dataPlaneIntf: fabric
+    dataPlaneIp: 10.6.1.1/24
diff --git a/xos-services/hippie-oss/.helmignore b/xos-services/hippie-oss/.helmignore
new file mode 100644
index 0000000..f0c1319
--- /dev/null
+++ b/xos-services/hippie-oss/.helmignore
@@ -0,0 +1,21 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
diff --git a/xos-services/hippie-oss/Chart.yaml b/xos-services/hippie-oss/Chart.yaml
new file mode 100644
index 0000000..5bf1244
--- /dev/null
+++ b/xos-services/hippie-oss/Chart.yaml
@@ -0,0 +1,21 @@
+---
+
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+appVersion: "1.0"
+description: A Helm chart for XOS's "hippie-oss" service
+name: hippie-oss
+version: 0.1.0
diff --git a/xos-services/hippie-oss/templates/_helpers.tpl b/xos-services/hippie-oss/templates/_helpers.tpl
new file mode 100644
index 0000000..f395a0c
--- /dev/null
+++ b/xos-services/hippie-oss/templates/_helpers.tpl
@@ -0,0 +1,82 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Copyright 2018-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "hippie-oss.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "hippie-oss.fullname" -}}
+{{- if .Values.fullnameOverride -}}
+{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- $name := default .Chart.Name .Values.nameOverride -}}
+{{- if contains $name .Release.Name -}}
+{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "hippie-oss.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{- define "hippie-oss.serviceConfig" -}}
+name: hippie-oss
+accessor:
+  username: {{ .Values.xosAdminUser | quote }}
+  password: {{ .Values.xosAdminPassword | quote }}
+  endpoint: xos-core:50051
+event_bus:
+  endpoint: cord-kafka-kafka
+  kind: kafka
+required_models:
+  - HippieOSSService
+  - HippieOSSServiceInstance
+  - RCORDSubscriber
+dependency_graph: "/opt/xos/synchronizers/hippie-oss/model-deps"
+model_policies_dir: "/opt/xos/synchronizers/hippie-oss/model_policies"
+models_dir: "/opt/xos/synchronizers/hippie-oss/models"
+steps_dir: "/opt/xos/synchronizers/hippie-oss/steps"
+logging:
+  version: 1
+  handlers:
+    console:
+      class: logging.StreamHandler
+    file:
+      class: logging.handlers.RotatingFileHandler
+      filename: /var/log/xos.log
+      maxBytes: 10485760
+      backupCount: 5
+  loggers:
+    'multistructlog':
+      handlers:
+          - console
+          - file
+      level: DEBUG
+{{- end -}}
diff --git a/xos-services/hippie-oss/templates/_tosca.tpl b/xos-services/hippie-oss/templates/_tosca.tpl
new file mode 100644
index 0000000..70caa17
--- /dev/null
+++ b/xos-services/hippie-oss/templates/_tosca.tpl
@@ -0,0 +1,30 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Copyright 2018-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+{{- define "volt.serviceTosca" -}}
+tosca_definitions_version: tosca_simple_yaml_1_0
+description: Set up VOLT service
+imports:
+  - custom_types/hippieossservice.yaml
+
+topology_template:
+  node_templates:
+    service#hippie-oss:
+      type: tosca.nodes.HippieOSSService
+      properties:
+        name: hippie-oss
+        kind: OSS
+{{- end -}}
diff --git a/xos-services/hippie-oss/templates/configmap.yaml b/xos-services/hippie-oss/templates/configmap.yaml
new file mode 100644
index 0000000..492fcae
--- /dev/null
+++ b/xos-services/hippie-oss/templates/configmap.yaml
@@ -0,0 +1,22 @@
+---
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: hippie-oss
+data:
+  serviceConfig: |
+{{ include "hippie-oss.serviceConfig" . | indent 4 }}
diff --git a/xos-services/hippie-oss/templates/deployment.yaml b/xos-services/hippie-oss/templates/deployment.yaml
new file mode 100644
index 0000000..811fb8a
--- /dev/null
+++ b/xos-services/hippie-oss/templates/deployment.yaml
@@ -0,0 +1,77 @@
+---
+
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: apps/v1beta2
+kind: Deployment
+metadata:
+  name: {{ template "hippie-oss.fullname" . }}
+  labels:
+    app: {{ template "hippie-oss.name" . }}
+    chart: {{ template "hippie-oss.chart" . }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  replicas: {{ .Values.replicaCount }}
+  selector:
+    matchLabels:
+      app: {{ template "hippie-oss.name" . }}
+      release: {{ .Release.Name }}
+  template:
+    metadata:
+      labels:
+        app: {{ template "hippie-oss.name" . }}
+        release: {{ .Release.Name }}
+      annotations:
+        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
+    spec:
+      containers:
+        - name: {{ .Chart.Name }}
+          image: {{ .Values.hippieOSS_synchronizerImage | quote }}
+          imagePullPolicy: {{ .Values.imagePullPolicy }}
+          resources:
+{{ toYaml .Values.resources | indent 12 }}
+          volumeMounts:
+            - name: hippie-oss-config
+              mountPath: /opt/xos/synchronizers/hippie-oss/config.yaml
+              subPath: config.yaml
+            - name: certchain-volume
+              mountPath: /usr/local/share/ca-certificates/local_certs.crt
+              subPath: config/ca_cert_chain.pem
+      volumes:
+        - name: hippie-oss-config
+          configMap:
+            name: hippie-oss
+            items:
+              - key: serviceConfig
+                path: config.yaml
+        - name: certchain-volume
+          configMap:
+            name: ca-certificates
+            items:
+              - key: chain
+                path: config/ca_cert_chain.pem
+    {{- with .Values.nodeSelector }}
+      nodeSelector:
+{{ toYaml . | indent 8 }}
+    {{- end }}
+    {{- with .Values.affinity }}
+      affinity:
+{{ toYaml . | indent 8 }}
+    {{- end }}
+    {{- with .Values.tolerations }}
+      tolerations:
+{{ toYaml . | indent 8 }}
+    {{- end }}
diff --git a/xos-services/hippie-oss/values.yaml b/xos-services/hippie-oss/values.yaml
new file mode 100644
index 0000000..109987a
--- /dev/null
+++ b/xos-services/hippie-oss/values.yaml
@@ -0,0 +1,38 @@
+---
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Default values for vOLT
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+replicaCount: 1
+
+nameOverride: ""
+fullnameOverride: ""
+
+imagePullPolicy: 'Always'
+
+hippieOSS_synchronizerImage: "xosproject/hippie-oss-synchronizer:master"
+
+xosAdminUser: "admin@opencord.org"
+xosAdminPassword: "letmein"
+
+resources: {}
+
+nodeSelector: {}
+
+tolerations: []
+
+affinity: {}
diff --git a/xos-services/openstack/templates/_helpers.tpl b/xos-services/openstack/templates/_helpers.tpl
index db369dd..181703e 100644
--- a/xos-services/openstack/templates/_helpers.tpl
+++ b/xos-services/openstack/templates/_helpers.tpl
@@ -31,13 +31,9 @@
 {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
 {{- else -}}
 {{- $name := default .Chart.Name .Values.nameOverride -}}
-{{- if contains $name .Release.Name -}}
-{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
 {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
 {{- end -}}
-{{- end -}}
 
 {{/*
 Create chart name and version as used by the chart label.
diff --git a/xos-services/volt/templates/_helpers.tpl b/xos-services/volt/templates/_helpers.tpl
index 6b6791d..bbf2a38 100644
--- a/xos-services/volt/templates/_helpers.tpl
+++ b/xos-services/volt/templates/_helpers.tpl
@@ -52,6 +52,9 @@
   username: {{ .Values.xosAdminUser | quote }}
   password: {{ .Values.xosAdminPassword | quote }}
   endpoint: xos-core:50051
+event_bus:
+  endpoint: cord-kafka-kafka
+  kind: kafka
 required_models:
   - VOLTService
   - VOLTServiceInstance
@@ -62,6 +65,7 @@
 models_dir: "/opt/xos/synchronizers/volt/models"
 steps_dir: "/opt/xos/synchronizers/volt/steps"
 pull_steps_dir: "/opt/xos/synchronizers/volt/pull_steps"
+event_steps_dir: "/opt/xos/synchronizers/volt/event_steps"
 logging:
   version: 1
   handlers:
diff --git a/xos-services/vtn-service/templates/_tosca.tpl b/xos-services/vtn-service/templates/_tosca.tpl
index 9edc27e..f1d630a 100644
--- a/xos-services/vtn-service/templates/_tosca.tpl
+++ b/xos-services/vtn-service/templates/_tosca.tpl
@@ -34,9 +34,9 @@
           privateGatewayMac: 00:00:00:00:00:01
           localManagementIp: 172.27.0.1/24
           ovsdbPort: 6641
-          sshUser: vagrant
+          sshUser: {{ .sshUser }}
           sshKeyFile: /root/node_key
-          sshPort: 22
+          sshPort: {{ .sshPort }}
           xosEndpoint: xos-chameleon:9101
           xosUser: {{ .xosAdminUser }}
           xosPassword: {{ .xosAdminPassword }}
diff --git a/xos-services/vtn-service/values.yaml b/xos-services/vtn-service/values.yaml
index 857df1b..49d5af5 100644
--- a/xos-services/vtn-service/values.yaml
+++ b/xos-services/vtn-service/values.yaml
@@ -29,6 +29,9 @@
 xosAdminUser: "admin@opencord.org"
 xosAdminPassword: "letmein"
 
+sshUser: "root"
+sshPort: 22
+
 resources: {}
 
 nodeSelector: {}