diff --git a/Dockerfile b/Dockerfile index 9252878..25a5650 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,10 +5,10 @@ FROM public.ecr.aws/lambda/provided:al2 # Download and install Julia WORKDIR /usr/local RUN yum install -y tar gzip \ - && curl -LO https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.3-linux-x86_64.tar.gz \ - && tar xf julia-1.5.3-linux-x86_64.tar.gz \ - && rm julia-1.5.3-linux-x86_64.tar.gz \ - && ln -s julia-1.5.3 julia + && curl -LO https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.4-linux-x86_64.tar.gz \ + && tar xf julia-1.8.4-linux-x86_64.tar.gz \ + && rm julia-1.8.4-linux-x86_64.tar.gz \ + && ln -s julia-1.8.4 julia # Install application WORKDIR /var/task @@ -30,7 +30,7 @@ ENV JULIA_DEPOT_PATH /tmp/.julia:/var/task/.julia # Install bootstrap script WORKDIR /var/runtime -COPY bootstrap . +COPY --chmod=0755 bootstrap . # Create an empty extensions directory WORKDIR /opt/extensions diff --git a/README.md b/README.md index 21b495d..0aebc03 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ As of December 2020, AWS supports running Lambda functions from any container image. This is an example of deploying Julia program as AWS lambda. +**Update Jan 2, 2023:** +This repo has been updated to use the latest version of Julia (1.8.4). + ## How it works The `Dockerfile` uses an AWS provided base image. It is more convenient because their @@ -44,12 +47,22 @@ quickly build/tag/push a Docker image and deploy the function on AWS. For example: ``` -sh scripts/deploy.sh julia-lambda latest +DOCKER_BUILDKIT=1 sh scripts/deploy.sh julia-lambda latest ``` -The script does not deploy the lambda function unless it is already created. +Note that the `DOCKER_BUILDKIT` is required for using setting the executable flag +for `/var/runtime/bootstrap` file. + +The script cannot deploy the lambda function unless it is already created. Hence, just for the first time, you must create the lambda function using your preferred approach (web interface, cloud formation, CDK, etc.) +The AWS interface requires an ECR Image URI, however. You can just do +this: + +1. Run the deploy script above. The script will fail but an image should be pushed to ECR. +2. Create the function with the ECR image URI. + +From this point on, you just need to run the deploy script for any update. ## Contributions welcome!