Changeset View
Changeset View
Standalone View
Standalone View
helm/dagster/templates/helpers/_compute-log-manager.tpl
{{- define "stringSource" }} | |||||
{{- $tp := typeOf . }} | |||||
{{- if eq $tp "map[string]interface {}" }} | |||||
{{- . | toYaml | nindent 4 }} | |||||
{{- else if eq $tp "string" }} | |||||
{{- . | quote }} | |||||
{{- end }} | |||||
{{- end }} | |||||
{{- define "dagsterYaml.computeLogManager.azure" }} | {{- define "dagsterYaml.computeLogManager.azure" }} | ||||
{{- $azureBlobComputeLogManagerConfig := .Values.computeLogManager.config.azureBlobComputeLogManager }} | {{- $azureBlobComputeLogManagerConfig := .Values.computeLogManager.config.azureBlobComputeLogManager }} | ||||
module: dagster_azure.blob.compute_log_manager | module: dagster_azure.blob.compute_log_manager | ||||
class: AzureBlobComputeLogManager | class: AzureBlobComputeLogManager | ||||
config: | config: | ||||
storage_account: {{ $azureBlobComputeLogManagerConfig.storageAccount | quote }} | storage_account: {{ include "stringSource" $azureBlobComputeLogManagerConfig.storageAccount }} | ||||
container: {{ $azureBlobComputeLogManagerConfig.container | quote }} | container: {{ include "stringSource" $azureBlobComputeLogManagerConfig.container }} | ||||
alangenfeld: woof this kinda sucks, is this how we do StringSource else where? | |||||
Done Inline ActionsThis is the first place in the helm chart where a StringSource field is exposed in values.yaml - all other instances of env: XXX are defined by us in the dagster.yaml using environment variables we have defined in a configmap. not sure how else to coerce StringSource correctly in the template rexledesma: This is the first place in the helm chart where a `StringSource` field is exposed in `values. | |||||
secret_key: {{ $azureBlobComputeLogManagerConfig.secretKey | quote }} | secret_key: {{ include "stringSource" $azureBlobComputeLogManagerConfig.secretKey }} | ||||
{{- if $azureBlobComputeLogManagerConfig.localDir }} | {{- if $azureBlobComputeLogManagerConfig.localDir }} | ||||
local_dir: {{ $azureBlobComputeLogManagerConfig.localDir | quote }} | local_dir: {{ include "stringSource" $azureBlobComputeLogManagerConfig.localDir }} | ||||
{{- end }} | {{- end }} | ||||
{{- if $azureBlobComputeLogManagerConfig.prefix }} | {{- if $azureBlobComputeLogManagerConfig.prefix }} | ||||
prefix: {{ $azureBlobComputeLogManagerConfig.prefix | quote }} | prefix: {{ include "stringSource" $azureBlobComputeLogManagerConfig.prefix }} | ||||
{{- end }} | {{- end }} | ||||
{{- end }} | {{- end }} | ||||
{{- define "dagsterYaml.computeLogManager.gcs" }} | {{- define "dagsterYaml.computeLogManager.gcs" }} | ||||
{{- $gcsComputeLogManagerConfig := .Values.computeLogManager.config.gcsComputeLogManager }} | {{- $gcsComputeLogManagerConfig := .Values.computeLogManager.config.gcsComputeLogManager }} | ||||
module: dagster_gcp.gcs.compute_log_manager | module: dagster_gcp.gcs.compute_log_manager | ||||
class: GCSComputeLogManager | class: GCSComputeLogManager | ||||
config: | config: | ||||
bucket: {{ $gcsComputeLogManagerConfig.bucket | quote }} | bucket: {{ include "stringSource" $gcsComputeLogManagerConfig.bucket }} | ||||
{{- if $gcsComputeLogManagerConfig.localDir }} | {{- if $gcsComputeLogManagerConfig.localDir }} | ||||
local_dir: {{ $gcsComputeLogManagerConfig.localDir | quote }} | local_dir: {{ include "stringSource" $gcsComputeLogManagerConfig.localDir }} | ||||
{{- end }} | {{- end }} | ||||
{{- if $gcsComputeLogManagerConfig.prefix }} | {{- if $gcsComputeLogManagerConfig.prefix }} | ||||
prefix: {{ $gcsComputeLogManagerConfig.prefix | quote }} | prefix: {{ include "stringSource" $gcsComputeLogManagerConfig.prefix }} | ||||
{{- end }} | {{- end }} | ||||
{{- end }} | {{- end }} | ||||
{{- define "dagsterYaml.computeLogManager.s3" }} | {{- define "dagsterYaml.computeLogManager.s3" }} | ||||
{{- $s3ComputeLogManagerConfig := .Values.computeLogManager.config.s3ComputeLogManager }} | {{- $s3ComputeLogManagerConfig := .Values.computeLogManager.config.s3ComputeLogManager }} | ||||
module: dagster_aws.s3.compute_log_manager | module: dagster_aws.s3.compute_log_manager | ||||
class: S3ComputeLogManager | class: S3ComputeLogManager | ||||
config: | config: | ||||
bucket: {{ $s3ComputeLogManagerConfig.bucket | quote }} | bucket: {{ include "stringSource" $s3ComputeLogManagerConfig.bucket }} | ||||
{{- if $s3ComputeLogManagerConfig.localDir }} | {{- if $s3ComputeLogManagerConfig.localDir }} | ||||
local_dir: {{ $s3ComputeLogManagerConfig.localDir | quote }} | local_dir: {{ include "stringSource" $s3ComputeLogManagerConfig.localDir }} | ||||
{{- end }} | {{- end }} | ||||
{{- if $s3ComputeLogManagerConfig.prefix }} | {{- if $s3ComputeLogManagerConfig.prefix }} | ||||
prefix: {{ $s3ComputeLogManagerConfig.prefix | quote }} | prefix: {{ include "stringSource" $s3ComputeLogManagerConfig.prefix }} | ||||
{{- end }} | {{- end }} | ||||
{{- if $s3ComputeLogManagerConfig.useSsl }} | {{- if $s3ComputeLogManagerConfig.useSsl }} | ||||
use_ssl: {{ $s3ComputeLogManagerConfig.useSsl }} | use_ssl: {{ $s3ComputeLogManagerConfig.useSsl }} | ||||
{{- end }} | {{- end }} | ||||
{{- if $s3ComputeLogManagerConfig.verify }} | {{- if $s3ComputeLogManagerConfig.verify }} | ||||
verify: {{ $s3ComputeLogManagerConfig.verify }} | verify: {{ $s3ComputeLogManagerConfig.verify }} | ||||
{{- end }} | {{- end }} | ||||
{{- if $s3ComputeLogManagerConfig.verifyCertPath }} | {{- if $s3ComputeLogManagerConfig.verifyCertPath }} | ||||
verify_cert_path: {{ $s3ComputeLogManagerConfig.verifyCertPath | quote }} | verify_cert_path: {{ include "stringSource" $s3ComputeLogManagerConfig.verifyCertPath }} | ||||
{{- end }} | {{- end }} | ||||
{{- if $s3ComputeLogManagerConfig.endpointUrl }} | {{- if $s3ComputeLogManagerConfig.endpointUrl }} | ||||
endpoint_url: {{ $s3ComputeLogManagerConfig.endpointUrl | quote }} | endpoint_url: {{ include "stringSource" $s3ComputeLogManagerConfig.endpointUrl }} | ||||
{{- end }} | {{- end }} | ||||
{{- end }} | {{- end }} | ||||
{{- define "dagsterYaml.computeLogManager.custom" }} | {{- define "dagsterYaml.computeLogManager.custom" }} | ||||
{{- $customComputeLogManagerConfig := .Values.computeLogManager.config.customComputeLogManager }} | {{- $customComputeLogManagerConfig := .Values.computeLogManager.config.customComputeLogManager }} | ||||
module: {{ $customComputeLogManagerConfig.module | quote }} | module: {{ $customComputeLogManagerConfig.module | quote }} | ||||
class: {{ $customComputeLogManagerConfig.class | quote }} | class: {{ $customComputeLogManagerConfig.class | quote }} | ||||
config: {{ toYaml $customComputeLogManagerConfig.config | nindent 2 }} | config: {{ $customComputeLogManagerConfig.config | toYaml | nindent 2 }} | ||||
{{- end }} | {{- end }} |
woof this kinda sucks, is this how we do StringSource else where?