You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SageMakerProcessingOperator does not honor action_if_job_exists #21711
Sagemaker Processing Operator no longer honors the action_if_job_exists param and always fails creation of a new processing job is a job with the name already exists.
This happens because in a recent change, the function responsible for executing the job no longer honors the increment setting:
When Sagemaker Processing operator is called with a job-name that already exists, the job creation should succeed with a name that is incremented by 1.
How to reproduce
invoke SageMakerProcessingOperator twice with the same job name while keeping action_if_job_exists as 'increment'.
It looks like this is still an issue. I am packing for a vacation, but perhaps someone else can pick it up while I'm away. The full error message is
Traceback (most recent call last):
File "/opt/airflow/airflow/providers/amazon/aws/operators/sagemaker.py", line 185, in execute
raise AirflowException(
airflow.exceptions.AirflowException: A SageMaker processing job with name processing-job already exists.
so it may be as simple as adding an if action_if_job_exists=='increment' section to the except block of this check
I looked at the issue and I agree, this change 96dd703 made a breaking change by stop using the parameter action_if_job_exists. However, I dont see any valid solution to fix it. If we still want to increment the job name if action_if_job_exists is increment, then we need to use list_processing_jobs and then having back the issue #16763. The only partial valid solution I can see is to generate a random number as increment but then we might run into other issues:
What range should we take for this number (0..??)
The implementation would deviate from the function signature since we do not increment the job name but suffix the name with a random number
My honest opinion here is we should deprecate the parameter action_if_job_exists and users should handle it themselves and apply whatever strategy they want
My honest opinion here is we should deprecate the parameter action_if_job_exists and users should handle it themselves and apply whatever strategy they want
I'm all for it. To my prespective it goes beyond what Airflow can/should do.
I think this is one of the cases where a blog post showing how to customize strategy is more suitable.
A fairly common recipe is to handle the ThrottlingException in situations like this. So the list_processing_jobs (or more specifically the _list_request helper`) can catch that exception when it's exhausted the quota, and then sleep for a second or two and then continue another burst of requests.
This way we don't drop existing functionality and the code remains backwards compatible. We've been a bit heavy-handed with deprecations and breaking changes in the Amazon Provider package as of late.
I am okay with that too. I still feel like this feature is odd and should have never been there but I agree, as a compromise we can go with what @o-nikolas described as solution
Activity
boring-cyborg commentedon Feb 21, 2022
Thanks for opening your first issue here! Be sure to follow the issue template!
eladkal commentedon Feb 24, 2022
Feel free to submit PR
ferruzzi commentedon Sep 30, 2022
It looks like this is still an issue. I am packing for a vacation, but perhaps someone else can pick it up while I'm away. The full error message is
so it may be as simple as adding an
if action_if_job_exists=='increment'section to the except block of this checkvincbeck commentedon Oct 3, 2022
I looked at the issue and I agree, this change 96dd703 made a breaking change by stop using the parameter
action_if_job_exists. However, I dont see any valid solution to fix it. If we still want to increment the job name ifaction_if_job_existsisincrement, then we need to uselist_processing_jobsand then having back the issue #16763. The only partial valid solution I can see is to generate a random number as increment but then we might run into other issues:My honest opinion here is we should deprecate the parameter
action_if_job_existsand users should handle it themselves and apply whatever strategy they wanteladkal commentedon Oct 3, 2022
I'm all for it. To my prespective it goes beyond what Airflow can/should do.
I think this is one of the cases where a blog post showing how to customize strategy is more suitable.
o-nikolas commentedon Oct 12, 2022
A fairly common recipe is to handle the
ThrottlingExceptionin situations like this. So thelist_processing_jobs(or more specifically the_list_requesthelper`) can catch that exception when it's exhausted the quota, and then sleep for a second or two and then continue another burst of requests.This way we don't drop existing functionality and the code remains backwards compatible. We've been a bit heavy-handed with deprecations and breaking changes in the Amazon Provider package as of late.
WDYT @vincbeck, @eladkal, @ferruzzi
vincbeck commentedon Oct 12, 2022
I am okay with that too. I still feel like this feature is odd and should have never been there but I agree, as a compromise we can go with what @o-nikolas described as solution
ferruzzi commentedon Oct 20, 2022
Sounds like a plan. I'll try to get it implemented in the next few days.