foreman-packaging icon indicating copy to clipboard operation
foreman-packaging copied to clipboard

Add katello-host-tools for debian/ubuntu

Open sbernhard opened this issue 3 years ago • 28 comments

sbernhard avatar Jul 29 '21 07:07 sbernhard

I think, I will need help to finish this successfully.

sbernhard avatar Jul 29 '21 07:07 sbernhard

[test deb]

pcreech avatar Oct 18 '21 12:10 pcreech

[test deb]

pcreech avatar Nov 18 '21 14:11 pcreech

I guess, this needs at least https://github.com/theforeman/jenkins-jobs/pull/152 Additonally, katello-host-tools need to be pushed to pip. What are your thoughts @jturel

sbernhard avatar Nov 19 '21 16:11 sbernhard

Additonally, katello-host-tools need to be pushed to pip. What are your thoughts @jturel

That seems like more work. Why do we need to do that?

jturel avatar Nov 22 '21 15:11 jturel

We don't require it, but it makes things easier ;) As we fetch gems from rubygems, we fetch python stuff from pypi.

evgeni avatar Nov 22 '21 15:11 evgeni

Somehow the source needs to be provided. Or should the source just be made avilable via git-annex? Currently I dont know how this can be done in deb build env.

sbernhard avatar Nov 22 '21 15:11 sbernhard

We don't require it, but it makes things easier ;) As we fetch gems from rubygems, we fetch python stuff from pypi.

Do we have a "foreman" org over there or anything, or automation to do the pushing? Trying to avoid having to do that by hand - can you blame me?

jturel avatar Nov 22 '21 15:11 jturel

We do have a bot that pushes things, yeah. Things can be arranged ;)

evgeni avatar Nov 22 '21 17:11 evgeni

Take https://github.com/theforeman/obal/blob/master/.github/workflows/release.yml for example. If you push a tag, automation will push it to PyPI.

ekohl avatar Dec 09 '21 19:12 ekohl

[test deb]

evgeni avatar Jan 20 '22 09:01 evgeni

well, it failed, so at least it did try to build something :see_no_evil:

evgeni avatar Jan 20 '22 09:01 evgeni

[test deb]

evgeni avatar Jan 20 '22 09:01 evgeni

now the failure is legit, there is no katello-host-tools on PyPI right now.

evgeni avatar Jan 20 '22 09:01 evgeni

now the failure is legit, there is no katello-host-tools on PyPI right now.

@jturel How do we want to handle this? The "easiest" solution is, to put katello-host-tools on PyPi. Otherwise we need to find another solution to provide the source.

sbernhard avatar Jan 20 '22 10:01 sbernhard

the other alternative is we implement a kind of "source_url" entry in the build_vars, and make that point at https://github.com/Katello/katello-host-tools/archive/refs/tags/$VERSION.tar.gz or similar.

But I would prefer PyPI as it has a rather standardized interface (which we already implement)

evgeni avatar Jan 20 '22 10:01 evgeni

now the failure is legit, there is no katello-host-tools on PyPI right now.

@jturel How do we want to handle this? The "easiest" solution is, to put katello-host-tools on PyPi. Otherwise we need to find another solution to provide the source.

I guess that's OK? I don't have any experience with putting a project there. If one of us does it first, are we able to grant access to others to do so as well? ie I don't want to be the only person who can perform a release to pypi :)

jturel avatar Jan 21 '22 14:01 jturel

You can use https://github.com/theforeman/obal/blob/master/.github/workflows/release.yml. It may be better if a GH admin sets the secret for you. I'm not a Katello GH admin so I can't do that. @evgeni?

ekohl avatar Jan 21 '22 14:01 ekohl

I am not an admin either.

evgeni avatar Jan 21 '22 14:01 evgeni

I am but, well, I don't have the password!

jturel avatar Jan 21 '22 14:01 jturel

So I added an API token to the project and opened https://github.com/Katello/katello-host-tools/pull/123. While looking at the code I think bin/ won't be part of the resulting tarball. See obal for an example of how to do this. It maps a command to be generated to a function in the code (in this case obal.main).

@sbernhard could you pick up this effort?

Edit: or if you don't need bin/* at all, there's no work to be done.

ekohl avatar Jan 24 '22 17:01 ekohl

dit: or if you don't need bin/* at all, there's no work to be done.

Well, the files in /bin/* are required and the zypper / apt / yum plugins, too. Actually, I don't know the purpose of setup.py regarding creating a simple tarball.

sbernhard avatar Jan 25 '22 16:01 sbernhard

Well, the files in /bin/* are required and the zypper / apt / yum plugins, too. Actually, I don't know the purpose of setup.py regarding creating a simple tarball.

Try python setup.py sdist. You'll end up with a tarball that's uploaded to PyPI. The old way is listing those bin/* files in scriptsinsetup.py`. The modern way is to ship the code inside the package itself and using the console entry points. Then an appropriate wrapper is generated during installation.

ekohl avatar Jan 25 '22 16:01 ekohl

Since there has been no progress on this, I took a stab at this and opened https://github.com/Katello/katello-host-tools/pull/125. That will likely also have packaging consequences, both RPM and deb side.

ekohl avatar Feb 19 '22 14:02 ekohl

I took a look at the RPM and I realized we don't ship all the additional files (etc, extra) in the tarball on PyPI. That's probably something to address.

ekohl avatar Feb 23 '22 11:02 ekohl

Need https://github.com/Katello/katello-host-tools/pull/130 before we can continue.

sbernhard avatar Apr 14 '22 07:04 sbernhard

[test deb]

sbernhard avatar Nov 07 '22 11:11 sbernhard

I started working on this again in https://github.com/theforeman/foreman-packaging/pull/11027 :)

evgeni avatar Jul 14 '24 13:07 evgeni