Skip to content
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: add dag processor deployment #577

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

karakanb
Copy link
Contributor

What issues does your PR fix?

As of version 2.3.0, Airflow allows running DagProcessorManager as standalone process. This PR adds the ability to run a separate deployment for the dag processor component to separate it from the scheduler.

What does your PR do?

This PR adds the deployment, PDB and docs for the new processor component. I couldn't figure out what to put in the liveness probe, so feedback is welcome.

Checklist

For all Pull Requests

For releasing ONLY

Signed-off-by: Burak Karakan <burak.karakan@gmail.com>
…e values.yaml file

Signed-off-by: Burak Karakan <burak.karakan@gmail.com>
…eadme

Signed-off-by: Burak Karakan <burak.karakan@gmail.com>
@karakanb karakanb force-pushed the feature/add-new-deployment-for-dag-processor branch from 0557ffd to 7e0a4a6 Compare May 10, 2022 00:17
@thesuperzapper thesuperzapper added this to PR | Needs Review in Issue Triage and PR Tracking Jun 6, 2022
@Linux-oiD
Copy link

Waiting for this functionality! )

@thesuperzapper thesuperzapper added this to the airflow-8.7.0 milestone Feb 7, 2023
Copy link
Member

@thesuperzapper thesuperzapper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karakanb Thanks for this PR (sorry for the massive delay), I have left a few comments, but there are a few general things we need to discuss:

  1. Should we be enabling this feature by default?
    • My initial instinct is no, as this increases the number of Pods, and users are probably not expecting it.
    • However, we should include a new faq page about how to Use Standalone Dag Processor for those who want it.
  2. We should include some kind of liveness probe, but I am not sure if airflow has a "job" type that we can check the heartbeat of (similar to how we do for the scheduler)

`dagProcessor.podAnnotations` | Pod annotations for the dag processor Deployment | `{}`
`dagProcessor.safeToEvict` | if we add the annotation: "cluster-autoscaler.kubernetes.io/safe-to-evict" = "true" | `true`
`dagProcessor.podDisruptionBudget.*` | configs for the PodDisruptionBudget of the dag processor Deployment | `<see values.yaml>`
`dagProcessor.livenessProbe.*` | liveness probe for the dag processor Pods | `<see values.yaml>`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no livenessProbe we should remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a liveness probe, please give it a look

Comment on lines +1162 to +1167
livenessProbe:
enabled: true
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 60
failureThreshold: 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not have these values if we don't actually use them.

true
{{- end -}}
{{- else -}}
false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The truthiness of this airflow.dagProcessor.should_use is actually simply whether it is defined.

In this case, we actually do want to allow the dag processor (if we don't know what version the user is using). Because in that case, they are probably using a custom image. All this is to say, we should make this string say true.

@thesuperzapper thesuperzapper moved this from PR | Needs Review to PR | Waiting for Changes in Issue Triage and PR Tracking Feb 7, 2023
@karakanb
Copy link
Contributor Author

thanks for giving this a look, I wanted to discuss some of these points as well.

Signed-off-by: Burak Karakan <burak.karakan@gmail.com>
@karakanb
Copy link
Contributor Author

also, one question: is there a reason why you picked running Python code for the liveness probes instead of the airflow CLI commands?

Signed-off-by: Burak Karakan <burak.karakan@gmail.com>
Signed-off-by: Burak Karakan <burak.karakan@gmail.com>
Signed-off-by: Burak Karakan <burak.karakan@gmail.com>
@fcomuniz
Copy link

anything i can help with this? it would be very useful for my deployment.

@karakanb
Copy link
Contributor Author

I have moved off of this chart to the official one, unfortunately I don't think I'll be able to maintain / follow-up on this PR, feel free to take over.

@thesuperzapper thesuperzapper changed the title feat: Add new deployment for dag processor feat: add dag processor deployment May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Issue Triage and PR Tracking
PR | Waiting for Changes
Development

Successfully merging this pull request may close these issues.

None yet

4 participants