aws-solutions / aws-control-tower-customizations

The Customizations for AWS Control Tower solution combines AWS Control Tower and other highly-available, trusted AWS services to help customers more quickly set up a secure, multi-account AWS environment using AWS best practices.
https://docs.aws.amazon.com/controltower/latest/userguide/cfct-overview.html
Apache License 2.0
354 stars 205 forks source link

Reduce warnings from CodeBuild projects #169

Open andrewvdm opened 11 months ago

andrewvdm commented 11 months ago

Is your feature request related to a problem? Please describe. Not related to a problem/bug

Describe the feature you'd like As an enhancement, it would be great to see fewer warnings in the CodeBuild logs of CfCT builds associated with pip, dpkg and package sources.

CodeBuild log snippet:

dpkg-preconfigure: unable to re-open stdin:
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 21.0.1; however, version 23.0.1 is available.
You should consider upgrading via the '/root/.pyenv/versions/3.8.16/bin/python3.8 -m pip install --upgrade pip' command.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
cfn-lint 0.72.2 requires pyyaml>5.4, but you have pyyaml 5.3.1 which is incompatible.
aws-sam-cli 1.72.0 requires PyYAML==5.*,>=5.4.1, but you have pyyaml 5.3.1 which is incompatible.
flask 2.0.3 requires Jinja2>=3.0, but you have jinja2 2.11.3 which is incompatible.
aws-sam-cli 1.72.0 requires PyYAML==5.*,>=5.4.1, but you have pyyaml 5.3.1 which is incompatible.

Additional context Builds from the CodeBuild projects within the CfCT pipeline can be difficult to read when there are multiple warnings. Clearing up warnings messages will shorten troubleshooting in the event a build fails because of an error in one of the CFN templates.

mbevc1 commented 11 months ago

Perhaps we could also use latest Build image (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html), i.e. aws/codebuild/standard:7.0 or aws/codebuild/amazonlinux2-x86_64-standard:5.0