From 82e7fd48058ae4e005ebd539ac339a4af2c90f99 Mon Sep 17 00:00:00 2001 From: Tom Kwong Date: Tue, 3 Jan 2023 03:14:18 +0000 Subject: [PATCH 1/3] Update to Julia 1.8.4 and README doc --- Dockerfile | 10 +++++----- README.md | 14 +++++++++++++- 2 files changed, 18 insertions(+), 6 deletions(-) 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..87376ea 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,13 +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 ``` +Note that the `DOCKER_BUILDKIT` is required for using setting the executable flag +for `/var/runtime/bootstrap` file. + The script does not 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.) +So, just for the first time, the procedure may be a little awkward: +1. Run the deploy script above. The push 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! Feel free to raise an issue or PR if you would like to contribute to this From b0fcb9b2be71f8f411693d8a403ad6843a744c71 Mon Sep 17 00:00:00 2001 From: Tom Kwong Date: Tue, 3 Jan 2023 03:19:35 +0000 Subject: [PATCH 2/3] minor edit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 87376ea..b2a948f 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Hence, just for the first time, you must create the lambda function using your preferred approach (web interface, cloud formation, CDK, etc.) So, just for the first time, the procedure may be a little awkward: -1. Run the deploy script above. The push will fail but an image should be pushed to ECR. +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. From 0b51ed7d9ee77377af05225db9d74bbfb5420959 Mon Sep 17 00:00:00 2001 From: Tom Kwong Date: Tue, 3 Jan 2023 03:21:59 +0000 Subject: [PATCH 3/3] minor edit --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b2a948f..0aebc03 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ 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: +**Update Jan 2, 2023:** This repo has been updated to use the latest version of Julia (1.8.4). ## How it works @@ -53,11 +53,12 @@ DOCKER_BUILDKIT=1 sh scripts/deploy.sh julia-lambda latest Note that the `DOCKER_BUILDKIT` is required for using setting the executable flag for `/var/runtime/bootstrap` file. -The script does not deploy the lambda function unless it is already created. +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: -So, just for the first time, the procedure may be a little awkward: 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.