Skip to content
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

ansible-core 2.14.5 & beefed up for latest 32-bit ARM (armhf) cryptography / piwheels / rust problems #3550

Merged
merged 3 commits into from
Apr 24, 2023

Conversation

@holta holta added this to the 8.1 milestone Apr 24, 2023
@holta
Copy link
Member Author

holta commented Apr 24, 2023

FYI install appears to fail on 32-bit ARM for reasons beyond our control — ansible-core-2.11.12 partially installs as follow:

root@box:~# dpkg --print-architecture
armhf
root@box:~# dpkg --print-foreign-architectures
root@box:/opt/iiab/iiab# scripts/ansible

[...]

Create virtual environment for Ansible
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting cryptography==40.0.1
  Downloading https://www.piwheels.org/simple/cryptography/cryptography-40.0.1-cp37-cp37m-linux_armv6l.whl (1.5MB)
    100% |████████████████████████████████| 1.5MB 54kB/s
Collecting cffi>=1.12 (from cryptography==40.0.1)
  Downloading https://www.piwheels.org/simple/cffi/cffi-1.15.1-cp37-cp37m-linux_armv6l.whl (219kB)
    100% |████████████████████████████████| 225kB 304kB/s
Collecting pycparser (from cffi>=1.12->cryptography==40.0.1)
  Downloading https://files.pythonhosted.org/packages/62/d5/5f610ebe421e85889f2e55e33b7f9a6795bd982198517d912eb1c76e1a53/pycparser-2.21-py2.py3-none-any.whl (118kB)
    100% |████████████████████████████████| 122kB 480kB/s
Installing collected packages: pycparser, cffi, cryptography
Successfully installed cffi-1.15.1 cryptography-40.0.1 pycparser-2.21
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting ansible-core
  Downloading https://www.piwheels.org/simple/ansible-core/ansible_core-2.11.12-py3-none-any.whl (2.0MB)
    100% |████████████████████████████████| 2.0MB 44kB/s
Collecting PyYAML (from ansible-core)
  Downloading https://www.piwheels.org/simple/pyyaml/PyYAML-6.0-cp37-cp37m-linux_armv6l.whl (45kB)
    100% |████████████████████████████████| 51kB 227kB/s
Collecting jinja2 (from ansible-core)
  Downloading https://files.pythonhosted.org/packages/bc/c3/f068337a370801f372f2f8f6bad74a5c140f6fda3d9de154052708dd3c65/Jinja2-3.1.2-py3-none-any.whl (133kB)
    100% |████████████████████████████████| 133kB 429kB/s
Collecting resolvelib<0.6.0,>=0.5.3 (from ansible-core)
  Downloading https://files.pythonhosted.org/packages/6b/f5/1b4375dbe7e3dddf074d206054ab3e27de0fdb2d32e64a1d5da25f813927/resolvelib-0.5.5-py2.py3-none-any.whl
Collecting packaging (from ansible-core)
  Downloading https://files.pythonhosted.org/packages/ab/c3/57f0601a2d4fe15de7a553c00adbc901425661bf048f2a22dfc500caf121/packaging-23.1-py3-none-any.whl (48kB)
    100% |████████████████████████████████| 51kB 527kB/s
Requirement already satisfied, skipping upgrade: cryptography in /usr/local/ansible/lib/python3.7/site-packages (from ansible-core) (40.0.1)
Collecting MarkupSafe>=2.0 (from jinja2->ansible-core)
  Downloading https://www.piwheels.org/simple/markupsafe/MarkupSafe-2.1.2-cp37-cp37m-linux_armv6l.whl
Requirement already satisfied, skipping upgrade: cffi>=1.12 in /usr/local/ansible/lib/python3.7/site-packages (from cryptography->ansible-core) (1.15.1)
Requirement already satisfied, skipping upgrade: pycparser in /usr/local/ansible/lib/python3.7/site-packages (from cffi>=1.12->cryptography->ansible-core) (2.21)
Installing collected packages: PyYAML, MarkupSafe, jinja2, resolvelib, packaging, ansible-core
Successfully installed MarkupSafe-2.1.2 PyYAML-6.0 ansible-core-2.11.12 jinja2-3.1.2 packaging-23.1 resolvelib-0.5.5

Create symlinks /usr/local/bin/ansible* -> /usr/local/ansible/bin/ansible*


IIAB requires these ~4 Ansible Collections: (we upgrade them here if possible!)

[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]. This feature will be removed from ansible-core in version
 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
scripts/ansible2: line 87: 16301 Illegal instruction     ansible-galaxy collection install --force-with-deps -r /opt/iiab/iiab/collections.yml -p /usr/share/ansible/collections
root@box:~# /usr/local/ansible/bin/ansible --version
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]. This feature will be removed from ansible-core in version
 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
Illegal instruction

@holta
Copy link
Member Author

holta commented Apr 24, 2023

While the above error is ugly, it's also possible it simply doesn't matter when preparing a microSD for 32-bit RPi Zero W using a much more modern 64-bit Raspberry Pi... ?

In any case: All Ansible-related work like installing of IIAB software and provisioning content... is generally-if-not-always completed entirely on a 64-bit Raspberry Pi... prior to inserting the microSD card into a 32-bit Zero W.

@tim-moody
Copy link
Contributor

I don't think requiring provision on 64 bit for 32 bit is too restrictive.

@jvonau
Copy link
Contributor

jvonau commented Apr 24, 2023

armv6l

Should be armv7l for the wheels. What kind of Pi is this and what does uname -m return?

@holta
Copy link
Member Author

holta commented Apr 24, 2023

armv6l

Should be armv7l for the wheels. What kind of Pi is this and what does uname -m return?

root@box:~# uname -m
armv6l
root@box:~# tail -1 /proc/cpuinfo
Model           : Raspberry Pi Zero W Rev 1.1

@jvonau
Copy link
Contributor

jvonau commented Apr 24, 2023

Example of good install #3494 (comment)

@jvonau
Copy link
Contributor

jvonau commented Apr 24, 2023

armv6l

Should be armv7l for the wheels. What kind of Pi is this and what does uname -m return?

root@box:~# uname -m
armv6l
root@box:~# tail -1 /proc/cpuinfo
Model           : Raspberry Pi Zero W Rev 1.1

Ansible installed on armv7 or better will now not run ansible when booted on an armv6l machine.

@holta
Copy link
Member Author

holta commented Apr 24, 2023

Any objections to merging this well-tested-on-most-platforms PR as is?

(And refining down the road if/as nec?)

@jvonau
Copy link
Contributor

jvonau commented Apr 24, 2023

one minute please

@jvonau
Copy link
Contributor

jvonau commented Apr 24, 2023

pycparser-2.21 is being pulled from outside of piwheels, that might be the issue, but push this and retry on an armv7 or better.
post the same snapshot of the install please.

@jvonau
Copy link
Contributor

jvonau commented Apr 24, 2023

I don't think requiring provision on 64 bit for 32 bit is too restrictive.

From the looks of the test above ansible will not run on armv6l at all or the newest wheels from piwheels are suffering from the recent change to boot 64bit kernels by default. Think that one change broke most of the build pipelines out in the wild. The regular installs on non 'w' hardware with this PR will help sort out if the wheels are broken or not.

@holta
Copy link
Member Author

holta commented Apr 24, 2023

pycparser-2.21 is being pulled from outside of piwheels, that might be the issue, but push this and retry on an armv7 or better. post the same snapshot of the install please.

This PR's scripts/ansible installed successfully on 32-bit RasPiOS in RPi 3:

root@box:~# dpkg --print-architecture
armhf
root@box:~# dpkg --print-foreign-architectures
root@box:~# uname -m
armv7l
root@box:~# tail -1 /proc/cpuinfo
Model           : Raspberry Pi 3 Model B Rev 1.2
Create virtual environment for Ansible
Looking in indexes: https://pypi.org/simple, https://www.piwheels.o
rg/simple
Collecting cryptography==40.0.1
  Downloading https://www.piwheels.org/simple/cryptography/cryptogr
aphy-40.0.1-cp39-cp39-linux_armv7l.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 383 kB/s
Collecting cffi>=1.12
  Downloading https://www.piwheels.org/simple/cffi/cffi-1.15.1-cp39
-cp39-linux_armv7l.whl (364 kB)
     |████████████████████████████████| 364 kB 395 kB/s
Collecting pycparser
  Downloading https://www.piwheels.org/simple/pycparser/pycparser-2
.21-py2.py3-none-any.whl (119 kB)
     |████████████████████████████████| 119 kB 1.1 MB/s
