This patch introduces a new structure of the it/dep repo.
Components are restructured into a tree. Helm charts are
designed with common templates so that parameters can be
standardized.
This patches introduced installation scripts that take override
value.yaml files for all the helm charts.
Signed-off-by: Zhe Huang <zhehuang@research.att.com>
Change-Id: I44f043f8c7a93fa7f50ac31c37f9cb5e0efbfb53
diff --git a/aux/80-Auxiliary-Functions/bin/install b/aux/80-Auxiliary-Functions/bin/install
new file mode 100755
index 0000000..8e8170d
--- /dev/null
+++ b/aux/80-Auxiliary-Functions/bin/install
@@ -0,0 +1,59 @@
+#!/bin/bash
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# 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. #
+################################################################################
+
+
+OVERRIDEYAML=$1
+
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+
+source $DIR/../etc/dashboard.conf
+
+if [ -z "$RICAUX_RELEASE_NAME" ];then
+ RELEASE_NAME=$helm_release_name
+else
+ RELEASE_NAME=$RICAUX_RELEASE_NAME
+fi
+if [ -z "$RICAUX_NAMESPACE" ];then
+ NAMESPACE=$namespace
+else
+ NAMESPACE=$RICAUX_NAMESPACE
+fi
+
+RICAUX_COMPONENTS="dashboard"
+
+echo "Deploying RIC AUX components [$RICAUX_COMPONENTS]"
+echo "Platform Namespace: $NAMESPACE"
+echo "Helm Release Name: $RELEASE_NAME"
+
+
+COMMON_CHART_VERSION=$(cat $DIR/../../50-RIC-Platform/charts/common/Chart.yaml | grep version | awk '{print $2}')
+
+helm package -d /tmp $DIR/../../50-RIC-Platform/charts/common
+
+
+for component in $RICAUX_COMPONENTS; do
+ echo "Preparing chart for comonent $component"
+ cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../charts/$component/charts/
+ if [ -z $OVERRIDEYAML ]; then
+ helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../charts/$component
+ else
+ helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-$component" $DIR/../charts/$component
+ fi
+done
diff --git a/aux/80-Auxiliary-Functions/etc/dashboard.conf b/aux/80-Auxiliary-Functions/etc/dashboard.conf
new file mode 100644
index 0000000..0ee625b
--- /dev/null
+++ b/aux/80-Auxiliary-Functions/etc/dashboard.conf
@@ -0,0 +1,25 @@
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# 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. #
+################################################################################
+
+
+# helm_release_name defines the release name helm will use to deploy RIC
+# It will be overrided by RICAUX_RELEASE_NAME
+helm_release_name=r0
+
+# namespace defines the namespace that helm will use to deploy RIC
+# It will be overrided by RICAUX_NAMESPACE
+namespace=ricaux
diff --git a/aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml
new file mode 100644
index 0000000..f142b0a
--- /dev/null
+++ b/aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml
@@ -0,0 +1,22 @@
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# 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: Helm chart for the RIC Dashboard web app
+name: dashboard
+version: 1.1.0
diff --git a/aux/80-Auxiliary-Functions/helm/dashboard/charts/common-1.1.0.tgz b/aux/80-Auxiliary-Functions/helm/dashboard/charts/common-1.1.0.tgz
new file mode 100644
index 0000000..ccccfe6
--- /dev/null
+++ b/aux/80-Auxiliary-Functions/helm/dashboard/charts/common-1.1.0.tgz
Binary files differ
diff --git a/aux/80-Auxiliary-Functions/helm/dashboard/requirements.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/requirements.yaml
new file mode 100644
index 0000000..aa94575
--- /dev/null
+++ b/aux/80-Auxiliary-Functions/helm/dashboard/requirements.yaml
@@ -0,0 +1,20 @@
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# 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. #
+################################################################################
+
+dependencies:
+ - name: common
+ version: ~1.1.0
diff --git a/aux/80-Auxiliary-Functions/helm/dashboard/templates/_helpers.tpl b/aux/80-Auxiliary-Functions/helm/dashboard/templates/_helpers.tpl
new file mode 100644
index 0000000..2a6a3cc
--- /dev/null
+++ b/aux/80-Auxiliary-Functions/helm/dashboard/templates/_helpers.tpl
@@ -0,0 +1,49 @@
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# 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. #
+################################################################################
+
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "dashboard.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 "dashboard.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 "dashboard.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
diff --git a/aux/80-Auxiliary-Functions/helm/dashboard/templates/configmap.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/templates/configmap.yaml
new file mode 100644
index 0000000..e10805e
--- /dev/null
+++ b/aux/80-Auxiliary-Functions/helm/dashboard/templates/configmap.yaml
@@ -0,0 +1,36 @@
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# 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. #
+################################################################################
+
+# Provides configuration parameters which spring expects as a JSON string
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: dashboard-configmap
+data:
+ springApplication.json: |
+ {
+ "a1med": {
+ "basepath": "http://0.1.2.3:45"
+ },
+ "e2mgr": {
+ "basepath": "http://1.2.3.4:56"
+ },
+ "xappmgr": {
+ "basepath": "http://2.3.4.5:67"
+ }
+ }
diff --git a/aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml
new file mode 100644
index 0000000..efabecb
--- /dev/null
+++ b/aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml
@@ -0,0 +1,64 @@
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# 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/v1
+kind: Deployment
+metadata:
+ name: {{ include "dashboard.fullname" . }}
+ namespace: {{ include "common.namespace" . }}
+ labels:
+ app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
+ chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ replicas: {{ .Values.replicaCount }}
+ selector:
+ matchLabels:
+ app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
+ release: {{ .Release.Name }}
+ template:
+ metadata:
+ labels:
+ app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
+ release: {{ .Release.Name }}
+ spec:
+ hostname: {{ .Chart.Name }}
+ imagePullSecrets:
+ - name: {{ include "common.repositoryCred" . }}
+ containers:
+ - name: {{ include "common.namespace" . }}-{{ include "common.name" . }}
+ image: {{ include "common.repository" . }}/{{ .Values.image.name }}:{{ .Values.image.tag }}
+ imagePullPolicy: {{ include "common.pullPolicy" . }}
+ ports:
+ - name: http
+ containerPort: 8080
+ protocol: TCP
+ env:
+ - name: SPRING_APPLICATION_JSON
+ valueFrom:
+ configMapKeyRef:
+ name: dashboard-configmap
+ key: springApplication.json
+ livenessProbe:
+ httpGet:
+ path: /
+ port: http
+ readinessProbe:
+ httpGet:
+ path: /
+ port: http
diff --git a/aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml
new file mode 100644
index 0000000..8ed2a96
--- /dev/null
+++ b/aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml
@@ -0,0 +1,36 @@
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# 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: Service
+metadata:
+ name: {{ include "dashboard.fullname" . }}
+ namespace: {{ include "common.namespace" . }}
+ labels:
+ app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
+ chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ type: {{ .Values.service.type }}
+ ports:
+ - port: {{ .Values.service.port }}
+ targetPort: http
+ protocol: TCP
+ selector:
+ app: {{ include "common.namespace" . }}-{{ include "common.name" . }}
+ release: {{ .Release.Name }}
diff --git a/aux/80-Auxiliary-Functions/helm/dashboard/values.yaml b/aux/80-Auxiliary-Functions/helm/dashboard/values.yaml
new file mode 100644
index 0000000..13bc5cf
--- /dev/null
+++ b/aux/80-Auxiliary-Functions/helm/dashboard/values.yaml
@@ -0,0 +1,36 @@
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# 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 dashboard.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+replicaCount: 1
+repository: "nexus3.o-ran-sc.org:10004"
+imagePullPolicy: IfNotPresent
+repositoryCred: docker-reg-cred
+
+
+image:
+ repository: ric-dash-be
+ tag: 1.0.0-SNAPSHOT
+
+
+service:
+ type: NodePort
+ port: 80
+