Skip to content

Commit

Permalink
Installation changes for modelmgmtservice component, review comments
Browse files Browse the repository at this point in the history
Issue-Id: AIMLFW-70

Change-Id: I13b8e9efc01beb73942d67d8219af1ff9249635c
Signed-off-by: SANDEEP KUMAR JAISAWAL <[email protected]>
  • Loading branch information
sjaisawal committed Dec 8, 2023
1 parent e468ea1 commit fdb7efc
Show file tree
Hide file tree
Showing 8 changed files with 285 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,10 @@ kserveadapter:
ric_dms:
ip: <Fill IP of ric dms>
port: 8000

modelmgmtservice:
image:
repository: modelmgmtservice
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "1.0.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# ==================================================================================
#
# Copyright (c) 2023 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 "modelmgmtservice.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 "modelmgmtservice.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 "modelmgmtservice.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "modelmgmtservice.labels" -}}
helm.sh/chart: {{ include "modelmgmtservice.chart" . }}
{{ include "modelmgmtservice.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "modelmgmtservice.selectorLabels" -}}
app.kubernetes.io/name: {{ include "modelmgmtservice.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "modelmgmtservice.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "modelmgmtservice.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "common.serviceport.modelmgmtservice.http" -}}8082{{- end -}}
{{- define "common.serviceport.modelmgmtservice.targetport" -}}8082{{- end -}}
{{- define "common.servicehost.modelmgmtservice.http" -}}modelmgmtservice.traininghost{{- end -}}
{{- define "common.serviceport.modelmgmtservice.external" -}}32006{{- end -}}
23 changes: 23 additions & 0 deletions helm/modelmgmtservice/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ==================================================================================
#
# Copyright (c) 2023 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.
#
# ==================================================================================
apiVersion: v1
name: modelmgmtservice
description: Helm chart for modelmgmtservice
type: application
version: 1.0.0
appVersion: "1.0.0"
21 changes: 21 additions & 0 deletions helm/modelmgmtservice/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ==================================================================================
#
# Copyright (c) 2023 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.
#
# ==================================================================================
dependencies:
- name: aimlfw-common
version: 1.0.0
repository: "@local"
32 changes: 32 additions & 0 deletions helm/modelmgmtservice/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ==================================================================================
#
# Copyright (c) 2023 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.
#
# ==================================================================================
kind: ConfigMap
apiVersion: v1
metadata:
name: modelmgmtservice-configmap
namespace: {{ include "common.namespace.platform" . }}

data:
# Configuration values can be set as key-value properties
MMES_URL: 0.0.0.0:8082
S3_URL: http://leofs.kubeflow:8080
S3_ACCESS_KEY: leofs
S3_REGION: oranaiml
MODEL_FILE_POSTFIX: _model.zip
INFO_FILE_POSTFIX: _info.json
LOG_FILE_NAME: mmes.log
60 changes: 60 additions & 0 deletions helm/modelmgmtservice/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# ==================================================================================
#
# Copyright (c) 2023 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.
#
# ==================================================================================
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "modelmgmtservice.fullname" . }}
namespace: {{ include "common.namespace.platform" . }}
labels:
{{- include "modelmgmtservice.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "modelmgmtservice.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "modelmgmtservice.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.modelmgmtservice.image.repository }}:{{ .Values.modelmgmtservice.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.modelmgmtservice.image.pullPolicy }}
ports:
- name: serviceport
containerPort: {{ include "common.serviceport.modelmgmtservice.http" . }}
protocol: TCP
envFrom:
- configMapRef:
name: modelmgmtservice-configmap
env:
- name: S3_SECRET_KEY
valueFrom:
secretKeyRef:
name: leofs-secret
key: password
33 changes: 33 additions & 0 deletions helm/modelmgmtservice/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ==================================================================================
#
# Copyright (c) 2023 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.
#
# ==================================================================================
apiVersion: v1
kind: Service
metadata:
name: {{ include "modelmgmtservice.fullname" . }}
namespace: {{ include "common.namespace.platform" . }}
labels: {{ include "modelmgmtservice.labels" . | nindent 4 }}
spec:
type: NodePort
ports:
- port: {{ include "common.serviceport.modelmgmtservice.http" . }}
targetPort:
{{ include "common.serviceport.modelmgmtservice.targetport" . }}
nodePort: {{ include "common.serviceport.modelmgmtservice.external" . }}
protocol: TCP
name: serviceport
selector: {{ include "modelmgmtservice.selectorLabels" . | nindent 4 }}
24 changes: 24 additions & 0 deletions helm/modelmgmtservice/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ==================================================================================
#
# Copyright (c) 2023 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.
#
# ==================================================================================
# Default values for modelmgmtservice component.

image:
repository: modelmgmtservice
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "1.0.0"

0 comments on commit fdb7efc

Please sign in to comment.