Fork me on GitHub
#holy-lambda
<
2022-08-02
>
Patrix09:08:03

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
Patrix10:08:47

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!

Patrix10:08:26

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

Patrix13:08:20

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

❤️ 1
Karol Wójcik15:08:01

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

Patrix01:08:33

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

Patrix11:08:05

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
Patrix11:08:14

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

Karol Wójcik11:08:30

Oh yes. Would be cool.

Karol Wójcik11:08:37

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

1