haps-runtime-remotessh
This is not a HAPS plugin. No tag, no metadata, no client half.
It is one class, RemoteSSHJob, which extends RuntimeJob from
haps-runtime-executor and gives it what it needs to talk to an HPC centre over
SSH. A maintainer imports it, subclasses it, and writes execute.
SSH is currently done with RemoteManager.
Nothing outside remote.py knows that, so it can be swapped later.
pip install haps-runtime-remotessh
Configure the centre
[hpc]
host = "idris-ssh"
user = "user"
passfile = "/home/user/.vault/idris_pass" # chmod 600, yours
Optional: keyfile instead of passfile, workdir_root for a directory per
job, and five timeouts. See HpcConfig for the whole list.
HpcConfig.from_toml reads the [hpc] table and ignores the rest of the file.
Write a job
from haps_runtime import HapsClient
from haps_runtime_executor import RuntimeService
from haps_runtime_remotessh import HpcConfig, RemoteSSHJob
class DiskUsage(RemoteSSHJob):
def execute(self) -> None:
self.free = self.remotessh.run(["df", "-h", "/scratch"]).stdout
def voutput(self, index: int, name: str) -> str:
return self.free
config = HpcConfig.from_toml("hpc.toml")
RuntimeService(runtime, DiskUsage, config=config).start()
A full example is in exemple/.
What you get
RemoteSSHJob adds two steps in front of the usual ones:
connect → setup directories → fetch arguments → fetch ebuffer inputs
→ execute → push results → push ebuffer outputs
self.remotessh |
the centre, ready to use |
self.workdir |
workdir_root/<job uuid>, or None |
self.hpc |
the configuration in use |
And on self.remotessh:
run(argv, *, timeout=None) -> CommandResult # returncode, stdout, stderr, ok
put(local: Path, remote: PurePosixPath)
get(remote: PurePosixPath, local: Path)
write_text(remote: PurePosixPath, text: str)
mkdir(remote) exists(remote) -> bool is_dir(remote) -> bool
size_of(remote) -> int | None
Three things to know
run takes argv. Each element arrives on the centre as one argument,
quoted for you: a |, > or $VAR in it is a character, not an operator. For
pipes, redirections, &&, loops or $VAR, hand the script to bash:
run(["bash", "-c", "cd /x && for f in *.tar; do tar -xf \"$f\"; done"]) -
bash -lc when it needs module. A script runs as written: never build one
from a value a submitter sent.
Nothing is deleted on the centre. cleanup releases the connection and
leaves self.workdir alone. Remove it yourself if you want it gone.
Errors are yours to interpret. A failed connect becomes a
RuntimeServiceError, because an unreachable centre would fail every job.
Everywhere else a RemoteSSHError reaches you untouched: only you know whether
a failed put condemns the job.
Licence
MIT
Metadata
Release files for haps-runtime-remotessh 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| haps_runtime_remotessh-0.5.1.tar.gz | 11.8 kB | Without provenance | Details for haps_runtime_remotessh-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| haps_runtime_remotessh-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for haps_runtime_remotessh-0.5.1-py3-none-any.whl |
Total release size: 23.4 kB
Release files / haps_runtime_remotessh-0.5.1.tar.gz
| Download URL | haps_runtime_remotessh-0.5.1.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
453999367f43e88b22a8c4662b5f6b6a052e6e5799e2edb1bbf2c216e50faf9f
|
|
BLAKE2b-256 checksum How to use checksums |
ef1657e0f99a3e9dde9c8ec48d31c80aa0a534362b3803d520b92f87ab425c69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / haps_runtime_remotessh-0.5.1-py3-none-any.whl
| Download URL | haps_runtime_remotessh-0.5.1-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4782050f202562a5708ce1239c442aa36d881f56aa1df311acac380095552be4
|
|
BLAKE2b-256 checksum How to use checksums |
4cfbd45cf8e89f6f03949267ebdf87a36de034ff638470b3249ebabfe927f863
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for haps-runtime-remotessh 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.