Marcin Juszkiewicz: Moving Kolla images to Python 3
source link: https://www.tuicool.com/articles/hit/Qji2muA
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Python… To use 2.7 or to go for 3.x? To “be compatible” or to “use fancy new features”. Next year Python 2 gets finally unsupported upstream.
Kolla state
Kolla can run under Python 2.7 or 3.x and results will be the same. All those container images containing OpenStack components and whatever needed to get them running. But so far all of those images will use Python 2.7 inside…
I proposed to take care of it during Train cycle (we are at Stein now). Then we had a meeting and decided — let us do that in Stein! If I only knew how many issues it will bring…
Cleaning/refactoring
First some cleaning and refactoring:
- debian/ubuntu: drop mysql compat stuff, unify on openssl 1.1
- openstack-base: drop pika-pool
- Introduce ‘get_pip’ macro
- helm-repository: drop unused os_client_config variable
Distribution handling
Then created new variable to keep which exactly version of Python 3: distro_python_version . And then used wherever needed.
In meantime we got support for Red Hat Enterprise Linux 8 distribution. Where Python 3 is the only version available.
Finally we moved Ubuntu to use Stein UCA which also switched us to Python 3 in several images.
CI failures
And then hell gates opened…
We moved our CI jobs from Ubuntu 16.04 ‘xenial’ to Ubuntu 18.04 ‘bionic’. OMG. So many failures. When Mark Goddard found out why (too old ‘setuptools’) we had to pile up fixes to get CI back into working state.
Nova images were failing. Turned out that Debian/Ubuntu ‘qemu’ package is no longer metapackage but useless dummy. And then it brought ‘armv6l’ architecture to Nova so it started failing. There were three different patches to handle it and problem got solved.
OracleLinux image got repository information files renamed. And as we edit them we had to adapt.
Python 3 got enabled in another set of images.
Changing other projects
Kolla uses other projects, right? Are they Python 3 ready?
Had to patch several ones:
- bifrost (and test their patch )
- ironic
- karbor
- kuryr-libnetwork
- monasca ( api and persister )
- vmtp
Some of those changes were requirements updates to mark “Python 2 only” components (enum34, functools32, UcsSdk) or getting rid of Unicode characters from files which should be be US-ASCII.
Bifrost one cleaned situation as we are using it within virtualenv so Python packages were going crazy. Now they handle it ;D
Current status
The most important patch switching all image to Python 3 for Debian/Ubuntu is still in review. Waiting for karbor fix getting merged and CentOS 7/OracleLinux 7 builds getting working again.
We also moved to Debian ‘buster’ release. It is now in ‘freeze’ state so no big changes allowed and provides us with many updates making Debian/Ubuntu blocks easy.
Python 2 stays
There are few images where we still have Python 2. Anything related to Ceph has it because Debian/Ubuntu ‘ceph-common’ package depends on Py2 packages. We install Py3 ones there.
Moving Kolla images to Python 3
Recommend
-
55
-
11
开源版本的OpenStack+Ceph的组合已经日趋稳定,所以搭建一朵私有云环境的难度在逐步降低。当然OpenStack安装问题其实一直没有得到有效的解决,学习曲线非常陡峭。本文主要介绍基于Kolla项目使用容器化快速部署OpenStack方法,该部署方法已经在内部环境得到了多...
-
15
This is the beginning of a short series detailing how to deploy OpenStack on ARM64, using Docker containers with Kolla and
-
0
Python - archiving the file before moving to another directory? advertisements This question already has an answer here: How...
-
4
Marcin Koziej: "TIL the assumption that string length does not ch…"Follow TIL the assumption that string length does not change when upper-cased is false!
-
5
Welcome to LWN.net The following subscription-only content has been made available to you by an LWN subscriber. Thousands of subscribers depend on LWN for the best news from the Linux and free software communities....
-
5
Marcin Nowik (@mnowik) Authority ...
-
3
Kolla-ansible安装Openstack(Ubuntu 18)全记录 发...
-
3
Smashing Podcast Episode 57 With Marcin Wichary: What’s The Key To A Great Keyboard?In this episode of the Smashing Podcast, we ask what’s the key to a great keyboard? Is this essen...
-
3
Meet the maker: Marcin WicharyMarch 6, 2023
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK