Skip to content

Commit

Permalink
options list and container overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Oct 9, 2024
1 parent 1e9728e commit 83262aa
Show file tree
Hide file tree
Showing 14 changed files with 342 additions and 596 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Description: In computationally demanding analysis projects,
'clustermq' by Schubert (2019) <doi:10.1093/bioinformatics/btz284>),
and 'batchtools' by Lang, Bischl, and Surmann (2017).
<doi:10.21105/joss.00135>.
Version: 0.0.6.9008
Version: 0.0.6.9010
License: MIT + file LICENSE
URL: https://wlandau.github.io/crew.aws.batch/,
https://github.com/wlandau/crew.aws.batch
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# crew.aws.batch 0.0.6.9008 (development)
# crew.aws.batch 0.0.6.9010 (development)

* Send both cancellation and termination requests to end jobs.
* Fix launcher bug/typo where parameters were supplied to container overrides.
* Add a new `all` argument to `terminate()` in the AWS Batch monitor.
* Add `r_arguments` to accept command line arguments to R.
* Support `options_metrics`.
* Reduce argument clutter with `crew_options_aws_batch()`. Supports direct inputs for CPUs, GPUs, and memory without having to specify a complicated `containerOverrides` list.

# crew.aws.batch 0.0.6

Expand Down
10 changes: 6 additions & 4 deletions R/crew_controller_aws_batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ crew_controller_aws_batch <- function(
processes = NULL,
r_arguments = c("--no-save", "--no-restore"),
options_metrics = crew::crew_options_metrics(),
aws_batch_config = list(),
aws_batch_credentials = list(),
options_aws_batch = crew.aws.batch::crew_options_aws_batch(),
aws_batch_config = NULL,
aws_batch_credentials = NULL,
aws_batch_endpoint = NULL,
aws_batch_region = NULL,
aws_batch_job_definition,
aws_batch_job_queue,
aws_batch_job_definition = NULL,
aws_batch_job_queue = NULL,
aws_batch_share_identifier = NULL,
aws_batch_scheduling_priority_override = NULL,
aws_batch_parameters = NULL,
Expand Down Expand Up @@ -92,6 +93,7 @@ crew_controller_aws_batch <- function(
processes = processes,
r_arguments = r_arguments,
options_metrics = options_metrics,
options_aws_batch = options_aws_batch,
aws_batch_config = aws_batch_config,
aws_batch_credentials = aws_batch_credentials,
aws_batch_endpoint = aws_batch_endpoint,
Expand Down
392 changes: 89 additions & 303 deletions R/crew_launcher_aws_batch.R

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions R/crew_options_aws_batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,20 @@
#' The `memory` argument can be `NULL`
#' to go with the defaults in the job definition. Ignored if
#' `container_overrides` is not `NULL`.
#' @param units_memory Character string, units of memory of the `memory`
#' @param memory_units Character string, units of memory of the `memory`
#' argument. Can be `"gigabytes"` or `"mebibytes"`.
#' Fargate instances can only be certain discrete values of mebibytes,
#' so please choose `memory_units = "mebibytes"` in that case.
#' @param config Named list, `config` argument of
#' `paws.compute::batch()` with optional configuration details.
#' @param credentials Named list. `credentials` argument of
#' `paws.compute::batch()` with optional credentials (if not already
#' provided through environment variables such as `AWS_ACCESS_KEY_ID`).
#' @param endpoint Character of length 1. `endpoint`
#' argument of `paws.compute::batch()` with the endpoint to send HTTP
#' requests.
#' @param region Character of length 1. `region` argument of
#' `paws.compute::batch()` with an AWS region string such as `"us-east-2"`.
#' @param share_identifier `NULL` or character of length 1.
#' For details, visit
#' <https://www.paws-r-sdk.com/docs/batch_submit_job/> and the
Expand Down Expand Up @@ -77,8 +87,8 @@
#' <https://www.paws-r-sdk.com/docs/batch_submit_job/> and the
#' "AWS arguments" sections of this help file.
crew_options_aws_batch <- function(
job_definition,
job_queue,
job_definition = "example",
job_queue = "example",
cpus = NULL,
gpus = NULL,
memory = NULL,
Expand Down
13 changes: 10 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,19 @@ library(crew.aws.batch)
controller <- crew_controller_aws_batch(
name = "my_workflow", # for informative job names
workers = 16,
tasks_max = 2, # to avoid reaching wall time limits
tasks_max = 2, # to avoid reaching wall time limits (if any exist)
seconds_launch = 600, # to allow a 10-minute startup window
seconds_idle = 60, # to release resources when they are not needed
processes = NULL, # See the "Asynchronous worker management" section below.
aws_batch_job_definition = "YOUR_JOB_DEFINITION_NAME",
aws_batch_job_queue = "YOUR_JOB_QUEUE_NAME"
options_aws_batch = crew_options_aws_batch(
job_definition = "YOUR_JOB_DEFINITION_NAME",
job_queue = "YOUR_JOB_QUEUE_NAME",
cpus = 2,
gpus = 0,
memory = 4,
memory_units = "gigabytes"
)
)
controller$start()
```
Expand Down
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ packages [`mirai`](https://github.com/shikokuchuo/mirai),

# Installation

| Type | Source | Command |
|-------------|------------|--------------------------------------------------------------------------------|
| Release | CRAN | `install.packages("crew.aws.batch")` |
| Development | GitHub | `remotes::install_github("wlandau/crew.aws.batch")` |
| Type | Source | Command |
|----|----|----|
| Release | CRAN | `install.packages("crew.aws.batch")` |
| Development | GitHub | `remotes::install_github("wlandau/crew.aws.batch")` |
| Development | R-universe | `install.packages("crew.aws.batch", repos = "https://wlandau.r-universe.dev")` |

# Documentation
Expand Down Expand Up @@ -329,12 +329,19 @@ library(crew.aws.batch)
controller <- crew_controller_aws_batch(
name = "my_workflow", # for informative job names
workers = 16,
tasks_max = 2, # to avoid reaching wall time limits
tasks_max = 2, # to avoid reaching wall time limits (if any exist)
seconds_launch = 600, # to allow a 10-minute startup window
seconds_idle = 60, # to release resources when they are not needed
processes = NULL, # See the "Asynchronous worker management" section below.
aws_batch_job_definition = "YOUR_JOB_DEFINITION_NAME",
aws_batch_job_queue = "YOUR_JOB_QUEUE_NAME"
options_aws_batch = crew_options_aws_batch(
job_definition = "YOUR_JOB_DEFINITION_NAME",
job_queue = "YOUR_JOB_QUEUE_NAME",
cpus = 2,
gpus = 0,
memory = 4,
memory_units = "gigabytes"
)

)
controller$start()
```
Expand Down Expand Up @@ -411,7 +418,7 @@ citation("crew.aws.batch")
To cite package 'crew.aws.batch' in publications use:

Landau WM (????). _crew.aws.batch: A Crew Launcher Plugin for AWS
Batch_. R package version 0.0.6,
Batch_. R package version 0.0.6.9010,
https://github.com/wlandau/crew.aws.batch,
<https://wlandau.github.io/crew.aws.batch/>.

Expand All @@ -420,7 +427,7 @@ A BibTeX entry for LaTeX users is
@Manual{,
title = {crew.aws.batch: A Crew Launcher Plugin for AWS Batch},
author = {William Michael Landau},
note = {R package version 0.0.6,
note = {R package version 0.0.6.9010,
https://github.com/wlandau/crew.aws.batch},
url = {https://wlandau.github.io/crew.aws.batch/},
}
Expand Down
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Edmondson
Fargate
FitzJohn
GCP
vCPUs
GPU
Gábor
Gao
Expand Down
81 changes: 3 additions & 78 deletions man/crew_class_launcher_aws_batch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 83262aa

Please sign in to comment.