#182 Create RPM package for fedora-messaging happinesspackets_schema
Opened 5 years ago by jflory7. Modified 4 years ago

Summary

Create RPM package for fedora-messaging happinesspackets_schema to deploy to Fedora Infrastructure

Background

Each application that publishes messages creates a schema Python package.

Consumers of those messages install that schema package and use it to validate the message and extract various bits of information. You can think of it as filling the same space as the fedmsg_meta_fedora_infrastructure package (it describes what a human-readable version of the message is like, what users/packages it relates to, etc), except that instead of every message in one place, each application can maintain its own and release updates on its own schedule.

In order to deploy fedora-messaging support for fedora-happiness-packets, we need to create an RPM package to submit into Fedora and EPEL.

Details

Start with basics of RPM packaging. I wrote How I created my first RPM package in Fedora to help explain how I navigated the Fedora packaging process start to finish. Some things are outdated in the blog post now, but here are some helpful resources mentioned in the post:

Outcome

Applications in Fedora infrastructure can install happinesspackets_schema as consumers of our events (unblocks #22)


@shraddhaag Sure! This ticket is still blocked by #96 / #161, but since you are already working on it, I think it's okay to start looking into this one.

Metadata Update from @jflory7:
- Issue assigned to shraddhaag

5 years ago

Metadata Update from @jflory7:
- Issue marked as depending on: #198

5 years ago

Metadata Update from @jflory7:
- Issue untagged with: blocked
- Issue priority set to: waiting on assignee (was: waiting on external)

5 years ago

Marking this ticket as unblocked since fedora-messaging integration was added a few PRs ago.

Hi @shraddhaag, did you have any progress on this? Since the packaging process takes additional time, I can help with an RPM over the next month. If you have something started, we can use that as a starting point in a new branch on this repo. :smiley:

Hi @jflory7! I wasn't able to get started with this ticket yet in a concrete away. I have done research about how to create an RPM package. I'll try my best to update this in the coming week. :)

@shraddhaag Sure! After #121, I suggest looking into this ticket next. I suspect we need extra lead time for this as you are a first-time packager, so you also need a sponsor for your first package. It may take 1-2 weeks longer after when the RPM is created.

There is not a pressing need for this yet though. Eventually, we will need this completed in order to deploy to production in Fedora's infrastructure, as I understand.

I have been successfully able to create a SPEC file for the RPM package and the source and binary RPMs. The SPEC file can be found here.

Here is a logged response for rpmlint on:

  • SPEC file:
$ rpmlint SPECS/happinesspacket_schema.spec 
0 packages and 1 specfiles checked; 0 errors, 0 warnings.
  • Source:
$ rpmlint SRPMS/happinesspacket_schema-0.1.2-1.fc29.src.rpm 
1 packages and 0 specfiles checked; 0 errors, 0 warnings.
  • Binary:
$ rpmlint RPMS/noarch/happinesspacket_schema-0.1.2-1.fc29.noarch.rpm 
happinesspacket_schema.noarch: W: no-documentation
1 packages and 0 specfiles checked; 0 errors, 1 warnings.

I wasn't sure what should I include in the documentation of this package.

@jflory7 Please let me know if this looks good and what should be my next steps in this ticket.

@shraddhaag Nice job on getting this done!

At first glance, the RPM SPEC looks good. I've never packaged a Python application for RPM, only C applications. I'll try and get more experienced Python packagers to review the RPM SPEC.

In the meanwhile, I suggest building this RPM inside of a COPR repository. COPR is a build service offered by the Fedora Project for anyone to build and distribute RPM packages. There is a command-line utility for submitting builds to COPR, but it might be tricky without a Fedora system. See if you can figure this out for now, but if you get stuck, let me know and I can offer more tips.

Metadata Update from @jflory7:
- Custom field Requirement # adjusted to 31

4 years ago

Hey @shraddhaag! Once you test out COPR and get a build working, the next step is to submit a new package review request on Red Hat Bugzilla. Since this is your first package, you will need a package sponsor (i.e. someone who works with new packagers and endorses their first package). I can co-maintain this package with you in the Fedora dist-git repositories. Note that the package review process may take 1-3 weeks so please budget time accordingly.

You can see my first package ticket as an example. The review process is explained in greater detail on the Fedora Wiki. Let me know if you have any questions!

Hi @jflory7! I was trying to build the RPM (created using SPEC file I created) inside a COPR repository using CLI. The build is failing and I can't see any errors logged. Here is the what is see on the terminal.

While trying to find how can I see see the errors logged, I came across pyp2rpm in COPR documentation. The SPEC file build using this can be found here.
I tried to build the RPM created using this SPEC file in this COPR repository. Again, I'm getting a similar Build error: failed. This is what I see on the terminal.

Could you please point me towards what I am doing wrong here?

I realize now that debugging a failed COPR build is not intuitive. The CLI output is querying the builds on COPR to notify you in the CLI if it is a passing or failing build. But the helpful information you are looking for is in the build logs of each build you submit.

For your COPR repo, check out the build history. Then you can filter down to a specific build, for a specific OS and architecture, like your most recent build. There's a lot of files in there, but the most helpful one is builder-live.log, where you will find the failing error at the very bottom:

No matching package to install: 'python3dist(fedora-messaging)'
Not all dependencies satisfied
Error: Some packages could not be found.

This might be a bug with pyp2rpm generating the BuildRequires statements – I haven't used it before. In our case, it's probably best to use the official package name in the Fedora RPM collection for the BuildRequires statement. A quick way to find packages in Fedora is on apps.fedoraproject.org/packages.

See if you can figure out the rest from here. Hopefully this is enough to help debugging.

(Also, I suggest enabling Fedora 30 + Fedora Rawhide builds on your COPR repo. Fedora 28 is about to go end-of-life and this could actually be causing a problem too because of outdated packages or dependencies. Since the official RPM packages are built on latest Fedora, it's best to build for those first, and all other versions / distros second.)

Hope this helps! :grin:

Metadata Update from @jflory7:
- Issue set to the milestone: Summer Coding 2019: phase 2 (was: Summer Coding 2019: phase 1)

4 years ago

@shraddhaag I pushed this ticket to Phase 2 milestone. Let's focus in on the remaining Phase 1 tasks this week. Once Phase 2 begins, we can put full focus on getting an updated version pushed to staging (including the RPM schema package). If you have spare time this week, you can keep working on this one. :grinning:

@jflory7 Thank you Justin. I'll work on this one once the other tasks are completed. :)

ICYMI: @shraddhaag opened BZ#1722843 to get the fedora-messaging schema officially packaged in Fedora. :sunglasses:

Metadata Update from @jflory7:
- Issue priority set to: waiting on external (was: waiting on assignee)

4 years ago

Metadata Update from @jflory7:
- Issue tagged with: blocked

4 years ago

Login to comment on this ticket.