Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh worker environment after update #153

Merged
merged 10 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/check-hipercow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
HIPERCOW_VIGNETTE_ROOT: ${{ env.RUNNER_TEMP }}/hipercow

steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
HIPERCOW_VIGNETTE_ROOT: ${{ env.RUNNER_TEMP }}/hipercow

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: hipercow
Title: High Performance Computing
Version: 1.0.46
Version: 1.0.47
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
email = "[email protected]"),
person("Wes", "Hinsley", role = "aut"),
Expand Down
7 changes: 7 additions & 0 deletions R/environment.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ hipercow_environment_create <- function(name = "default", packages = NULL,
action <- if (exists) "Updated" else "Created"
cli::cli_alert_success("{action} environment '{name}'")
}

if (name == "rrq" && is_rrq_enabled(root)) {
cli::cli_alert_info("Refreshing existing rrq worker environments")
controller <- hipercow_rrq_controller(root)
## or rrq::rrq_worker_refresh(controller) in recent rrq
rrq_message_send("REFRESH", controller = controller)
}
}


Expand Down
10 changes: 10 additions & 0 deletions R/rrq.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,13 @@ hipercow_rrq_envir <- function(e) {
hipercow_rrq_offload_path <- function(root) {
offload_path <- file.path(root$path$rrq, "offload")
}


is_rrq_enabled <- function(root, call = parent.frame()) {
driver <- hipercow_driver_select(name = NULL, required = FALSE,
root = root, call = call)
if (!is.null(driver)) {
path_queue_id <- file.path(root$path$rrq, driver)
file.exists(path_queue_id)
}
}
2 changes: 1 addition & 1 deletion drivers/windows/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: hipercow.windows
Title: DIDE HPC Support for Windows
Version: 1.0.46
Version: 1.0.47
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
email = "[email protected]"),
person("Wes", "Hinsley", role = "aut"),
Expand Down
6 changes: 1 addition & 5 deletions vignettes/parallel.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vignette: >

```{r setup, include = FALSE}
source("common.R")
options(hipercow.timeout = 120)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably don't need this any more, but it doesn't matter either

vignette_root <- new_hipercow_root_path()
fs::file_copy("simulation.R", vignette_root)
set_vignette_root(vignette_root)
Expand All @@ -18,11 +19,6 @@ cleanup <- withr::with_dir(
new_directory = FALSE,
initialise = FALSE))
library(hipercow)

```

```{r, echo = FALSE, results = "asis"}
add_header()
```

# Task-level parallelism
Expand Down
4 changes: 0 additions & 4 deletions vignettes/troubleshooting.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ cleanup <- withr::with_dir(
initialise = TRUE))
```

```{r, echo = FALSE, results = "asis"}
add_header()
```

```{r}
library(hipercow)
```
Expand Down
Loading