-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(helm): Helm template for Celery beat (for reporting and alerting) #13116
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR! I said on Slack that I would open one, but as our templates aren't up-to-date with those of master
it took me some time 😅
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "superset.fullname" . }}-beat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially named the pods the same way you did, but some colleague said that beat
is kind of generic, and it would be better naming it {{ template "superset.fullname" . }}-celerybeat
.
I let you judge 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that makes sense...
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 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[K8S newbie] What's the point of those annotations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since those values will change on any content updates of the source values, this will force a patch of the Deployment
, and a restart of the pods whenever we publish an update to these (otherwise, updates to a ConfigMap
does not automatically force the pods mounting them to restart).
Also, we need to add documentation on the K8S part about this celery beat, I think this PR is the good one to do it! |
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
Yes, I agree this deserves a documentation update. Another thing I've been wondering about is Celery Flower... I'm a total noob about Celery / Flask... and in fact Python in general, so I'm not 100% sure what |
Flower is an interface that allow us to monitor celery workers and see which worker run which task! |
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
OK. So from a Helm point of view this would mean that:
|
|
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no trace of flower in the master
chart in fact 😮 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. 😕
If you have some time to do it, I would gladly help!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, different PR... and probably not high prio...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, but flower by default does not support auth, and it exposes dangerous functionality and sensitive info. May be a bit out of scope
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
Co-authored-by: Valentin Nourdin <valentin.nourdin@lilo.org>
Sorry, I forgot to update the template to reflect the |
No problem, Github suggestions isn't perfect 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the suggestion on how to add the webdriver is not ideal. Calling @craig-rueda here for some additional thoughts
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, but flower by default does not support auth, and it exposes dangerous functionality and sensitive info. May be a bit out of scope
Yes I definitely agree... installing stuff at runtime isn't a really good practice since it creates extra risks and often requires running as Btw I would argue that the same goes for the way extra pip packages are installed (which also requires running the containers as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
SUMMARY
This PR adds an optional kubernetes
Deployment
to run the Celery beat, which is needed in order to trigger the scheduled alerts and reports (as per the excellent unpublished guide at https://github.com/apache/superset/blob/4fa3b6c7185629b87c27fc2c0e5435d458f7b73d/docs/src/pages/docs/installation/email_reports.mdx).It is off by default, and needs to be enabled with
supersetBeat.enabled
.The new pod is defined pretty much exactly like the worker pod except that:
replicas
is always 1, since this needs to be a singletonNote that for the chart to be able to execute reports, we still need to check all the other boxes, in particular:
supersetWorker.command
(this is only needed in the worker container) with the existing chart, with something like this in yourvalues.yaml
:superset_config.py
. This is now possible with the latest chart frommaster
by specifying overrides in yourvalues.yaml
such as:The above would probably need to be added to the doc together with PR #13104 for the Kubernetes case.
TEST PLAN
values.yaml
withsupersetBeat.enabled: true
and upgrade your chart releaseADDITIONAL INFORMATION