-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow client to interact with remote PBS server #19
Comments
This issue has been mentioned on ACCESS Hive Community Forum. There might be relevant details there: |
Hi Ben, you may find this package useful https://www.fabfile.org/ for the ssh connections. I use this in scripts to submit and monitor jobs on Gadi. It has very occasional timeout issues but mostly works really well. |
Excellent suggestion. Thanks! |
Hi @frizwi, I'm going through the backlog of issues on this one and having some trouble getting the Are you able to share a snippet of your code (redacted of course) with which you've been able to establish a connection? Thanks in advance. |
Disregard, I've figured it out. :) |
For future reference when we get up to this bit: from paramiko.client import SSHClient
from paramiko import RSAKey
from pathlib import Path
import os
nci_user = os.getenv("NCI_USER")
nci_host = os.getenv("NCI_HOST")
key_file = Path.home() / ".ssh/id_rsa"
known_hosts = Path.home() / ".ssh/known_hosts"
pkey = RSAKey.from_private_key_file(key_file)
client = SSHClient()
client.load_host_keys(filename=known_hosts)
client.connect(
nci_host,
pkey=pkey,
look_for_keys=False,
allow_agent=False,
username=nci_user,
)
stdin, stdout, stderr = client.exec_command("echo $HOME")
print(stdout.read()) I assume we can pass similar details into the Then, from within the base client class of HPCPy, we can intercept the shell call to execute over ssh instead. Theoretically... |
The current client is designed for local execution, however, there is a solid case for making it interact with a remote server.
This would likely be implemented like this...
Other considerations:
This is a reasonable package of work. Target v2.0.
The text was updated successfully, but these errors were encountered: