-
Feature Request
-
Resolution: Unresolved
-
Undefined
-
None
-
2.5
-
False
-
-
False
Summary
Please remove unnecessary Python dependencies from the ansible.controller and ansible.netcommon bindeps.txt files.
Details
When building execution environments (EE) from Red Hat's multi-stream minimal images (e.g. ansible-automation-platform/ee-minimal-rhel8/9) the minimum version of ansible-core that is supported is 2.16 (see the [Red Hat Ansible Automation Execution Environment Life Cycle document|https://access.redhat.com/support/policy/updates/ansible-automation-platform-execution-environments).] And ansible-core 2.16 uses Python 3.11.
When trying to build the ansible.controller and ansible.netcommon collection in to such a minimal EE the bindeps.txt files for both collections pull in Python 38 and 39 files. See https://github.com/ansible/awx/blob/devel/awx_collection/bindep.txt and https://github.com/ansible-collections/ansible.netcommon/blob/main/bindep.txt.
For ansible.controller:
# This is a cross-platform list tracking distribution packages needed by tests;
# see https://docs.openstack.org/infra/bindep/ for additional information.python38-pytz [platform:centos-8 platform:rhel-8]# awxkit
python38-requests [platform:centos-8 platform:rhel-8]
python38-pyyaml [platform:centos-8 platform:rhel-8]
For ansible.netcommon:
# This is a cross-platform list tracking distribution packages needed by tests;
# see https://docs.openstack.org/infra/bindep/ for additional information.gcc-c++ [doc test platform:rpm]
libyaml-devel [test platform:rpm]
libyaml-dev [test platform:dpkg]# ansible-pylibssh
gcc [compile platform:rpm]
libssh-dev [compile platform:dpkg]
libssh-devel [compile platform:rpm]
python3-Cython [compile platform:fedora-35 platform:rhel-9]
# 3.9 Cython doesn't seem to be available on our centos-8 images
# But I'm not sure why we would need it anyway?
# python39-Cython [compile platform:centos-8 platform:rhel-8]# ncclient
python3-six [platform:centos-9 platform:rhel-9]
python39-six [platform:centos-8 platform:rhel-8]
python3-lxml [platform:centos-9 platform:rhel-9]
python39-lxml [platform:centos-8 platform:rhel-8]# paramiko
findutils [compile platform:centos-8 platform:rhel-8]
gcc [compile platform:centos-8 platform:rhel-8]
make [compile platform:centos-8 platform:rhel-8]
python3-cffi [platform:centos-9 platform:rhel-9]
python39-cffi [platform:centos-8 platform:rhel-8]
python3-cryptography [platform:centos-9 platform:rhel-9]
python39-cryptography [platform:centos-8 platform:rhel-8]
python3-pycparser [platform:centos-9 platform:rhel-9]
python39-pycparser [platform:centos-8 platform:rhel-8]
These Python 38 and 39 dependencies are not needed to successful use the collections with ansible-core 2.16+ and therefore should be removed since they are just inflating the size of the EE artificially.
If you look at how Red Hat builds their own supported EEs (e.g. ansible-automation-platform-25/ee-supported-rhel8) then it's apparent that they also remove the dependencies during the build process. See the Containerfile: https://catalog.redhat.com/software/containers/ansible-automation-platform-25/ee-supported-rhel8/650a568071ef4510aa484727?container-tabs=dockerfile
# HACK THE GIBSON!! - https://github.com/ansible/ansible-builder/issues/207 # NOTE(pabelanger): We really need a denylist for bindep.txt, until we update # collections upstream manually remove python38 RPMs. RUN sed -i.orig '/python38.*/d;/python39.*/d;/python3-.*/d;/dnf/d' /tmp/src/bindep.txt && \