Skip to content

Commit

Permalink
Merge branch 'release/1.34.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Jul 29, 2024
2 parents 1c4c733 + e7399de commit e11031e
Show file tree
Hide file tree
Showing 31 changed files with 3,771 additions and 1,742 deletions.
50 changes: 21 additions & 29 deletions .github/workflows/covr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
covr:
if: "! contains(github.event.head_commit.message, '[ci skip]')"

timeout-minutes: 45
timeout-minutes: 120

runs-on: ubuntu-22.04
runs-on: ubuntu-latest

name: covr

Expand All @@ -17,48 +17,39 @@ jobs:

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
R_KEEP_PKG_SOURCE: yes
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
## Test in other locale (optional)
LANGUAGE: ${{ matrix.config.language }}
## R CMD check
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_LENGTH_1_CONDITION_: true
_R_CHECK_LENGTH_1_LOGIC2_: true
_R_CHECK_MATRIX_DATA_: true
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_SUGGESTS_ONLY_: true
_R_CHECK_THINGS_IN_TEMP_DIR_: true
RCMDCHECK_ERROR_ON: note
## Specific to futures
R_FUTURE_RNG_ONMISUSE: error

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v3
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
extra-packages: |
any::rcmdcheck
any::remotes
any::sessioninfo
any::covr
needs: check

- name: Install dependencies
run: |
install.packages(c("covr", "sessioninfo"))
remotes::install_deps(dependencies = TRUE)
install.packages(".", repos=NULL, type="source")
shell: Rscript {0}
Expand All @@ -76,7 +67,8 @@ jobs:
## https://app.codecov.io/gh/<org>/<repo>/settings
## 2. Set 'CODECOV_TOKEN' in GitHub Secrets:
## https://github.com/<org>/<repo>/settings/environments/
coverage <- covr::package_coverage()
coverage <- covr::package_coverage(quiet = FALSE)
print(coverage)
covr::codecov(coverage = coverage, token="${{secrets.CODECOV_TOKEN}}")
shell: Rscript {0}

42 changes: 17 additions & 25 deletions .github/workflows/future_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

timeout-minutes: 30

runs-on: ubuntu-22.04
runs-on: ubuntu-latest

name: future.plan=${{ matrix.future.plan }}

Expand All @@ -26,7 +26,6 @@ jobs:

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
## R CMD check
_R_CHECK_LENGTH_1_LOGIC2_: true
Expand All @@ -42,35 +41,28 @@ jobs:

- uses: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true

- name: Query R package dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v3
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
extra-packages: |
any::rcmdcheck
any::remotes
any::sessioninfo
any::covr
needs: check

- name: Install R package system dependencies (Linux)
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
- name: Install dependencies
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
remotes::install_deps(dependencies = TRUE)
install.packages(".", repos=NULL, type="source")
shell: Rscript {0}

- name: Install R package dependencies
- name: Session info
run: |
remotes::install_deps(dependencies = TRUE)
install.packages(".", repos=NULL, type="source") ## needed by parallel workers
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Install 'future.tests' and any backend R packages
Expand Down
35 changes: 10 additions & 25 deletions .github/workflows/revdepcheck-top.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

timeout-minutes: 30

runs-on: ubuntu-22.04
runs-on: ubuntu-latest

name: ${{ matrix.config.pkg }} (${{ matrix.config.r }}) ${{ matrix.config.label }}

Expand Down Expand Up @@ -51,36 +51,21 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v3
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
extra-packages: |
any::rcmdcheck
any::remotes
any::sessioninfo
any::covr
needs: check

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
install.packages(".", repos=NULL, type="source") ## needed by parallel workers
install.packages(".", repos=NULL, type="source")
install.packages("${{ matrix.config.pkg }}", dependencies=TRUE)
shell: Rscript {0}

Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Package: future
Version: 1.33.2
Version: 1.34.0
Title: Unified Parallel and Distributed Processing in R for Everyone
Imports:
digest,
globals (>= 0.16.1),
listenv (>= 0.8.0),
parallel,
parallelly (>= 1.34.0),
parallelly (>= 1.38.0),
utils
Suggests:
methods,
Expand Down Expand Up @@ -40,5 +40,5 @@ ByteCompile: TRUE
URL: https://future.futureverse.org, https://github.com/HenrikBengtsson/future
BugReports: https://github.com/HenrikBengtsson/future/issues
Encoding: UTF-8
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ importFrom(parallelly,isNodeAlive)
importFrom(parallelly,makeClusterMPI)
importFrom(parallelly,makeClusterPSOCK)
importFrom(parallelly,makeNodePSOCK)
importFrom(parallelly,serializedSize)
importFrom(parallelly,supportsMulticore)
importFrom(utils,capture.output)
importFrom(utils,file_test)
Expand Down
22 changes: 22 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Version 1.34.0 [2024-07-29]

## New Features

* Added support for backend maintainers to specify "cleanup" hook
functions on future strategies, which are called when switching
future plan. These hook functions are specified via the optional
`cleanup` attribute, cf. `attr(cluster, "cleanup")`.

## Performance

* Size calculation of globals is now done using the much faster
`parallelly::serializedSize()`.

## Bug Fixes

* `resolved()` for `ClusterFuture`:s would produce `Error:
'inherits(future, "Future")' is not TRUE` instead of an intended,
informative error message that the connection to the parallel
worker is broken.


# Version 1.33.2 [2024-03-23]

## Performance
Expand Down
4 changes: 2 additions & 2 deletions R/ClusterFuture-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ resolved.ClusterFuture <- function(x, run = TRUE, timeout = NULL, ...) {
isValid <- isConnectionValid(con)
if (!isValid) {
ex <- simpleError("Connection to the worker is corrupt")
msg <- post_mortem_cluster_failure(ex, when = "checking resolved from", node = node, future = future)
stop(FutureError(msg, future = future))
msg <- post_mortem_cluster_failure(ex, when = "checking resolved from", node = node, future = x)
stop(FutureError(msg, future = x))
}

if (is.null(timeout)) {
Expand Down
3 changes: 3 additions & 0 deletions R/cluster.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ cluster <- function(..., persistent = FALSE, workers = availableWorkers(), envir
}
class(cluster) <- c("cluster", "multiprocess", "future", "function")
attr(cluster, "init") <- TRUE
attr(cluster, "cleanup") <- function() {
ClusterRegistry(action = "stop")
}
attr(cluster, "tweakable") <- quote(c(makeClusterPSOCK_args(), "persistent"))
5 changes: 4 additions & 1 deletion R/multisession.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#'
#' @return
#' A \link{MultisessionFuture}.
#' If `workers == 1`, then all processing using done in the
#' If `workers == 1`, then all processing is done in the
#' current/main \R session and we therefore fall back to using a
#' lazy future. To override this fallback, use `workers = I(1)`.
#'
Expand Down Expand Up @@ -81,4 +81,7 @@ multisession <- function(..., workers = availableCores(), lazy = FALSE, rscript_
}
class(multisession) <- c("multisession", "cluster", "multiprocess", "future", "function")
attr(multisession, "init") <- TRUE
attr(multisession, "cleanup") <- function() {
ClusterRegistry(action = "stop")
}
attr(multisession, "untweakable") <- c("persistent")
6 changes: 6 additions & 0 deletions R/options.R
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@
#' R_FUTURE_OUTPUT_WINDOWS_REENCODE
#' future.journal
#' R_FUTURE_JOURNAL
#' R_FUTURE_GLOBALS_OBJECTSIZE_METHOD
#' future.globals.objectSize.method
#'
#' @name future.options
NULL
Expand Down Expand Up @@ -356,4 +358,8 @@ update_package_options <- function(debug = FALSE) {
## SETTINGS USED FOR DEPRECATING FEATURES
## future 1.22.0:
update_package_option("future.globals.keepWhere", mode = "logical", debug = debug)

## future 1.34.0:
update_package_option("future.globals.objectSize.method", mode = "character", debug = debug)
update_package_option("future.plan.cleanup.legacy", mode = "logical", debug = debug)
}
Loading

0 comments on commit e11031e

Please sign in to comment.