- Update
holy-lambda
version inbb.edn
anddeps.edn
. - Use
hl:update-bb-tasks
to update the tasks.
- Update
holy-lambda
version inbb.edn
anddeps.edn
. - Use
hl:update-bb-tasks
to update the tasks.
Update holy-lambda
version in bb.edn
and deps.edn
.
-
In this release
:envs
property from:ctx
object has been removed to prevent cases, where the credentials are exposed in CloudWatch.To get the
:envs
please use(System/getenv "ENVIRONMENT_VARIABLE")
instead.For cases where the env was passed in
agent-native-payloads
use following helper:(defn get-env [env & [ctx]] (or (get ctx env) (System/getenv env)))
(defn LambdaFunction [{:keys [ctx event]}] (let [hl-entrypoint (get-env ctx "HL_ENTRYPOINT")] (println hl-entrypoint)))
-
Bump
holy-lambda
dependency inbb.edn
anddeps.edn
:
{:deps {...
io.github.FieryCod/holy-lambda {:mvn/version "0.6.3"}}
- Add a
holy-lambda
dependency inbb.edn
**bb.edn**
```clojure
{:deps {...
io.github.FieryCod/holy-lambda {:mvn/version "0.6.2"}}
```
- Update the
:sha
version ofio.github.FieryCod/holy-lambda-babashka-tasks
toe6c47274a2bfc7576a9da0ccdbc079c1e83bee17
.
**bb.edn**
```clojure
{:deps {io.github.FieryCod/holy-lambda-babashka-tasks
{:git/url "https://github.com/FieryCod/holy-lambda"
:deps/root "./modules/holy-lambda-babashka-tasks"
:sha "e6c47274a2bfc7576a9da0ccdbc079c1e83bee17"}}}
```
- Add
hl:update-bb-tasks
inbb.edn
.
**bb.edn**
```clojure
:tasks {:requires ([holy-lambda.tasks])
hl:docker:run holy-lambda.tasks/hl:docker:run
hl:native:conf holy-lambda.tasks/hl:native:conf
hl:native:executable holy-lambda.tasks/hl:native:executable
hl:babashka:sync holy-lambda.tasks/hl:babashka:sync
hl:compile holy-lambda.tasks/hl:compile
hl:doctor holy-lambda.tasks/hl:doctor
hl:clean holy-lambda.tasks/hl:clean
hl:update-bb-tasks holy-lambda.tasks/hl:update-bb-tasks
hl:version holy-lambda.tasks/hl:version}}
```
New version of the backend (0.6.2) doesn't ship the holy-lambda
artifact, therefore you have to pack the holy-lambda
yourself.
Migrating to new backend version:
-
Reference a new layer version ARN in
template.yml
-
Add a local layer that points to
.holy-lambda/bb-clj-deps
. -
Run
bb hl:babashka:sync
to populate.holy-lambda/bb-clj-deps
.
**Example:**
```yml
BabashkaDepsLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: BabashkaDepsLayer
ContentUri: ./.holy-lambda/bb-clj-deps
ExampleLambdaFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: ExampleLambdaFunction
Handler: com.company.example-lambda.core.ExampleLambda
CodeUri: src
Events:
HelloEvent:
Type: HttpApi
Properties:
ApiId: !Ref ServerlessHttpApi
Path: /
Method: GET
Layers:
- arn:aws:lambda:eu-central-1:443526418261:layer:holy-lambda-babashka-runtime-amd64:3
- !Ref BabashkaDepsLayer
```
- Deploy!
The new version of HL removes the hl:sync
step, therefore the development should be faster now.
To take the advantage of the new tasks release follow these steps.
- Remove the following properties from
bb.edn
-:mvn/local-repo
-:build/clj-alias
-:runtime/entrypoint
- Replace
:tasks
with the following set of tasks:
```clojure
:tasks {:requires ([holy-lambda.tasks])
hl:docker:run holy-lambda.tasks/hl:docker:run
hl:native:conf holy-lambda.tasks/hl:native:conf
hl:native:executable holy-lambda.tasks/hl:native:executable
hl:babashka:sync holy-lambda.tasks/hl:babashka:sync
hl:compile holy-lambda.tasks/hl:compile
hl:doctor holy-lambda.tasks/hl:doctor
hl:clean holy-lambda.tasks/hl:clean
hl:version holy-lambda.tasks/hl:version}}
```
- Replace the
:sha
inbb.edn
with the newest tag version:eb299bf6e380bcc8e484e80f8f16363bc5deb41c
- Remove
:mvn/local-repo
property fromdeps.edn
- Replace
:uberjar
alias indeps.edn
with the following:clojure {:uberjar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.303"}} :exec-fn hf.depstar/uberjar :exec-args {:aot ["<VALUE_OF_ENTRYPOINT>"] :main-class "<VALUE_OF_ENTRYPOINT>" :jar ".holy-lambda/build/output.jar" :jvm-opts ["-Dclojure.compiler.direct-linking=true" "-Dclojure.spec.skip-macros=true"]}}}
- Add
:build/compile-cmd
property withclojure -X:uberjar
command in string. - Rename
:runtime
to:backend
property in bb.edn.
Babashka backend now supports arm64
and amd64
architectures on Amazon Linux 2
.
ℹ️ The old layer holy-lambda-babashka-runtime is now deprecated
instead one of the following layers should be used:
The difference between both versions is in cold starts, where arm64
has at least 100ms cold start improvement.
Additionally for downloading pods & clojure deps the new bb hl:babashka:sync
is used.
ℹ️ ARM64 version requires a arm64/aarch64 version of holy-lambda-builder
Babashka runtime requires additional environment variable (previously Entrypoint
) now HL_ENTRYPOINT
.
DockerHub version of fierycod/graalvm-native-image
builder has been deprecated.
Use new holy-lambda-builder
.
See here