Installing collected packages: pycparser, cffi, cryptography
Successfully installed cffi-1.15.1 cryptography-40.0.1 pycparser-2.
21
Looking in indexes: https://pypi.org/simple, https://www.piwheels.o
rg/simple
Collecting ansible-core
  Downloading https://www.piwheels.org/simple/ansible-core/ansible_
core-2.14.5-py3-none-any.whl (2.2 MB)
     |████████████████████████████████| 2.2 MB 444 kB/s
Collecting jinja2>=3.0.0
  Downloading https://www.piwheels.org/simple/jinja2/Jinja2-3.1.2-p
y3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 649 kB/s
Collecting packaging
  Downloading https://www.piwheels.org/simple/packaging/packaging-2
3.1-py3-none-any.whl (48 kB)
     |████████████████████████████████| 48 kB 290 kB/s
Collecting resolvelib<0.9.0,>=0.5.3
  Downloading https://www.piwheels.org/simple/resolvelib/resolvelib
-0.8.1-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: cryptography in /usr/local/ansible/l
ib/python3.9/site-packages (from ansible-core) (40.0.1)
Collecting PyYAML>=5.1
  Downloading https://www.piwheels.org/simple/pyyaml/PyYAML-6.0-cp3
9-cp39-linux_armv7l.whl (45 kB)
     |████████████████████████████████| 45 kB 262 kB/s
Collecting MarkupSafe>=2.0
  Downloading https://www.piwheels.org/simple/markupsafe/MarkupSafe
-2.1.2-cp39-cp39-linux_armv7l.whl (23 kB)
Requirement already satisfied: cffi>=1.12 in /usr/local/ansible/lib
/python3.9/site-packages (from cryptography->ansible-core) (1.15.1)
Requirement already satisfied: pycparser in /usr/local/ansible/lib/
python3.9/site-packages (from cffi>=1.12->cryptography->ansible-cor
e) (2.21)
Installing collected packages: MarkupSafe, resolvelib, PyYAML, pack
aging, jinja2, ansible-core
Successfully installed MarkupSafe-2.1.2 PyYAML-6.0 ansible-core-2.1
4.5 jinja2-3.1.2 packaging-23.1 resolvelib-0.8.1

Create symlinks /usr/local/bin/ansible* -> /usr/local/ansible/bin/a
nsible*


IIAB requires these ~4 Ansible Collections: (we upgrade them here i
f possible!)

Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/download/ansible-posix-1.5.2
.tar.gz to /root/.ansible/tmp/ansible-local-85246hglqq3v/tmpzvcwtg6
d/ansible-posix-1.5.2-ub3ds6x5
Installing 'ansible.posix:1.5.2' to '/usr/share/ansible/collections
/ansible_collections/ansible/posix'
Downloading https://galaxy.ansible.com/download/community-postgresq
l-2.3.2.tar.gz to /root/.ansible/tmp/ansible-local-85246hglqq3v/tmp
zvcwtg6d/community-postgresql-2.3.2-yvazx_w6
ansible.posix:1.5.2 was installed successfully
Installing 'community.postgresql:2.3.2' to '/usr/share/ansible/coll
ections/ansible_collections/community/postgresql'
Downloading https://galaxy.ansible.com/download/community-mysql-3.6
.0.tar.gz to /root/.ansible/tmp/ansible-local-85246hglqq3v/tmpzvcwt
g6d/community-mysql-3.6.0-bwj59_fm
community.postgresql:2.3.2 was installed successfully
Installing 'community.mysql:3.6.0' to '/usr/share/ansible/collectio
ns/ansible_collections/community/mysql'
community.mysql:3.6.0 was installed successfully
Downloading https://galaxy.ansible.com/download/community-general-6
.5.0.tar.gz to /root/.ansible/tmp/ansible-local-85246hglqq3v/tmpzvc
wtg6d/community-general-6.5.0-3j_afuu3
Installing 'community.general:6.5.0' to '/usr/share/ansible/collect
ions/ansible_collections/community/general'
community.general:6.5.0 was installed successfully


SUCCESS!  PLEASE VERIFY ANSIBLE WITH COMMANDS LIKE:

    ansible --version
    /usr/local/ansible/bin/pip3 show ansible-core
    pip3 show ansible-core
    apt -a list "ansible*"
    ansible-galaxy collection list

WARNING: Start a new Linux shell, if it changed

