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

Call resources from within the R script? #26

Open
brorio opened this issue Nov 7, 2018 · 2 comments
Open

Call resources from within the R script? #26

brorio opened this issue Nov 7, 2018 · 2 comments

Comments

@brorio
Copy link

brorio commented Nov 7, 2018

I assume that the R script in the Lambda has access to the AWS OS it's running on so theoretically it could use for example Clodyr's R library aws.s3 and fetch files from s3.

# get file as raw vector
get_object("mtcars.Rdata", bucket = "my_bucket")

Then you don't have to pass it thru Python and also you avoid rewriting your existing R code base. Or am I missing something? Is this not possible?

@MikeBadescu
Copy link
Member

  • We need Python to call R from within the AWS lambda container (since AWS lambda calls a Python function).
  • EC2 machines already have AWS CLI installed so it is easy to use (and up to date)
  • On the local machine, one could use the cloudyr packages. However, they did not (and still do not) provide all the functionality needed to set up all the AWS services (not only S3)
  • The AWS CLI tools are maintained by AWS and tested extensively

Thus, I made the decision not to make the R code dependent on any cloudyr packages (although I use them heavily in other projects). This has the additional advantage that keeps the number of libraries loaded by R at a minimum, leaving more space in the deployment package (zip ) for R packages and files provided by the user.

@brorio
Copy link
Author

brorio commented Nov 7, 2018

Yes, you have a point there with the size of the deployment package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants