-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace eawsy/aws-lambda-go with aws-lambda-go #58
Conversation
Thanks @paulolai! My main concern here is change of |
Makefile
Outdated
# Makefile based on https://sahilm.com/makefiles-for-golang/ | ||
|
||
BINARY := buildkite-agent-metrics | ||
VERSION ?= vlatest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, after refreshing my memory on the scripts like https://github.com/buildkite/buildkite-agent-metrics/blob/master/.buildkite/steps/build-binary.sh, we've already got the building side of things pretty well covered I think. Does the Makefile add value? It seems to duplicate a lot of the stuff in there. |
I'd be fine to have a Makefile be the source of truth, but probably worth copying over some of the nuances from https://github.com/buildkite/buildkite-agent-metrics/blob/master/.buildkite/steps/build-binary.sh such as how the binary is carefully built to be static |
Oh, I didn't see those scripts there! I agree, there should only be one
source of truth.
…On Wed, Oct 17, 2018 at 3:27 PM Lachlan Donald ***@***.***> wrote:
I'd be fine to have a Makefile be the source of truth, but probably worth
copying over some of the nuances from
https://github.com/buildkite/buildkite-agent-metrics/blob/master/.buildkite/steps/build-binary.sh
such as how the binary is carefully built to be static
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#58 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AnYPoS0D7qASqO8aS0OCs90hsD7P-_mCks5ulrGXgaJpZM4XjBxT>
.
--
*P.S. We've launched a new blog to share the latest ideas and case studies
from our team. Check it out here: product.canva.com
<http://product.canva.com/>. ***
** <https://canva.com>Empowering the world
to design
Also, we're hiring. Apply here!
<https://about.canva.com/careers/>
<https://twitter.com/canva>
<https://facebook.com/canva> <https://au.linkedin.com/company/canva>
<https://instagram.com/canva>
|
Replaces github.com/eawsy/aws-lambda-go/service/lambda/runtime with github.com/aws/aws-lambda-go/lambda This uses the runningInLambda() function from https://github.com/bcongdon/corral/blob/2c8445a2388a9f33e44cd1bf16d252c4a13589a3/lambda.go#L27
The name is a bit long though. I'm tempted to just call it monitor instead.
45fa670
to
914279c
Compare
Added a reference to the build scripts which already exist from the README
@lox I've removed the Makefile, have switched back to handler.handle (note that you will still need to change the lambda runtime from python2.7 to go1.x ), updated the build scripts and bumped up the version number. I've removed build_lambda.sh as I removed eawsy/aws-lambda-go, instead I modified build_binaries.sh to manually create the package (renaming then zipping it). build_binaries.sh now no longer takes arguments, instead it always builds the darwin and linux arm64 binaries and creates the lambda package. It only requires BUILDKITE_BUILD_NUMBER to have been set. You will need to change your tooling to account for that. You normally use cloudformation, I don't know enough about that so I've included the TF file I've written for my own use as a reference, you should update your cloudformation file (update the runtime to go1.x from python2.7). I don't have buildkite-agent on my system to upload the artifacts, you'll need to test that part of the scripts yourself. The follow up PRs are in: |
This is replaced by #59 |
Replace github.com/eawsy/aws-lambda-go/service/lambda/runtime with github.com/aws/aws-lambda-go/lambda This now determines if it's running as a Lambda when the program is launched.
Also add in a makefile, update the documentation and an example tf file.
I've tested that this works for cloudwatch when ran locally and when ran as an AWS Lambda.