From: tganesh2k Date: Thu, 17 Nov 2022 09:10:26 +0000 (+0530) Subject: Common template files for installing aimlfw. X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=d2f9fce2536d02330818466977150fc810955be1;p=aiml-fw%2Faimlfw-dep.git Common template files for installing aimlfw. Issue-id: AIMLWF-4 Signed-off-by: tganesh2k Change-Id: Ie55dbd8559800121454cc37b179ae0d1f6494801 --- diff --git a/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_aiml-dashboard.tpl b/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_aiml-dashboard.tpl new file mode 100644 index 0000000..f46be19 --- /dev/null +++ b/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_aiml-dashboard.tpl @@ -0,0 +1,84 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# 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 "aiml-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 "aiml-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 "aiml-dashboard.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "aiml-dashboard.labels" -}} +helm.sh/chart: {{ include "aiml-dashboard.chart" . }} +{{ include "aiml-dashboard.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "aiml-dashboard.selectorLabels" -}} +app.kubernetes.io/name: {{ include "aiml-dashboard.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "aiml-dashboard.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "aiml-dashboard.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{- define "common.serviceport.aiml-dashboard.http" -}}32005{{- end -}} +{{- define "common.serviceport.aiml-dashboard.react-app-tm-port" -}}32002{{- end -}} +{{- define "common.serviceport.aiml-dashboard.react-app-notebook-port" -}}32088{{- end -}} diff --git a/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_aiml-notebook.tpl b/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_aiml-notebook.tpl new file mode 100644 index 0000000..bc47ac9 --- /dev/null +++ b/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_aiml-notebook.tpl @@ -0,0 +1,84 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# 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 "aiml-notebook.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 "aiml-notebook.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 "aiml-notebook.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "aiml-notebook.labels" -}} +helm.sh/chart: {{ include "aiml-notebook.chart" . }} +{{ include "aiml-notebook.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "aiml-notebook.selectorLabels" -}} +app.kubernetes.io/name: {{ include "aiml-notebook.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "aiml-notebook.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "aiml-notebook.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{- define "common.serviceport.aiml-notebook.http" -}}18888{{- end -}} +{{- define "common.serviceport.aiml-notebook.targetport" -}}8888{{- end -}} +{{- define "common.serviceport.aiml-notebook.external" -}}32088{{- end -}} {{/*Signfies NodePort*/}} diff --git a/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_data-extraction.tpl b/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_data-extraction.tpl new file mode 100644 index 0000000..833a7b0 --- /dev/null +++ b/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_data-extraction.tpl @@ -0,0 +1,88 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# 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 "data-extraction.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 "data-extraction.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 "data-extraction.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "data-extraction.labels" -}} +helm.sh/chart: {{ include "data-extraction.chart" . }} +{{ include "data-extraction.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "data-extraction.selectorLabels" -}} +app.kubernetes.io/name: {{ include "data-extraction.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "data-extraction.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "data-extraction.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{- define "common.servicehost.data-extraction" -}}0.0.0.0{{- end -}} +{{- define "common.servicehost.data-extraction.http" -}}data-extraction.traininghost{{- end -}} +{{- define "common.serviceport.data-extraction.http" -}}32000{{- end -}} +{{- define "common.servicehost.fs-db" -}}cassandra.traininghost{{- end -}} +{{- define "common.serviceport.fs-db" -}}9042{{- end -}} +{{- define "common.serviceuser.fs-db" -}}cassandra{{- end -}} +{{- define "common.ksname.fs-db" -}}feature_store{{- end -}} diff --git a/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_kfadapter.tpl b/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_kfadapter.tpl new file mode 100644 index 0000000..044762f --- /dev/null +++ b/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_kfadapter.tpl @@ -0,0 +1,83 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# 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 "kfadapter.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 "kfadapter.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 "kfadapter.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "kfadapter.labels" -}} +helm.sh/chart: {{ include "kfadapter.chart" . }} +{{ include "kfadapter.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "kfadapter.selectorLabels" -}} +app.kubernetes.io/name: {{ include "kfadapter.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "kfadapter.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "kfadapter.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{- define "common.serviceport.kfadapter.http" -}}5001{{- end -}} +{{- define "common.servicehost.kfadapter.http" -}}kfadapter.traininghost{{- end -}} diff --git a/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_tm.tpl b/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_tm.tpl new file mode 100644 index 0000000..9a6a76a --- /dev/null +++ b/aimlfw-common/Common-Template/helm/aimlfw-common/templates/_tm.tpl @@ -0,0 +1,83 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# 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 "tm.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 "tm.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 "tm.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "tm.labels" -}} +helm.sh/chart: {{ include "tm.chart" . }} +{{ include "tm.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "tm.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tm.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "tm.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "tm.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{- define "common.serviceport.tm.http" -}}32002{{- end -}} +{{- define "common.servicehost.tm.http" -}}tm.traininghost{{- end -}}