station-x / lambda-r-survival-stats Goto Github PK
View Code? Open in Web Editor NEWEnables creating a AWS Lambda package that bundles R and a Python Lambda function for calculating survival statistics
License: Apache License 2.0
Enables creating a AWS Lambda package that bundles R and a Python Lambda function for calculating survival statistics
License: Apache License 2.0
Where is the R script and how do I load the R libraries. Also how can I pass parameters to the R Script....do we send the input parameters to Python and Python sends it to R. I am unable to understand where do R and its related libraries come into the picture as I do not see a single script.R file which is supposed to take the input parameters and do the calculation using known R libraries and output the result back to the API
Thanks for sharing your code on how to use R on AWS.
Unfortunately if i follow your code with the current Lambda-AMI i get the following error when testing it on a new AWS instance:
[ec2-user@***]$ python ./test_handler.py
Traceback (most recent call last):
File "./test_handler.py", line 17, in <module>
import handler
File "/home/ec2-user/handler.py", line 29, in <module>
ctypes.cdll.LoadLibrary(os.path.join('lib', file))
File "/usr/lib64/python2.7/ctypes/__init__.py", line 438, in LoadLibrary
return self._dlltype(name)
File "/usr/lib64/python2.7/ctypes/__init__.py", line 360, in __init__
self._handle = _dlopen(self._name, mode)
OSError: lib/libRrefblas.so: undefined symbol: xerbla_
I tried googling for it but unfortunately do not understand how to fix this...
Any idea?
While running the script it throws the following error:
cp: cannot stat '/usr/lib64/libblas.so.3': No such file or directory
cp: cannot stat '/usr/lib64/liblapack.so.3': No such file or directory
I tried installing these libraries using
sudo yum -y install blas
sudo yum -y install lapack
And then ran the script again... still same error
The script installs the current R version 3.3.2 - dont know if this helps
Might that have something to do with openBlas VS blas?
https://bodhi.fedoraproject.org/updates/rkward-0.6.5-3.fc24%20rpy-2.8.3-1.fc24%20R-3.3.2-2.fc24/edit
Thanks for this great worked example!
When I run the build file I get an error - I believe rpy2 is looking for python3, not 2.7.
Thoughts about where in the build script I might change this?
Collecting rpy2
Downloading https://files.pythonhosted.org/packages/f1/98/c7652cc9d7fc0afce74d2c30a52b9c9ac391713a63d037e4ab8feb56c530/rpy2-2.9.4.tar.gz (194kB)
100% |████████████████████████████████| 204kB 13.4MB/s
Complete output from command python setup.py egg_info:
rpy2 is no longer supporting Python < 3. Consider using an older rpy2 release when using an older Python release.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-iPB2pw/rpy2/
I do not know how to apply Step 4 as mentioned here: https://aws.amazon.com/blogs/compute/extracting-video-metadata-using-lambda-and-mediainfo/
for our purposes.
I created the role for lambda_trust_policy and I skipped the DynamoDB related role creation as we are not doing anything with DynamoDB.
Then I execute this command:
--function-name MyAmazingLambda \
--runtime python2.7 \
--role LambdaMediaInfoExecutionRole \
--handler handler.lambda_handler \
--description "My Amazing Lambda Function" \
--timeout 30 \
--memory-size 1536 \
--zip-file fileb://lambda_r_survival.zip
but I get the following complaint:
When calling the CreateFunction operation: 1 validation error detected: Value 'LambdaMediaInfoExecutionRole' at 'role' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:aws:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+
Could you be so kind to specify more what needs to be done under Step 8: Deploy the Lambda function
so I do not encounter the above error?
Thank
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.