r-lambda-workflow
r-lambda-workflow copied to clipboard
Rscript execution error
RESPONSE=$(/opt/R/bin/Rscript /opt/runtime.R $EVENT_DATA)
When you run the lamda function the output from the console in AWS says "Rscript execution error: No such file or directory" eventhough it is in the /opt/R/bin directory.
Could you send more details of how you run lambda?
When I first ran setup_r_instance, the script fails at:
print("Connecting to server")
connection = Ssh(ip = my_server_ip, key_path = key_path)
It just says connection failed, so I just logged on to the AWS EC2 instance manually and run the build_runtime and build_r scripts by hand. No problems doing this, and then I installed them as layers into a custom lambda function. No issues there.
The problem happens when you run the lambda function. Does the zipping of the layer (R.zip) possible mess up the internal paths of R? I wonder...
Is there a place where we can see what runtime environments look like for a lambda function? That is, what does the directory structure look like and where are things placed, etc? I created the R zip file with the bootstrap and also without the bootstrap so I could edit the bootstrap myself to see if I could debug better.
Anyway, just trying different things. I am also using a ubuntu 18.04 instance.
- I don't know, why
setup_r_instance.pyfails. You can try switching todevelopbranch and running script with a flag-d- it should print more information. - It seems that you uploaded bare R as a layer.
build_runtime.shscript should zip R together withbootstrapandruntime.Rfiles intoruntime.ziparchive. Please check, if a file that you upload to AWS includesRdirectory and those two files.
@clemizurieta I encountered the issue of seeing "connection failed" when running the script, to fix it I had to modify Security Groups inbound rules in the ec2 console and create a custom tcp rule that allows any ip to ssh using port 22.