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] gsutil rsync failing to sync source with dangling symlink #2165

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sky/cloud_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def is_directory(self, url: str) -> bool:
def make_sync_dir_command(self, source: str, destination: str) -> str:
"""Downloads a directory using gsutil."""
download_via_gsutil = (
f'{self._GSUTIL} -m rsync -r {source} {destination}')
f'{self._GSUTIL} -m rsync -e -r {source} {destination}')
all_commands = [self._GET_GSUTIL]
all_commands.append(download_via_gsutil)
return ' && '.join(all_commands)
Expand Down
7 changes: 4 additions & 3 deletions sky/data/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1507,14 +1507,15 @@ def batch_gsutil_rsync(self,

def get_file_sync_command(base_dir_path, file_names):
sync_format = '|'.join(file_names)
sync_command = (f'gsutil -m rsync -x \'^(?!{sync_format}$).*\' '
sync_command = (f'gsutil -m rsync -e -x \'^(?!{sync_format}$).*\' '
f'{base_dir_path} gs://{self.name}')
return sync_command

def get_dir_sync_command(src_dir_path, dest_dir_name):
# we exclude .git directory from the sync
sync_command = (f'gsutil -m rsync -r -x \'.git/*\' {src_dir_path} '
f'gs://{self.name}/{dest_dir_name}')
sync_command = (
f'gsutil -m rsync -e -r -x \'.git/*\' {src_dir_path} '
f'gs://{self.name}/{dest_dir_name}')
return sync_command

# Generate message for upload
Expand Down