Skip to content

Commit

Permalink
no Rscript
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Oct 8, 2024
1 parent 92dec7d commit 95a5ea8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* Return a status and status code from `pop()` etc.
* New internal function `as_monad()` makes error reporting more consistent.
* Use `path.expand()` on local log files.
* Switch to `Rscript`.
* Print session info from `crew_worker()` before attempting to dial into `mirai`.
* Add `asyncdial = FALSE` back to `mirai::daemon()` call.
* Deprecate `local_log_directory` and `local_log_join` in favor of `crew_options_local()` and the `options_local` argument.
Expand Down
2 changes: 1 addition & 1 deletion R/crew_launcher.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#' using `launcher$async$eval()` and expect a `mirai` task object
#' as the return value.
#' @param r_arguments Optional character vector of command line arguments
#' to pass to `Rscript` (non-Windows) or `Rscript.exe` (Windows)
#' to pass to `R` (non-Windows) or `R.exe` (Windows)
#' when starting a worker. Example:
#' `r_arguments = c("--vanilla", "--max-connections=32")`.
#' @examples
Expand Down
4 changes: 2 additions & 2 deletions R/crew_launcher_local.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ crew_class_launcher_local <- R6::R6Class(
launch_worker = function(call, name, launcher, worker, instance) {
bin <- if_any(
tolower(Sys.info()[["sysname"]]) == "windows",
"Rscript.exe",
"Rscript"
"R.exe",
"R"
)
path <- file.path(R.home("bin"), bin)
private$.log_prepare()
Expand Down
4 changes: 2 additions & 2 deletions vignettes/plugins.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ custom_launcher_class <- R6::R6Class(
inherit = crew::crew_class_launcher,
public = list(
launch_worker = function(call, name, launcher, worker, instance) {
bin <- file.path(R.home("bin"), "Rscript")
bin <- file.path(R.home("bin"), "R")
processx::process$new(
command = bin,
args = c(self$r_arguments, "-e", call),
Expand Down Expand Up @@ -205,7 +205,7 @@ result$result[[1]]
#> [1] "192.168.0.2 27336"
```

Please use the result to verify that the task really ran on a worker as intended. The process ID above should agree with the one from the handle ([except on Windows](https://github.com/r-lib/processx/issues/364) because the actual R process may be different from the `Rscript.exe` process created first). In addition, if the worker is running on a different computer, the worker IP address should be different than the local IP address. Since our custom launcher creates local processes, the IP addresses are the same in this case, but they should be different for a [SLURM](https://slurm.schedmd.com/) or [AWS Batch](https://aws.amazon.com/batch/) launcher.
Please use the result to verify that the task really ran on a worker as intended. The process ID above should agree with the one from the handle ([except on Windows](https://github.com/r-lib/processx/issues/364) because the actual R process may be different from the `R.exe` process created first). In addition, if the worker is running on a different computer, the worker IP address should be different than the local IP address. Since our custom launcher creates local processes, the IP addresses are the same in this case, but they should be different for a [SLURM](https://slurm.schedmd.com/) or [AWS Batch](https://aws.amazon.com/batch/) launcher.

```r
getip::getip(type = "local")
Expand Down

0 comments on commit 95a5ea8

Please sign in to comment.