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

[Storage] Truncate long command str in sky storage ls #2177

Merged
merged 4 commits into from
Jul 12, 2023

Conversation

romilbhardwaj
Copy link
Collaborator

@romilbhardwaj romilbhardwaj commented Jul 5, 2023

Truncates long COMMAND strs in sky storage ls, like we do in sky status.

Before:

(base) ➜  ~ sky storage ls
NAME                       CREATED     STORE  COMMAND                                   STATUS
romil-debug-parq           22 hrs ago  S3     sky launch parquet_test.yaml --cloud gcp  READY

After:

(base) ➜  ~ sky storage ls
NAME                       CREATED     STORE  COMMAND                       STATUS
romil-debug-parq           22 hrs ago  S3     sky launch parquet_test.y...  READY

...

(base) ➜  ~ sky storage ls -a    
NAME                 CREATED    STORE  COMMAND                                                                                                                            STATUS  
sky-test-1688589264  1 day ago  S3     sky launch -y -c t-kubernetes-sto363-2ea4-d7 --cloud kubernetes /var/folders/98/hhq8wrtx6y13196q61xphjsm0000gn/T/tmp4ev9pbqq.yaml  INIT    
sky-test-1688589292  1 day ago  S3     sky launch -y -c t-kubernetes-sto363-2ea4-54 --cloud kubernetes /var/folders/98/hhq8wrtx6y13196q61xphjsm0000gn/T/tmpwbfcbv4x.yaml  READY  

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • pytest tests/test_smoke.py::TestStorageWithCredentials

Copy link
Collaborator

@landscapepainter landscapepainter left a comment

Choose a reason for hiding this comment

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

I'm wondering if we should add -a option for sky storage ls as well if we are going to truncate COMMAND as a default. -a, --all would allow the user to see the full COMMAND. sky launch command with task yaml and some options used will always get truncated.

@romilbhardwaj
Copy link
Collaborator Author

@landscapepainter good idea - added -a flag to print without truncation.

Copy link
Collaborator

@landscapepainter landscapepainter 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 adding the support for --all @romilbhardwaj ! I tested out the flag and this should be ready to go after adding the support in the doc, docs/source/reference/cli.rst, for the newly added flag.

@romilbhardwaj
Copy link
Collaborator Author

The CLI page is auto-populated from docstrs, so it should already be there:

image

Copy link
Collaborator

@landscapepainter landscapepainter left a comment

Choose a reason for hiding this comment

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

@landscapepainter landscapepainter merged commit 2bdec2a into master Jul 12, 2023
@landscapepainter landscapepainter deleted the storage_truncate_str branch July 12, 2023 22:39
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