bakdata / aws-lambda-r-runtime

Serverless execution of R code on AWS Lambda
https://medium.com/bakdata/running-r-on-aws-lambda-9d40643551a6
MIT License
144 stars 53 forks source link

docker_build results in error #44

Closed tioback closed 5 years ago

tioback commented 5 years ago

Hi,

I cloned the repository locally and ran docker_build.sh, but step 5 throws up this error:

The command '/bin/sh -c wget -q https://cran.r-project.org/src/base/R-3/R-${VERSION}.tar.gz && mkdir ${R_DIR} && tar -xf R-${VERSION}.tar.gz && mv R-${VERSION}/* ${R_DIR} && rm R-${VERSION}.tar.gz' returned a non-zero code: 8

More details:

Renatos-MacBook-Pro-2:aws-lambda-r-runtime renatopb$ ./docker_build.sh 3_6_0
Sending build context to Docker daemon  328.2kB
Step 1/9 : FROM lambci/lambda:build-provided
build-provided: Pulling from lambci/lambda
838b886eca89: Pull complete 
c57f92b37644: Pull complete 
c94065e4fef9: Pull complete 
Digest: sha256:4d400577d34d84a224264572e436151fbcdee45436f22ec1be26c7c7ec99811e
Status: Downloaded newer image for lambci/lambda:build-provided
 ---> 49b76ef13c9e
Step 2/9 : RUN yum install -q -y wget     readline-devel     xorg-x11-server-devel libX11-devel libXt-devel     curl-devel     gcc-c++ gcc-gfortran     zlib-devel bzip2 bzip2-libs     java-1.8.0-openjdk-devel
 ---> Running in 36cc3bb309ef
Package readline-devel-6.2-9.14.amzn1.x86_64 already installed and latest version
Package libX11-devel-1.6.0-2.2.12.amzn1.x86_64 already installed and latest version
Package libXt-devel-1.1.4-6.1.9.amzn1.x86_64 already installed and latest version
Package libcurl-devel-7.61.1-7.91.amzn1.x86_64 already installed and latest version
Package gcc-c++-4.8.5-1.22.amzn1.noarch already installed and latest version
Package gcc-gfortran-4.8.5-1.22.amzn1.noarch already installed and latest version
Package zlib-devel-1.2.8-7.18.amzn1.x86_64 already installed and latest version
Package bzip2-1.0.6-8.12.amzn1.x86_64 already installed and latest version
Package bzip2-libs-1.0.6-8.12.amzn1.x86_64 already installed and latest version
Removing intermediate container 36cc3bb309ef
 ---> 91d15e79072d
Step 3/9 : ARG VERSION=3.6.0
 ---> Running in cb6c95c5d2bd
Removing intermediate container cb6c95c5d2bd
 ---> d917d30523fe
Step 4/9 : ARG R_DIR=/opt/R/
 ---> Running in cc054eb53b4a
Removing intermediate container cc054eb53b4a
 ---> c2b9a80a08ce
Step 5/9 : RUN wget -q https://cran.r-project.org/src/base/R-3/R-${VERSION}.tar.gz &&     mkdir ${R_DIR} &&     tar -xf R-${VERSION}.tar.gz &&     mv R-${VERSION}/* ${R_DIR} &&     rm R-${VERSION}.tar.gz
 ---> Running in 1c7b50da850f
The command '/bin/sh -c wget -q https://cran.r-project.org/src/base/R-3/R-${VERSION}.tar.gz &&     mkdir ${R_DIR} &&     tar -xf R-${VERSION}.tar.gz &&     mv R-${VERSION}/* ${R_DIR} &&     rm R-${VERSION}.tar.gz' returned a non-zero code: 8
Renatos-MacBook-Pro-2:aws-lambda-r-runtime renatopb$

I'm running it on macOS Mojave 10.14.5 and docker 18.09.2.

Am I doing it wrong?

philipp94831 commented 5 years ago

Hi @tioback, it should work with 3.6.0. The underscores are just needed in the layer names as '.' is an unsupported character. I will update the documentation to make it more clear. Thanks for spotting this!

tioback commented 5 years ago

Thanks for the quick reply, Phillipp.

However, isn't that fixed by step 3/9?

Step 3/9 : ARG VERSION=3.6.0
 ---> Running in cb6c95c5d2bd
philipp94831 commented 5 years ago

This is just the default value. It is applied if you use docker build directly. However, the docker_build.sh script expects a value.

tioback commented 5 years ago

All ends well when you have the right help:

Running it with ./docker_build.sh 3.6.0 did it.

Step 9/9 : CMD mkdir -p /var/r/ &&     cp -r bin/ lib/ etc/ library/ doc/ modules/ share/ /var/r/
 ---> Running in d09e6a431cdc
Removing intermediate container d09e6a431cdc
 ---> e998f894872c
Successfully built e998f894872c
Successfully tagged lambda-r:build-3.6.0

Thanks a lot, @philipp94831 !