-
Notifications
You must be signed in to change notification settings - Fork 5
Add features to make iPython console work in cluster #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e0c4801
6dded26
cf733c9
5a6fd94
f4b0a48
1752a8c
6464a7c
a1991c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,24 +4,27 @@ Default the derivable substitution values. | |
This keeps the length of the values.txt file for each individual IOC | ||
to a minimum | ||
*/ -}} | ||
{{- $location := default .Values.global.location .Values.location | required "ERROR - You must supply location or global.location" -}} | ||
{{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | required "ERROR - You must supply ioc_group or global.ioc_group" -}} | ||
{{- $location := default .Values.global.location .Values.location | default "" -}} | ||
# for epics-containers services repos, ioc_group is set in services/values.yaml | ||
{{- $ioc_group := default .Values.global.ioc_group .Values.ioc_group | default "" -}} | ||
# for epics-containers services repos, opisClaim is named after the ioc_group in services/values.yaml | ||
# for non-epics-containers services repos, opisClaim should be set in the service values.yaml | ||
{{- $opisClaim := default (print $ioc_group "-opi-claim") .Values.opisClaim -}} | ||
{{- $runtimeClaim := default (print $ioc_group "-runtime-claim") .Values.runtimeClaim -}} | ||
{{- $autosaveClaim := default (print $ioc_group "-autosave-claim") .Values.autosaveClaim -}} | ||
{{- $image := .Values.image | required "ERROR - You must supply image." -}} | ||
|
||
{{- $enabled := eq .Values.global.enabled false | ternary false true -}} | ||
{{- $enabled := eq .Values.global.enabled false | ternary false true }} | ||
|
||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ .Release.Name }} | ||
labels: | ||
location: {{ $location }} | ||
location: {{ $location | quote }} | ||
{{- with $ioc_group }} | ||
ioc_group: {{ $ioc_group }} | ||
{{- end }} | ||
enabled: {{ $enabled | quote }} | ||
is_ioc: "true" | ||
is_ioc: {{ .Values.is_ioc | quote }} | ||
{{- include "fastcs.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ $enabled | ternary 1 0 }} | ||
|
@@ -35,10 +38,12 @@ spec: | |
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
location: {{ $location }} | ||
location: {{ $location | quote }} | ||
{{- with $ioc_group }} | ||
ioc_group: {{ $ioc_group }} | ||
{{- end }} | ||
enabled: {{ $enabled | quote }} | ||
is_ioc: "true" | ||
is_ioc: {{ .Values.is_ioc | quote }} | ||
{{- include "fastcs.labels" . | nindent 8 }} | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
|
@@ -78,6 +83,19 @@ spec: | |
- name: {{ .name }} | ||
image: {{ .image }} | ||
imagePullPolicy: {{ $.Values.image.pullPolicy }} | ||
# a writable place to have cwd | ||
workingDir: /tmp | ||
env: | ||
- name: HOME | ||
value: /tmp | ||
- name: TERM | ||
value: xterm-256color | ||
{{- with $.Values.env }} | ||
{{- toYaml . | nindent 12}} | ||
{{- end }} | ||
{{- with $.Values.global.env }} | ||
{{- toYaml . | nindent 12}} | ||
{{- end }} | ||
{{- with $.Values.securityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 12 }} | ||
|
@@ -90,11 +108,13 @@ spec: | |
{{- with $.Values.volumeMounts }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with $.Values.opisMountPoint }} | ||
- name: opis-volume | ||
mountPath: /epics/opi | ||
subPath: "{{ $.Release.Name }}" | ||
mountPath: {{ . }} | ||
subPath: {{ $.Release.Name }} | ||
{{- end }} | ||
- name: config-volume | ||
mountPath: {{ $.Values.iocConfig }} | ||
mountPath: {{ $.Values.configFolder }} | ||
{{- if $.Values.editable }} | ||
- name: {{ $.Release.Name }}-develop | ||
mountPath: /dest | ||
|
@@ -103,6 +123,19 @@ spec: | |
- name: {{ .Chart.Name }} | ||
image: '{{ .Values.image.repository }}{{ ternary "-debug" "" .Values.editable }}:{{ .Values.image.tag }}' | ||
{{- with .Values.securityContext }} | ||
# a writable place to have cwd | ||
workingDir: /tmp | ||
env: | ||
- name: HOME | ||
value: /tmp | ||
- name: TERM | ||
value: xterm-256color | ||
gilesknap marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{{- with $.Values.env }} | ||
{{- toYaml . | nindent 12}} | ||
{{- end }} | ||
{{- with $.Values.global.env }} | ||
{{- toYaml . | nindent 12}} | ||
{{- end }} | ||
Comment on lines
+133
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the precedence here if a variable appears in both? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good point, I think in fact the schema will fail for having the same key twice in a dictionary. This means some exciting dictionary mergining in GoLang templates! blurg! |
||
securityContext: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
|
@@ -138,11 +171,13 @@ spec: | |
{{- with .Values.volumeMounts }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with $.Values.opisMountPoint }} | ||
- name: opis-volume | ||
mountPath: /epics/opi | ||
subPath: "{{ .Release.Name }}" | ||
mountPath: {{ . }} | ||
subPath: {{ $.Release.Name }} | ||
{{- end }} | ||
- name: config-volume | ||
mountPath: {{ .Values.iocConfig }} | ||
mountPath: {{ .Values.configFolder }} | ||
{{- if .Values.editable }} | ||
- name: {{ .Release.Name }}-develop | ||
mountPath: /workspaces | ||
|
@@ -155,9 +190,15 @@ spec: | |
{{- with .Values.volumes }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
# if a mount point has been specified, claim a PVC to mount | ||
# the PVC name will be ixx-epics-opis for IOCs (created in $opisClaim above) | ||
# the PVC name must be specified in values.yaml for non-IOC services | ||
{{- if .Values.opisMountPoint | default false }} | ||
- name: opis-volume | ||
persistentVolumeClaim: | ||
claimName: {{ $opisClaim }} | ||
# use the supplied claim name or default to one based on ioc_group | ||
claimName: {{ $.Values.opisClaimName | default $opisClaim }} | ||
{{- end }} | ||
- name: config-volume | ||
configMap: | ||
name: {{ .Release.Name }}-config | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could set
is_ioc
to true here ifioc_group
is not empty, so that it doesn't have to be a value? And so that we can't haveioc_group=something
withis_ioc=false
, which would probably do bad things.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds sensible to me.