containers / toolbox

Tool for interactive command line environments on Linux
https://containertoolbx.org/
Apache License 2.0
2.38k stars 208 forks source link

playbooks: Avoid using potentially broken DNF5 #1509

Closed debarshiray closed 3 weeks ago

debarshiray commented 3 weeks ago

The Zuul executor got updated from Ansible 2.13.7 to 2.15.10, which now has support for DNF5 [1] and the previous DNF5 Change [2] for Fedora 39 is now aiming at Fedora 41 (and Rawhide) [3]. Unfortunately, Ansible's dnf5 module is still under development and doesn't seem to match the state of DNF5 in Fedora Rawhide, which causes:

  TASK [Install RPM packages]
  fedora-rawhide | ERROR
  fedora-rawhide | {
  fedora-rawhide |   "failures": [],
  fedora-rawhide |   "msg": "Could not import the libdnf5 python module
      using /usr/bin/python3 (3.12.3 (main, Apr 17 2024, 00:00:00) [GCC
      14.0.1 20240411 (Red Hat 14.0.1-0)]). Please install
      python3-libdnf5 package or ensure you have specified the correct
      ansible_python_interpreter. (attempted
      ['/usr/libexec/platform-python', '/usr/bin/python3',
      '/usr/bin/python2', '/usr/bin/python'])"
  fedora-rawhide | }

Trying to explicitly install python3-libdnf5, as suggested above, using Ansible's command module before using the package module to install the Toolbx dependencies, still ends up with:

  TASK [Install RPM packages]
  fedora-rawhide | MODULE FAILURE:
  fedora-rawhide | Traceback (most recent call last):
  fedora-rawhide |   File "<stdin>", line 107, in <module>
  fedora-rawhide |   File "<stdin>", line 99, in _ansiballz_main
  fedora-rawhide |   File "<stdin>", line 47, in invoke_module
  fedora-rawhide |   File "<frozen runpy>", line 226, in run_module
  fedora-rawhide |   File "<frozen runpy>", line 98, in _run_module_code
  fedora-rawhide |   File "<frozen runpy>", line 88, in _run_code
  fedora-rawhide |   File "/tmp/ansible_ansible.legacy.dnf5_payload_kecazv78/ansible_ansible.legacy.dnf5_payload.zip/ansible/modules/dnf5.py",
      line 708, in <module>
  fedora-rawhide |   File "/tmp/ansible_ansible.legacy.dnf5_payload_kecazv78/ansible_ansible.legacy.dnf5_payload.zip/ansible/modules/dnf5.py",
      line 704, in main
  fedora-rawhide |   File "/tmp/ansible_ansible.legacy.dnf5_payload_kecazv78/ansible_ansible.legacy.dnf5_payload.zip/ansible/modules/dnf5.py",
      line 487, in run
  fedora-rawhide | AttributeError: 'Base' object has no attribute
      'load_config_from_file'

Therefore, force the use of DNF4 when an Ansible job is being attempted more than once [4].

[1] Ansible commit a81b787a05100986 https://github.com/ansible/ansible/commit/a81b787a05100986 https://github.com/ansible/ansible/issues/78898

[2] https://fedoraproject.org/wiki/Changes/ReplaceDnfWithDnf5

[3] https://fedoraproject.org/wiki/Changes/SwitchToDnf5

[4] https://zuul-ci.org/docs/zuul/latest/job-content.html#var-zuul.attempts

softwarefactory-project-zuul[bot] commented 3 weeks ago

Build failed. https://softwarefactory-project.io/zuul/t/local/buildset/4dbcb019c8e741819a08e182b854d88f

:x: unit-test RETRY_LIMIT in 34s :heavy_check_mark: unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 37s :x: unit-test-restricted RETRY_LIMIT in 33s :x: system-test-fedora-rawhide RETRY_LIMIT in 34s :x: system-test-fedora-40 RETRY_LIMIT in 34s :x: system-test-fedora-39 RETRY_LIMIT in 34s :x: system-test-fedora-38 RETRY_LIMIT in 32s

softwarefactory-project-zuul[bot] commented 3 weeks ago

Build failed. https://softwarefactory-project.io/zuul/t/local/buildset/c64e04f1ca5548888fe90442c799d1d3

:x: unit-test RETRY_LIMIT in 35s :heavy_check_mark: unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 26s :x: unit-test-restricted RETRY_LIMIT in 36s :x: system-test-fedora-rawhide RETRY_LIMIT in 33s :x: system-test-fedora-40 POST_FAILURE in 34m 56s :heavy_check_mark: system-test-fedora-39 SUCCESS in 35m 54s :heavy_check_mark: system-test-fedora-38 SUCCESS in 34m 39s

softwarefactory-project-zuul[bot] commented 3 weeks ago

Build failed. https://softwarefactory-project.io/zuul/t/local/buildset/580ace5cb1cc44fdb9536558aed5a843

:heavy_check_mark: unit-test SUCCESS in 7m 09s :heavy_check_mark: unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 18s :x: unit-test-restricted RETRY_LIMIT in 1m 17s :heavy_check_mark: system-test-fedora-rawhide SUCCESS in 38m 24s :heavy_check_mark: system-test-fedora-40 SUCCESS in 36m 08s :heavy_check_mark: system-test-fedora-39 SUCCESS in 35m 22s :heavy_check_mark: system-test-fedora-38 SUCCESS in 35m 11s

debarshiray commented 3 weeks ago

@danpawlik @TristanCacqueray Will it be possible to somehow set up Ansible on Software Factory in a way that the dnf5 module is disabled until it's known to work?

softwarefactory-project-zuul[bot] commented 3 weeks ago

Build succeeded. https://softwarefactory-project.io/zuul/t/local/buildset/036e88a6a3b1461488b330aade1449bd

:heavy_check_mark: unit-test SUCCESS in 6m 15s :heavy_check_mark: unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 21s :heavy_check_mark: unit-test-restricted SUCCESS in 5m 43s :heavy_check_mark: system-test-fedora-rawhide SUCCESS in 39m 41s :heavy_check_mark: system-test-fedora-40 SUCCESS in 38m 04s :heavy_check_mark: system-test-fedora-39 SUCCESS in 38m 29s :heavy_check_mark: system-test-fedora-38 SUCCESS in 38m 20s

TristanCacqueray commented 3 weeks ago

@debarshiray We don't setup Ansible, this is taken care of by Zuul, so I'm not sure how we would do that.

debarshiray commented 3 weeks ago

@debarshiray We don't setup Ansible, this is taken care of by Zuul, so I'm not sure how we would do that.

Maybe by downstream patching to suppress the dnf5 module? I don't know how all the pieces fit, so I don't know what I am talking about. Anyway, it's not a big deal, just a passing thought.