Skip to content
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

[Provisioner] Fix Azure disk tier explicitly shown in resources str #3064

Merged
merged 7 commits into from
Feb 2, 2024

Conversation

cblmemo
Copy link
Collaborator

@cblmemo cblmemo commented Feb 1, 2024

To reproduce:

$ sky launch --cloud azure
Clusters
NAME                           LAUNCHED        RESOURCES                                                 STATUS   AUTOSTOP  COMMAND                       
sky-ccca-txia                  a few secs ago  1x Azure(Standard_D8s_v5, disk_tier=medium)               INIT     -         sky launch --cloud azure

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
    • Previous reproducible code
    • sky launch -t Standard_D8_v5 --disk-tier medium and correctly throws an error
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
    • tests/test_smoke.py::test_azure_disk_tier
    • tests/test_smoke.py::test_azure_best_tier_failover
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh

Copy link
Collaborator

@Michaelvll Michaelvll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting the PR @cblmemo! Left a comment.

Comment on lines 299 to 310
def _failover_disk_tier() -> Optional[resources_utils.DiskTier]:
# Failover disk tier.
all_tiers = list(reversed(resources_utils.DiskTier))
start_index = all_tiers.index(
Azure._translate_disk_tier(r.disk_tier))
while start_index < len(all_tiers):
disk_tier = all_tiers[start_index]
ok, _ = Azure.check_disk_tier(r.instance_type, disk_tier)
if ok:
return disk_tier
start_index += 1
return None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean a user specifying --disk-tier medium may get an instance with disk_tier low?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! We should only do failover if the disk tier is None or BEST. Just pushed a commit to fix that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just re-run every tests and passed

@Michaelvll Michaelvll self-requested a review February 1, 2024 18:14
Copy link
Collaborator

@Michaelvll Michaelvll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @cblmemo! LGTM.

sky/clouds/azure.py Outdated Show resolved Hide resolved
sky/clouds/azure.py Outdated Show resolved Hide resolved
sky/clouds/azure.py Outdated Show resolved Hide resolved
cblmemo and others added 5 commits February 2, 2024 16:25
Co-authored-by: Zhanghao Wu <zhanghao.wu@outlook.com>
Co-authored-by: Zhanghao Wu <zhanghao.wu@outlook.com>
@cblmemo cblmemo merged commit 09eeeff into master Feb 2, 2024
19 checks passed
@cblmemo cblmemo deleted the fix-azure-tier-shown branch February 2, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants