-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Add a "force" option to emr serverless stop/delete operator #30757
Changes from all commits
7fbb07c
a7f25a1
8370c81
ede8b85
d132b70
0232d2e
4b44efe
9f88cc1
af8eb19
76bd915
9ddaafe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": 2, | ||
"waiters": { | ||
"no_job_running": { | ||
"operation": "ListJobRuns", | ||
"delay": 10, | ||
"maxAttempts": 60, | ||
"acceptors": [ | ||
{ | ||
"matcher": "path", | ||
"argument": "length(jobRuns) == `0`", | ||
"expected": true, | ||
"state": "success" | ||
} | ||
] | ||
Comment on lines
+8
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like too much the fact that I don't have a failure case for this waiter, but I think there is nothing we can do about it... |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,13 +100,15 @@ | |
configuration_overrides=SPARK_CONFIGURATION_OVERRIDES, | ||
) | ||
# [END howto_operator_emr_serverless_start_job] | ||
start_job.waiter_check_interval_seconds = 10 | ||
start_job.wait_for_completion = False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of waiting for the job to finish, we just trigger it and continue... |
||
|
||
# [START howto_sensor_emr_serverless_job] | ||
wait_for_job = EmrServerlessJobSensor( | ||
task_id="wait_for_job", | ||
application_id=emr_serverless_app_id, | ||
job_run_id=start_job.output, | ||
# the default is to wait for job completion, here we just wait for the job to be running. | ||
target_states={"RUNNING"}, | ||
) | ||
# [END howto_sensor_emr_serverless_job] | ||
wait_for_job.poke_interval = 10 | ||
|
@@ -115,6 +117,7 @@ | |
stop_app = EmrServerlessStopApplicationOperator( | ||
task_id="stop_application", | ||
application_id=emr_serverless_app_id, | ||
force_stop=True, | ||
) | ||
# [END howto_operator_emr_serverless_stop_application] | ||
stop_app.waiter_check_interval_seconds = 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about updating the
docs/apache-airflow-providers-amazon/operators/emr/emr_serverless.rst
to contain this additional paramThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it to the system test (https://github.com/apache/airflow/pull/30757/files/8370c8172d8c28ffeec3ca460621b9d0447bfba6#diff-69be45953c5be696ca3159bb385a89c90930fc06e68357e8bdb33a1b31694f88R120) inside the
howto_operator
thing, so it'll be embeded in the doc automatically (as sample usage).It doesn't explain what it's doing, but it being present there highlights its presence, and the code doc contains the explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good