# Lambda or Cloud Functions -- eventually possible?

**URL:** <https://discourse.julialang.org/t/lambda-or-cloud-functions-eventually-possible/39128>\
**Category:** Web Stack\
**Tags:** question\
**Created:** [May 8, 2020, 7:00pm UTC](https://discourse.julialang.org/t/lambda-or-cloud-functions-eventually-possible/39128 "2020-05-08T19:00:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [May 8, 2020, 7:00pm UTC](https://discourse.julialang.org/t/lambda-or-cloud-functions-eventually-possible/39128/1 "2020-05-08T19:00:57Z")

</div>

Things like [AWS Lambda](https://aws.amazon.com/lambda/) and/or [Google Cloud Functions](https://cloud.google.com/functions) are basically just replacements for traditionally lightweight tasks that smart people realized could be done without a server. Right now, you can create these serverless functions in languages you might expect: Javascript, Python, Go, etc.

I am wondering if those who know more about this might be able to comment on the possibility of using Julia in this capacity. I imagine that one big hurdle is startup/compilation time?

---

<div class="post-metadata">

**Author:** ![yoh-meyers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yoh-meyers/32/14700_2.png) [@yoh-meyers](https://discourse.julialang.org/u/yoh-meyers)\
**Post date:** [May 9, 2020, 10:44am UTC](https://discourse.julialang.org/t/lambda-or-cloud-functions-eventually-possible/39128/2 "2020-05-09T10:44:03Z")

</div>

Might want to check [GitHub - samoconnor/AWSLambda.jl: AWS Lambda interface for Julia](https://github.com/samoconnor/AWSLambda.jl)

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [May 9, 2020, 2:32pm UTC](https://discourse.julialang.org/t/lambda-or-cloud-functions-eventually-possible/39128/3 "2020-05-09T14:32:41Z")

</div>

That looks quite abandoned.

---

<div class="post-metadata">

**Author:** ![yoh-meyers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yoh-meyers/32/14700_2.png) [@yoh-meyers](https://discourse.julialang.org/u/yoh-meyers)\
**Post date:** [May 10, 2020, 8:43am UTC](https://discourse.julialang.org/t/lambda-or-cloud-functions-eventually-possible/39128/4 "2020-05-10T08:43:42Z")

</div>

Is best I found doing search for myself, but agree.

But as any open source project, would suggest:

- contacting owner and asking to be new maintainer
- forking library and creating newer more maintained version that would benefit at least all of us reading this topic

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [May 10, 2020, 10:10am UTC](https://discourse.julialang.org/t/lambda-or-cloud-functions-eventually-possible/39128/5 "2020-05-10T10:10:34Z")

</div>

@tbeason I had similar thoughts. It would be amazing to call Julia functions by an AWS Lambda. Function as a Service.  
This thread may be useful:

> [@Creating a custom Julia AWS Layer Runtime](https://discourse.julialang.org/t/creating-a-custom-julia-aws-layer-runtime/18166/25):
>
> There was also a package described on here recently which approached this problem. I forget what it was - can anyone remind me? Probably [Fezzik.jl](https://github.com/TsurHerman/Fezzik)

Avik Sengupta pointed out to me that this had been looked at, however there is a limit on the payload size for lambda functions.  
As I remember there are intrinsically supported languages for lambdas. If you want to add your own you must install it - such as Julia. Then you hit the size limit.  
That was some time ago - perhaps you coud revisit this,.

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [May 10, 2020, 10:13am UTC](https://discourse.julialang.org/t/lambda-or-cloud-functions-eventually-possible/39128/6 "2020-05-10T10:13:12Z")

</div>

Looks like a larger package IS possible

> **[Deploy Node.js Lambda functions with .zip file archives - AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-package.html)**
>
> Your AWS Lambda function’s code comprises a .js or .mjs file containing your function’s handler code, together with any additional packages and modules your code depends on. To deploy this function code to Lambda, you use a deployment package . This...

A deployment package is a ZIP archive that contains your function code and dependencies. You need to create a deployment package if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK. You can upload the package directly to Lambda, or you can use an Amazon S3 bucket, and then upload it to Lambda. If the deployment package is larger than 50 MB, you must use Amazon S3.

---

<div class="post-metadata">

**Author:** ![allomorphy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/allomorphy/32/19913_2.png) [@allomorphy](https://discourse.julialang.org/u/allomorphy)\
**Post date:** [December 2, 2020, 2:57pm UTC](https://discourse.julialang.org/t/lambda-or-cloud-functions-eventually-possible/39128/7 "2020-12-02T14:57:43Z")

</div>

👋 all

I am very curious to see any reports of julia deployment using this new packaging of container to lambda announced yesterday:

> **[AWS Lambda now supports container images as a packaging format](https://aws.amazon.com/about-aws/whats-new/2020/12/aws-lambda-now-supports-container-images-as-a-packaging-format/)**

Would love to learn if this is possible 😊

---

<div class="post-metadata">

**Author:** ![iamed2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iamed2/32/215082_2.png) [@iamed2](https://discourse.julialang.org/u/iamed2)\
**Post date:** [December 2, 2020, 8:41pm UTC](https://discourse.julialang.org/t/lambda-or-cloud-functions-eventually-possible/39128/8 "2020-12-02T20:41:47Z")

</div>

The first step I see to effective Julia on Lambda is publishing a Julia Lambda container image with a runtime interface client to ECR Public. From what I can tell, this means a base install of Julia running a loop over HTTP [Lambda Runtime API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html) calls, fetching events and executing them and then reporting status. A service for running that HTTP server locally is available [here](https://github.com/aws/aws-lambda-runtime-interface-emulator). An example of the thing we’d need to implement in Julia is available [here](https://github.com/aws/aws-lambda-python-runtime-interface-client).

---

<div class="post-metadata">

**Author:** ![harris-chris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/harris-chris/32/23877_2.png) [@harris-chris](https://discourse.julialang.org/u/harris-chris)\
**Post date:** [April 19, 2021, 10:03pm UTC](https://discourse.julialang.org/t/lambda-or-cloud-functions-eventually-possible/39128/9 "2021-04-19T22:03:12Z")

</div>

Hello all

I’ve created a package to make this a little easier here: [https://github.com/harris-chris/julia-for-aws-lambda](https://github.com/harris-chris/julia-for-aws-lambda)  
As others have said, there’s no native runtime for Julia in AWS Lambda, meaning the function has to be containerized, but this works fine. The only minor pain point is that if the container is cold-started then it takes a little longer than usual (say, 2s) to start. If warm-started it is very fast. I’m currently working to bring in PackageCompiler.jl, which should bring cold-start times down to that of warm-start times.
