ansible / pylibssh

Python bindings specific to Ansible use case for libssh https://www.libssh.org/
https://ansible-pylibssh.rtfd.io
GNU Lesser General Public License v2.1
59 stars 29 forks source link

[TODO] Implement building/packaging and testing RPMs #90

Open webknjaz opened 4 years ago

webknjaz commented 4 years ago
webknjaz commented 4 years ago

New pointers/questions:

  1. 2.10+ only?
  2. spec files + build: https://docs.fedoraproject.org/en-US/quick-docs/create-hello-world-rpm/ / https://rpm-packaging-guide.github.io/ / https://drive.google.com/file/d/1Bi5p-dRW_Q-qcMAr4_89VhnEoAGyxEZ6/view?usp=sharing
    • rpmdev-newspec will create a spec file
    • put things in the right directories, and run rpmbuild -ba mypackage.spec
  3. using centos/fedora + mock as a build env?
    • UBI available:
      $ podman run -it --rm -v `pwd`:/io --name ubi8 registry.access.redhat.com/ubi8/ubi bash
  4. runtime deps: libssh, ansible?
  5. build deps: python? libssh-dev?
  6. test containers: centos/fedora/ubi?
webknjaz commented 4 years ago

@ganeshrn could you please document the requirements here? There's no clear/complete understanding of the target envs...

webknjaz commented 4 years ago

Based on the last call, the plan is: 1) [ ] Package RPM for Fedora 2) [ ] Package RPM for CentOS 3) [ ] Package RPM for RHEL8 4) Rely on Python 3 that the recent Ansible is linked against in these OSs 5) [ ] Wait for the new channel/repository to get created in Brew (Koji)

webknjaz commented 3 years ago

Requested adding libssh-devel to ubi8: https://bugzilla.redhat.com/show_bug.cgi?id=1954863.

UPD: this is not going to happen so I've applied a hack to install them from CentOS RPMs in the CI.

webknjaz commented 3 years ago

@pabelanger could you please help figure out the RHEL channel this is supposed to get in?

webknjaz commented 3 years ago

Side idea: figure out if we could use bindep to declare deps for building RPMs because they are only available in CI workflow files right now which is suboptimal.

Ref: https://rbtcollins.wordpress.com/2015/07/12/bootstrapping-developer-environments-for-openstack/ / https://github.com/rbtcollins/bindep / https://docs.opendev.org/opendev/bindep/latest/ / https://pypi.org/project/bindep/

How to install packages returned by bindep: https://jakobandersen.github.io/mod/compiling.html#quick-start + ansible -m package? / https://github.com/ansible/ansible-builder/blob/abb609ab127158d2536a3d74febec62fa89277ec/ansible_builder/steps.py#L78

Examples: https://github.com/openstack/openstack-ansible/blob/master/bindep.txt / https://gerrit.cesnet.cz/plugins/gitiles/github/openstack-infra/zuul/+/19f8d27fd8d8a02322d3a56f8e18403df527d855/bindep.txt / https://github.com/openstack/ansible-role-python_venv_build/blob/master/bindep.txt

Another idea: extract running rpmlint into tox (may depend on https://github.com/tox-dev/tox-bindep).

webknjaz commented 3 years ago

Extra unsolved question: do we need to build RPMs for custom archs (it's currently only set up for x86_64). I'd like this to be integrated but objectively having QEMU may be ridiculously slow.

pabelanger commented 3 years ago

Side idea: figure out if we could use bindep to declare deps for building RPMs because they are only available in CI workflow files right now which is suboptimal.

Ref: rbtcollins.wordpress.com/2015/07/12/bootstrapping-developer-environments-for-openstack / rbtcollins/bindep / docs.opendev.org/opendev/bindep/latest / pypi.org/project/bindep

How to install packages returned by bindep: jakobandersen.github.io/mod/compiling.html#quick-start + ansible -m package? / ansible/ansible-builder@abb609a/ansible_builder/steps.py#L78

Examples: https://github.com/openstack/openstack-ansible/blob/master/bindep.txt / gerrit.cesnet.cz/plugins/gitiles/github/openstack-infra/zuul/+/19f8d27fd8d8a02322d3a56f8e18403df527d855/bindep.txt / https://github.com/openstack/ansible-role-python_venv_build/blob/master/bindep.txt

Another idea: extract running rpmlint into tox (may depend on tox-dev/tox-bindep).

You'd do something like: https://github.com/ansible-collections/ansible.netcommon/blob/main/bindep.txt#L10

Which we automatically pickup in our python-builder image (assemble script) when we build containers. We standardize on bindep.txt files in our Zuul CI, to make is easier for developers to distro level packages into jobs.

So adding something here, is possible.

webknjaz commented 3 years ago

You'd do something like: https://github.com/ansible-collections/ansible.netcommon/blob/main/bindep.txt#L10

Which we automatically pickup in our python-builder image (assemble script) when we build containers. We standardize on bindep.txt files in our Zuul CI, to make is easier for developers to distro level packages into jobs.

I want that for this repo's in-tree automation specifically, not for Zuul. Meaning that the automation needs to learn how to install those things (possibly from within tox).

pabelanger commented 3 years ago

You'd do something like: https://github.com/ansible-collections/ansible.netcommon/blob/main/bindep.txt#L10 Which we automatically pickup in our python-builder image (assemble script) when we build containers. We standardize on bindep.txt files in our Zuul CI, to make is easier for developers to distro level packages into jobs.

I want that for this repo's in-tree automation specifically, not for Zuul. Meaning that the automation needs to learn how to install those things (possibly from within tox).

https://opendev.org/zuul/zuul-jobs/src/branch/master/roles/bindep is the ansible role we use to manage bindep files.