vnourdin commented on a change in pull request #13116:
URL: https://github.com/apache/superset/pull/13116#discussion_r576699334
##########
File path: helm/superset/templates/deployment-beat.yaml
##########
@@ -0,0 +1,95 @@
+{{- if .Values.supersetBeat.enabled -}}
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ template "superset.fullname" . }}-celerybeat
+ labels:
+ app: {{ template "superset.name" . }}-celerybeat
+ chart: {{ template "superset.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ # This must be a singleton
+ replicas: 1
+ selector:
+ matchLabels:
+ app: {{ template "superset.name" . }}-celerybeat
+ release: {{ .Release.Name }}
+ template:
+ metadata:
+ annotations:
+ checksum/superset_config.py: {{ include "superset-config" . |
sha256sum }}
+ checksum/connections: {{ .Values.supersetNode.connections | toYaml |
sha256sum }}
+ checksum/extraConfigs: {{ .Values.extraConfigs | toYaml | sha256sum }}
+ checksum/extraSecretEnv: {{ .Values.extraSecretEnv | toYaml |
sha256sum }}
+ checksum/configOverrides: {{ .Values.configOverrides | toYaml |
sha256sum }}
+ {{ if .Values.supersetBeat.forceReload }}
+ # Optionally force the thing to reload
+ force-reload: {{ randAlphaNum 5 | quote }}
+ {{ end }}
+ labels:
+ app: {{ template "superset.name" . }}-celerybeat
+ release: {{ .Release.Name }}
+ spec:
+ securityContext:
+ runAsUser: 0 # Needed in order to allow pip install to work in
bootstrap
+ {{- if .Values.supersetBeat.initContainers }}
Review comment:
```suggestion
{{- if .Values.supersetCeleryBeat.initContainers }}
```
##########
File path: helm/superset/templates/deployment-beat.yaml
##########
@@ -0,0 +1,95 @@
+{{- if .Values.supersetBeat.enabled -}}
Review comment:
```suggestion
{{- if .Values.supersetCeleryBeat.enabled -}}
```
##########
File path: helm/superset/templates/deployment-beat.yaml
##########
@@ -0,0 +1,95 @@
+{{- if .Values.supersetBeat.enabled -}}
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ template "superset.fullname" . }}-celerybeat
+ labels:
+ app: {{ template "superset.name" . }}-celerybeat
+ chart: {{ template "superset.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ # This must be a singleton
+ replicas: 1
+ selector:
+ matchLabels:
+ app: {{ template "superset.name" . }}-celerybeat
+ release: {{ .Release.Name }}
+ template:
+ metadata:
+ annotations:
+ checksum/superset_config.py: {{ include "superset-config" . |
sha256sum }}
+ checksum/connections: {{ .Values.supersetNode.connections | toYaml |
sha256sum }}
+ checksum/extraConfigs: {{ .Values.extraConfigs | toYaml | sha256sum }}
+ checksum/extraSecretEnv: {{ .Values.extraSecretEnv | toYaml |
sha256sum }}
+ checksum/configOverrides: {{ .Values.configOverrides | toYaml |
sha256sum }}
+ {{ if .Values.supersetBeat.forceReload }}
+ # Optionally force the thing to reload
+ force-reload: {{ randAlphaNum 5 | quote }}
+ {{ end }}
+ labels:
+ app: {{ template "superset.name" . }}-celerybeat
+ release: {{ .Release.Name }}
+ spec:
+ securityContext:
+ runAsUser: 0 # Needed in order to allow pip install to work in
bootstrap
+ {{- if .Values.supersetBeat.initContainers }}
+ initContainers:
+ {{- tpl (toYaml .Values.supersetBeat.initContainers) . | nindent 6 }}
+ {{- end }}
+ containers:
+ - name: {{ .Chart.Name }}
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ command: {{ tpl (toJson .Values.supersetBeat.command) . }}
Review comment:
```suggestion
command: {{ tpl (toJson .Values.supersetCeleryBeat.command) . }}
```
##########
File path: helm/superset/values.yaml
##########
@@ -165,6 +165,25 @@ supersetWorker:
name: '{{ tpl .Values.envFromSecret . }}'
command: [ "/bin/sh", "-c", "until nc -zv $DB_HOST $DB_PORT -w1; do echo
'waiting for db'; sleep 1; done" ]
+##
+## Superset beat configuration (to trigger scheduled jobs like reports)
+supersetCeleryBeat:
+ # This is only required if you intend to use alerts and reports
+ enabled: false
+ command:
+ - "/bin/sh"
+ - "-c"
+ - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; celery beat
--app=superset.tasks.celery_app:app --pidfile /tmp/celerybeat.pid --schedule
/tmp/celerybeat-schedule"
Review comment:
There is no trace of flower in the `master` chart in fact :open_mouth:
To add it, we should do something really similar to this PR, plus a service
dedicated to flower.
I think this is out of the scope of this PR, my team will switch back to the
`master` charts, and we will open PR to add what's missing, but not sure when
this will be. :confused:
If you have some time to do it, I would gladly help!
##########
File path: helm/superset/templates/deployment-beat.yaml
##########
@@ -0,0 +1,95 @@
+{{- if .Values.supersetBeat.enabled -}}
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ template "superset.fullname" . }}-celerybeat
+ labels:
+ app: {{ template "superset.name" . }}-celerybeat
+ chart: {{ template "superset.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ # This must be a singleton
+ replicas: 1
+ selector:
+ matchLabels:
+ app: {{ template "superset.name" . }}-celerybeat
+ release: {{ .Release.Name }}
+ template:
+ metadata:
+ annotations:
+ checksum/superset_config.py: {{ include "superset-config" . |
sha256sum }}
+ checksum/connections: {{ .Values.supersetNode.connections | toYaml |
sha256sum }}
+ checksum/extraConfigs: {{ .Values.extraConfigs | toYaml | sha256sum }}
+ checksum/extraSecretEnv: {{ .Values.extraSecretEnv | toYaml |
sha256sum }}
+ checksum/configOverrides: {{ .Values.configOverrides | toYaml |
sha256sum }}
+ {{ if .Values.supersetBeat.forceReload }}
Review comment:
```suggestion
{{ if .Values.supersetCeleryBeat.forceReload }}
```
##########
File path: helm/superset/templates/deployment-beat.yaml
##########
@@ -0,0 +1,95 @@
+{{- if .Values.supersetBeat.enabled -}}
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ template "superset.fullname" . }}-celerybeat
+ labels:
+ app: {{ template "superset.name" . }}-celerybeat
+ chart: {{ template "superset.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ # This must be a singleton
+ replicas: 1
+ selector:
+ matchLabels:
+ app: {{ template "superset.name" . }}-celerybeat
+ release: {{ .Release.Name }}
+ template:
+ metadata:
+ annotations:
+ checksum/superset_config.py: {{ include "superset-config" . |
sha256sum }}
+ checksum/connections: {{ .Values.supersetNode.connections | toYaml |
sha256sum }}
+ checksum/extraConfigs: {{ .Values.extraConfigs | toYaml | sha256sum }}
+ checksum/extraSecretEnv: {{ .Values.extraSecretEnv | toYaml |
sha256sum }}
+ checksum/configOverrides: {{ .Values.configOverrides | toYaml |
sha256sum }}
+ {{ if .Values.supersetBeat.forceReload }}
+ # Optionally force the thing to reload
+ force-reload: {{ randAlphaNum 5 | quote }}
+ {{ end }}
+ labels:
+ app: {{ template "superset.name" . }}-celerybeat
+ release: {{ .Release.Name }}
+ spec:
+ securityContext:
+ runAsUser: 0 # Needed in order to allow pip install to work in
bootstrap
+ {{- if .Values.supersetBeat.initContainers }}
+ initContainers:
+ {{- tpl (toYaml .Values.supersetBeat.initContainers) . | nindent 6 }}
Review comment:
```suggestion
{{- tpl (toYaml .Values.supersetCeleryBeat.initContainers) . |
nindent 6 }}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]