Skip to content

docs: add airflow example #519

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

Closed
wants to merge 1 commit into from
Closed

docs: add airflow example #519

wants to merge 1 commit into from

Conversation

d4l3k
Copy link
Member

@d4l3k d4l3k commented Jun 15, 2022

This adds an example for how to use Airflow with TorchX. This example requires airflow server to be running on the local machine during the docs build process.

This also adds in a AppStatus.raise_for_status() method to match the requests/urllib3 behavior which just makes checking for whether or not a job failed easier.

Build is working locally -- might need to fiddle with CI to get airflow running there correctly still

Test plan:

cd docs && make html

Screenshot 2022-06-14 at 18-01-37 Airflow — PyTorch_TorchX main documentation

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 15, 2022
@d4l3k d4l3k marked this pull request as draft June 15, 2022 00:53
@codecov
Copy link

codecov bot commented Jun 15, 2022

Codecov Report

Merging #519 (3d4e87f) into main (84158cf) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #519   +/-   ##
=======================================
  Coverage   94.78%   94.79%           
=======================================
  Files          65       65           
  Lines        3932     3939    +7     
=======================================
+ Hits         3727     3734    +7     
  Misses        205      205           
Impacted Files Coverage Δ
torchx/specs/api.py 99.61% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84158cf...3d4e87f. Read the comment docs.

@d4l3k d4l3k marked this pull request as ready for review June 15, 2022 01:02
@facebook-github-bot
Copy link
Contributor

@d4l3k has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@d4l3k has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@d4l3k has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@kurman kurman left a comment

Choose a reason for hiding this comment

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

Really nice integration showcase.

assert ti.state == TaskInstanceState.SUCCESS
```

If all goes well you should see `Hello, TorchX!` printed above.
Copy link
Contributor

@kurman kurman Jun 15, 2022

Choose a reason for hiding this comment

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

What do you think on recommending links on things to do next after this example? For more complex apps that can be used in the pipeline?

Copy link
Member Author

Choose a reason for hiding this comment

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

done


```python
@task(task_id=f'hello_torchx')
def run_torchx(echo):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the arg 'echo' used in the function? I see "foo" passed in from line 81 but the echo command used in the body at line 52 looks like a string literal

Copy link
Member Author

Choose a reason for hiding this comment

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

It is -- utils.sh runs a shell command which in this case is "echo"

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry, you're right! I was thinking about the lower echo! my bad :)

@facebook-github-bot
Copy link
Contributor

@d4l3k has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@d4l3k has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@d4l3k has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@d4l3k has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@d4l3k has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@d4l3k has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@d4l3k has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@d4l3k d4l3k linked an issue Jun 15, 2022 that may be closed by this pull request
@d4l3k d4l3k deleted the airflow branch October 28, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[torchx.pipelines] Add an Airflow pipeline adapter
4 participants