Closed mojimi closed 5 years ago
You do not need to compile it yourself. Just follow the example to use our provided layer:
cd example/
chmod 755 script.R
zip function.zip script.R
# current region
region=$(aws configure get region)
# latest runtime layer ARN for R 3.6.0
runtime_layer=$(aws lambda list-layer-versions --max-items 1 --no-paginate \
--layer-name arn:aws:lambda:${region}:131329294410:layer:r-runtime-3_6_0 \
--query 'LayerVersions[0].LayerVersionArn' --output text)
aws lambda create-function --function-name r-example \
--zip-file fileb://function.zip --handler script.handler \
--runtime provided --timeout 60 \
--layers ${runtime_layer} \
--role <role-arn>
@philipp94831 Thanks, I got that working to get testing but I need a specific R library (knitr), unfortunately I don't have enough knowledge to follow the instruction on README
I managed to got as far as succesfully running docker_build.sh but I don't see any output from it and where to go from here.
If you run
docker build -t lambda-r:build-${VERSION} --build-arg VERSION=${VERSION} .
you should have a valid base image with compiled R.
You can then build your own layer using docker. See https://github.com/bakdata/aws-lambda-r-runtime/blob/master/awspack/build.sh
If you run
docker build -t lambda-r:build-${VERSION} --build-arg VERSION=${VERSION} .
you should have a valid base image with compiled R.
You can then build your own layer using docker. See https://github.com/bakdata/aws-lambda-r-runtime/blob/master/awspack/build.sh
Yes I got a lambda-r image called build-3.6.0
So, do I need to run the build.sh inside the docker image? Its not clear to me I have little docker knowledge
Just run it in your machine
Just run it in your machine
Thanks, I eventually managed to do it on windows using git bash, but I had to export MSYS_NO_PATHCONV=1
so that it stopped converting paths.
If I get further than this I'll try to do a PR with instructions for Windows
Sorry but I don't understand what to do here, I'm on windows and I don't understand how to run these .sh files.
I see that you provided arns for your layers but I also don't understand how to download someone else's layer by arn.
Could you just provide a pre-compiled zip for the R custom runtime?
I tried running using git but I got the following error :