You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, thanks for creating this tool. I like the simplicity.
On my project I'm using Java, so I already have build tooling in place via mvn package. This produces a single JAR that contains several lambda functions.
Consequently I'd like to be able to do something like this:
#!/bin/bashset -e
# build JAR and upload to S3
mvn clean package
aws s3 cp target/myproj-with-deps.jar s3://mybucket/myproj.jar
# use kappa to register lambdas
kappa --config lambda/func1.yml deploy
kappa --config lambda/func2.yml deploy
I have a quick and dirty version of the above working on my fork. I augmented the lambda section of the config to support an option code block. If this block is present, the S3 keys are set in the create_function and update_function_code calls. For example:
---
name: hellolambda:
# new optional section - if present, no ZIP is created and S3 code is usedcode:
bucket: mybucketkey: myproj.jar description: Hello Catshandler: com.bitmechanic.foo.LambdaHello::handleRequestruntime: java8memory_size: 128timeout: 10
One consequence of my current implementation is that the config file is not generated in the S3 case, as this is done as part of the ZIP bundling. This is what I'd expect, as I'm not relying on kappa to bundle my code for me, so I wouldn't expect configuration manifests to be injected into my JAR.
Would you entertain a PR with this work?
I'm open to feedback on the YAML changes. I also implemented this by factoring out all the ZIP stuff into a separate class in function.py such there are S3Code and ZipCode classes. Function.update and Function.create delegate to these classes.
Before I submit a PR I need to clean things up, write docs, etc. But before I got too far I wanted to open up the conversation here and get preliminary feedback on the enhancement.
Thanks!
The text was updated successfully, but these errors were encountered:
@coopernurse Sounds like a great idea! I'd be happy to take a look at such a pr :) Your initial implementation looks good, lets see how it works in code and I can give further feedback then :)
First off, thanks for creating this tool. I like the simplicity.
On my project I'm using Java, so I already have build tooling in place via
mvn package
. This produces a single JAR that contains several lambda functions.Consequently I'd like to be able to do something like this:
I have a quick and dirty version of the above working on my fork. I augmented the
lambda
section of the config to support an optioncode
block. If this block is present, the S3 keys are set in thecreate_function
andupdate_function_code
calls. For example:One consequence of my current implementation is that the config file is not generated in the S3 case, as this is done as part of the ZIP bundling. This is what I'd expect, as I'm not relying on kappa to bundle my code for me, so I wouldn't expect configuration manifests to be injected into my JAR.
Would you entertain a PR with this work?
I'm open to feedback on the YAML changes. I also implemented this by factoring out all the ZIP stuff into a separate class in
function.py
such there areS3Code
andZipCode
classes.Function.update
andFunction.create
delegate to these classes.Before I submit a PR I need to clean things up, write docs, etc. But before I got too far I wanted to open up the conversation here and get preliminary feedback on the enhancement.
Thanks!
The text was updated successfully, but these errors were encountered: