holy-lambda

Patrix 2022-08-02T09:07:03.253189Z

hi all.. first foray into holy-lambda. Got a couple of questions. Context: trying to create a Lambda function for my clojure code, preferably using graalvm. 1. I'm on an M1 Mac. While I can modify the docker image under bb.edn's :holy-lambda/options parameter and successfully build an aarch64 native executable with bb hl:native:executable, running sam local invoke ExampleLambdaFunction fails because it's using an amd64 docker image, while my native executable is aarch64. If I try to build an amd64 native executable, well I ran out of patience after waiting 2 hours for the 2nd step (analysis) of the hl:compile... 2. So ok I've given up on running it locally, no big deal. I want to deploy it. Same problem though ,seems that whatever runtime holy-lambda or sam is choosing is amd64-only, does not support aarch64. 3. So fiiine, I'm going to build a codebuild/codepipeline to just build the thing in AWS and deploy it, skip my local machine. Errr...... has anyone tried this before? sam's own pipeline bootstrap and init seemed to be working until I realized it doesn't actually build the native executable so of course nothing can be deployed. And before I try and go figure it out on my own, just wanted to check if that work has already been done by someone, somewhere.... 4. failing all that, well if I could just use the babashka serverless runtime, that would work well too I suppose and skip all the above issues. My only issue would be about how to properly including my dependencies (clojurewerkz.money and its own dependency on joda.money) when using babashka...

❤️ 1
Patrix 2022-08-02T10:51:47.201509Z

ok, in template.yaml, if I change the Runtime property to provided.al2 then I can run this on arm64, after also adding the Architectures property. Some progress!

Patrix 2022-08-02T10:54:26.181949Z

ok so, back to #1 then, I can run it on arm64 and deploy it using sam, and figure out pipelines later.

Patrix 2022-08-02T13:24:20.103219Z

(the conclusion is: it pays to read documentation!)

❤️ 1
Karol Wójcik 2022-08-02T15:48:01.631259Z

Oh yes! I’m happy you have figured it out! Good for you!

Patrix 2022-08-03T01:53:33.917699Z

thanks for all the hard work @karol.wojcik, glad I don't have to figure out all these details by myself lol

Patrix 2022-08-03T11:16:05.808259Z

OK and now I solved #3, after I figured out codebuild under arm64 + a few things I needed to install on the default Amazon Linux 2 image (clojure, babashka mainly), so this code can now be automatically deployed after a git push

❤️ 1
Patrix 2022-08-03T11:16:14.768329Z

maybe I'm the one who should write a blog post about it lol

Karol Wójcik 2022-08-03T11:16:30.026479Z

Oh yes. Would be cool.

Karol Wójcik 2022-08-03T11:17:37.980439Z

I know many people are using HL, but I always was too shy to ask users for a blog post :>

🤣 1