-
Notifications
You must be signed in to change notification settings - Fork 153
feat(build): publish lib as a Lambda Layer #884
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
275f79f
to
e3fd639
Compare
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
|
||
const runtime = lambda.Runtime.ALL.find((r) => r.name === process.env.RUNTIME) ?? lambda.Runtime.NODEJS_14_X; | ||
|
||
const powerToolsPackageVersion = '1.0.1'; |
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.
Is this synced to the actual version published on NPM? If yes, how do we increment it when we 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.
no it's only to test and therefore on purpose set as a lower version than latest
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.
in release workflow it takes latest from latest tag https://github.com/awslabs/aws-lambda-powertools-typescript/pull/884/files#diff-39e8ac1723228023ce8c44a0a27a9ce7db36f9ddaf8404cbf2e16c648ad42705R42
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.
Perfect, thanks for the explanation.
Leaving the thread open so others can see the answer in case they have the same question
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
@@ -0,0 +1,32 @@ | |||
{ |
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.
Putting this comment here because the file above called is a binary and doesn't allow comments:
Do we need this layer-publisher/[email protected]
???
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.
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.
for now yes since my PR there is not merged yet : aws-samples/cdk-lambda-powertools-python-layer#52
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.
Gotcha, thanks for the explanation
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
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, I have left a series of comments which you have already addressed.
Thanks a lot for the work you've done on this. We all know having Layers is very important for the long term sustainability of the project so I just want to acknowledge your contribution.
From my side the last thing to agree is the naming of the Layer between:
AWSLambdaPowertoolsNodeJS
(current name in the PR)AWSLambdaPowertoolsTypeScript
On one hand I understand the current choice since that's the name of the AWS Lambda runtime. If I were looking at the Layer in isolation (i.e. from the console etc.) this name would not leave any doubt about the fact that it's compatible with that runtime. Also this name makes the JS support unambiguous.
On the other hand I personally prefer the AWSLambdaPowertoolsTypeScript
option for the following reasons:
- In the context of a Lambda Layer compatibility is already expressed by the
Compatible runtimes
field - This name is in line with the rest of the branding we are using here and elsewhere
- We should clarify that this project can be unambiguously used with both JS & TS Lambda functions elsewhere, not in the name of the layer.
Would like however to hear the opinions of the rest of the maintainers as well as @heitorlessa before moving forward.
1714919
to
810e0dc
Compare
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
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
* chore: broke up pr workflow & measure package size * chore: explicitly set packages where to run cmds * fix: added missing dependency to examples/sam * added cache in workflow * chore: updated workflow + removed env var from command * chore: updated action version * fix: removed redundant env variable
…owertools-typescript into feat/layerPublisher
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.
Fixed merge conflicts
Description of your changes
This PR aims to add the capability to publish safely AWS Lambda PowerTools for TypeScript.
TODO list:
How to verify this change
Test layer publisher
Build layer manually in your account:
cd layer-publisher npm ci npm run cdk deploy
Then you can use the layer shown as cfn output.
Or you can use the e2e tests that will:
e2e-tests-layer-nodejs
Test in github action
check https://github.com/flochaz/aws-lambda-powertools-typescript/actions/runs/2718610199
Diff with Powertools for Python version
The only difference with Python version for publishing layer is the way we do e2e tests:
Canary
stack launching a Lambda Function (as a CustomResource) which consume the published layer in the same CDK App. This canary function deployed in their beta and prod account will use the layer and throw exception if any issue found making the stack deployment fail.layer-publisher
cdk app contains aJest
test that wille2e-tests-layer-nodejs
Related issues, RFCs
Issue number: #826
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.