This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-03
Channels
- # announcements (6)
- # babashka (14)
- # beginners (17)
- # biff (3)
- # calva (19)
- # circleci (3)
- # clj-on-windows (1)
- # cljdoc (21)
- # cljs-dev (6)
- # clojure (119)
- # clojure-australia (2)
- # clojure-europe (28)
- # clojure-france (3)
- # clojure-norway (12)
- # clojure-survey (2)
- # clojure-uk (7)
- # clojurescript (25)
- # core-typed (1)
- # cursive (11)
- # datomic (53)
- # emacs (14)
- # events (1)
- # gratitude (1)
- # holy-lambda (21)
- # integrant (2)
- # jobs (1)
- # jobs-discuss (3)
- # juxt (3)
- # kaocha (1)
- # lsp (17)
- # nbb (14)
- # off-topic (25)
- # pathom (11)
- # re-frame (24)
- # releases (1)
- # remote-jobs (2)
- # rewrite-clj (10)
- # shadow-cljs (11)
- # sql (3)
- # tools-build (6)
- # tools-deps (83)
- # vim (26)
- # xtdb (10)
I have a lambda with a Babashka runtime but it’s failing at runtime:
1: (ns example.core
2022-06-03T10:39:54.221+01:00 2: (:gen-class)
2022-06-03T10:39:54.221+01:00 3: (:require
2022-06-03T10:39:54.221+01:00 ^--- Could not find namespace: fierycod.holy-lambda.response.
2022-06-03T10:39:54.221+01:00 4: [babashka.pods :as pods]
2022-06-03T10:39:54.221+01:00 5: [fierycod.holy-lambda.response :as hr]
2022-06-03T10:39:54.221+01:00 6: [fierycod.holy-lambda.core :as h]
2022-06-03T10:39:54.221+01:00 7: ;; shipped with Babashka, hence no dependency in deps.edn
2022-06-03T10:39:54.221+01:00 8: [hiccup.core :as hiccup]))
the relevant bit in my template.yml
Resources:
BabashkaDepsLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: BabashkaDepsLayer
ContentUri: ./.holy-lambda/bb-clj-deps
BabashkaPodsLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: BabashkaPodsLayer
Description: Shared pods for stack.
ContentUri: ./.holy-lambda/pods
CompatibleRuntimes:
- provided.al2
ExampleLambdaFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: "ExampleLambda"
Runtime: provided.al2
Architectures:
- arm64
Handler: example.core.ExampleLambda
CodeUri: src
Timeout: 40
MemorySize: 2048
Events:
GetEvent:
Type: HttpApi
Properties:
ApiId: !Ref ExampleHttpApi
Path: /my-path/{id}
Method: GET
Layers:
- !Sub "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:holy-lambda-babashka-runtime-arm64:1"
- !Ref BabashkaDepsLayer
- !Ref BabashkaPodsLayer
I’d deployed the ARM runtime to my account via this link:
I’m using the HL layer, so it’s strange that the namespace fierycod.holy-lambda.response
is reported as something that cannot be found.
This is using HL 0.6.6 with latest tasks
The latest BB runtimes are not shipping HL directly.
ah, ok
You have to include the dependency in bb.edn 🙂
what do I need to include?
HL dependency
Hmmm - I already have it:
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
io.github.FieryCod/holy-lambda {:mvn/version "0.6.6"}
com.github.clj-easy/graal-build-time {:mvn/version "0.1.4"}}
I’ll try without the graal-build-time
I assume Clojure 1.11.1 is ok?
Do you have it in bb.edn?
Nothing explicit for HL in bb.deps
is there a specific pod I need to add?
You need to place io.github.FieryCod/holy-lambda {:mvn/version "0.6.6"}
in bb.edn deps
This is because for babashka runtime the BB is handling deps not HL tasks
> This is because for babashka runtime the BB is handling deps not HL. Which is something I always forget!
Perfect - that worked. Thank you @UJ1339K2B
You are very welcome 🙂