-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[Azure][Cluster] Only set evictionPolicy to Delete when spot is used #46959
[Azure][Cluster] Only set evictionPolicy to Delete when spot is used #46959
Conversation
This makes sense. Although if the user provides this parameter, I would default to use that first before filling in a default. I'm assuming it's null if not provided? If so you should be able to check if the policy is null and the priority is for spot then use delete otherwise keep the parameter as is. |
@gramhagen new logic was added to check if the user supplied an eviction policy & a spot instance is used, otherwise if spot instance is regular, it passes null for eviction policy. |
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.
does this work? my eyes are getting crossed looking at the parentheses in the if condition 😵💫
@@ -78,7 +78,7 @@ | |||
}, | |||
"evictionPolicy": { | |||
"type": "string", | |||
"defaultValue": "Delete", | |||
"defaultValue": "json('null')", |
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.
oops, didn't realize there was already a default for this, i'd suggest putting this back and just catching the error case below. that should also allow people to maintain any overrides (just not an invalid one)
"defaultValue": "json('null')", | |
"defaultValue": "Delete", |
@@ -253,7 +253,7 @@ | |||
} | |||
}, | |||
"priority": "[parameters('priority')]", | |||
"evictionPolicy": "[parameters('evictionPolicy')]", | |||
"evictionPolicy": "[if(and(equals(parameters('priority'), 'Spot'), or(equals(parameters('evictionPolicy'), ''), equals(parameters('evictionPolicy'), json('null')))), 'Delete', parameters('evictionPolicy'))]", |
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.
"evictionPolicy": "[if(and(equals(parameters('priority'), 'Spot'), or(equals(parameters('evictionPolicy'), ''), equals(parameters('evictionPolicy'), json('null')))), 'Delete', parameters('evictionPolicy'))]", | |
"evictionPolicy": "[if(and(equals(parameters('priority'), 'Spot'), equals(parameters('evictionPolicy'), 'Delete')), json('null'), parameters('evictionPolicy'))]", |
@kekulai-fredchang can you address comments here? |
I looked at @gramhagen suggestions, and from my limited azure knowledge it did not seem correct because it will pass json('null') even when 'Delete' is desired. I redid the logic as follows, which allows both spot instances with delete default and user defined pass through, and regular instances with evictionPolicy set to json('null').
|
ok, lgtm |
I was running into this same issue, but I think this can be a lot simpler. The
and it works for me. |
@mjd3 that does seem like the easiest option! |
Also, as a workaround until this PR is merged in, you can add |
good point @mjd3. This either should be annotated in the docs or have this PR merged. |
@kekulai-fredchang do you agree with the suggestion above? From looking back, it seems like my suggestion mirrors @gramhagen's initial suggestion too. If so, can you update this PR? Would love to get this one merged in. |
Agreed. |
Thanks @kekulai-fredchang! @anyscalesam this should be ready to merge. |
@hongchaodeng can you please take a look? |
Sorry for introducing this issue in the earlier PR. I confirmed that this fix works for me locally. @ericl @architkulkarni @hongchaodeng would you be able to review this PR? |
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.
I don't have an Azure account to test this PR, but some folks have already verified it. Hence, I approve this PR.
@kekulai-fredchang It looks like you could run these instructions to pass the DCO check: https://github.com/ray-project/ray/pull/46959/checks?check_run_id=30602666160 Thanks for fixing this issue. |
The DCO check failing is fine with me. We just need to make sure the premerge check passes. |
Simplify evictionPolicy handling based on VM priority - Set default value of evictionPolicy to 'Delete'. - Implement conditional logic to only pass evictionPolicy when priority is set to 'Spot'. - If the VM priority is 'Spot', use the user-defined evictionPolicy; otherwise, default to 'Delete'. - If the VM priority is not 'Spot', the evictionPolicy is not passed (set to empty string ''). (cherry picked from commit 3601528248a0375a6f2f0b19af697095cea665aa) Signed-off-by: Frederick Chang <fred.chang@kekulai.com>
ce8d1f1
to
1d5fa32
Compare
@bthananjeyan @kevin85421 I updated the branch to include signoff |
…ay-project#46959) Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
previous update assumed evictionPolicy on all nodes as 'Delete', which yields error for those azure users that do not launch a Spot instance.
@gramhagen , @eisber , @ijrsvt
Why are these changes needed?
Since Spot instance availability is low in azure, many users will launch with regular instance and encounter error.
added conditional logic in master azure json file to check if priority is indeed Spot , if so, then yield evictionPolicy as 'Delete', otherwise yield json('null') to skip this policy.
Related issue number
fixes #46198
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.