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] Show logs for storage mount #4387

Merged

Conversation

zpoint
Copy link
Collaborator

@zpoint zpoint commented Nov 20, 2024

Feature for #4105

  • All storage object uploads will get a new temp file and log to this temp file.
image
(sky) ➜  skypilot git:(dev/zeping/show_logs_for_storage_mount) ✗ cat ~/Desktop/hello-sky/work_dir_2.yaml
resources:
  cloud: aws

file_mounts:
  ~/aws: ~/Desktop/dir2

  /datasets-storage:
    name: sky-dataset
    source: ~/Desktop/dir2 
    persistent: True
    mode: MOUNT

workdir: ~/Desktop/dir1

num_nodes: 1

run: |
  echo "Hello, world!"
  ls ~/aws
  ls /datasets-storage
sky jobs launch ~/Desktop/hello-sky/work_dir_2.yaml
image

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • 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 Copilot November 20, 2024 19:56

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no suggestions.

Comments skipped due to low confidence (3)

sky/data/storage.py:1002

  • The variable 'self.source' should be 'source' to match the function parameter.
logger.warning(f'\'.git\' directory under \'{self.source}\' ' 'is excluded during sync.')

sky/data/data_utils.py:541

  • The error message has a grammatical error. It should be 'No file uploaded. This could be due to an error or because all files already exist on the cloud.'
storage_logger.info('No file uploaded, could be error happened or all files already exist on cloud')

sky/data/data_utils.py:531

  • [nitpick] The variable name 'stdout_line_write_cnt' is not very descriptive. Consider renaming it to 'stdout_line_count'.
stdout_line_write_cnt = 0
@zpoint zpoint requested a review from Michaelvll November 25, 2024 03:33
@romilbhardwaj romilbhardwaj self-requested a review November 25, 2024 20:18
Copy link
Collaborator

@romilbhardwaj romilbhardwaj left a comment

Choose a reason for hiding this comment

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

Thanks @zpoint!

sky/sky_logging.py Outdated Show resolved Hide resolved
sky/data/storage.py Outdated Show resolved Hide resolved
sky/data/data_utils.py Outdated Show resolved Hide resolved
@zpoint zpoint requested a review from romilbhardwaj November 26, 2024 09:05
Copy link
Collaborator

@romilbhardwaj romilbhardwaj left a comment

Choose a reason for hiding this comment

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

Thanks @zpoint! Works nicely. Should be good to go after the two comments are resolved.

sky/data/data_utils.py Outdated Show resolved Hide resolved

def generate_tmp_logging_file_path(file_name: str) -> str:
"""Generate an absolute path of a tmp file for logging."""
run_timestamp = datetime.now().strftime('%Y-%m-%d-%H-%M-%S-%f')
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should use backend_utils.get_run_timestamp() to have paths consistent with provisioning logs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I made some modifications to avoid a circular import.

@zpoint zpoint requested a review from romilbhardwaj December 2, 2024 15:19
@zpoint
Copy link
Collaborator Author

zpoint commented Dec 22, 2024

@romilbhardwaj Review reminder 😊

Copy link
Collaborator

@romilbhardwaj romilbhardwaj left a comment

Choose a reason for hiding this comment

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

Thanks @zpoint! One minor comment, should be good to go.

sky/backends/backend_utils.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@romilbhardwaj romilbhardwaj left a comment

Choose a reason for hiding this comment

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

Thanks @zpoint, lgtm!

@romilbhardwaj romilbhardwaj changed the title show logs for storage mount [Storage] Show logs for storage mount Dec 23, 2024
@zpoint zpoint merged commit 6b62570 into skypilot-org:master Dec 24, 2024
19 checks passed
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