From d7ad4c401891cb090e1e924ebace2c47e83b077c Mon Sep 17 00:00:00 2001 From: shikokuchuo <53399081+shikokuchuo@users.noreply.github.com> Date: Thu, 21 Dec 2023 22:36:55 +0000 Subject: [PATCH] update examples --- R/daemons.R | 19 +++++++++++-------- R/launchers.R | 37 ++++++++++++++++++++----------------- man/daemons.Rd | 19 +++++++++++-------- man/remote_config.Rd | 37 ++++++++++++++++++++----------------- 4 files changed, 62 insertions(+), 50 deletions(-) diff --git a/R/daemons.R b/R/daemons.R index 4c08fc0f2..0e5222f01 100644 --- a/R/daemons.R +++ b/R/daemons.R @@ -242,19 +242,22 @@ #' # Reset to zero #' daemons(0) #' +#' } +#' +#' \dontrun{ #' # Launch 2 daemons on remotes 'nodeone' and 'nodetwo' using SSH #' # connecting back directly to the host URL over a TLS connection: -#' # -#' # daemons(url = host_url(tls = TRUE), -#' # remote = ssh_config(c('ssh://nodeone', 'ssh://nodetwo')), -#' # dispatcher = FALSE) +#' +#' daemons(url = host_url(tls = TRUE), +#' remote = ssh_config(c('ssh://nodeone', 'ssh://nodetwo')), +#' dispatcher = FALSE) #' #' # Launch 4 daemons on the remote machine 10.75.32.90 using SSH tunnelling #' # over port 5555 ('url' hostname must be 'localhost' or '127.0.0.1'): -#' # -#' # daemons(n = 4, -#' # url = 'ws://localhost:5555', -#' # remote = ssh_config('ssh://10.75.32.90', tunnel = TRUE)) +#' +#' daemons(n = 4, +#' url = 'ws://localhost:5555', +#' remote = ssh_config('ssh://10.75.32.90', tunnel = TRUE)) #' #' } #' diff --git a/R/launchers.R b/R/launchers.R index 83f53d4c2..a63173155 100644 --- a/R/launchers.R +++ b/R/launchers.R @@ -250,28 +250,31 @@ remote_config <- function(command = NULL, args = c("", "."), rscript = "Rscript" #' @examples #' ssh_config(remotes = c("ssh://10.75.32.90:222", "ssh://nodename"), timeout = 10) #' +#' \dontrun{ +#' #' # 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 -#' # ) -#' # ) +#' +#' 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'): -#' # -#' # make_cluster( -#' # url = "tcp://localhost:5555", -#' # remote = ssh_config( -#' # remotes = c("ssh://10.75.32.90", "ssh://10.75.32.90"), -#' # timeout = 1, -#' # tunnel = TRUE -#' # ) -#' # ) +#' +#' cl <- make_cluster( +#' url = "tcp://localhost:5555", +#' remote = ssh_config( +#' remotes = c("ssh://10.75.32.90", "ssh://10.75.32.90"), +#' timeout = 1, +#' tunnel = TRUE +#' ) +#' ) +#' } #' #' @rdname remote_config #' @export diff --git a/man/daemons.Rd b/man/daemons.Rd index cf97f245d..f2c955147 100644 --- a/man/daemons.Rd +++ b/man/daemons.Rd @@ -266,19 +266,22 @@ status() # Reset to zero daemons(0) +} + +\dontrun{ # Launch 2 daemons on remotes 'nodeone' and 'nodetwo' using SSH # connecting back directly to the host URL over a TLS connection: -# -# daemons(url = host_url(tls = TRUE), -# remote = ssh_config(c('ssh://nodeone', 'ssh://nodetwo')), -# dispatcher = FALSE) + +daemons(url = host_url(tls = TRUE), + remote = ssh_config(c('ssh://nodeone', 'ssh://nodetwo')), + dispatcher = FALSE) # Launch 4 daemons on the remote machine 10.75.32.90 using SSH tunnelling # over port 5555 ('url' hostname must be 'localhost' or '127.0.0.1'): -# -# daemons(n = 4, -# url = 'ws://localhost:5555', -# remote = ssh_config('ssh://10.75.32.90', tunnel = TRUE)) + +daemons(n = 4, + url = 'ws://localhost:5555', + remote = ssh_config('ssh://10.75.32.90', tunnel = TRUE)) } diff --git a/man/remote_config.Rd b/man/remote_config.Rd index 645da70cf..c559947ea 100644 --- a/man/remote_config.Rd +++ b/man/remote_config.Rd @@ -94,27 +94,30 @@ remote_config(command = "ssh", args = c("-fTp 22 10.75.32.90", ".")) ssh_config(remotes = c("ssh://10.75.32.90:222", "ssh://nodename"), timeout = 10) +\dontrun{ + # 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 -# ) -# ) + +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'): -# -# make_cluster( -# url = "tcp://localhost:5555", -# remote = ssh_config( -# remotes = c("ssh://10.75.32.90", "ssh://10.75.32.90"), -# timeout = 1, -# tunnel = TRUE -# ) -# ) + +cl <- make_cluster( + url = "tcp://localhost:5555", + remote = ssh_config( + remotes = c("ssh://10.75.32.90", "ssh://10.75.32.90"), + timeout = 1, + tunnel = TRUE + ) +) +} }