Skip to content

Commit e778b76

Browse files
authored
Merge pull request #14 from DiamondLightSource/fix-python
Fix python
2 parents 5976bf1 + dee3a77 commit e778b76

File tree

3 files changed

+60
-17
lines changed

3 files changed

+60
-17
lines changed

Charts/dev-c7/templates/statefulset.yaml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,29 @@ spec:
5252
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
5353
command:
5454
{{- .Values.command | toYaml | nindent 12 }}
55+
args:
56+
{{- .Values.args | toYaml | nindent 12 }}
5557
stdin: true
5658
tty: true
57-
{{- $iocLocation := (.Values.iocLocation | default $location) | upper }}
59+
{{- $epicsDomain := (.Values.epicsDomain | default $location) | upper }}
5860
{{- $iocName := (.Values.iocName | default .Release.Name) | upper }}
59-
{{ $workingDir := "" }} {{- /* create the variable in global scope before setting in if/else!!! */ -}}
60-
{{- if .Values.iocPath }}
61-
{{- $workingDir = printf "%s/%s" .Values.iocPath $iocName }}
62-
{{- else }}
63-
{{- $workingDir = printf "/dls_sw/prod/%s/ioc/%s/%s/%s" .Values.epicsVersion $iocLocation $iocName .Values.iocVersion }}
61+
{{- $workingDir := .Values.workingDir }}
62+
{{- if eq $workingDir "" }}
63+
{{- if .Values.iocPath }}
64+
{{- $workingDir = printf "%s/%s" .Values.iocPath $iocName }}
65+
{{- else }}
66+
{{- $workingDir = printf "/dls_sw/prod/%s/ioc/%s/%s/%s" .Values.epicsVersion $epicsDomain $iocName .Values.iocVersion }}
67+
{{- end }}
6468
{{- end }}
65-
workingDir: {{ $workingDir }}
69+
workingDir: {{ .Values.workingDir | default $workingDir }}
6670
{{- with .Values.securityContext }}
6771
securityContext:
6872
{{- toYaml . | nindent 12 }}
6973
{{- end }}
7074
env:
71-
# psuedo home sets up epics module etc.
72-
- name: HOME
73-
value: /epicsHome
75+
# psuedo home sets up epics module etc.
76+
- name: HOME
77+
value: /epicsHome
7478
imagePullPolicy: {{ .Values.image.pullPolicy }}
7579
{{- with .Values.livenessProbe }}
7680
livenessProbe:
@@ -87,6 +91,9 @@ spec:
8791
{{- with .Values.volumeMounts }}
8892
volumeMounts:
8993
{{- toYaml . | nindent 12 }}
94+
{{- with $.Values.extraVolumeMounts }}
95+
{{- toYaml . | nindent 12 }}
96+
{{- end }}
9097
{{- end }}
9198
{{- with .Values.autosavePath }}
9299
- name: autosave
@@ -102,6 +109,9 @@ spec:
102109
{{- with .Values.volumes }}
103110
volumes:
104111
{{- toYaml . | nindent 8 }}
112+
{{- with $.Values.extraVolumes }}
113+
{{- toYaml . | nindent 8 }}
114+
{{- end }}
105115
{{- end }}
106116
{{- with .Values.autosavePath }}
107117
- name: autosave

Charts/dev-c7/values.schema.json

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/affinity.json",
99
"type": "object"
1010
},
11+
"args": {
12+
"type": "array",
13+
"items": {
14+
"type": "string"
15+
}
16+
},
1117
"autosavePath": {
1218
"description": "Full path to an IOC instance's autosave folder. Overrides autosaveRootPath when not blank",
1319
"type": "string"
@@ -22,10 +28,24 @@
2228
"type": "string"
2329
}
2430
},
31+
"epicsDomain": {
32+
"description": "IOCs DLS EPICS Domain (e.g. BL16I FE02J SR03C)",
33+
"type": "string"
34+
},
2535
"epicsVersion": {
2636
"description": "the EPICS version, used to generate the /dls_sw/prod path to iocName",
2737
"type": "string"
2838
},
39+
"extraVolumeMounts": {
40+
"description": "add extra mounts without overriding the default ones",
41+
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/container.json#/properties/volumeMounts",
42+
"type": "array"
43+
},
44+
"extraVolumes": {
45+
"description": "add extra volumes without overriding the default ones",
46+
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/podspec.json#/properties/volumes",
47+
"type": "array"
48+
},
2949
"fullnameOverride": {
3050
"type": "string"
3151
},
@@ -56,10 +76,6 @@
5676
"imagePullSecrets": {
5777
"type": "array"
5878
},
59-
"iocLocation": {
60-
"description": "the IOC location (e.g. BL16I FE02J SR03C)",
61-
"type": "string"
62-
},
6379
"iocName": {
6480
"description": "the folder name for the compiled IOC, defaults to ucase of the services folder name",
6581
"type": "string"
@@ -140,6 +156,10 @@
140156
}
141157
}
142158
}
159+
},
160+
"workingDir": {
161+
"description": "override the cwd for launching the IOC, defaults to /dls_sw/prod/$epicsVersion/ioc/$epicsDomain/$iocName/$iocVersion",
162+
"type": "string"
143163
}
144164
},
145165
"additionalProperties": false

Charts/dev-c7/values.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
iocName: ""
1313
# @schema description: the IOC release, used to generate the /dls_sw/prod path to iocName
1414
iocVersion: ""
15-
# @schema description: the IOC location (e.g. BL16I FE02J SR03C)
16-
iocLocation: ""
15+
# @schema description: IOCs DLS EPICS Domain (e.g. BL16I FE02J SR03C)
16+
epicsDomain: ""
1717
# @schema description: the EPICS version, used to generate the /dls_sw/prod path to iocName
1818
epicsVersion: R3.14.12.7
19-
2019
# @schema description: overrides the parent folder for iocName to any path in /dls_sw/work or /dls_sw/prod
2120
iocPath: ""
21+
# @schema description: override the cwd for launching the IOC, defaults to /dls_sw/prod/$epicsVersion/ioc/$epicsDomain/$iocName/$iocVersion
22+
workingDir: ""
2223

2324
# @schema description: shared values for all services
2425
# @schema additionalProperties: true
@@ -36,6 +37,8 @@ image:
3637
command:
3738
- bash
3839
- -lc
40+
41+
args:
3942
- stdio-expose ./bin/linux-x86_64/st*.sh
4043

4144
# @schema description: enable host networking for the pod
@@ -87,6 +90,11 @@ volumes:
8790
hostPath:
8891
path: /dls_sw/etc
8992

93+
# extraVolumes for the Deployment.
94+
# @schema description: add extra volumes without overriding the default ones
95+
# @schema $ref: $k8s/podspec.json#/properties/volumes
96+
extraVolumes: []
97+
9098
# volumeMounts for the Deployment.
9199
# @schema $ref: $k8s/container.json#/properties/volumeMounts
92100
volumeMounts:
@@ -106,6 +114,11 @@ volumeMounts:
106114
mountPath: /dls_sw/etc
107115
readOnly: true
108116

117+
# extraVolumeMounts for the Deployment.
118+
# @schema description: add extra mounts without overriding the default ones
119+
# @schema $ref: $k8s/container.json#/properties/volumeMounts
120+
extraVolumeMounts: []
121+
109122
# @schema $ref: $k8s/podspec.json#/properties/tolerations
110123
tolerations: []
111124

0 commit comments

Comments
 (0)