Closed terhorstd closed 1 year ago
@terhorstd Thanks a lot for keeping detailed notes!
Takeaways:
python
command it should use. I'm not sure how to explain the python3-dnf
trouble though...@pescobar: Any feedback on this w.r.t. the Ansible parts?
I often use Ansible 2.9.x or 2.10.x, Terje has been using 2.10.x. So I'm guessing that 2.7 is too old, and 3.0 (released a few weeks ago) too new. But it would be good if we can test this and specify which version(s) should be used / are known to work.
- We need to make it clear which Ansible version to use (do we expect Ansible 3.0?), and which
python
command it should use. I'm not sure how to explain thepython3-dnf
trouble though...
The python3-dnf
problem seems to be caused by a kind of dummy package. I've seen similar "broken" installs in containers before. The package is marked as installed (dnf install python3-dnf
finds everything is ok), but it is not usable due to some parts being stripped off. The try in native Python shows, that even Python finds the files, but they don't do anything but complain:
>>> import dnf
/usr/local/lib/python3.8/site-packages/dnf.py:15: UserWarning: The DNF Python API is not currently available via PyPI.
The re-install of the package then overwrites the broken instance (and usually inflates the image quite a bit).
- Some problems seem to be due to locale issues, those can probably be fixed in the playbook?
This could also be caused by the SSH itself. Some of the LC_*
environment variables are transferred to the target machine by ssh depending on the local configuration. Different OS have different defaults in /etc/ssh/ssh_config
:
SendEnv LANG LC_*
If the target container is strongly stripped, only LC_ALL=C
may be available... The playbook could of course build e.g. European locales. Anyway, I think this only affects the build process, once the system is complete, there is I think no big influence on the cvmfs mount. Does anyone know if the existing locales affect the build artifacts?
I usually store a requirements.txt
file with my playbooks generated with pip freeze
(as you can do with any python project) to define the specific ansible version and deps which were used when developing the playbook.
About the ansible version to choose, I am personally using the latest release in 2.10.x branch until I find time to test my playbooks with 3.x. ansible-3.x was released quite recently and introduced some breaking changes. Up to you if you can start testing ansible3.x now or you prefer to stay in 2.10.x for a while. All the details here https://www.ansible.com/blog/announcing-the-community-ansible-3.0.0-package https://www.ansible.com/blog/ansible-3.0.0-qa
For the python3-dnf
problem I would try to define ansible_python_interpreter
. I don't manage any system using dnf
but I have seen similar issues with the python-yum module. see here https://stackoverflow.com/questions/47069450/ansible-yum-not-working . You can define the variable ansible_python_interpreter
only at the task level if needed
my two cents. Hope it helps :)
We now use a build container that includes Ansible, and the installation can be fired off using a bash script. With this approach we can completely control the build environment, and this should address all of the issues mentioned here. So, I'll go ahead and close this issue.
These are the notes during a novice installing aarch64 on a test machine.
Aarch64 compatibility layer compile
The machine is
Install attempt on machine itself
Seems to be very worksome...
screen
is not installed, could help for long running installs from localhostgit
is not installed required to clone repo locallysudo yum install ansible
Remote install
On my local machine, fetch repository.
Credentials as provided, key added to ssh-agent.
Error /usr/bin/python not found
Error
Resolved by
and adding
ansible_python_interpreter=/usr/bin/python3
to hostsAnsible I still had installed in a conda environment, so I reused that one.
'ansible_os_family' is undefined
Error
when debug printing all
{{ ansible_facts }}
no distribution defining variables are defined, so they are also not injected into globalansible_
namespace.Resolved by manual verification in
/etc/os-release
and commenting out the OS check in the playbook.Could not detect which major revision of yum is in use
Error
Manually checked
python3-dnf
package requiredError
Notice however, that
However the package is still not found. NOT SOLVED!
update ansible 2.7 -> 3
Maybe old Ansible does not detect packages right?
python3-dnf
package requiredError
nope.
try again
Manually test install:
Really strange. Try overwriting already installed package...
Still the error
remove
ansible_python_interpreter
from hosts file.RUN STARTS: Wed Feb 24 17:53:07 CET 2021 RUN BREAKS: Wed Feb 24 20:54:00 CET 2021 (very approximate time)
Error lmod masked by missing keyword
that is
The package should have a
aarch64
or~aarch64
keyword, but it doesn't:Suggestion by Bob:
RUN RESTART: Thu Feb 25 16:35:24 CET 2021
RUN FINISHED: Thu Feb 25 16:59:34 CET 2021 SUCCESS.