Skip to content
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

Closed
wants to merge 11 commits into from

Conversation

paulolai
Copy link
Contributor

@paulolai paulolai commented Oct 17, 2018

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.

@lox
Copy link
Contributor

lox commented Oct 17, 2018

Thanks @paulolai! My main concern here is change of handler.handle. I wonder if we should keep that the same for consistency with previous versions?

Makefile Outdated
# Makefile based on https://sahilm.com/makefiles-for-golang/

BINARY := buildkite-agent-metrics
VERSION ?= vlatest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lox
Copy link
Contributor

lox commented Oct 17, 2018

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.

@lox
Copy link
Contributor

lox commented Oct 17, 2018

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

@paulolai
Copy link
Contributor Author

paulolai commented Oct 17, 2018 via email

@paulolai
Copy link
Contributor Author

paulolai commented Oct 17, 2018

@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:
paulolai#1 - fix up the files for the AWS package
paulolai#2 - add support for reading the agent token from SSM

@paulolai paulolai closed this Oct 17, 2018
@paulolai paulolai reopened this Oct 17, 2018
@paulolai
Copy link
Contributor Author

This is replaced by #59

@paulolai paulolai closed this Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants