Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #186: Add rpm .spec to skupper-router project #189

Merged
merged 15 commits into from
Apr 8, 2022

Conversation

jiridanek
Copy link
Contributor

@jiridanek jiridanek commented Mar 15, 2022

This is a very basic rpm .spec file, which nonetheless can be compiled and installed.

Tested with

rpkg local --nocheck
sudo dnf install /tmp/rpkg/skupper-router-31-8gtb5wwt/x86_64/skupper-router-0.0.git.3483.7cc6a1d8.dirty.1i20wb-2.fc35.x86_64.rpm
skrouterd

@jiridanek jiridanek linked an issue Mar 15, 2022 that may be closed by this pull request
@jiridanek
Copy link
Contributor Author

@mcressman @ajssmith Do you think such basic rpm .spec is sufficient for upstream uses, or is there something more that has to be done?

Do we want to also build qpid-proton static libraries as part of this spec file?

skupper-router.spec Outdated Show resolved Hide resolved
Comment on lines 75 to 76
%check
%ctest
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may not be a good idea, I heard multiple people talking against this. Easy to skip with --nocheck, though.

@jiridanek jiridanek changed the title Fixed # 186: Add rpm .spec to skupper-router project Fixed #186: Add rpm .spec to skupper-router project Mar 17, 2022
Comment on lines +629 to +591
- name: Check that skrouterd works
run: |
skrouterd -c /dev/empty |& grep "Configuration file could not be opened"
Copy link
Contributor Author

@jiridanek jiridanek Mar 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, this should be testing each rpm package independently ("Does -server package work without -tools being installed?") and more in depth. Sadly, the -tests package is actually broken and the system tests don't run against installed skrouterd (this is known ENTMQIC issue). For now, what I have is good enough, I think. It checks that Python internal module can be loaded, because that is happening before router accesses config.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you open a corresponding GH skupper-router issue for this -tests package breakage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 69 to 82
# TODO: name?
%package server
Copy link
Contributor Author

@jiridanek jiridanek Mar 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, the packages were called qpid-dispatch-router, qpid-dispatch-tools, ... If the base name is to be skupper-router, we can't have skupper-router-router. I resolved this by calling it -server.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skupper-router.spec.rpkg Outdated Show resolved Hide resolved
skupper-router.spec.rpkg Outdated Show resolved Hide resolved
Comment on lines 637 to 600
man skrouterd
man skstat
man skmanage
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The man pages are somewhat outdated regarding skupper-router changes. The synopsis talk about skrouter being good for AMQP, disregarding the differences from old dispatch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires: python3
Requires: qpid-proton-c >= %{proton_minimum_version}
Requires: libwebsockets >= %{libwebsockets_minimum_version}
Requires: libnghttp2 >= %{libnghttp2_minimum_version}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here (and for -tools) there probably should be a Requires: for cyrus-sasl-plain. That is needed to pass %check (due to system_tests_sasl_plain) and actually I think users should have this package ready since they are very likely to need it.

If you disagree this should be runtime dep, it can be made a build dep, maybe condition it on whether %check is required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put the dep on -tests package! That should be the smallest possible change. Still, I think that users should not be allowed to install the router without plain sasl mechanism. It is usually needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, putting it on -tests package. Hopefully this will work the way I expect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not work as expected, it has to be a BuildRequires. There is an enhancement proposal for rpmbuild which got stuck https://bugzilla.redhat.com/show_bug.cgi?id=1134397.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now.

skupper-router.spec.rpkg Outdated Show resolved Hide resolved
Comment on lines 55 to 63
# ctest
BuildRequires: cyrus-sasl-plain
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to add this, so I can run (some) tests in Fedora COPR. The results look ok, with some flakes here and there

https://copr.fedorainfracloud.org/coprs/jdanek/skupper-router/build/3821395/

image

I reported missing Qpid Proton RPM on EPEL 9 at https://issues.apache.org/jira/browse/PROTON-2523

Copy link
Contributor

@kgiusti kgiusti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea but to be honest all this RPM-fu is way beyond my expertise. We should get @fgiorgetti @mcressman involved for their approval.

skupper-router.spec.rpkg Show resolved Hide resolved
skupper-router.spec.rpkg Outdated Show resolved Hide resolved
skupper-router.spec.rpkg Outdated Show resolved Hide resolved
@jiridanek jiridanek force-pushed the jd_2022_03_15_rpm branch 4 times, most recently from f3305bb to 60de4b8 Compare April 7, 2022 12:24
Comment on lines 52 to 53
%{?fedora:BuildRequires: python3.9}
%{?rhel:BuildRequires: python39-devel}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is attempt to use Python 3.9 everywhere, as per #48.

ModuleNotFoundError: No module named 'proton'

That happens because python3-qpid-proton RPM installs Proton only for the system-default Python. I should've thought of that! Using static embedded build of Proton will not completely help, because the spec that @mcressman has now still needs the RPM package to do, ..., things.

Furthermore, I am not completely positive on the exact procedure to use the 3.9 Python in Fedora and CentOS. I asked on StackOverflow ;P https://stackoverflow.com/questions/71782123/how-do-i-install-python39-rpm-macros-for-fedora-35

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be resolved. We will build Qpid Proton statically as part of this RPM build anyways, which means that the python proton part can be built as well. I am not sure where to put it, though, so that it is out of the way of the user of the system, but still findable for the router. Seems to me that nonstandard location then requires some modifications in the router so that it will look there. (It can be small changes to PYTHONPATH setting, or note the -I switch for skrouterd... feels messy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attempt to use Python 3.9 everywhere is considered abandoned, because it was decided so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'll bring it up again when I'll know how to implement it cleanly; It should become easier when Proton build is embedded in building this RPM)

@jiridanek jiridanek force-pushed the jd_2022_03_15_rpm branch from 60de4b8 to 52e3561 Compare April 8, 2022 16:38
@jiridanek jiridanek merged commit e79ce3c into skupperproject:main Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add rpm .spec to skupper-router project
2 participants