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

SDK - Using Airflow ops in Pipelines #1483

Merged

Conversation

Ark-kun
Copy link
Contributor

@Ark-kun Ark-kun commented Jun 10, 2019

This CL adds support for converting arbitrary Airflow operators to Pipelines components so that it can be used as a pipeline task.

from airflow.operators.bash_operator import BashOperator
bash_op = kfp.components.create_component_from_airflow_op(BashOperator)

@pipeline()
def my_pipeline():
  bash_task = bash_op('echo "Hello from $SHELL"', xcom_push=True)

This change is Reviewable

Copy link
Contributor

@hongye-sun hongye-sun left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. This is really great that KFP users can directly use Airflow operators in their pipeline.

sdk/python/kfp/components/_airflow_op.py Outdated Show resolved Hide resolved
sdk/python/kfp/components/_airflow_op.py Outdated Show resolved Hide resolved
@Ark-kun Ark-kun force-pushed the SDK---Using-Airflow-ops-in-Pipelines---1 branch from ad984bb to a5b0644 Compare June 11, 2019 03:09
@Ark-kun
Copy link
Contributor Author

Ark-kun commented Jun 20, 2019

/test kubeflow-pipeline-sample-test

@animeshsingh
Copy link
Contributor

@Ark-kun is this only for bash operator? Other operators being supported as well? Also can this be extended to take an overall Airflow DAG, and execute as one of the 'steps' in KFP, assuming an Airflow deployment exists and KFP is made aware of it?

@animeshsingh
Copy link
Contributor

@paveldournov you have a viewpoint on the above question? cc @vicaire @jlewi

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Jul 17, 2019

@Ark-kun is this only for bash operator? Other operators being supported as well?

This feature supports all Airflow operators.

can this be extended to take an overall Airflow DAG, and execute as one of the 'steps' in KFP

It could. How do you envision the API for AirFlow DAGs?

assuming an Airflow deployment exists and KFP is made aware of it?

This might be unnecessary

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Jul 30, 2019

/test kubeflow-pipeline-e2e-test

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Aug 1, 2019

/cc @hongye-sun I've added documentation for this functionality.

@hongye-sun
Copy link
Contributor

/lgtm

@animeshsingh
Copy link
Contributor

It could. How do you envision the API for AirFlow DAGs?

Two modes

  1. maybe a component can take Airflow DAG as an input, and calls Airflow deployment
  2. Pipeline DSL can compile to airflow DAG?

@k8s-ci-robot k8s-ci-robot removed the lgtm label Aug 2, 2019
@hongye-sun
Copy link
Contributor

/lgtm

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Aug 3, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ark-kun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit a7635f1 into kubeflow:master Aug 3, 2019
@NieRonghua
Copy link

@Ark-kun is this only for bash operator? Other operators being supported as well?

This feature supports all Airflow operators.

Hi, I’m an Airflow user, now i want to create components by using create_component_from_airflow_op(SimpleHttpOperator), but i do not konw how to define the airflow‘s conn such as msyql conn or http conn, can u give me an example? thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants