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

Chart: Mount DAGs in triggerer #18753

Merged
merged 1 commit into from
Oct 5, 2021

Conversation

jedcunningham
Copy link
Member

We need to mount the DAGs in the triggerer, as triggers could come from
the DAGs themselves.

Example DAG to demonstrate this, named custom_trigger.py, in the root of the DAGS dir:

from datetime import datetime

from airflow import DAG
from airflow.models import BaseOperator
from airflow.triggers.base import BaseTrigger, TriggerEvent


class CustomSuccessTrigger(BaseTrigger):
    def serialize(self):
        return ("custom_trigger.CustomSuccessTrigger", {})

    async def run(self):
        yield TriggerEvent(True)


class CustomOperator(BaseOperator):
    def execute(self, context):
        self.defer(trigger=CustomSuccessTrigger(), method_name="next")

    def next(self, context, event=None):
        return None


with DAG(
    "custom_trigger", schedule_interval=None, start_date=datetime(2021, 10, 1)
) as dag:
    CustomOperator(task_id="run")

@boring-cyborg boring-cyborg bot added the area:helm-chart Airflow Helm Chart label Oct 5, 2021
@github-actions
Copy link

github-actions bot commented Oct 5, 2021

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Oct 5, 2021
@kaxil kaxil added this to the Airflow Helm Chart 1.3.0 milestone Oct 5, 2021
We need to mount the DAGs in the triggerer, as triggers could come from
the DAGs themselves.
@jedcunningham jedcunningham merged commit a192b4a into apache:main Oct 5, 2021
@jedcunningham jedcunningham deleted the trigger_dags_mount branch October 5, 2021 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:helm-chart Airflow Helm Chart okay to merge It's ok to merge this PR as it does not require more tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants