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

[Catalog] Fix lambda fetcher #3801

Merged
merged 5 commits into from
Aug 5, 2024
Merged

[Catalog] Fix lambda fetcher #3801

merged 5 commits into from
Aug 5, 2024

Conversation

Michaelvll
Copy link
Collaborator

@Michaelvll Michaelvll commented Jul 31, 2024

Lambda recently added CPU instance type which causes our catalog fetcher fail. This PR fixes this.

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
    • python -m sky.clouds.service_catalog.data_fetchers.fetch_lambda_cloud
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: conda deactivate; bash -i tests/backward_compatibility_tests.sh

@Michaelvll Michaelvll requested a review from cblmemo August 1, 2024 17:32
Copy link
Collaborator

@cblmemo cblmemo 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! LGTM.

@@ -71,24 +73,32 @@ def create_catalog(api_key: str, output_path: str) -> None:
# We parse info.keys() in reverse order so gpu_1x_a100_sxm4 comes before
# gpu_1x_a100 in the catalog (gpu_1x_a100_sxm4 has more availability).
for vm in reversed(list(info.keys())):
gpu = name_to_gpu(vm)
gpu_cnt = float(name_to_gpu_cnt(vm))
Copy link
Collaborator

Choose a reason for hiding this comment

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

The name_to_gpu_cnt function is not used and safe to delete?

}


def name_to_gpu(name: str) -> str:
def name_to_gpu_and_cnt(name: str) -> Optional[Tuple[str, int]]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we add a comment for the expected format of the name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added. Thanks!

@Michaelvll Michaelvll enabled auto-merge August 5, 2024 20:14
@Michaelvll Michaelvll added this pull request to the merge queue Aug 5, 2024
Merged via the queue into master with commit 1da7fbf Aug 5, 2024
20 checks passed
@Michaelvll Michaelvll deleted the fix-lambda-catalog-fetcher branch August 5, 2024 20:22
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