@jvonau
Copy link
Contributor

jvonau commented Apr 24, 2023

maybe cryptography==40.0.1 is buggy, might want to try an older version.
Edit The above looks good, everything is coming from piwheels

@holta
Copy link
Member Author

holta commented Apr 24, 2023

root@box:~# dpkg --print-architecture
armhf
root@box:~# dpkg --print-foreign-architectures
root@box:~# uname -m
armv7l
root@box:~# tail -1 /proc/cpuinfo
Model           : Raspberry Pi 3 Model B Rev 1.2

CLARIF:

root@box:~# cat /etc/rpi-issue
Raspberry Pi reference 2022-09-22
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 8a42abcd1dbd8c9c1fdfca4e0c3778255b2f9cc4, stage2

@jvonau
Copy link
Contributor

jvonau commented Apr 24, 2023

root@box:~# dpkg --print-architecture
armhf
root@box:~# dpkg --print-foreign-architectures
root@box:~# uname -m
armv7l
root@box:~# tail -1 /proc/cpuinfo
Model           : Raspberry Pi 3 Model B Rev 1.2

CLARIF:

root@box:~# cat /etc/rpi-issue
Raspberry Pi reference 2022-09-22
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 8a42abcd1dbd8c9c1fdfca4e0c3778255b2f9cc4, stage2

Shove that sdcard into a w and do the --version test

@holta
Copy link
Member Author

holta commented Apr 24, 2023

maybe cryptography==40.0.1 is buggy, might want to try an older version. Edit The above looks good, everything is coming from piwheels

cryptography==39.0.2 fails in the same way on armv6l :

scripts/ansible: line 87: 17147 Illegal instruction ansible-galaxy collection install --force-with-deps -r /opt/iiab/iiab/collections.

@holta
Copy link
Member Author

holta commented Apr 24, 2023

Shove that sdcard into a w and do the --version test

About 5 min later, ansible-core 2.14.5 (that worked on 32-bit RasPiOS in RPi 3) failed as follows:
(when inserted & booted in RPi Zero W)

root@box:~# ansible --version
Illegal instruction

ASIDE: Just a reminder that even if Ansible ever does run on Zero W, it would be so painfully & incredibly slow, that no sane person should do this. 🐌

@jvonau
Copy link
Contributor

jvonau commented Apr 24, 2023

root@box:~# ansible --version
Illegal instruction

ASIDE: Just a reminder that even if Ansible ever does run on Zero W, it would be so painfully & incredibly slow, that no sane person should do this. snail

Wonder how far back this armv6l issue goes? Nothing stopping somebody from fiddling around in admin-console once booted on any hardware, that is where this ansible issue can burn the user. I would be looking at changing the minimum supported hardware recommendation just saying armv6l is not supported any way going forward.

@jvonau
Copy link
Contributor

jvonau commented Apr 24, 2023

maybe cryptography==40.0.1 is buggy, might want to try an older version. Edit The above looks good, everything is coming from piwheels

cryptography==39.0.2 fails in the same way on armv6l :

scripts/ansible: line 87: 17147 Illegal instruction ansible-galaxy collection install --force-with-deps -r /opt/iiab/iiab/collections.

Might have to go back to a 'pre-rust' release, 38.0.4 if I recall correctly.

For the same reasons of not having available wheels think U2304 32bit arm might not be recommended either. I haven't booted the 32bit version in a long time and I'm not investing any of my time to find out.

@holta
Copy link
Member Author

holta commented Apr 24, 2023

Might have to go back to a 'pre-rust' release, 38.0.4 if I recall correctly.

Same problem with cryptography==38.0.4 just like cryptography==39.0.2 just like as cryptography==40.0.1:

scripts/ansible2: line 87:  1807 Illegal instruction     ansible-galaxy collection install --force-with-deps -r /opt/iiab/iiab/collections.yml -p /usr/share/ansible/collections

WIth cryptography==37.0.4 the error is a bit different:

ERROR! The requirements file '/opt/iiab/iiab/collections.yml' does not exist.

Either way, it looks like it's time to face the music... admitting that Ansible's not needed on 32-bit Raspberry Pi Zero W's 🕊️

@holta
Copy link
Member Author

holta commented Apr 24, 2023

Recap:

  • This PR moves the ball forward, in a number of areas, and is well-tested.
  • Further revisions welcome, if/as their prove necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants