Jump to: navigation, search

Difference between revisions of "Cinder/3rdParty-drivers-py3-update"

m (added '3.7' to title)
Line 1: Line 1:
== Cinder Third Party CI update to Python ==
+
== Cinder Third Party CI update to Python 3.7 ==
  
 
The key point of this page is to share tips about updating Third Party CI to run Python 3.7.  (Feel free to skip ahead to that part!)
 
The key point of this page is to share tips about updating Third Party CI to run Python 3.7.  (Feel free to skip ahead to that part!)

Revision as of 12:56, 8 August 2019

Cinder Third Party CI update to Python 3.7

The key point of this page is to share tips about updating Third Party CI to run Python 3.7. (Feel free to skip ahead to that part!)

Background

Python 2 (that is, Python 2 itself, not simply OpenStack support for Python 2) is end-of-life on 1 January 2020. This means that the Train release of OpenStack is the last release that will support Python 2. The OpenStack Technical Committee has declared that Python 2 support will be dropped completely during the beginning of the U development cycle (that is, late in 2019).

Reference: 2018-05-29 Python2 Deprecation Timeline

What this means for Cinder Third Party CI

Walt explained on the mailing list:

Hello Cinder folks,

The train release is going to be the last release of OpenStack with python 2 support. Train also is going to require supporting python 3.6 and 3.7. This means that we should be enabling and or switching over all of our 3rd party CI runs to python 3 to ensure that our drivers and all of their required libraries run properly in a python 3.6/3.7 environment. This will help driver maintainers discover any python3 incompatibilities with their driver as well as any required libraries. At the PTG in Denver, the cinder team agreed that we wanted driver CI systems to start using python3 by milestone 2 for Train. This would be the July 22-26th time frame [1].

We are also working on adding driver library requirements to the OpenStack global requirements project [2] [3]. This effort will provide native install primitives for driver libraries in cinder. This process also requires the driver libraries to run in python3.6/3.7.

The Cinder team wants to maintain it's high quality of driver support in the train release. By enabling python 3.6 and python 3.7 in CI tests, this will help everyone ship Cinder with the required support in Train and the following releases.

Walt

[1] https://releases.openstack.org/train/schedule.html

[2] https://review.opendev.org/#/c/656724/

[3] https://review.opendev.org/#/c/657395/

Jay followed up with an additional note that the Cinder team wanted to see drivers running Python 3 in their CI environments by Train Milestone 2 (week of July 22).

Because the Train release of OpenStack is supposed to support both Python 3.6 and Python 3.7, it's acceptable to have your CI running 3.7 only on the theory that anything that runs in 3.7 will also run in 3.6.

Tips for Converting Your CI to Python 3

Please share your experiences to help other CI maintainers. If you can't edit this wiki page (permissions were restricted due to a really bad spam storm in 2017), please slap your comments into a paste and contact jungleboyj, smcginnis, or rosmaita in the #openstack-cinder IRC channel and we'll add them for you.

The latest runtime may not be available as a distribution package for the distro you are using, but that is acceptable. Newer versions can be installed from third party package repos (PPAs or other RPM repos) or by directly installing the Python runtime source release. Another option that has been reported to work well is to use the pyenv Python version manager.

Ubuntu-based CI

Chris M reports that if you are running Ubuntu 16.04, you can convert very easily. (Though he also reported that he only found out how easy it was after trying a bunch of other stuff that didn't work out. In particular, he said "My first thought was to update my CI to Ubuntu 18.04 (Bionic Beaver) to get native support for Python 3.7, but the kernels in the Ubuntu cloud images crashed when I launched nested VMs, so I went back to 16.04 and used the "deadsnakes" PPA to load Python 3.7 on Xenial.")

So you can profit from what he learned, Chris had success converting his Ubuntu 16.04 CI to run Python 3.7 by doing this:

Key steps prior to running stack.sh on Ubuntu 16.04:

   add-apt-repository ppa:deadsnakes/ppa
   apt-get -q update
   apt-get install -y python3.7

Lines to add to local.conf:

   [[local|localrc]]
   USE_PYTHON3=True
   PYTHON3_VERSION=3.7
   :