Sign inSign up

jsinghm/aws-lambda-r

By jsinghm

Updated almost 4 years ago

Custom R Runtime for AWS Lambda

Image
0

10K+

jsinghm/aws-lambda-r repository overview

AWS Lambda R Runtime

This Dockerfile and R code is a fork of https://github.com/mdneuzerling/r-on-lambda. David's blog post on this topic can be viewed here.

This Dockerfile implements a custom R runtime for AWS Lambda containers as described here.

Usage

To use your R functions with this container, simply create a new Dockerfile and use:

FROM jsinghm/aws-lambda-r:latest

as the base container. Then, create an R file with the function(s) you want to call, i.e.

# myfunctions.R
r_lambda_call <- function(arg) {
    list("passed" = as.character(arg))
}

and COPY the R file into the $LAMBDA_TASK_ROOT in your container:

# Dockerfile
COPY myfunctions.R ${LAMBDA_TASK_ROOT}/

Now just add a CMD line with the corresponding file.function syntax:

# Dockerfile
CMD ["myfunctions.r_lambda_call"]

Alternatively, this can be added in the Lambda console.

An example of the full custom Dockerfile is:

FROM jsinghm/aws-lambda-r:latest

COPY myfunctions.R ${LAMBDA_TASK_ROOT}/

CMD ["myfunctions.r_lambda_call"]

Tag summary

Content type

Image

Digest

sha256:3c469c05f

Size

29.8 MB

Last updated

almost 4 years ago

docker pull jsinghm/aws-lambda-r