-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f722bc2
commit 61ef69d
Showing
16 changed files
with
238 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +0,0 @@ | ||
#' @title Submit an AWS Batch job. | ||
#' @export | ||
#' @keywords internal | ||
#' @description Not a user-side function. For internal use only. | ||
#' @return HTTP response from submitting the job. | ||
#' @param args_client Named list of arguments to `paws.compute::batch()`. | ||
#' @param args_submit Named list of arguments to | ||
#' `paws.compute::batch()$submit_job()`. | ||
crew_aws_batch_launch <- function(args_client, args_submit) { | ||
client <- crew_aws_batch_client( | ||
config = args_client$config, | ||
args = args_client | ||
) | ||
do.call(what = client$submit_job, args = args_submit) | ||
} | ||
|
||
#' @title Terminate an AWS Batch job. | ||
#' @export | ||
#' @keywords internal | ||
#' @description Not a user-side function. For internal use only. | ||
#' @return HTTP response from submitting the job. | ||
#' @param args_client Named list of arguments to `paws.compute::batch()`. | ||
#' @param job_id Character of length 1, ID of the AWS Batch job to | ||
#' terminate. | ||
crew_aws_batch_terminate <- function(args_client, job_id) { | ||
client <- crew_aws_batch_client( | ||
config = args_client$config, | ||
args = args_client | ||
) | ||
client$terminate_job( | ||
jobId = job_id, | ||
reason = "terminated by crew controller" | ||
) | ||
} | ||
|
||
crew_aws_batch_client <- function(config, args) { | ||
UseMethod("crew_aws_batch_client") | ||
} | ||
|
||
#' @export | ||
crew_aws_batch_client.default <- function(config, args) { | ||
do.call(what = paws.compute::batch, args = args) | ||
} | ||
|
||
#' @export | ||
crew_aws_batch_client.crew_aws_batch_debug <- function(config, args) { | ||
list( | ||
submit_job = function( | ||
jobName, | ||
jobQueue, | ||
shareIdentifier, | ||
schedulingPriorityOverride, | ||
jobDefinition, | ||
parameters, | ||
containerOverrides, | ||
nodeOverrides, | ||
retryStrategy, | ||
propagateTags, | ||
timeout, | ||
tags, | ||
eksPropertiesOverride | ||
) { | ||
envir <- environment() | ||
lapply(X = names(formals()), FUN = function(arg) { | ||
force(get(x = arg, envir = envir)) | ||
}) | ||
for (arg in list(jobName, jobQueue, jobDefinition)) { | ||
crew::crew_assert( | ||
arg, | ||
length(.) == 1L, | ||
is.character(.), | ||
!anyNA(.), | ||
nzchar(.), | ||
nchar(.) < 100L | ||
) | ||
} | ||
list(jobId = jobName) | ||
}, | ||
terminate_job = function(jobId, reason) { | ||
envir <- environment() | ||
lapply(X = names(formals()), FUN = function(arg) { | ||
force(get(x = arg, envir = envir)) | ||
}) | ||
list(value = sample.int(n = 1e9L, size = 1L)) | ||
} | ||
) | ||
} | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.