From aaacf096c7147d2a720941ac32a10468db568e0d Mon Sep 17 00:00:00 2001 From: sys_softwarerecipes Date: Tue, 5 Mar 2024 07:23:31 +0530 Subject: [PATCH] adding chart evi-fm-worker-bf-2.1.0 --- charts/evi-fm-worker-bf-2.1.0/Chart.yaml | 6 + .../configs/worker.conf | 26 +++++ .../templates/Namespace.yaml | 24 ++++ .../templates/_helpers.tpl | 75 +++++++++++++ .../templates/configmap.yaml | 21 ++++ .../templates/deployment.yaml | 106 ++++++++++++++++++ .../templates/service.yaml | 29 +++++ .../templates/serviceaccount.yaml | 21 ++++ charts/evi-fm-worker-bf-2.1.0/values.yaml | 58 ++++++++++ 9 files changed, 366 insertions(+) create mode 100644 charts/evi-fm-worker-bf-2.1.0/Chart.yaml create mode 100644 charts/evi-fm-worker-bf-2.1.0/configs/worker.conf create mode 100644 charts/evi-fm-worker-bf-2.1.0/templates/Namespace.yaml create mode 100644 charts/evi-fm-worker-bf-2.1.0/templates/_helpers.tpl create mode 100644 charts/evi-fm-worker-bf-2.1.0/templates/configmap.yaml create mode 100644 charts/evi-fm-worker-bf-2.1.0/templates/deployment.yaml create mode 100644 charts/evi-fm-worker-bf-2.1.0/templates/service.yaml create mode 100644 charts/evi-fm-worker-bf-2.1.0/templates/serviceaccount.yaml create mode 100644 charts/evi-fm-worker-bf-2.1.0/values.yaml diff --git a/charts/evi-fm-worker-bf-2.1.0/Chart.yaml b/charts/evi-fm-worker-bf-2.1.0/Chart.yaml new file mode 100644 index 0000000..8d401ed --- /dev/null +++ b/charts/evi-fm-worker-bf-2.1.0/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +appVersion: 1.16.0 +description: A Helm chart for Kubernetes +name: evi-fm-worker-bf +type: application +version: 2.1.0 diff --git a/charts/evi-fm-worker-bf-2.1.0/configs/worker.conf b/charts/evi-fm-worker-bf-2.1.0/configs/worker.conf new file mode 100644 index 0000000..673cd77 --- /dev/null +++ b/charts/evi-fm-worker-bf-2.1.0/configs/worker.conf @@ -0,0 +1,26 @@ +[Local] +method=0 #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=local #`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 diff --git a/charts/evi-fm-worker-bf-2.1.0/templates/Namespace.yaml b/charts/evi-fm-worker-bf-2.1.0/templates/Namespace.yaml new file mode 100644 index 0000000..6c078df --- /dev/null +++ b/charts/evi-fm-worker-bf-2.1.0/templates/Namespace.yaml @@ -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 -}} + diff --git a/charts/evi-fm-worker-bf-2.1.0/templates/_helpers.tpl b/charts/evi-fm-worker-bf-2.1.0/templates/_helpers.tpl new file mode 100644 index 0000000..5827614 --- /dev/null +++ b/charts/evi-fm-worker-bf-2.1.0/templates/_helpers.tpl @@ -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 }} diff --git a/charts/evi-fm-worker-bf-2.1.0/templates/configmap.yaml b/charts/evi-fm-worker-bf-2.1.0/templates/configmap.yaml new file mode 100644 index 0000000..a74992a --- /dev/null +++ b/charts/evi-fm-worker-bf-2.1.0/templates/configmap.yaml @@ -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 }} + diff --git a/charts/evi-fm-worker-bf-2.1.0/templates/deployment.yaml b/charts/evi-fm-worker-bf-2.1.0/templates/deployment.yaml new file mode 100644 index 0000000..65b442b --- /dev/null +++ b/charts/evi-fm-worker-bf-2.1.0/templates/deployment.yaml @@ -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-bf + serviceName: "evi-fm-worker-bf" + replicas: {{ .Values.env.workerCount }} + minReadySeconds: 10 # by default is 0 + podManagementPolicy: "OrderedReady" + template: + metadata: + labels: + app: evi-fm-worker-bf + sidecar.istio.io/inject: "{{ .Values.istioInjection }}" + version: v1 + spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - evi-fm-worker-bf + topologyKey: "kubernetes.io/hostname" + serviceAccountName: evi-fm-worker-bf + containers: + - name: evi-fm-worker-bf + 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/^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/^name=MasterName.*/name=Master-bf/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-bf + - name: fmlocal + hostPath: + path: /home/fmlocal/ diff --git a/charts/evi-fm-worker-bf-2.1.0/templates/service.yaml b/charts/evi-fm-worker-bf-2.1.0/templates/service.yaml new file mode 100644 index 0000000..e137f59 --- /dev/null +++ b/charts/evi-fm-worker-bf-2.1.0/templates/service.yaml @@ -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-bf + diff --git a/charts/evi-fm-worker-bf-2.1.0/templates/serviceaccount.yaml b/charts/evi-fm-worker-bf-2.1.0/templates/serviceaccount.yaml new file mode 100644 index 0000000..08ceb47 --- /dev/null +++ b/charts/evi-fm-worker-bf-2.1.0/templates/serviceaccount.yaml @@ -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-bf + labels: + account: evi-fm-worker-bf + diff --git a/charts/evi-fm-worker-bf-2.1.0/values.yaml b/charts/evi-fm-worker-bf-2.1.0/values.yaml new file mode 100644 index 0000000..11ed448 --- /dev/null +++ b/charts/evi-fm-worker-bf-2.1.0/values.yaml @@ -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-bf + localConf: + maxRetry: 5 + retryInterval: 1000 + redis: + redisAddr: tcp://evi-redis-standalone-master.smartedge-apps + redisPort: 6379 + +service: + name: evi-fm-worker-bf + labels: + value: evi-fm-worker-bf + +image: + repository: fm-worker + version: master-c8d66502f0864e634a642d1062836050248fd81f + pullPolicy: IfNotPresent + containerPort: 8080 + +env: + method: 0 + workerCount: 1 + coreCount: 1 + cpuSetting: "1:0|1:1" + loadFrom: local + hbaseAddr: evi-hbase-hbase-master.smartedge-apps + hbasePort: 9090 + psqlAddr: evi-postgresql.postgresql + psqlPort: 5432 + psqlDatabase: hce + localFilePath: features_quantized_scale475.099.dat