Skip to content

Commit

Permalink
separate the init config in helm (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-dot committed Sep 11, 2024
1 parent 07c273f commit dc99ad5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
7 changes: 7 additions & 0 deletions helm/blueapi/templates/init-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "blueapi.fullname" . }}-initconfig
data:
initconfig.yaml: |-
{{- toYaml .Values.initContainer.scratch | nindent 4 }}
9 changes: 7 additions & 2 deletions helm/blueapi/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ spec:
sources:
- configMap:
name: {{ include "blueapi.fullname" . }}-config
- name: init-config
projected:
sources:
- configMap:
name: {{ include "blueapi.fullname" . }}-initconfig
{{- if .Values.scratchHostPath }}
- name: scratch-host
hostPath:
Expand All @@ -55,12 +60,12 @@ spec:
args:
- |
echo "Setting up scratch area"
blueapi -c /config/config.yaml setup-scratch
blueapi -c /config/initconfig.yaml setup-scratch
if [ $? -ne 0 ]; then echo 'Blueapi failed'; exit 1; fi;
echo "Exporting venv as artefact"
cp -r /venv/* /artefacts
volumeMounts:
- name: worker-config
- name: init-config
mountPath: "/config"
readOnly: true
- name: scratch-host
Expand Down
20 changes: 11 additions & 9 deletions helm/blueapi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ listener:
resources: {}

# Additional envVars to mount to the pod as a String
extraEnvVars: []
extraEnvVars:
[]
# - name: RABBITMQ_PASSWORD
# valueFrom:
# secretKeyRef:
Expand Down Expand Up @@ -108,13 +109,14 @@ worker:
passcode: guest
host: rabbitmq
port: 61613
# Uncomment this to enable the scratch directory
# scratch:
# root: /blueapi-plugins/scratch
# repositories: []
# - name: "dodal"
# remote_url: https://github.com/DiamondLightSource/dodal.git

# Mount path for scratch area from host machine, setting

initContainer:
scratch:
root: /blueapi-plugins/scratch
repositories: []
# - name: "dodal"
# remote_url: https://github.com/DiamondLightSource/dodal.git

# Mount path for scratch area from host machine, setting
# this effectively enables scratch area management
scratchHostPath: "" # example: /usr/local/blueapi-software-scratch

0 comments on commit dc99ad5

Please sign in to comment.