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

[Core] Fix for sky status --endpoints when a range of ports is opened #3199

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

romilbhardwaj
Copy link
Collaborator

When multiple ports are opened, sky status --endpoint 8888 <cluster> would fail. This is because the handle.launched_resources.ports contains a str like '8888-8889'. We need to convert to a set of ints and then compare in our code.

Repro:

resources:
  cloud: kubernetes
  ports:
    - 8888
    - 8889

run: |
    python -m http.server 8888 & python -m http.server 8889;
# Before:
$ sky status --endpoint 8889 mycluster
ValueError: Port 8889 is not exposed on cluster 'test'.

# After fix:
$ sky status --endpoint 8889 mycluster
34.67.101.159:8889

FYI - code paths for endpoints are refactored out of cli.py in #3109.

  • Code formatting: bash format.sh
  • Tested manually for the above repro with a) no ports, b)1 port c) many ports

@romilbhardwaj romilbhardwaj added this to the v0.5 milestone Feb 20, 2024
@romilbhardwaj romilbhardwaj changed the title [Core] Fix for sky status --endpoints when a range of ports is opened. [Core] Fix for sky status --endpoints when a range of ports is opened Feb 20, 2024
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.

Great catch @romilbhardwaj! LGTM.

@romilbhardwaj romilbhardwaj merged commit c2b6a09 into master Feb 20, 2024
19 checks passed
@romilbhardwaj romilbhardwaj deleted the endpoints_fix branch February 20, 2024 19:47
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