@@ -105,26 +105,10 @@ launch_remote <- function(
105105 if (length(remote ) == 2L ) {
106106 platform <- remote [[" platform" ]]
107107 args <- remote [[" args" ]]
108- platform == " posit" && {
109- tools <- posit_tools()
110- is.environment(tools ) || stop(._ [[" posit_api" ]])
111- submit_job <- .subset2(tools , " .rs.api.launcher.submitJob" )
112- new_container <- .subset2(tools , " .rs.api.launcher.newContainer" )
113- cluster <- args [[" name" ]]
114- container <- new_container(args [[" image" ]])
115- cmds <- launch_remote(n )
116- lapply(
117- cmds ,
118- function (cmd ) submit_job(
119- sprintf(" mirai_daemon_%s" , random(3L )),
120- cluster = cluster ,
121- command = cmd ,
122- container = container
123- )
124- )
125- return (cmds )
126- }
127- stop(._ [[" platform_unsupported" ]])
108+ platform != " posit" && stop(._ [[" platform_unsupported" ]])
109+ tools <- posit_tools()
110+ is.environment(tools ) || stop(._ [[" posit_api" ]])
111+ return (posit_workbench_launch(n , args , tools ))
128112 }
129113
130114 command <- remote [[" command" ]]
@@ -588,3 +572,20 @@ posit_tools <- function() {
588572 is.function(feature_available ) && feature_available() || return ()
589573 tools
590574}
575+
576+ posit_workbench_launch <- function (n , args , tools ) {
577+ submit_job <- .subset2(tools , " .rs.api.launcher.submitJob" )
578+ new_container <- .subset2(tools , " .rs.api.launcher.newContainer" )
579+ cluster <- args [[" name" ]]
580+ container <- new_container(args [[" image" ]])
581+ cmds <- launch_remote(n )
582+ lapply(cmds , function (cmd )
583+ submit_job(
584+ sprintf(" mirai_daemon_%s" , random(3L )),
585+ cluster = cluster ,
586+ command = cmd ,
587+ container = container
588+ )
589+ )
590+ cmds
591+ }
0 commit comments