Due to change made in the following pr https://github.com/aws-cloudformation/cloudformation-cli-python-plugin/pull/193, we cannot update our resources to use the new cloudformation-cli-python-plugin versions as git is not installed in the new base image. Hence, pip fails to clone the repo and install the requirements.
This fails in non-obvious ways as well:
[2022-11-22T21:58:19Z] DEBUG - Caught downstream error
Traceback (most recent call last):
File "/Users/<user>/Dev/datadog-cloudformation-resources/datadog-monitors-monitor-handler/.venv/lib/python3.10/site-packages/rpdk/python/codegen.py", line 306, in _docker_build
logs = docker_client.containers.run(
File "/Users/<user>/Dev/datadog-cloudformation-resources/datadog-monitors-monitor-handler/.venv/lib/python3.10/site-packages/docker/models/containers.py", line 876, in run
raise ContainerError(
docker.errors.ContainerError: Command '/bin/bash -c "pip install --no-cache-dir --no-color --disable-pip-version-check --upgrade --requirement /project/requirements.txt --target /project/build"' in image 'public.ecr.aws/lambda/python:3.7' returned non-zero exit status 1
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/<user>/Dev/datadog-cloudformation-resources/datadog-monitors-monitor-handler/.venv/lib/python3.10/site-packages/rpdk/core/cli.py", line 100, in main
args.command(args)
File "/Users/<user>/Dev/datadog-cloudformation-resources/datadog-monitors-monitor-handler/.venv/lib/python3.10/site-packages/rpdk/core/submit.py", line 15, in submit
project.submit(
File "/Users/<user>/Dev/datadog-cloudformation-resources/datadog-monitors-monitor-handler/.venv/lib/python3.10/site-packages/rpdk/core/project.py", line 636, in submit
self._add_resources_content_to_zip(zip_file)
File "/Users/<user>/Dev/datadog-cloudformation-resources/datadog-monitors-monitor-handler/.venv/lib/python3.10/site-packages/rpdk/core/project.py", line 664, in _add_resources_content_to_zip
self._plugin.package(self, zip_file)
File "/Users/<user>/Dev/datadog-cloudformation-resources/datadog-monitors-monitor-handler/.venv/lib/python3.10/site-packages/rpdk/python/codegen.py", line 227, in package
self._build(project.root)
File "/Users/<user>/Dev/datadog-cloudformation-resources/datadog-monitors-monitor-handler/.venv/lib/python3.10/site-packages/rpdk/python/codegen.py", line 244, in _build
self._docker_build(base_path)
File "/Users/<user>/Dev/datadog-cloudformation-resources/datadog-monitors-monitor-handler/.venv/lib/python3.10/site-packages/rpdk/python/codegen.py", line 325, in _docker_build
raise DownstreamError("Error running docker build") from e
rpdk.core.exceptions.DownstreamError: Error running docker build
Our Cloudformation resources pull in their dependencies from a common package by specifying the common packages git url in the requirements file.
Due to change made in the following pr https://github.com/aws-cloudformation/cloudformation-cli-python-plugin/pull/193, we cannot update our resources to use the new
cloudformation-cli-python-plugin
versions asgit
is not installed in the new base image. Hence,pip
fails to clone the repo and install the requirements.This fails in non-obvious ways as well: