This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-09
Channels
- # aleph (1)
- # announcements (7)
- # asami (1)
- # beginners (44)
- # calva (54)
- # cherry (24)
- # cider (6)
- # clj-kondo (19)
- # cljsrn (27)
- # clojure (119)
- # clojure-europe (61)
- # clojure-gamedev (38)
- # clojure-germany (7)
- # clojure-nl (1)
- # clojure-norway (104)
- # clojure-portugal (4)
- # clojure-spec (4)
- # clojure-uk (1)
- # clojurescript (38)
- # cursive (18)
- # datomic (11)
- # emacs (9)
- # events (1)
- # fulcro (4)
- # holy-lambda (7)
- # introduce-yourself (7)
- # jobs (1)
- # malli (6)
- # off-topic (4)
- # pathom (4)
- # pedestal (16)
- # podcasts-discuss (1)
- # polylith (27)
- # portal (17)
- # releases (2)
- # shadow-cljs (46)
- # squint (1)
- # xtdb (9)
Hi folks, relatively new to dealing with custom runtimes + layers in general with AWS, and having an issue with which it is not apparent that I'm doing anything wrong. Attempting to deploy a babashka backend using SAM Here's a snippet from my template.yml
BabashkaDepsLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: BabashkaDepsLayer
ContentUri: ./.holy-lambda/bb-clj-deps
AcquisitionLambdaFn:
Type: AWS::Serverless::Function
Properties:
FunctionName: AcquisitionLambdaFn
Handler: com.nyaya.acquisition.core.ExampleLambda
CodeUri: src
Upon attempting to deploy with sam deploy --guided --profile my_profile
I get the following error
Building codeuri: /home/jam/acquisition/src runtime: provided metadata: {} architecture: x86_64 functions: AcquisitionLambdaFn
Running CustomMakeBuilder:CopySource
Running CustomMakeBuilder:MakeBuild
Build Failed
Error: CustomMakeBuilder:MakeBuild - Makefile not found at /home/jam/acquisition/src/Makefile
and
Error: Unable to upload artifact ./.holy-lambda/bb-clj-deps referenced by ContentUri parameter of BabashkaDepsLayer resource.
Bucket does not exist
As far as I can tell everything is in line with the example. I figured there's probably something invisible here such as the example includes a code signing ARN, or something like that. I don't receive any prompt that suggests SAM realises it's using a local folder for the CodeUri/ContentUriHow did you setup the project? Let’s start from the beginning.
By following this https://fierycod.github.io/holy-lambda/#/babashka-backend-tutorial dependencies are stated in bb.edn
Morning @U04A9F0Q1GU - I couldn’t see the Layers
section of your Function properties. See step 3 in the tutorial.
I also had to add the Runtime entry, as the template no longer specifies a global default.
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Example basic lambda using `holy-lambda` micro library
Parameters:
Timeout:
Type: Number
Default: 40
MemorySize:
Type: Number
Default: 128
Entrypoint:
Type: String
Default: com.company.example-lambda.core
Globals:
Function:
Timeout: !Ref Timeout
MemorySize: !Ref MemorySize
Environment:
Variables:
HL_ENTRYPOINT: !Ref Entrypoint
Resources:
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
Runtime: provided.al2
Layers:
- arn:aws:lambda:eu-west-1:12345678:layer:holy-lambda-babashka-runtime-amd64:1
- !Ref BabashkaDepsLayer
Replace the line arn:aws:lambda:us-east-1:12345678:layer:holy-lambda-babashka-runtime-amd64:1
with your own physical ID
sam local invoke ExampleLambdaFunction
Invoking com.company.example-lambda.core.ExampleLambda (provided.al2)
Downloading arn:aws:lambda:eu-west-1:12345678:layer:holy-lambda-babashka-runtime-arm64 [####################################] 22724528/22724528
BabashkaDepsLayer is a local Layer in the template
Image was not found.
Building image.....................................................................................................................................................
Skip pulling image and use local one: samcli/lambda:provided.al2-arm64-60629b788a5cc330ec446efa7.
Mounting /Users/lowecg/tmp/holy-lambda-example/src as /var/task:ro,delegated inside runtime container
END RequestId: ae66b1a9-4da6-42fa-ad05-71ce388794de
REPORT RequestId: ae66b1a9-4da6-42fa-ad05-71ce388794de Init Duration: 0.14 ms Duration: 54.48 ms Billed Duration: 55 ms Memory Size: 128 MB Max Memory Used: 128 MB
Regarding the “Bucket does not exist” error, can you try adding --resolve-s3
to the sam guided deploy?Hi - thanks for your responses. Issue is resolved - I had not provided a bucket for the source! I was under the impression that the error was due to it not finding the artifact in my local directory since the messages were right next to each other and related - thanks for your patience!
You’re welcome and glad to hear you’re up and running.
Thank you @U01RXDR9F4M for helping out the newcomers!