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

Implement LivyOperatorAsync #178

Merged
merged 32 commits into from
Apr 8, 2022
Merged

Implement LivyOperatorAsync #178

merged 32 commits into from
Apr 8, 2022

Conversation

sunank200
Copy link
Collaborator

@sunank200 sunank200 commented Mar 31, 2022

  • Add LivyOperatorAsync, LivyTrigger and LivyHookAsync
  • Add example DAG for LivyOperatorAsync
  • Propagate the logs dump from livy to worker through triggerer.
  • Add tests for hooks, operators and triggers.

Implements: #119

@sunank200 sunank200 requested a review from kaxil March 31, 2022 17:54
@codecov
Copy link

codecov bot commented Mar 31, 2022

Codecov Report

Merging #178 (62f2d60) into main (f135d4a) will increase coverage by 0.21%.
The diff coverage is 97.87%.

@@            Coverage Diff             @@
##             main     #178      +/-   ##
==========================================
+ Coverage   95.76%   95.97%   +0.21%     
==========================================
  Files          39       42       +3     
  Lines        2101     2336     +235     
==========================================
+ Hits         2012     2242     +230     
- Misses         89       94       +5     
Impacted Files Coverage Δ
astronomer/providers/apache/livy/triggers/livy.py 97.67% <97.67%> (ø)
astronomer/providers/apache/livy/hooks/livy.py 97.70% <97.70%> (ø)
astronomer/providers/apache/livy/operators/livy.py 100.00% <100.00%> (ø)

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 f135d4a...62f2d60. Read the comment docs.

Copy link
Collaborator

@kaxil kaxil left a comment

Choose a reason for hiding this comment

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

Can you update the PR title as per http://chris.beams.io/posts/git-commit/ please

@sunank200 sunank200 changed the title Livy operator async Implement LivyOperatorAsync Apr 4, 2022
@sunank200 sunank200 marked this pull request as ready for review April 4, 2022 10:13
setup.cfg Outdated Show resolved Hide resolved
@kaxil kaxil changed the title Implement LivyOperatorAsync Implement LivyOperatorAsync Apr 4, 2022

LIVY_JAVA_FILE = os.environ.get("LIVY_JAVA_FILE", "/spark-examples.jar")
LIVY_PYTHON_FILE = os.environ.get("LIVY_PYTHON_FILE", "/user/hadoop/pi.py")

Copy link
Collaborator

Choose a reason for hiding this comment

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

This DAG still needs work to be self sufficient. We might want to use existing operators and boto3 api to

  • spin up the EMR cluster along with Livy, and Spark
  • create the SSH tunnel
  • execute job using this async livy operator
  • terminate EMR cluster

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I am working on this right now.

@kaxil kaxil added this to the 1.2.0 milestone Apr 5, 2022
@phanikumv phanikumv merged commit 67d1ac5 into main Apr 8, 2022
@phanikumv phanikumv deleted the livy-operator-async branch April 8, 2022 06:30
See Tenacity documentation at https://github.com/jd/tenacity
"""

def execute(self, context: "Context") -> Any:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should have been None, we dont return anything from this method

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

Successfully merging this pull request may close these issues.

4 participants