Stop a Remote pyDarwin Job
stop_pyDarwinRemote.RdAttempts to gracefully stop a running pyDarwin job on a remote host by creating a 'stop.darwin' file in the remote project directory.
Usage
stop_pyDarwinRemote(
LocalDirectoryPath,
LocalJobInfoFilePath = NULL,
OriginalOptionsPath = NULL,
Password = NULL,
KeyPath = NULL,
verbose = getOption("verbose", default = FALSE)
)Arguments
- LocalDirectoryPath
Character string: The base local directory associated with the pyDarwin job. This directory is used to locate the job information file and the original options file.
- LocalJobInfoFilePath
Character string (optional): Explicit path to the local JSON file containing remote job information. If NULL (default), it's constructed using
LocalDirectoryPathandProjectName(derived fromOriginalOptionsPath).- OriginalOptionsPath
Character string (optional): Explicit path to the original local
options.jsonfile. If NULL (default), it's sought inLocalDirectoryPath. This is used to deriveProjectNameif needed.- Password
Character string. The password for SSH authentication. Defaults to
"", which is appropriate when using key-based authentication. Using keys is strongly recommended over embedding passwords in scripts.- KeyPath
Character string. The path to your private SSH key file. Defaults to the path stored in the
SSH_PRIVATE_KEY_PATHenvironment variable.- verbose
Logical: Passed to
ssh::ssh_connectfor verbose SSH output. Default:getOption("verbose", default = FALSE).
Value
Invisibly returns TRUE if the stop signal file was successfully created
(or already existed), and FALSE if there was an SSH error or an error
creating the file. This only signals the intent to stop; it does not
confirm the pyDarwin process has actually stopped.
Examples
if (FALSE) { # \dontrun{
# Assuming 'my_project_remote_job_info.json' and 'options.json'
# exist in '~/darwin_runs/my_project_run'.
try({
stop_pyDarwinRemote(
LocalDirectoryPath = "~/darwin_runs/my_project_run",
KeyPath = "~/.ssh/id_rsa_remote"
)
})
# Explicitly providing paths
try({
stop_pyDarwinRemote(
LocalDirectoryPath = "~/darwin_runs/my_project_run", # Still used as a base if needed
LocalJobInfoFilePath = "~/darwin_runs/my_project_run/my_project_remote_job_info.json",
OriginalOptionsPath = "~/darwin_runs/my_project_run/options.json"
)
})
} # }