diff options
author | 2019-04-11 00:36:20 +0000 | |
---|---|---|
committer | 2019-04-11 00:36:20 +0000 | |
commit | 9d98267fe7046c304a71f98e89de6774d09f094e (patch) | |
tree | 7e93353e9eff19a11e01a73ff5c176ec78513237 /vnfs/DAaaS/applications/charts/sample-horovod-app/templates/_helpers.tpl | |
parent | 6fca0bf437c0917096a0105292514633c0ec3db3 (diff) |
Add helm charts for horovod based app
Tasks in this patch:
Create sample Tensorflow MNIST application using horovod: https://jira.onap.org/browse/ONAPARC-450
Change-Id: I50827a47f7c48574944cde28fca32f265b649b59
Issue-ID: ONAPARC-450
Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com>
Diffstat (limited to 'vnfs/DAaaS/applications/charts/sample-horovod-app/templates/_helpers.tpl')
-rw-r--r-- | vnfs/DAaaS/applications/charts/sample-horovod-app/templates/_helpers.tpl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vnfs/DAaaS/applications/charts/sample-horovod-app/templates/_helpers.tpl b/vnfs/DAaaS/applications/charts/sample-horovod-app/templates/_helpers.tpl new file mode 100644 index 00000000..02071c0f --- /dev/null +++ b/vnfs/DAaaS/applications/charts/sample-horovod-app/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "horovod.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 "horovod.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 "horovod.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} |