File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -215,14 +215,22 @@ The lambda payload is unwrapped as named arguments to the R function to call, e.
215215
216216The lambda function returns whatever is returned by the R function as a JSON object with ` result ` as a root element.
217217
218+ ### Building custom layers
219+
218220In order to install additional R packages, you can create a lambda layer containing the libraries, just as in the second example.
219221You must use the the compiled package files.
220222The easiest way is to install the package with ` install.packages() ` and copy the resulting folder in ` $R_LIBS ` .
221223Using only the package sources does not suffice.
222224The file structure must be ` R/library/<my-library> ` .
223- See ` awspack/compile.sh ` for an example.
224225If your package requires system libraries, place them in ` R/lib/ ` .
225226
227+ You can use Docker for building your layer.
228+ You need to run ` ./docker_build.sh ` first.
229+ Then you can install your packages inside the container and copy the files to your machine.
230+ See ` awspack/ ` for an example.
231+ The ` build.sh ` script is used to run the docker container and copy sources to your machine.
232+ The ` entrypoint.sh ` script is used for installing packages inside the container.
233+
226234## Limitations
227235
228236AWS Lambda is limited to running with 3GB RAM and must finish within 15 minutes.
You can’t perform that action at this time.
0 commit comments