-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
chore(lambda-layer-awscli): install awscli with pip and requirements.txt #18800
chore(lambda-layer-awscli): install awscli with pip and requirements.txt #18800
Conversation
We are currently bundling the AWS CLI in the Lambda Layer and need a mechanism to automatically upgrade when new versions are released. This changes the way we bundle the AWS CLI, from using the install script to using pip to install from a `requirements.txt` file. This will enable dependabot to auto upgrade the version of the awscli specified in requirements.txt
Actually just realized that we need to update the hash function. |
|
||
# organize for self-contained usage | ||
RUN mv /opt/awscli /opt/awscli.tmp | ||
RUN pyver=$(python3 -c 'import sys; v = sys.version_info; print(f"{v[0]}.{v[1]}")') && \ | ||
mv /opt/awscli.tmp/lib/python${pyver}/site-packages /opt/awscli |
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 think if we don't do this, your statement of "this will work with any Python 3.x" runtime is going to be true. It's probably going to need to be the exact same Python version as the one that we used to install this, i.e. 3.7.
I'm saying that because I'm pretty sure the disk layout is going to look like this:
/opt/awscli/lib/python3.7/awscli
Can you confirm that, and see if there's something to be done about that?
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.
@rix0rrr The directory layout that is produced doesn't have that lib
folder at all. I also don't think doing version manipulation in the build image will have an impact on the version of python in the runtime environment.
But anyway I ended up adding integration tests for Python 3.6, 3.7, & 3.9.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
* origin/master: (27 commits) chore(eks): deprecate older versions of EKS (aws#18842) fix(tooling): update vscode devcontainer image (aws#18455) chore: npm-check-updates && yarn upgrade (aws#18832) chore(docs): Fix broken md links (aws#18384) chore(lambda-layer-awscli): install awscli with pip and requirements.txt (aws#18800) fix(aws-appsync): Strip unsupported characters from Lambda DataSource (aws#18765) feat(cfnspec): cloudformation spec v55.0.0 (aws#18827) docs(cfnspec): update CloudFormation documentation (aws#18826) chore(cxapi): plugin context provider limited by cx schema (aws#18709) feat(iotevents): add grant method to Input class (aws#18617) chore(cx-api): break circular dependencies (aws#18767) docs(core): clarify that `addOverride` does not change property casing (aws#18687) feat(s3-deployment): deploy data with deploy-time values (aws#18659) docs(cfnspec): update CloudFormation documentation (aws#18808) feat(cli): `cdk diff` works for Nested Stacks (aws#18207) docs(cfnspec): update CloudFormation documentation (aws#18783) chore(lambda-layer-awscli): add update mechanism for AWS CLI (aws#18780) chore(release): 1.143.0 feat(fsx): add support for FSx Lustre Persistent_2 deployment type (aws#18626) feat(amplify): support performance mode in Branch (aws#18598) ...
#18833) This PR follows up #18800 by turning on dependabot updates for `awscli` in `lambda-layer-awscli`. Currently the only other place we have pip dependencies are in our tests and the init templates. dependabot does currently look for security updates in all of our pip dependencies, this just turns on normal updates for this specific module. Need to follow up this PR by adding this process to the PR checklist and the contributing guide. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…txt (aws#18800) We are currently bundling the AWS CLI in the Lambda Layer and need a mechanism to automatically upgrade when new versions are released. This changes the way we bundle the AWS CLI, from using the install script to using pip to install from a `requirements.txt` file. This will enable dependabot to auto upgrade the version of the awscli specified in requirements.txt Also added integration tests to ensure that the AWS CLI is executable from within various Python runtimes. The `assetHash` has been updated to fingerprint the entire `layer` directory since we want to deploy a new version anytime anything in that directory changes, not just the Dockerfile. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
aws#18833) This PR follows up aws#18800 by turning on dependabot updates for `awscli` in `lambda-layer-awscli`. Currently the only other place we have pip dependencies are in our tests and the init templates. dependabot does currently look for security updates in all of our pip dependencies, this just turns on normal updates for this specific module. Need to follow up this PR by adding this process to the PR checklist and the contributing guide. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
We are currently bundling the AWS CLI in the Lambda Layer and need a
mechanism to automatically upgrade when new versions are released.
This changes the way we bundle the AWS CLI, from using the install
script to using pip to install from a
requirements.txt
file. This willenable dependabot to auto upgrade the version of the awscli specified in
requirements.txt
Also added integration tests to ensure that the AWS CLI is executable from within
various Python runtimes.
The
assetHash
has been updated to fingerprint the entirelayer
directory sincewe want to deploy a new version anytime anything in that directory changes, not just the
Dockerfile.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license