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

added ssh_port option for ssh to alternative port. #98

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added a docker based SLURM cluster in the CI pipeline for testing the plugin.
- Ignoring `tests/docker_tests` directory from pytest.


## [0.18.1] - 24-11-25

### Added

- `ssh_port` options in the slurmExecutor to allow connection to HPC system that use alternative port for `ssh`.

## [0.18.0] - 2024-01-26

### Added
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ pip install covalent-slurm-plugin

On the remote system, the Python version in the environment you plan to use must match that used when dispatching the calculations. Additionally, the remote system's Python environment must have the base [covalent package](https://github.com/AgnostiqHQ/covalent) installed (e.g. `pip install covalent`).


For development use the following to build it.

- Create a python environment, and in that environment install `pip install build`
- Go to the source folder, and run

```bash
python -m build
```


## Usage

The following shows an example of a Covalent [configuration](https://covalent.readthedocs.io/en/latest/how_to/config/customization.html) that is modified to support Slurm:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.18.0
0.18.1
6 changes: 6 additions & 0 deletions covalent_slurm_plugin/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class ExecutorPluginDefaults(BaseModel):
address: Optional[str] = ""
ssh_key_file: Optional[str] = ""
cert_file: Optional[str] = None
ssh_port: Optional[int] = 22
remote_workdir: Optional[str] = "covalent-workdir"
create_unique_workdir: bool = False
variables: Optional[Dict[str, str]] = Field(default_factory=dict)
Expand Down Expand Up @@ -120,6 +121,8 @@ def __init__(
address: Optional[str] = None,
ssh_key_file: Optional[str] = None,
cert_file: Optional[str] = None,
# added ssh port option: Rajarshi
ssh_port: Optional[int] = 22,
remote_workdir: Optional[str] = None,
create_unique_workdir: bool = False,
options: Optional[Dict] = None,
Expand Down Expand Up @@ -150,6 +153,8 @@ def __init__(
self.address = address or get_config("executors.slurm.address")
self.ssh_key_file = ssh_key_file or get_config("executors.slurm.ssh_key_file")
self.cert_file = cert_file or get_config("executors.slurm").get("cert_file", None)
# add ssh port: Rajarshi
self.ssh_port = ssh_port or get_config("executors.slurm").get("ssh_port", 22)
self.remote_workdir = remote_workdir or get_config("executors.slurm.remote_workdir")
self.variables = variables or get_config("executors.slurm.variables")
self.conda_env = conda_env or get_config("executors.slurm.conda_env")
Expand Down Expand Up @@ -235,6 +240,7 @@ async def _client_connect(self) -> asyncssh.SSHClientConnection:
try:
conn = await asyncssh.connect(
self.address,
port=self.ssh_port,
username=self.username,
client_keys=client_keys,
known_hosts=None,
Expand Down