-
Notifications
You must be signed in to change notification settings - Fork 550
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] support latest version for image id in azure cloud #4581
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Song Gao <[email protected]>
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.
Thank you for the PR, @Yisaer! This will be a useful feature. I appreciate you digging into this problem because the Azure docs are kind of unclear about it. Left a comment to check on.
sky/clouds/azure.py
Outdated
publisher_name=publisher, | ||
offer=offer, | ||
skus=sku) | ||
latest_version = max(versions, key=lambda x: x.name) |
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.
Did you confirm that the name
field here is the image version number? I assume it is a string, so will max()
work correctly? E.g. we need to make sure that 1.0.10
> 1.0.2
.
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.
Thanks for pointing out the max()
problem, it should use packaging.version
to parse the image version here.
Also I tried to find out the meaning of the name
in the azure document, but it's not clear enough.
So when I tested my pr, I debug the returned versions
during the runtime, and the returned name
here was acutuall the image version number.
Signed-off-by: Song Gao <[email protected]>
@Yisaer Just checking - we don't need this in |
@cg505 Yes, it appears that compute_client.virtual_machine_images.get does not accept the latest image version, whereas compute_client.virtual_machines.begin_create_or_update does. By querying the image size through a precise image version, while directly using the latest image version when creating a VM, there might be a difference in image information. However, the probability of this occurring is very small, and I think this is an acceptable solution. |
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.
Thank you, it looks good to me! Let's have @Michaelvll review as well.
Thanks for the explanation! We should mention this in the comment as well. |
Signed-off-by: Song Gao <[email protected]>
As titled.
close #4435
Tested (run the relevant ones):
bash format.sh
I manually tested with following task:
The cluster was launched and the job work well. I checked the image in the azure console, and it was
ubuntu-24_04-lts
as expectedpytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
conda deactivate; bash -i tests/backward_compatibility_tests.sh