# example for Slurm
remote_config(
command = "srun",
args = c("--mem 512", "-n 1", "."),
rscript = file.path(R.home("bin"), "Rscript")
)
# commands like SSH require quoting of the daemon launch command
remote_config(
command = "/usr/bin/ssh",
args = c("-fTp 22 10.75.32.90", "."),
quote = TRUE
)
# can be used to start local dameons with special configurations
remote_config(
command = "Rscript",
rscript = "--default-packages=NULL --vanilla"
)
# simple SSH example
ssh_config(
remotes = c("ssh://10.75.32.90:222", "ssh://nodename"),
timeout = 5
)
# SSH tunnelling example
ssh_config(
remotes = c("ssh://10.75.32.90:222", "ssh://nodename"),
tunnel = TRUE,
host = "tls+tcp://127.0.0.1:5555"
)
if (FALSE) {
# launch 2 daemons on the remote machines 10.75.32.90 and 10.75.32.91 using
# SSH, connecting back directly to the host URL over a TLS connection:
daemons(
url = host_url(tls = TRUE),
remote = ssh_config(
remotes = c("ssh://10.75.32.90:222", "ssh://10.75.32.91:222"),
timeout = 1
)
)
# launch 2 nodes on the remote machine 10.75.32.90 using SSH tunnelling over
# port 5555 ('url' hostname must be 'localhost' or '127.0.0.1'):
cl <- make_cluster(
url = "tcp://localhost:5555",
remote = ssh_config(
remotes = c("ssh://10.75.32.90", "ssh://10.75.32.90"),
tunnel = TRUE,
timeout = 1
)
)
}
Run the code above in your browser using DataLab