-
Notifications
You must be signed in to change notification settings - Fork 35
ci: automate ARN publishing #101
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
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
/test |
Prints a JSON skeleton to standard output without sending an API request
apm-lambda-extension/Makefile
Outdated
publish-layer-version \ | ||
--layer-name "${ELASTIC_LAYER_NAME}" \ | ||
--zip-file "fileb://./bin/extension.zip" \ | ||
--generate-cli-skeleton > $(AWS_FOLDER)/${AWS_DEFAULT_REGION} |
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.
--generate-cli-skeleton
will do nothing -> dry-run for now
unstash "arn-arm" | ||
unstash "arn-amd" |
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.
This is the trick to converge the outcome from the publishing stage for the two supported architectures (ARM and AMD64)
ifndef AWS_DEFAULT_REGION | ||
$(error AWS_DEFAULT_REGION is undefined) | ||
endif | ||
build-and-publish: validate-layer-name validate-aws-default-region |
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.
validate-*
are the goals to avoid duplication of missing arguments/env-variables in some other Make goals
test: | ||
go test extension/*.go -v | ||
env: | ||
ifndef GOARCH |
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.
Already defined above
apm-lambda-extension/Makefile
Outdated
release \ | ||
create $(BRANCH_NAME) \ | ||
--title '$(BRANCH_NAME)' \ | ||
--draft \ |
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.
This is only for testing purposes
create $(BRANCH_NAME) \ | ||
--title '$(BRANCH_NAME)' \ | ||
--draft \ | ||
--generate-notes \ |
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.
Automatically generate title and notes for the release, it works in conjunction with --notes-file
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.
Things look good on the publishing a list of ARNs front, so +1 there (although the jenkins build syntax isn't something I'm as familiar with, so I can't comment in depth on that)
One problem I noticed is the changes to the Makefile
appear to break the user-facing installer. If you look at this docs section you can see users have the self-service option of installing the extension by running a small Node.js command line program.
When running the program on the main
branch, it successfully builds and installs the Lambda extension (as expected). However, when we attempt to run it with this PR branch, it fails half way through with the following error.
$ AWS_DEFAULT_REGION=... AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... ./elastic-lambda.js install
//...
# building extension and publishing as layer
stdout: running cd .. && make build-and-publish
error: Command failed: cd .. && make build-and-publish
Makefile:81: *** BRANCH_NAME is undefined. Stop.
make: *** [build-and-publish] Error 2
I don't have any strong opinions on how we achieve this, but users being able to self serve by running this program is an important part of the this product.
Can we ensure that this functionality remains in place?
A misleading error when running the publish - PublishLayerVersion operation: The security token included in the request is invalid.
@v1v Looks like we cleared up the previous errors here -- huzzah! However, I'm now seeing a new error when running the installer -- specifically
I believe this is result of our changing the invocation of the The I'm unsure what the intent of this change is, but if I was trying to fix this I'd replace with the redirect (
Assuming |
$(MAKE) create-arn-file | ||
|
||
# Publish the given LAYER in the given AWS region | ||
publish: validate-layer-name validate-aws-default-region |
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.
This goal is uses in two different places:
- The traditional one when using
./elastic-lambda.js install
- The one to rollout the ARN in all the AWS regions, see
publish-in-all-aws-regions
I decided to refactor build-and-publish
in favour of avoiding running aws lambda
command in two different Make goals.
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.
Thanks for making those changes @v1v -- ./elastic-lambda.js build-and-publish
appears to be doing its thing again 👍
What
Publish the AWS lambda as an ARN for AWS users in various regions for
linux
andarm
.It happens when a new Git tag is created with the format
v.major.minor.patch
then:Refactored the Makefile to avoid duplicated code and added section in the
DEVELOPMENT.md
regarding this new release automation.Actions
Implementation details
Docs
See the doc to list all the AWS regions.
Test
Pipeline
Release notes
An example of the release notes that are generated in my forked repo (unfortunately the autogenerated does not work in my end while working on a PR)
https://github.com/v1v/apm-aws-lambda/releases/tag/untagged-a2134f29781f369bef01
List all the AWS regions and publish (dry-run)
Local testing