[azure] support latest version for image id in azure cloud#4581
[azure] support latest version for image id in azure cloud#4581cg505 merged 4 commits intoskypilot-org:masterfrom
Conversation
Signed-off-by: Song Gao <disxiaofei@163.com>
| publisher_name=publisher, | ||
| offer=offer, | ||
| skus=sku) | ||
| latest_version = max(versions, key=lambda x: x.name) |
There was a problem hiding this comment.
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.
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 <disxiaofei@163.com>
|
@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. |
cg505
left a comment
There was a problem hiding this comment.
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 <disxiaofei@163.com>
Signed-off-by: Song Gao <disxiaofei@163.com>
cg505
left a comment
There was a problem hiding this comment.
Thank you for your contribution!
As titled.
close #4435
Tested (run the relevant ones):
bash format.shI 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-ltsas expectedpytest tests/test_smoke.pypytest tests/test_smoke.py::test_fill_in_the_nameconda deactivate; bash -i tests/backward_compatibility_tests.sh