-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 2 -> Python 3 IIAB strategic planning to prepare for 2020 #1810
Comments
biggest issue is switch from str and unicode types to bytes and str types. |
Do we have a list of code that needs to be updated? |
These are the 4 8=12 that matter, if you have time to assess any quick? (1) Arising from
(2) Arising from
P.S. @tim-moody has done a preliminary conversion of cmdsrv. As mentioned above (4 days ago) the next step there needs a knowledge of bytes vs str and ZeroMQ. |
Well section 1 looks like it shouldn't be a problem, those can probably just be switched to python3 directly without any errors. The one I'd be most worried about is I've been thinking about putting together an IIAB for myself for a while, so when I stand that up I should be able to confirm. Cmdsrv does look pretty complicated, I'd rather avoid touching it if there's someone who's actually familiar with the code base working on it. Section 2 is a lot more/denser code, and Now that I know what files are relevant when I build my IIAB node I can work on that. If I change those files from |
@georgejhunt do you have any recommendations above?
We highly recommend the Raspberry Pi 4 (if those are available in Nova Scotia ;) But a VM or old PC running Debian 10 or Ubuntu 18.04 should also work — even a pre-release daily build of Ubuntu 19.10 if you're daring: #1714
Let me ask others like @tim-moody & @jvonau to see if they know- |
Probably going to throw it on an odroid-xu4 I have kicking around. |
What OS likely? Keep an eye on these HW/OS options that stand the best chance of working! |
Armbian Sid if I can, armbian buster if I can't. |
Hey @traverseda, I have had some luck with DietPi as well on Orange Pi's. You could give that a shot on your Odroid. I know they have an image for it. |
FYI @tim-moody is now working on converting Admin Console (and its CMDSRV & ZeroMQ) from Python 2 to Python 3. |
@tim-moody is reviewing our options under "3. Python 3 Migration" under "September 26, 2019" at http://minutes.iiab.io Excerpt:
|
turns out that /usr/lib/python3/dist-packages exists and is in python path |
George prefers #! /usr/bin/env python which is not caught by the above grep /opt/iiab/iiab/roles/kiwix/templates/iiab-make-apache-config.py grep -rl '#!.*python' /opt/iiab/iiab-admin-console yields: grep -rl '#!.*python' /opt/iiab/iiab-factory/ |
Below are 3 serious Python 3 issues we're now facing, with Python 2.7 being end-of-life'd in just over 2 months: (https://pythonclock.org)
@jvonau @tim-moody @georgejhunt @traverseda do you know of others that should be added to the list? |
@jvonau recommends these 2 Ansible guides w.r.t. transitioning to Python 3:
The key to determining what Python Ansible's using under the covers seems to be...
Or better yet:
e.g. above is the result after running
Strangely / FWIW running
|
FYI @jvonau even the very latest Ansible (2.9.0rc5) currently being installed as part of IIAB's master ends up using Python 2.7 not Python 3 -- see the notes just above for background (e.g. serious bugs in Ansible 2.8.3 & 2.8.6 mentioned at #1737 In any case, here is the warning shown when running ./iiab-install on Ubuntu 19.10:
|
See the last 2 lines of PR #2019 where @jvonau is prototyping an
@jvonau also mentions:
|
This is a result of having installed python2.7 prior to the mysql crash (due to the missing package python3-pymysql) on the first run of anisble. Now when run a second time ansible sees the newly installed python2.7 and fallsback to using that, resulting in the mysql crash mysteriously going away running python2.7. #2019 |
mod_wsgi for apache can only be python 2 OR 3, not both. it is used by |
Good to know. This relates to Captive Portal work at #1182 that @georgejhunt is looking into, and #2003 "CMDSRV python-systemd -> python3-systemd isn't quite enough to run on Ubuntu 19.10" etc. |
In the short term we get python2 out of the box on Raspbian and apache is the default webserver. However on Ubuntu what is needed on a pure python3 distro is to change the pip call to use python3 and tell pip to use python2 in the venv. Now python2.7 is not installed but we install what is needed in packages.yml for kalite and others' venv that are installed later, those four packages should be changed to python3. What program needs python-passlib? Perhaps cmdsrv could use a venv to contain the python2 dependencies? The nginx changes could make mod_wsgi python3 only as uwsgi is used with nginx, which I see has new python dependency. Think pathagar and all other unused/unmaintained roles that require python2 be moved out of the main line code. |
#2034 addresses a short term need for vector-maps to install on Ubuntu-19.10 and provide backwards support for older python2 scripts till porting is complete. |
"Python 2 removal in sid/bullseye: Progress and next steps" |
PR #2043 merged to facilitate this effort. See @tim-moody's clarification of @jvonau's related work, at #2043 (comment) |
See also IIAB Admin Console's ongoing conversion to Python 3:
|
@jvonau has posted a request to IBM/Red Hat's Ansible developers here: ansible/ansible#57342 (comment) "Please provide packages for python3 in PPA" |
With things like PR #2052 now merged, at what stage do we declare victory? |
@jvonau suggests leaving this tkt open pending Ansible & Nodesource.com full transition to Python 3. |
Related: #2105 "Update /opt/iiab/iiab/.travis.yml Python version? distro version? (integrate Ansible Lint?)" |
Related: #2231 "Should Calibre-Web use Python 3 instead of 2.7 ?" |
Better question is what about kalite, also python2. |
@benjaoming what's the summary status here do you know? |
@holta KA Lite will not support Python 3 in this current millennium :) |
Moving this ticket from IIAB 7.1 milestone to 7.2, to keep organized around any residual Python 2 -> 3 issues. |
Related:
|
Good enough !! KA Lite remains on Python 2, but there's nothing we can do about that ;) |
https://pythonclock.org excerpts:
The text was updated successfully, but these errors were encountered: