-
Notifications
You must be signed in to change notification settings - Fork 232
Lambda layer release automation #1814
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
Lambda layer release automation #1814
Conversation
github-draft: | ||
needs: | ||
- publish-lambda-layers | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: arn-file | ||
- run: >- | ||
gh release create "${GITHUB_REF_NAME}" | ||
--title="${GITHUB_REF_NAME}" | ||
--generate-notes | ||
--notes-file=".arn-file.md" | ||
--draft | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
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.
I'm creating a github release draft here, which can be adjusted and published manually later.
I did this so we have the arn table already in the draft.
example arn table created during testing
Elastic APM Python agent layer ARNs
Region | ARN |
---|---|
ap-northeast-1 | arn:aws:lambda:ap-northeast-1:627286350134:layer:jcal-dev-elastic-apm-python:6 |
ap-northeast-2 | arn:aws:lambda:ap-northeast-2:627286350134:layer:jcal-dev-elastic-apm-python:6 |
ap-northeast-3 | arn:aws:lambda:ap-northeast-3:627286350134:layer:jcal-dev-elastic-apm-python:6 |
ap-south-1 | arn:aws:lambda:ap-south-1:627286350134:layer:jcal-dev-elastic-apm-python:8 |
ap-southeast-1 | arn:aws:lambda:ap-southeast-1:627286350134:layer:jcal-dev-elastic-apm-python:6 |
ap-southeast-2 | arn:aws:lambda:ap-southeast-2:627286350134:layer:jcal-dev-elastic-apm-python:6 |
ca-central-1 | arn:aws:lambda:ca-central-1:627286350134:layer:jcal-dev-elastic-apm-python:6 |
eu-central-1 | arn:aws:lambda:eu-central-1:627286350134:layer:jcal-dev-elastic-apm-python:6 |
eu-north-1 | arn:aws:lambda:eu-north-1:627286350134:layer:jcal-dev-elastic-apm-python:6 |
eu-west-1 | arn:aws:lambda:eu-west-1:627286350134:layer:jcal-dev-elastic-apm-python:6 |
eu-west-2 | arn:aws:lambda:eu-west-2:627286350134:layer:jcal-dev-elastic-apm-python:6 |
eu-west-3 | arn:aws:lambda:eu-west-3:627286350134:layer:jcal-dev-elastic-apm-python:6 |
sa-east-1 | arn:aws:lambda:sa-east-1:627286350134:layer:jcal-dev-elastic-apm-python:6 |
us-east-1 | arn:aws:lambda:us-east-1:627286350134:layer:jcal-dev-elastic-apm-python:6 |
us-east-2 | arn:aws:lambda:us-east-2:627286350134:layer:jcal-dev-elastic-apm-python:6 |
us-west-1 | arn:aws:lambda:us-west-1:627286350134:layer:jcal-dev-elastic-apm-python:6 |
us-west-2 | arn:aws:lambda:us-west-2:627286350134:layer:jcal-dev-elastic-apm-python:6 |
WDYT?
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.
Looks great!
@elastic/apm-agent-python Not sure if related, but the windows tests seem to be stuck. |
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.
LGTM
Note: Some minor feedbacks
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.
LGTM, with some comments
.ci/publish-aws.sh
Outdated
--region="${region}" \ | ||
--layer-name="${FULL_LAYER_NAME}" \ | ||
--description="AWS Lambda Extension Layer for the Elastic APM Python Agent" \ | ||
--license="Apache-2.0" \ |
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.
As far as I see the apm-agent-python
uses a different license. But I don't know what's the one for the AWS lambda, can we clarify this?
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.
Good point. It's copied from apm-aws-lambda. I mistakenly assumed it will be the same.
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.
Any suggestions @basepi @beniwohli ?
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.
The Layer will be licensed with BSD 3 Clause, same as the agent: https://github.com/elastic/apm-agent-python/blob/main/LICENSE
(This is due to legacy code, Apache-2.0 would definitely be my preference but we're stuck with the original license.)
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.
.github/workflows/release.yml
Outdated
- uses: actions/download-artifact@v3 | ||
with: | ||
name: arn-file | ||
- run: >- |
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.
NIT: Use name for the step?
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.
- run: >- | |
- name: Create GitHub Draft Release | |
run: >- |
.github/workflows/release.yml
Outdated
if: always() | ||
needs: | ||
- publish-lambda-layers | ||
- release |
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.
What about github-draft
? Though, it has a dependency with publish-lambda-layers
, if added, will it work in the case github-draft
failed?
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.
- release | |
- publish-pypi | |
- github-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.
Looking great! Thank you for the fast turnaround here. Once we fix up the license and the other review feedback we should be good.
@basepi one last thing that I noticed while checking the license. what are the compatible runtimes? these are the available options:
can be one or more |
3.6, 3.7, 3.8, 3.9 (3.9 is an option too, it's just up at the top of the dropdown with the other "latest versions") |
Ah ups, thanks for double checking. I was looking at the example of the cli documentation https://awscli.amazonaws.com/v2/documentation/api/2.0.34/reference/lambda/publish-layer-version.html and the list is incomplete. |
|
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.
LGTM, with a minor comment
tags: | ||
- "v*.*.*" | ||
|
||
permissions: |
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.
NIT: if it is only used when creating the draft release, then it can be configured in that particular job rather than globally
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.
Windows tests are unrelated: #1817 |
Please do not merge this. #1796 needs to be reviewed and merged first, then we'll merge the automation. |
@reakaleek I updated #1796 to better handle the docker image paths, and added a Dockerfile. You'll want to rebase. Similar to the nodejs docker file, it expects an This will result in the same directory structure in both the lambda layer (mounted at Can you please add support for building and uploading the docker image? Thanks! |
33a23a1
to
489cffe
Compare
|
#1796 is merged, so you can rebase and merge this at your convenience. |
Actually, I have one more request, @reakaleek -- I think we should be testing I could throw a Edit: We already do |
Hi @basepi, Sorry for the delay, just got back from sick leave.
I agree, testing this regularly makes sense.
Can you elaborate on this more? Do you mean we run the script |
Co-authored-by: Adrien Mannocci <[email protected]>
63b7294
to
beeab0c
Compare
I extracted the build-distribution script into a reusable workflow and it's now called in the release and the test workflow. Let me know if this matches your suggestion/request. |
This should be perfect! Thank you. |
What does this pull request do?
Based on #1796
Relevant commit range: https://github.com/elastic/apm-agent-python/pull/1814/files/766da7e9b5e9f8c4d5067ffac3f4c4087ade5554..436c7f5c8748bfb7fffac092bd763e963dc2f3ac
How to test
With valid AWS credentials