Skip to content

Commit

Permalink
adding chart evi-fm-worker-as-2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
softwarerecipes committed Mar 5, 2024
1 parent fa8b615 commit 9d200ab
Show file tree
Hide file tree
Showing 9 changed files with 366 additions and 0 deletions.
6 changes: 6 additions & 0 deletions charts/evi-fm-worker-as-2.1.0/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
appVersion: 1.16.0
description: A Helm chart for Kubernetes
name: evi-fm-worker-as
type: application
version: 2.1.0
26 changes: 26 additions & 0 deletions charts/evi-fm-worker-as-2.1.0/configs/worker.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[Local]
method=1 #0 for brutal force, 1 for approximate search
name=WorkerName-1# workerName
logDir=/tmp/
maxLogFileSize=16777216
maxLogFileNum=20
logSeverity=0#0:trace,1:debug,2:info,3:notice,4:warning,5:error,6:critical,7:alert,8:emergence,9:off
heartBeatIntervals=900#ms
cpu=1
cpuSetting= 1:2|#coreCountForPod0:cpuStartForPod0|coreCountForPod1:cpuStartForPod1
scaleFactor=411.317
loadFrom=postgresql #`hbase` for brutalforce, `local` for brutal force with a local file, `postgresql` for approximate search
maxRetry=3
retryInterval=1000#ms
[Master]
name=MasterName
[RedisSentinels]
masterName=mymaster
sentinel=tcp://evi-redis-standalone-master.smartedge-apps
sentinel=redis-redis-ha-announce-1
sentinel=tcp://127.0.0.1
port=6379
port=26379
port=26379
[Connection]
poolSize=3
24 changes: 24 additions & 0 deletions charts/evi-fm-worker-as-2.1.0/templates/Namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# INTEL CONFIDENTIAL
#
# Copyright (C) 2022 Intel Corporation.
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you (License).
# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute,
# disclose or transmit this software or the related documents without Intel's prior written permission.
#
# This software and the related documents are provided as is, with no express or implied warranties,
# other than those that are expressly stated in the License.

---
{{- if .Values.global.namespace.create -}}
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.global.namespace.value }}
{{ if .Values.global.namespace.istioInjection.create }}
labels:
istio-injection: enabled
{{ end }}
{{- end -}}

75 changes: 75 additions & 0 deletions charts/evi-fm-worker-as-2.1.0/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# INTEL CONFIDENTIAL
#
# Copyright (C) 2022 Intel Corporation.
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you (License).
# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute,
# disclose or transmit this software or the related documents without Intel's prior written permission.
#
# This software and the related documents are provided as is, with no express or implied warranties,
# other than those that are expressly stated in the License.

