Fork me on GitHub
#holy-lambda
<
2022-10-15
>
viesti20:10:16

Whoa, got a reitit+muuntaja+malli based Lambda native-image compiled and it runs even! • First started with the default java11 runtime, seems that muuntaja makes by default a java.io.ByteArrayInputStream ring response, bytes are good for traditional HTTP servers, but for a lambda adapter, a String :body would be better, could add a String encoder to muuntaja. • Then grabbed the bb.edn tasks from holy-lambda basic example, replaced the uberjar build command since I had a tools.build based version. The thing here was to keep producing uberjar into .holy-lambda/build/output.jar to keep holy-lambda working, maybe worth a documentation line here. • Then, since I used some aws-sdk java libraries in the project (for now for S3 presigning), started a whack-a-mole on adding enough --initialize-at-build-time classes until the thing worked 😄

❤️ 1
Karol Wójcik11:10:18

Have you looked into hl-ring-adapter? Retailic runs on the same stack for almost a year now.

viesti20:10:27

it seems that holy-lambda wants to find AWS credentials quite badly, but I'm not quite sure why, but made my way with export HL_NO_PROFILE=true, maybe the idea is that https://github.com/FieryCod/holy-lambda/blob/master/modules/holy-lambda-babashka-tasks/src/holy_lambda/tasks.clj#L405 is provided a AWS environment for example to be able to go invoke AWS services while running traces with agent compiled, maybe?

Karol Wójcik11:10:35

HL is for now hacked to use credentials from the profile. We should for sure extend it to support all possible creds providers. The reason we need the profile is to register all paths for GraalVM agent. HL_NO_PROFILE should be used exactly on occassions when you already have the creds provided in the environment variables.

viesti11:10:30

> register all paths for the GraalVM agent > I think I didn't yet get this Is the idea to run the lambda with enough similar creds as in real aws environment to be able do invocations while running the agent loaded?

viesti11:10:44

hacking totally ok, holy-lambda has accomplished a lot, just trying to wrap my head around stuff :)

viesti20:10:33

maybe I could have been spared by whack-a-mole by just having aws creds at hand, maybe I could do traces on a laptop, then use them in CI :thinking_face: