From afda0ad76c73ae9e3915dec4825910a99a67be0d Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Mon, 31 Jan 2022 09:23:11 +0200 Subject: [PATCH] fix(unmanic): force disable nvidia, if no gpu is assigned (#1817) * fix(unmanic): force disable nvidia, if no gpu is assigned * typo * mount remote lib outside of emptyDir --- charts/incubator/unmanic/Chart.yaml | 2 +- charts/incubator/unmanic/questions.yaml | 43 +++++++++++++++++++ .../unmanic/templates/_configmap.tpl | 14 ++++++ .../incubator/unmanic/templates/common.yaml | 9 +++- charts/incubator/unmanic/values.yaml | 7 +++ 5 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 charts/incubator/unmanic/templates/_configmap.tpl diff --git a/charts/incubator/unmanic/Chart.yaml b/charts/incubator/unmanic/Chart.yaml index 62a66582541..efdb023313e 100644 --- a/charts/incubator/unmanic/Chart.yaml +++ b/charts/incubator/unmanic/Chart.yaml @@ -18,7 +18,7 @@ name: unmanic sources: - https://github.com/Unmanic/unmanic - https://hub.docker.com/r/josh5/unmanic -version: 0.0.3 +version: 0.0.4 annotations: truecharts.org/catagories: | - media diff --git a/charts/incubator/unmanic/questions.yaml b/charts/incubator/unmanic/questions.yaml index dd385935c16..e01e73d89e4 100644 --- a/charts/incubator/unmanic/questions.yaml +++ b/charts/incubator/unmanic/questions.yaml @@ -262,6 +262,49 @@ questions: - value: "Memory" description: "Memory" # Include{persistenceAdvanced} + - variable: remote + label: "App Remote Library Storage" + description: "Stores files from remote library until they are finished" + schema: + additional_attrs: true + type: dict + attrs: + - variable: type + label: "Type of Storage" + description: "Sets the persistence type, Anything other than PVC could break rollback!" + schema: + type: string + default: "simplePVC" + enum: + - value: "simplePVC" + description: "PVC (simple)" + - value: "simpleHP" + description: "HostPath (simple)" + - value: "emptyDir" + description: "emptyDir" + - value: "pvc" + description: "pvc" + - value: "hostPath" + description: "hostPath" +# Include{persistenceBasic} + - variable: hostPath + label: "hostPath" + description: "Path inside the container the storage is mounted" + schema: + show_if: [["type", "=", "hostPath"]] + type: hostpath + - variable: medium + label: "EmptyDir Medium" + schema: + show_if: [["type", "=", "emptyDir"]] + type: string + default: "" + enum: + - value: "" + description: "Default" + - value: "Memory" + description: "Memory" +# Include{persistenceAdvanced} # Include{persistenceList} diff --git a/charts/incubator/unmanic/templates/_configmap.tpl b/charts/incubator/unmanic/templates/_configmap.tpl new file mode 100644 index 00000000000..4c30b502963 --- /dev/null +++ b/charts/incubator/unmanic/templates/_configmap.tpl @@ -0,0 +1,14 @@ +{{/* Define the configmap */}} +{{- define "unmanic.configmap" -}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: unmanic-config +data: + {{- if .Values.scaleGPU }} + NVIDIA_VISIBLE_DEVICES: "all" + {{- else }} + NVIDIA_VISIBLE_DEVICES: "void" + {{- end }} +{{- end -}} diff --git a/charts/incubator/unmanic/templates/common.yaml b/charts/incubator/unmanic/templates/common.yaml index a6613c2ce21..0aa3722b0d6 100644 --- a/charts/incubator/unmanic/templates/common.yaml +++ b/charts/incubator/unmanic/templates/common.yaml @@ -1 +1,8 @@ -{{ include "common.all" . }} +{{/* Make sure all variables are set properly */}} +{{- include "common.setup" . }} + +{{/* Render configmap for unmanic */}} +{{- include "unmanic.configmap" . }} + +{{/* Render the templates */}} +{{ include "common.postSetup" . }} diff --git a/charts/incubator/unmanic/values.yaml b/charts/incubator/unmanic/values.yaml index 3f3e1991371..28d84a5498e 100644 --- a/charts/incubator/unmanic/values.yaml +++ b/charts/incubator/unmanic/values.yaml @@ -15,6 +15,10 @@ env: TZ: UTC PUID: 568 +envFrom: + - configMapRef: + name: unmanic-config + service: main: ports: @@ -29,6 +33,9 @@ persistence: library: enabled: true mountPath: "/library" + remote: + enabled: true + mountPath: "/tmp/unmanic/remote_library" cache: enabled: true mountPath: "/tmp/unmanic"