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

Feature request: (Host-specific) remote command prefix #49

Closed
pbsds opened this issue Feb 2, 2022 · 0 comments · Fixed by #57
Closed

Feature request: (Host-specific) remote command prefix #49

pbsds opened this issue Feb 2, 2022 · 0 comments · Fixed by #57

Comments

@pbsds
Copy link
Contributor

pbsds commented Feb 2, 2022

When working on various remote hosts, it would be nice to prefix the remote COMMAND with something. This could either because the remote is shared, warranting prefixing all command with nice -n 5, or because the command needs to run inside some docker container with docker run, or because it has to queued in some job system such as SLURM.

Specifically, the command here would be nice to if it could be prefixed.

One way this could be configured in .remotes.toml would be:

[general]
cmd_prefix = ["nice", "-n", "5"]

[[hosts]]
host = "..."
cmd_prefix = ["docker", "run", "-it", "MYIMAGE", "-v", "/some/folder:/some/path"]

[[hosts]]
host = "..."
cmd_prefix = ["srun", "--account=foobar", "--mem=4g", "--cpus-per-task=4"]

[[hosts]]
host = "..."
cmd_prefix = [] # no prefix, ignores the default in [general]

This way enables you to have both a default prefix, with the option to override it per remote host

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant