Amphora images based on RHEL flavors should use Python 3 interpreter same as in Ubuntu

Bug #1680435 reported by Nir Magnezi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
octavia
Invalid
High
Unassigned

Bug Description

All amphora images are expected to run[1] the amphora agent using the same Python version.
What we currently have is as follows:
Ubuntu: Python 3.5.2 (expected)
RHEL, CentOS, Fedora: Python.7.5

The reason is:
https://github.com/openstack/diskimage-builder/blob/master/diskimage_builder/elements/dib-python/environment.d/50-dib-python-version
https://github.com/openstack/diskimage-builder/blob/master/diskimage_builder/elements/dib-python/pre-install.d/01-dib-python

We should change (probably override in Octavia code base) the image building for RHEL, CentOS and fedora to use Python 3 to avoid future bugs in the amphora agent.
This is already breaking this[1] WIP patch Which only works on Ubuntu based amphora since it has some Python3 specific code bits:

[1] via systemd: /usr/local/bin/dib-python /usr/local/bin/amphora-agent --config-file /etc/octavia/amphora-agent.conf
[1] https://review.openstack.org/#/c/429398
[2] https://review.openstack.org/#/c/429398/31/octavia/amphorae/backends/agent/api_server/listener.py@124

Tags: auto-abandon
Revision history for this message
Bernard Cafarelli (bcafarel) wrote :

If I got it correctly, this is how we end with python2:
* DIB setups dib-python element as a dependency on pip-and-virtualenv-source-install element
* this element installs/reinstalls pip and virtualenv with forced /usr/local/bin/dib-python
* new pip now is "configured" for /usr/local/bin/dib-python
* pip install in /opt/amphora creates the amphora-agent console_script entry point with this interpreter
* systemd unit just uses this script

Not sure where to mix in a change to force python 3 yet (also it will most probably need a step to install proper python3)

Changed in octavia:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Nir Magnezi (nmagnezi) wrote :

Tested a CentOS based amp again (with current master branch):

[root@amphora-cc38f42f-8875-4813-82f9-35c8c1c7354e ~]# ps -ef | grep amp
root 3277 742 0 09:34 ? 00:00:00 /usr/bin/python /usr/local/bin/amphora-agent --config-file /etc/octavia/amphora-agent.conf
root 9335 9321 0 09:35 pts/0 00:00:00 grep --color=auto amp
[root@amphora-cc38f42f-8875-4813-82f9-35c8c1c7354e ~]# /usr/bin/python --version
Python 2.7.5

Revision history for this message
Gregory Thiemonge (gthiemonge) wrote : auto-abandon-script

Abandoned after re-enabling the Octavia launchpad.

Changed in octavia:
status: Triaged → Invalid
tags: added: auto-abandon
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.