ansible / awx-ee

An Ansible execution environment for AWX project
https://quay.io/ansible/awx-ee
Other
137 stars 158 forks source link

Update `python_interpreter` to 3.11 #207

Closed austlane closed 1 month ago

austlane commented 1 year ago

Upgrades AWX-EE from Python 3.9 to Python 3.11. Bringing with it 3.11's speed improvements. https://docs.python.org/3/whatsnew/3.11.html

This also replaces python-unversioned-command with alternatives command -- as python-unversioned-command always links to python3.9 in EL9

Working in my local testing:

% ansible-builder create -v3 --context context --output-filename Dockerfile
% docker buildx build -f context/Dockerfile -t awx-ee:dev-py311 context --platform linux/amd64
% docker run -it --user=root awx-ee:dev-py311 bash

[root@2d078ce66bc3 runner]# ansible --version
ansible [core 2.15.0]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.2 (main, Feb 16 2023, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (/usr/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True
austlane commented 1 year ago

The roadmap for Ansible 2.16 seems to indicate this interpreter upgrade will be necessary soon. See:

https://docs.ansible.com/ansible/devel//roadmap/ROADMAP_2_16.html#planned-work

- Drop Python 3.9 support for controller
oyvindkolbu commented 10 months ago

Ansible-core 2.16 is out already, so would be great to get this is merged.

We've been running with the patch from the PR in our custom EEs for a while and it works fine. The only issue is for localhost tasks we need to specify the correct python interpreter, which was quickly resolved by setting ansible_python_interpreter: /usr/bin/python3.11 in inventory.yml.

But4ler commented 9 months ago

Any update ? We have a different problem with python 3.9, ansible 8.7.0 and above all ansible-core 2.15.7

Julien5858 commented 5 months ago

Any update about this one?

TheRealHaoLiu commented 1 month ago

close and re-open to trigger CI

jessicamack commented 1 month ago

Hello @austlane, thank you for your contribution. I've confirmed the test case and will be merging.