From e7814a7791f99db2528547424e36b1cc51f73747 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Mon, 3 Nov 2025 15:11:08 +0000 Subject: [PATCH 1/4] rename iocLocation to epicsDomain --- Charts/dev-c7/templates/statefulset.yaml | 4 ++-- Charts/dev-c7/values.schema.json | 14 ++++++++++---- Charts/dev-c7/values.yaml | 12 +++++++++--- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Charts/dev-c7/templates/statefulset.yaml b/Charts/dev-c7/templates/statefulset.yaml index 1c4f214..2693a3c 100644 --- a/Charts/dev-c7/templates/statefulset.yaml +++ b/Charts/dev-c7/templates/statefulset.yaml @@ -54,13 +54,13 @@ spec: {{- .Values.command | toYaml | nindent 12 }} stdin: true tty: true - {{- $iocLocation := (.Values.iocLocation | default $location) | upper }} + {{- $epicsDomain := (.Values.epicsDomain | default $location) | upper }} {{- $iocName := (.Values.iocName | default .Release.Name) | upper }} {{ $workingDir := "" }} {{- /* create the variable in global scope before setting in if/else!!! */ -}} {{- if .Values.iocPath }} {{- $workingDir = printf "%s/%s" .Values.iocPath $iocName }} {{- else }} - {{- $workingDir = printf "/dls_sw/prod/%s/ioc/%s/%s/%s" .Values.epicsVersion $iocLocation $iocName .Values.iocVersion }} + {{- $workingDir = printf "/dls_sw/prod/%s/ioc/%s/%s/%s" .Values.epicsVersion $epicsDomain $iocName .Values.iocVersion }} {{- end }} workingDir: {{ $workingDir }} {{- with .Values.securityContext }} diff --git a/Charts/dev-c7/values.schema.json b/Charts/dev-c7/values.schema.json index 37c6e2a..9cec7eb 100644 --- a/Charts/dev-c7/values.schema.json +++ b/Charts/dev-c7/values.schema.json @@ -8,6 +8,12 @@ "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/affinity.json", "type": "object" }, + "args": { + "type": "array", + "items": { + "type": "string" + } + }, "autosavePath": { "description": "Full path to an IOC instance's autosave folder. Overrides autosaveRootPath when not blank", "type": "string" @@ -22,6 +28,10 @@ "type": "string" } }, + "epicsDomain": { + "description": "IOCs DLS EPICS Domain (e.g. BL16I FE02J SR03C)", + "type": "string" + }, "epicsVersion": { "description": "the EPICS version, used to generate the /dls_sw/prod path to iocName", "type": "string" @@ -56,10 +66,6 @@ "imagePullSecrets": { "type": "array" }, - "iocLocation": { - "description": "the IOC location (e.g. BL16I FE02J SR03C)", - "type": "string" - }, "iocName": { "description": "the folder name for the compiled IOC, defaults to ucase of the services folder name", "type": "string" diff --git a/Charts/dev-c7/values.yaml b/Charts/dev-c7/values.yaml index 0493d9d..0ff6c20 100644 --- a/Charts/dev-c7/values.yaml +++ b/Charts/dev-c7/values.yaml @@ -12,8 +12,8 @@ iocName: "" # @schema description: the IOC release, used to generate the /dls_sw/prod path to iocName iocVersion: "" -# @schema description: the IOC location (e.g. BL16I FE02J SR03C) -iocLocation: "" +# @schema description: IOCs DLS EPICS Domain (e.g. BL16I FE02J SR03C) +epicsDomain: "" # @schema description: the EPICS version, used to generate the /dls_sw/prod path to iocName epicsVersion: R3.14.12.7 @@ -36,7 +36,10 @@ image: command: - bash - -lc - - stdio-expose ./bin/linux-x86_64/st*.sh + - stdio-expose + +args: + - ./bin/linux-x86_64/st*.sh # @schema description: enable host networking for the pod hostNetwork: false @@ -86,6 +89,9 @@ volumes: - name: etc hostPath: path: /dls_sw/etc + - name: apps + hostPath: + path: /dls_sw/apps # volumeMounts for the Deployment. # @schema $ref: $k8s/container.json#/properties/volumeMounts From bbffebc41c51f781e9b5464bbc79f6039ce0dcae Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Mon, 3 Nov 2025 15:18:37 +0000 Subject: [PATCH 2/4] add workingDir override --- Charts/dev-c7/templates/statefulset.yaml | 16 +++++++++------- Charts/dev-c7/values.schema.json | 4 ++++ Charts/dev-c7/values.yaml | 2 ++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Charts/dev-c7/templates/statefulset.yaml b/Charts/dev-c7/templates/statefulset.yaml index 2693a3c..61b89a9 100644 --- a/Charts/dev-c7/templates/statefulset.yaml +++ b/Charts/dev-c7/templates/statefulset.yaml @@ -56,13 +56,15 @@ spec: tty: true {{- $epicsDomain := (.Values.epicsDomain | default $location) | upper }} {{- $iocName := (.Values.iocName | default .Release.Name) | upper }} - {{ $workingDir := "" }} {{- /* create the variable in global scope before setting in if/else!!! */ -}} - {{- if .Values.iocPath }} - {{- $workingDir = printf "%s/%s" .Values.iocPath $iocName }} - {{- else }} - {{- $workingDir = printf "/dls_sw/prod/%s/ioc/%s/%s/%s" .Values.epicsVersion $epicsDomain $iocName .Values.iocVersion }} - {{- end }} - workingDir: {{ $workingDir }} + {{ $workingDir := .Values.workingDir }} + {{ if eq $workingDir "" }} + {{- if .Values.iocPath }} + {{- $workingDir = printf "%s/%s" .Values.iocPath $iocName }} + {{- else }} + {{- $workingDir = printf "/dls_sw/prod/%s/ioc/%s/%s/%s" .Values.epicsVersion $epicsDomain $iocName .Values.iocVersion }} + {{- end }} + {{ end }} + workingDir: {{ .Values.workingDir | default $workingDir }} {{- with .Values.securityContext }} securityContext: {{- toYaml . | nindent 12 }} diff --git a/Charts/dev-c7/values.schema.json b/Charts/dev-c7/values.schema.json index 9cec7eb..e93773a 100644 --- a/Charts/dev-c7/values.schema.json +++ b/Charts/dev-c7/values.schema.json @@ -146,6 +146,10 @@ } } } + }, + "workingDir": { + "description": "override the cwd for launching the IOC, defaults to /dls_sw/prod/$epicsVersion/ioc/$epicsDomain/$iocName/$iocVersion", + "type": "string" } }, "additionalProperties": false diff --git a/Charts/dev-c7/values.yaml b/Charts/dev-c7/values.yaml index 0ff6c20..b57dd56 100644 --- a/Charts/dev-c7/values.yaml +++ b/Charts/dev-c7/values.yaml @@ -16,6 +16,8 @@ iocVersion: "" epicsDomain: "" # @schema description: the EPICS version, used to generate the /dls_sw/prod path to iocName epicsVersion: R3.14.12.7 +# @schema description: override the cwd for launching the IOC, defaults to /dls_sw/prod/$epicsVersion/ioc/$epicsDomain/$iocName/$iocVersion +workingDir: "" # @schema description: overrides the parent folder for iocName to any path in /dls_sw/work or /dls_sw/prod iocPath: "" From 2f01c954a207bd04e70a238bfa00ea7433ba876a Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Mon, 3 Nov 2025 15:45:29 +0000 Subject: [PATCH 3/4] add extraVolumes --- Charts/dev-c7/templates/statefulset.yaml | 6 ++++++ Charts/dev-c7/values.schema.json | 10 ++++++++++ Charts/dev-c7/values.yaml | 15 ++++++++++++--- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Charts/dev-c7/templates/statefulset.yaml b/Charts/dev-c7/templates/statefulset.yaml index 61b89a9..ce3462f 100644 --- a/Charts/dev-c7/templates/statefulset.yaml +++ b/Charts/dev-c7/templates/statefulset.yaml @@ -89,6 +89,9 @@ spec: {{- with .Values.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} + {{ - with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- end }} {{- with .Values.autosavePath }} - name: autosave @@ -104,6 +107,9 @@ spec: {{- with .Values.volumes }} volumes: {{- toYaml . | nindent 8 }} + {{ - with .Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} {{- with .Values.autosavePath }} - name: autosave diff --git a/Charts/dev-c7/values.schema.json b/Charts/dev-c7/values.schema.json index e93773a..7ed573e 100644 --- a/Charts/dev-c7/values.schema.json +++ b/Charts/dev-c7/values.schema.json @@ -36,6 +36,16 @@ "description": "the EPICS version, used to generate the /dls_sw/prod path to iocName", "type": "string" }, + "extraVolumeMounts": { + "description": "add extra mounts without overriding the default ones", + "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/container.json#/properties/volumeMounts", + "type": "array" + }, + "extraVolumes": { + "description": "add extra volumes without overriding the default ones", + "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/podspec.json#/properties/volumes", + "type": "array" + }, "fullnameOverride": { "type": "string" }, diff --git a/Charts/dev-c7/values.yaml b/Charts/dev-c7/values.yaml index b57dd56..69b1557 100644 --- a/Charts/dev-c7/values.yaml +++ b/Charts/dev-c7/values.yaml @@ -16,11 +16,10 @@ iocVersion: "" epicsDomain: "" # @schema description: the EPICS version, used to generate the /dls_sw/prod path to iocName epicsVersion: R3.14.12.7 -# @schema description: override the cwd for launching the IOC, defaults to /dls_sw/prod/$epicsVersion/ioc/$epicsDomain/$iocName/$iocVersion -workingDir: "" - # @schema description: overrides the parent folder for iocName to any path in /dls_sw/work or /dls_sw/prod iocPath: "" +# @schema description: override the cwd for launching the IOC, defaults to /dls_sw/prod/$epicsVersion/ioc/$epicsDomain/$iocName/$iocVersion +workingDir: "" # @schema description: shared values for all services # @schema additionalProperties: true @@ -95,6 +94,11 @@ volumes: hostPath: path: /dls_sw/apps +# extraVolumes for the Deployment. +# @schema description: add extra volumes without overriding the default ones +# @schema $ref: $k8s/podspec.json#/properties/volumes +extraVolumes: [] + # volumeMounts for the Deployment. # @schema $ref: $k8s/container.json#/properties/volumeMounts volumeMounts: @@ -114,6 +118,11 @@ volumeMounts: mountPath: /dls_sw/etc readOnly: true +# extraVolumeMounts for the Deployment. +# @schema description: add extra mounts without overriding the default ones +# @schema $ref: $k8s/container.json#/properties/volumeMounts +extraVolumeMounts: [] + # @schema $ref: $k8s/podspec.json#/properties/tolerations tolerations: [] From dee3a7789cdd5da796f15de522dfd5d1b53ac3b3 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Tue, 4 Nov 2025 08:20:37 +0000 Subject: [PATCH 4/4] fix args --- Charts/dev-c7/templates/statefulset.yaml | 18 ++++++++++-------- Charts/dev-c7/values.yaml | 6 +----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Charts/dev-c7/templates/statefulset.yaml b/Charts/dev-c7/templates/statefulset.yaml index ce3462f..9d51279 100644 --- a/Charts/dev-c7/templates/statefulset.yaml +++ b/Charts/dev-c7/templates/statefulset.yaml @@ -52,27 +52,29 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" command: {{- .Values.command | toYaml | nindent 12 }} + args: + {{- .Values.args | toYaml | nindent 12 }} stdin: true tty: true {{- $epicsDomain := (.Values.epicsDomain | default $location) | upper }} {{- $iocName := (.Values.iocName | default .Release.Name) | upper }} - {{ $workingDir := .Values.workingDir }} - {{ if eq $workingDir "" }} + {{- $workingDir := .Values.workingDir }} + {{- if eq $workingDir "" }} {{- if .Values.iocPath }} {{- $workingDir = printf "%s/%s" .Values.iocPath $iocName }} {{- else }} {{- $workingDir = printf "/dls_sw/prod/%s/ioc/%s/%s/%s" .Values.epicsVersion $epicsDomain $iocName .Values.iocVersion }} {{- end }} - {{ end }} + {{- end }} workingDir: {{ .Values.workingDir | default $workingDir }} {{- with .Values.securityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} env: - # psuedo home sets up epics module etc. - - name: HOME - value: /epicsHome + # psuedo home sets up epics module etc. + - name: HOME + value: /epicsHome imagePullPolicy: {{ .Values.image.pullPolicy }} {{- with .Values.livenessProbe }} livenessProbe: @@ -89,7 +91,7 @@ spec: {{- with .Values.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} - {{ - with .Values.extraVolumeMounts }} + {{- with $.Values.extraVolumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} {{- end }} @@ -107,7 +109,7 @@ spec: {{- with .Values.volumes }} volumes: {{- toYaml . | nindent 8 }} - {{ - with .Values.extraVolumes }} + {{- with $.Values.extraVolumes }} {{- toYaml . | nindent 8 }} {{- end }} {{- end }} diff --git a/Charts/dev-c7/values.yaml b/Charts/dev-c7/values.yaml index 69b1557..ccc925e 100644 --- a/Charts/dev-c7/values.yaml +++ b/Charts/dev-c7/values.yaml @@ -37,10 +37,9 @@ image: command: - bash - -lc - - stdio-expose args: - - ./bin/linux-x86_64/st*.sh + - stdio-expose ./bin/linux-x86_64/st*.sh # @schema description: enable host networking for the pod hostNetwork: false @@ -90,9 +89,6 @@ volumes: - name: etc hostPath: path: /dls_sw/etc - - name: apps - hostPath: - path: /dls_sw/apps # extraVolumes for the Deployment. # @schema description: add extra volumes without overriding the default ones