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

Fixed rsync command to include files recursively #1777

Merged
merged 2 commits into from
Sep 14, 2023
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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Formatted executor block under Qelectron job details to handle any class-type values
- Fixed test-cases to handle latest pydantic version changes
- Rsync command fixed to recursively copy files when using SSH
- Removed accidentally added migrations build files

### Changed

Expand Down
53 changes: 0 additions & 53 deletions build/lib/covalent_migrations/README.md

This file was deleted.

106 changes: 0 additions & 106 deletions build/lib/covalent_migrations/alembic.ini

This file was deleted.

4 changes: 2 additions & 2 deletions covalent/_file_transfer/strategies/rsync_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def get_rsync_ssh_cmd(
remote_filepath = remote_file.filepath
args = ["rsync"]
if self.private_key_path:
args.append(f'-e "ssh -i {self.private_key_path}"')
args.append(f'-ae "ssh -i {self.private_key_path}"')
else:
args.append("-e ssh")
args.append("-ae ssh")

remote_source = f"{self.user}@{self.host}:{remote_filepath}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@ def test_get_ssh_rsync_cmd_with_ssh_key(self, mocker):
# commands take the form of rsync -s ssh ... [source] [destination]
assert (
upload_cmd_with_key
== f'rsync -e "ssh -i {private_key_path}" {self.MOCK_LOCAL_FILEPATH} {self.MOCK_USER}@{self.MOCK_HOST}:{self.MOCK_REMOTE_FILEPATH}'
== f'rsync -ae "ssh -i {private_key_path}" {self.MOCK_LOCAL_FILEPATH} {self.MOCK_USER}@{self.MOCK_HOST}:{self.MOCK_REMOTE_FILEPATH}'
)
assert (
download_cmd_with_key
== f'rsync -e "ssh -i {private_key_path}" {self.MOCK_USER}@{self.MOCK_HOST}:{self.MOCK_REMOTE_FILEPATH} {self.MOCK_LOCAL_FILEPATH}'
== f'rsync -ae "ssh -i {private_key_path}" {self.MOCK_USER}@{self.MOCK_HOST}:{self.MOCK_REMOTE_FILEPATH} {self.MOCK_LOCAL_FILEPATH}'
)

assert (
upload_cmd_without_key
== f"rsync -e ssh {self.MOCK_LOCAL_FILEPATH} {self.MOCK_USER}@{self.MOCK_HOST}:{self.MOCK_REMOTE_FILEPATH}"
== f"rsync -ae ssh {self.MOCK_LOCAL_FILEPATH} {self.MOCK_USER}@{self.MOCK_HOST}:{self.MOCK_REMOTE_FILEPATH}"
)
assert (
download_cmd_without_key
== f"rsync -e ssh {self.MOCK_USER}@{self.MOCK_HOST}:{self.MOCK_REMOTE_FILEPATH} {self.MOCK_LOCAL_FILEPATH}"
== f"rsync -ae ssh {self.MOCK_USER}@{self.MOCK_HOST}:{self.MOCK_REMOTE_FILEPATH} {self.MOCK_LOCAL_FILEPATH}"
)
Loading