---
{{/*
Expand the name of the chart.
*/}}
{{- define "fm-worker.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 "fm-worker.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 "fm-worker.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "fm-worker.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "fm-worker.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
21 changes: 21 additions & 0 deletions charts/evi-fm-worker-as-2.1.0/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# INTEL CONFIDENTIAL
#
# Copyright (C) 2022 Intel Corporation.
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you (License).
# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute,
# disclose or transmit this software or the related documents without Intel's prior written permission.
#
# This software and the related documents are provided as is, with no express or implied warranties,
# other than those that are expressly stated in the License.

---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: {{ .Values.global.namespace.value }}
name: {{ .Values.configMap.name }}
data:
{{ (.Files.Glob "configs/**.conf").AsConfig | replace "maxRetry_placeholder" (toString .Values.configMap.localConf.maxRetry) | replace "retryInterval_placeholder" (toString .Values.configMap.localConf.retryInterval) | replace "redisAddr_placeholder" .Values.configMap.redis.redisAddr | replace "redisPort_placeholder" (toString .Values.configMap.redis.redisPort) | indent 2 }}

106 changes: 106 additions & 0 deletions charts/evi-fm-worker-as-2.1.0/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# INTEL CONFIDENTIAL
#
# Copyright (C) 2022-2023 Intel Corporation.
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you (License).
# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute,
# disclose or transmit this software or the related documents without Intel's prior written permission.
#
# This software and the related documents are provided as is, with no express or implied warranties,
# other than those that are expressly stated in the License.

---
apiVersion: apps/v1
#kind: Deployment
kind: StatefulSet
metadata:
name: {{ include "fm-worker.fullname" . }}
namespace: {{ .Values.global.namespace.value }}
spec:
selector:
matchLabels:
app: evi-fm-worker-as
serviceName: "evi-fm-worker-as"
replicas: {{ .Values.env.workerCount }}
minReadySeconds: 10 # by default is 0
podManagementPolicy: "OrderedReady"
template:
metadata:
labels:
app: evi-fm-worker-as
sidecar.istio.io/inject: "{{ .Values.istioInjection }}"
version: v1
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- evi-fm-worker-as
topologyKey: "kubernetes.io/hostname"
serviceAccountName: evi-fm-worker-as
containers:
- name: evi-fm-worker-as
image: {{ .Values.image.repository }}:{{ .Values.image.version}}
command: ["/bin/sh"]
args: ["-c", 'cp /opt/feature_matching_service/featurematchingservice/worker/worker.conf /opt/featurematchingservice/worker/worker-${HOSTNAME}.conf; sed -i "s/^name=MasterName.*/name=Master-as/g" /opt/featurematchingservice/worker/worker-${HOSTNAME}.conf; sed -i "s/^method=.*/method=${METHOD}/g" /opt/featurematchingservice/worker/worker-${HOSTNAME}.conf; sed -i "s/^sentinel=.*/sentinel=${{.Values.configMap.redis.redisAddr}}:${{.Values.configMap.redis.redisPort}}/g" /opt/featurematchingservice/worker/worker-${HOSTNAME}.conf; sed -i "s/^cpuSetting=.*/cpuSetting=${FM_CPU_SETTING}/g" /opt/featurematchingservice/worker/worker-${HOSTNAME}.conf; sed -i "s/^name=WorkerName.*/name=${HOSTNAME}/g" /opt/featurematchingservice/worker/worker-${HOSTNAME}.conf; sed -i "s/^cpu=.*/cpu=${FM_CORE_COUNT}/g" /opt/featurematchingservice/worker/worker-${HOSTNAME}.conf; sed -i "s/^loadFrom=.*/loadFrom=${FM_LOAD_FROM}/g" /opt/featurematchingservice/worker/worker-${HOSTNAME}.conf; sleep 3; /opt/featurematchingservice/worker/bin/fmsWorker -C /opt/featurematchingservice/worker/worker-${HOSTNAME}.conf']
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
limits:
cpu: "120"
memory: 64Gi
requests:
cpu: 5m
memory: 30Mi
env:
- name: NODE_NAME
value: {{ include "fm-worker.fullname" . }}
- name: FeatureStorage_HBaseVehicleFeatureServerAddress
value: "{{ .Values.env.hbaseAddr }}"
- name: FeatureStorage_HBaseVehicleFeatureServerPort
value: "{{ .Values.env.hbasePort }}"
- name: FeatureStorage_PSQL_ServerAddress
value: "{{ .Values.env.psqlAddr }}"
- name: FeatureStorage_PSQL_ServerPort
value: "{{ .Values.env.psqlPort }}"
- name: FeatureStorage_localFilePath
value: "{{ .Values.env.localFilePath }}"
- name: FeatureStorage_PSQL_Password
valueFrom:
secretKeyRef:
name: sqldbsecret
key: password
- name: FeatureStorage_PSQL_Database
value: "{{ .Values.env.psqlDatabase }}"
#valueFrom:
# fieldRef:
# fieldPath: metadata.name
- name: FM_WORKER_COUNT
value: "{{ .Values.env.workerCount }}"
- name: FM_CORE_COUNT
value: "{{ .Values.env.coreCount }}"
- name: FM_CPU_SETTING
value: "{{ .Values.env.cpuSetting }}"
- name: FM_LOAD_FROM
value: "{{ .Values.env.loadFrom }}"
- name: METHOD
value: "{{ .Values.env.method }}"
ports:
- containerPort: {{ .Values.image.containerPort }}
volumeMounts:
- mountPath: /opt/feature_matching_service/featurematchingservice/worker/worker.conf
subPath: worker.conf
name: config-volume
- mountPath: /opt/data/
name: fmlocal
volumes:
- name: config-volume
configMap:
name: evi-fm-worker-as
- name: fmlocal
hostPath:
path: /home/fmlocal/
29 changes: 29 additions & 0 deletions charts/evi-fm-worker-as-2.1.0/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# INTEL CONFIDENTIAL
#
# Copyright (C) 2022 Intel Corporation.
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you (License).
# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute,
# disclose or transmit this software or the related documents without Intel's prior written permission.
#
# This software and the related documents are provided as is, with no express or implied warranties,
# other than those that are expressly stated in the License.

---
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.service.name }}
namespace: {{ .Values.global.namespace.value }}
labels:
app: {{ .Values.service.labels.value }}
spec:
ports:
- port: {{ .Values.image.containerPort }}
targetPort: {{ .Values.image.containerPort }}
protocol: TCP
type: ClusterIP
selector:
app: evi-fm-worker-as

21 changes: 21 additions & 0 deletions charts/evi-fm-worker-as-2.1.0/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# INTEL CONFIDENTIAL
#
# Copyright (C) 2022 Intel Corporation.
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you (License).
# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute,
# disclose or transmit this software or the related documents without Intel's prior written permission.
#
# This software and the related documents are provided as is, with no express or implied warranties,
# other than those that are expressly stated in the License.

---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: {{ .Values.global.namespace.value }}
name: evi-fm-worker-as
labels:
account: evi-fm-worker-as

58 changes: 58 additions & 0 deletions charts/evi-fm-worker-as-2.1.0/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# INTEL CONFIDENTIAL
#
# Copyright (C) 2022 Intel Corporation.
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you (License).
# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute,
# disclose or transmit this software or the related documents without Intel's prior written permission.
#
# This software and the related documents are provided as is, with no express or implied warranties,
# other than those that are expressly stated in the License.

---
# Default values for fm-worker.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

global:
namespace:
create: false
value: fm
istioInjection:
create: false

istioInjection: true

configMap:
name: evi-fm-worker-as
localConf:
maxRetry: 5
retryInterval: 1000
redis:
redisAddr: tcp://evi-redis-standalone-master.smartedge-apps
redisPort: 6379

service:
name: evi-fm-worker-as
labels:
value: evi-fm-worker-as

image:
repository: fm-worker
version: master-c8d66502f0864e634a642d1062836050248fd81f
pullPolicy: IfNotPresent
containerPort: 8080

env:
method: 1
workerCount: 1
coreCount: 1
cpuSetting: "1:0|1:1"
loadFrom: postgresql
hbaseAddr: evi-hbase-hbase-master.smartedge-apps
hbasePort: 9090
psqlAddr: evi-postgresql.postgresql
psqlPort: 5432
psqlDatabase: hce
localFilePath: features_quantized_scale475.099.dat

0 comments on commit 9d200ab

Please sign in to comment.