Skip to main content

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, never a shell string. No pipe, no redirection, no $VAR. An argument that would need quoting is refused rather than mangled. Write paths out in full, and put anything needing a shell in a script on the centre.

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for haps-runtime-remotessh 0.5.0
File Size Uploaded Provenance Actions
haps_runtime_remotessh-0.5.0.tar.gz 11.3 kB Without provenance Details for haps_runtime_remotessh-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for haps-runtime-remotessh 0.5.0
File Interpreter ABI Platform Actions
haps_runtime_remotessh-0.5.0-py3-none-any.whl Python 3 none any Details for haps_runtime_remotessh-0.5.0-py3-none-any.whl

Total release size: 22.6 kB

Release files / haps_runtime_remotessh-0.5.0.tar.gz

Download URL haps_runtime_remotessh-0.5.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a842bc6f83ed59d797e0fc0902dd764cc3b0431284402667a58e7fe30ed933fc
BLAKE2b-256 checksum
How to use checksums
20d7a8945ab8aee804b0ed45fd6c41f77bbc4f37ea0522cc9c30ba10139db2fe
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.0-py3-none-any.whl

Download URL haps_runtime_remotessh-0.5.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d36784eb5b3609cb1b8a8f0b3578199e4e4170d76a37318ee73cd35cde38dbf3
BLAKE2b-256 checksum
How to use checksums
f56f9cbe992b2f1f2f884fa92ce8ddda186e143c963b2eee2d47438f0a045291
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.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page