Skip to content

Commit 101c6c9

Browse files
krish918bharaghamadhuri-rai07
authored
[Smart-Route-Planner-Agent] Adding Helm Charts (open-edge-platform#2248)
Signed-off-by: Krishna Murti <krishna.murti@intel.com> Co-authored-by: Raghu Bhat <raghavendra.bhat@intel.com> Co-authored-by: Madhuri Kumari <madhuri.rai07@gmail.com>
1 parent 1e17d51 commit 101c6c9

File tree

13 files changed

+424
-10
lines changed

13 files changed

+424
-10
lines changed

metro-ai-suite/smart-route-planning-agent/.pre-commit-config.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ repos:
66
- id: trailing-whitespace
77
- id: end-of-file-fixer
88
- id: check-yaml
9+
exclude: (^|/)charts?(/|$)
910
- id: check-json
1011
- id: check-toml
1112
- id: debug-statements
@@ -24,7 +25,7 @@ repos:
2425
args: [ --ignore-missing-imports ]
2526
exclude: ^metro-ai-suite/smart-route-planning-agent/testing/resources/
2627
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.14.14
28+
rev: v0.15.7
2829
hooks:
2930
- id: ruff-check
3031
types_or: [ python, pyi ]
@@ -36,7 +37,17 @@ repos:
3637
hooks:
3738
- id: shellcheck
3839
- repo: https://github.com/astral-sh/uv-pre-commit
39-
rev: 0.9.28
40+
rev: 0.10.12
4041
hooks:
4142
- id: uv-sync
4243
args: ["--locked", "--all-packages"]
44+
- repo: https://github.com/gruntwork-io/pre-commit
45+
rev: v0.1.30
46+
hooks:
47+
- id: helmlint
48+
name: helmlint
49+
description: Run helm lint, a linter for helm charts
50+
entry: hooks/helmlint.sh
51+
language: script
52+
files: \.((ya?ml)|(tpl))$
53+
require_serial: true

metro-ai-suite/smart-route-planning-agent/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ The Smart Route Planning Agent analyzes the route between a given source and des
44

55
## Get Started
66

7-
- [Get Started](./docs/user-guide/get-started.md): Step-by-step guide to get started with the agent.
8-
- [System Requirements](./docs/user-guide/get-started/system-requirements.md): Hardware and software requirements for running the agent.
9-
- [Build from Source](./docs/user-guide/get-started/build-from-source.md): Instructions for building the agent from source code.
10-
- [Environment Variables](./docs/user-guide/get-started/environment-variables.md): Configure the microservice through environment variables.
7+
- [Get Started](./docs/user-guide/get-started.md): Step-by-step guide to get started with the agent.
8+
- [System Requirements](./docs/user-guide/get-started/system-requirements.md): Hardware and software requirements for running the agent.
9+
- [Deploy with Helm](./docs/user-guide/get-started/deploy-with-helm.md): Deploy on Kubernetes using Helm.
10+
- [Build from Source](./docs/user-guide/get-started/build-from-source.md): Instructions for building the agent from source code.
11+
- [Environment Variables](./docs/user-guide/get-started/environment-variables.md): Configure the microservice through environment variables.
1112

1213
## Learn More
1314

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Patterns to ignore when building packages.
2+
.git/
3+
.gitignore
4+
*.md
5+
.DS_Store
6+
tests/
7+
ci/
8+
.vscode/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (C) 2026 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
apiVersion: v2
5+
name: smart-route-planning-agent
6+
description: A chart for deploying Smart Route Planning Agent Application
7+
type: application
8+
version: 1.0.0
9+
appVersion: "1.0.0"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{{/*
2+
Copyright (C) 2026 Intel Corporation
3+
SPDX-License-Identifier: Apache-2.0
4+
*/}}
5+
6+
{{- define "smart-route-planning-agent.name" -}}
7+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
8+
{{- end }}
9+
10+
{{- define "smart-route-planning-agent.fullname" -}}
11+
{{- if .Values.fullnameOverride }}
12+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
13+
{{- else }}
14+
{{- $name := default .Chart.Name .Values.nameOverride }}
15+
{{- if contains $name .Release.Name }}
16+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
17+
{{- else }}
18+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
19+
{{- end }}
20+
{{- end }}
21+
{{- end }}
22+
23+
{{- define "smart-route-planning-agent.chart" -}}
24+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
25+
{{- end }}
26+
27+
{{- define "smart-route-planning-agent.labels" -}}
28+
helm.sh/chart: {{ include "smart-route-planning-agent.chart" . }}
29+
{{ include "smart-route-planning-agent.selectorLabels" . }}
30+
{{- if .Chart.AppVersion }}
31+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
32+
{{- end }}
33+
app.kubernetes.io/managed-by: {{ .Release.Service }}
34+
{{- end }}
35+
36+
{{/* Selector labels — do not change after first install */}}
37+
{{- define "smart-route-planning-agent.selectorLabels" -}}
38+
app.kubernetes.io/name: {{ include "smart-route-planning-agent.name" . }}
39+
app.kubernetes.io/instance: {{ .Release.Name }}
40+
{{- end }}
41+
42+
43+
{{/* Handles optional registry prefix without double slashes */}}
44+
{{- define "smart-route-planning-agent.image" -}}
45+
{{- if .Values.image.registry }}
46+
{{- printf "%s/%s:%s" (.Values.image.registry | trimSuffix "/") .Values.image.repository .Values.image.tag }}
47+
{{- else }}
48+
{{- printf "%s:%s" .Values.image.repository .Values.image.tag }}
49+
{{- end }}
50+
{{- end }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (C) 2026 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
apiVersion: v1
5+
kind: ConfigMap
6+
metadata:
7+
name: {{ include "smart-route-planning-agent.fullname" . }}-config
8+
namespace: {{ .Release.Namespace }}
9+
labels:
10+
{{- include "smart-route-planning-agent.labels" . | nindent 4 }}
11+
data:
12+
http_proxy: {{ .Values.httpProxy | quote }}
13+
HTTP_PROXY: {{ .Values.httpProxy | quote }}
14+
https_proxy: {{ .Values.httpsProxy | quote }}
15+
HTTPS_PROXY: {{ .Values.httpsProxy | quote }}
16+
no_proxy: {{ .Values.noProxy | quote }}
17+
NO_PROXY: {{ .Values.noProxy | quote }}
18+
config.json: |
19+
{
20+
"api_endpoint": {{ .Values.trafficIntersections.apiEndpoint | quote }},
21+
"api_hosts": [
22+
{{- range $index, $host := .Values.trafficIntersections.hosts }}
23+
{{- if $index }},{{ end }}
24+
{
25+
"host": {{ $host | quote }}
26+
}
27+
{{- end }}
28+
]
29+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{{/*
2+
Copyright (C) 2026 Intel Corporation
3+
SPDX-License-Identifier: Apache-2.0
4+
*/}}
5+
6+
apiVersion: apps/v1
7+
kind: Deployment
8+
metadata:
9+
name: {{ include "smart-route-planning-agent.fullname" . }}
10+
namespace: {{ .Release.Namespace }}
11+
labels:
12+
{{- include "smart-route-planning-agent.labels" . | nindent 4 }}
13+
spec:
14+
replicas: {{ .Values.replicaCount }}
15+
selector:
16+
matchLabels:
17+
{{- include "smart-route-planning-agent.selectorLabels" . | nindent 6 }}
18+
template:
19+
metadata:
20+
annotations:
21+
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
22+
labels:
23+
{{- include "smart-route-planning-agent.labels" . | nindent 8 }}
24+
spec:
25+
{{- with .Values.imagePullSecrets }}
26+
imagePullSecrets:
27+
{{- toYaml . | nindent 8 }}
28+
{{- end }}
29+
securityContext:
30+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
31+
containers:
32+
- name: {{ .Chart.Name }}
33+
image: {{ include "smart-route-planning-agent.image" . | quote }}
34+
imagePullPolicy: {{ .Values.image.pullPolicy }}
35+
securityContext:
36+
{{- toYaml .Values.securityContext | nindent 12 }}
37+
ports:
38+
- name: {{ .Values.containerPortName }}
39+
containerPort: {{ .Values.containerPort }}
40+
protocol: TCP
41+
envFrom:
42+
- configMapRef:
43+
name: {{ include "smart-route-planning-agent.fullname" . }}-config
44+
volumeMounts:
45+
- name: config-volume
46+
mountPath: /app/data/config.json
47+
subPath: config.json
48+
readOnly: true
49+
{{- with .Values.livenessProbe }}
50+
livenessProbe:
51+
{{- toYaml . | nindent 12 }}
52+
{{- end }}
53+
{{- with .Values.readinessProbe }}
54+
readinessProbe:
55+
{{- toYaml . | nindent 12 }}
56+
{{- end }}
57+
resources:
58+
{{- toYaml .Values.resources | nindent 12 }}
59+
volumes:
60+
- name: config-volume
61+
configMap:
62+
name: {{ include "smart-route-planning-agent.fullname" . }}-config
63+
{{- with .Values.nodeSelector }}
64+
nodeSelector:
65+
{{- toYaml . | nindent 8 }}
66+
{{- end }}
67+
{{- with .Values.tolerations }}
68+
tolerations:
69+
{{- toYaml . | nindent 8 }}
70+
{{- end }}
71+
{{- with .Values.affinity }}
72+
affinity:
73+
{{- toYaml . | nindent 8 }}
74+
{{- end }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{/*
2+
Copyright (C) 2026 Intel Corporation
3+
SPDX-License-Identifier: Apache-2.0
4+
*/}}
5+
6+
apiVersion: v1
7+
kind: Service
8+
metadata:
9+
name: {{ include "smart-route-planning-agent.fullname" . }}
10+
namespace: {{ .Release.Namespace }}
11+
labels:
12+
{{- include "smart-route-planning-agent.labels" . | nindent 4 }}
13+
spec:
14+
type: {{ .Values.service.type }}
15+
ports:
16+
- port: {{ .Values.service.port }}
17+
targetPort: {{ .Values.containerPortName }}
18+
protocol: TCP
19+
selector:
20+
{{- include "smart-route-planning-agent.selectorLabels" . | nindent 4 }}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright (C) 2026 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
httpProxy: ""
5+
httpsProxy: ""
6+
noProxy: ""
7+
8+
replicaCount: 1
9+
10+
image:
11+
registry: "docker.io"
12+
repository: "intel/smart-route-planning-agent"
13+
tag: "latest"
14+
pullPolicy: IfNotPresent
15+
16+
imagePullSecrets: []
17+
nameOverride: ""
18+
fullnameOverride: ""
19+
20+
service:
21+
type: NodePort
22+
port: 7860
23+
24+
containerPort: 7860
25+
containerPortName: agent-uiport
26+
27+
28+
# Following values are used to generate config.json in configmap which is mounted into the container.
29+
trafficIntersections:
30+
apiEndpoint: ""
31+
# Each host is a WebSocket address of a traffic intersection agent.
32+
hosts: []
33+
34+
resources:
35+
36+
podSecurityContext:
37+
runAsNonRoot: true
38+
runAsUser: 1000
39+
runAsGroup: 1000
40+
fsGroup: 1000
41+
42+
securityContext:
43+
allowPrivilegeEscalation: false
44+
capabilities:
45+
drop:
46+
- ALL
47+
seccompProfile:
48+
type: RuntimeDefault
49+
50+
livenessProbe:
51+
httpGet:
52+
path: /
53+
port: agent-uiport
54+
initialDelaySeconds: 20
55+
periodSeconds: 30
56+
timeoutSeconds: 10
57+
failureThreshold: 3
58+
59+
readinessProbe:
60+
httpGet:
61+
path: /
62+
port: agent-uiport
63+
initialDelaySeconds: 10
64+
periodSeconds: 10
65+
timeoutSeconds: 5
66+
failureThreshold: 3
67+
68+
nodeSelector: {}
69+
tolerations: []
70+
affinity: {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (C) 2026 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
httpProxy: ""
5+
httpsProxy: ""
6+
noProxy: "localhost,127.0.0.0/8,10.0.0.0/8,127.0.0.1,0.0.0.0,172.16.0.0/12,192.168.0.0/16"
7+
8+
trafficIntersections:
9+
apiEndpoint: "/api/v1/traffic/current?images=false"
10+
# Add or remove entries based on available Traffic Intersection deployments.
11+
hosts:
12+
- "http://127.0.0.1:8081"
13+
- "http://127.0.0.1:8082"

0 commit comments

Comments
 (0)