diff --git a/ml-testing-toolkit/chart-backend/templates/statefulset.yaml b/ml-testing-toolkit/chart-backend/templates/statefulset.yaml index dae753215..d019db32b 100644 --- a/ml-testing-toolkit/chart-backend/templates/statefulset.yaml +++ b/ml-testing-toolkit/chart-backend/templates/statefulset.yaml @@ -127,11 +127,8 @@ spec: mountPath: /opt/app/examples/environments/{{ $k }} subPath: {{ $k }} {{- end }} - {{- range $k, $v := .Values.config_files }} - name: {{ $serviceFullName }}-volume-config-default - mountPath: /opt/app/spec_files/{{ $k | replace "__" "/" }} - subPath: {{ $k }} - {{- end }} + mountPath: /opt/default_config - name: release-cd-rc mountPath: /home/ml-user/.release_cd volumes: diff --git a/ml-testing-toolkit/chart-backend/values.yaml b/ml-testing-toolkit/chart-backend/values.yaml index d122d065a..4c7f36755 100644 --- a/ml-testing-toolkit/chart-backend/values.yaml +++ b/ml-testing-toolkit/chart-backend/values.yaml @@ -28,7 +28,7 @@ replicaCount: 1 # .Values.persistence.enabled = true commandPersistence: '["sh", "-c", "if [ -d /opt/ttk-data ]; then if [ ! -d /opt/ttk-data/spec_files ]; then cp -pR spec_files /opt/ttk-data/spec_files; fi; mv spec_files spec_files_bkp; ln -s /opt/ttk-data/spec_files spec_files; fi; npm run start;"]' # .Values.persistence.enabled = false -command: '["sh", "-c", "npm run start;"]' +command: '["sh", "-c", "cd /opt/default_config; for FILE in *; do newFileName=/opt/app/spec_files/${FILE//__/\\/}; mkdir -p ${newFileName%/*}; firstLine=$(head -n 1 $FILE | tr -d \\\"); regex=\"^(http|https|ftp)://\"; if [[ \"$firstLine\" =~ $regex ]]; then wget $firstLine -O $newFileName; else cp $FILE $newFileName; fi; done; cd /opt/app; npm run start;"]' ## Pod scheduling preferences. ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity