Bug 26741 - Make rabbitmq-server suggested rather than required
Summary: Make rabbitmq-server suggested rather than required
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Victor Grousset/tuxayo
URL:
Keywords:
Depends on: 22417
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-20 00:33 UTC by David Cook
Modified: 2021-12-13 21:09 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 26741: Remove rabbitmq-server requirements (replace with suggestions) (1.51 KB, patch)
2020-10-20 00:34 UTC, David Cook
Details | Diff | Splinter Review
Bug 26741: Make rabbitmq-server a 'recommended' package (3.12 KB, patch)
2020-10-21 01:32 UTC, Mason James
Details | Diff | Splinter Review
Bug 26741: Change information field from Recommended to Recommends (1.92 KB, patch)
2020-10-21 05:10 UTC, David Cook
Details | Diff | Splinter Review
Bug 26741: Remove rabbitmq-server requirements (replace with suggestions) (1.58 KB, patch)
2020-11-04 02:36 UTC, Mason James
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2020-10-20 00:33:42 UTC
While some parts of Koha will require RabbitMQ, we should make rabbitmq-server a suggested dependency rather than a required dependency, since it shouldn't have to be run on the same server as Koha.

In fact, the RabbitMQ website explicitly recommends not collocating RabbitMQ on the same server as other applications.
Comment 1 David Cook 2020-10-20 00:34:30 UTC
Created attachment 112012 [details] [review]
Bug 26741: Remove rabbitmq-server requirements (replace with suggestions)
Comment 2 Mason James 2020-10-21 01:32:23 UTC
Created attachment 112083 [details] [review]
Bug 26741: Make rabbitmq-server a 'recommended' package

to test...

1/ apply patch, build new package

2/ install package with  'apt install koha-common', observe rabbitmq-server package is installed

3/ install package with 'apt install --no-install-recommends koha-common', observe rabbitmq-server package is *not* installed
Comment 3 David Cook 2020-10-21 04:37:11 UTC
I'm trying to build on Jessie but getting the following:
E: Unable to locate package libemail-stuffer-perl
E: Unable to locate package libplack-middleware-logwarn-perl

But Jessie is EOL iirc so I guess it's time to update the build box...
Comment 4 David Cook 2020-10-21 05:02:31 UTC
dpkg-source: warning: unknown information field 'Recommended' in input data in package's section of control info file
dpkg-source: warning: unknown information field 'Recommended' in input data in package's section of control info file

That should be Recommends rather than Recommended
Comment 5 David Cook 2020-10-21 05:08:56 UTC
Comment on attachment 112083 [details] [review]
Bug 26741: Make rabbitmq-server a 'recommended' package

Review of attachment 112083 [details] [review]:
-----------------------------------------------------------------

::: debian/koha-common.postinst
@@ +261,5 @@
> +# config rmq, if rmq is installed
> +if dpkg-query -W -f='${db:Status-Abbrev}' rabbitmq-server | grep -q ^.i ; then
> +    rabbitmq-plugins enable rabbitmq_stomp
> +    service rabbitmq-server restart
> +fi

I haven't tested this yet, but why not just do "dpkg -l rabbitmq-server"? The if/then construct will do the right thing with the exit code.
Comment 6 David Cook 2020-10-21 05:10:35 UTC
Created attachment 112091 [details] [review]
Bug 26741: Change information field from Recommended to Recommends
Comment 7 David Cook 2020-10-21 05:27:55 UTC
(In reply to Mason James from comment #2)
> Created attachment 112083 [details] [review] [review]
> Bug 26741: Make rabbitmq-server a 'recommended' package
> 
> to test...
> 
> 1/ apply patch, build new package
> 
> 2/ install package with  'apt install koha-common', observe rabbitmq-server
> package is installed
> 
> 3/ install package with 'apt install --no-install-recommends koha-common',
> observe rabbitmq-server package is *not* installed

My test plan
1. Apply the patch to a Koha git repo
2. Download https://gitlab.com/minusdavid/koha-deb-builder-docker and follow the instructions in the README
3. Run winpty docker run --rm -it debian:stretch
4. Copy the built koha-common*.deb package into the new empty Docker container
5. apt-get update
6. apt-get install wget gnupg
7. wget -q -O- https://debian.koha-community.org/koha/gpg.asc | apt-key add -
8. echo 'deb http://debian.koha-community.org/koha stable main' | tee /etc/apt/sources.list.d/koha.list
9. apt-get update
10. apt install ./<built koha-common*.deb package>
11. Review "The following NEW packages will be installed" and note rabbitmq-server is included
12. apt install --no-install-recommends ./<built koha-common*.deb package>
13. Review "The following NEW packages will be installed" and note rabbitmq-server is included
Comment 8 David Cook 2020-10-21 05:30:09 UTC
Note that there are a lot of recommended packages that aren't installed when using "--no-install-recommends":

Recommended packages:
  ssl-cert default-mta | mail-transport-agent exim4 | postfix | mail-transport-agent docbook-xml iamerican | ispell-dictionary wamerican | wordlist rabbitmq-server liburi-escape-xs-perl libasync-interrupt-perl libev-perl
  | libevent-perl libguard-perl libcgi-fast-perl libfreezethaw-perl libclass-xsaccessor-perl libclass-c3-xs-perl libconfig-tiny-perl libdevel-argnames-perl libdate-calc-xs-perl libsql-translator-perl libmoosex-nonmoose-perl gcc
  libmime-tools-perl libsys-hostname-long-perl libauthen-sasl-perl libdevel-lexalias-perl libglib2.0-data xdg-user-dirs libpod-coverage-perl libtest-pod-perl ghostscript gsfonts libintl-xs-perl javascript-common libjson-xs-perl
  libnet-idn-encode-perl krb5-locales liblog-dispatch-perl libipc-shareable-perl libmath-random-isaac-xs-perl libev-perl libio-socket-ip-perl libio-socket-socks-perl libmojo-server-fastcgi-perl libdevel-partialdump-perl libgpm2
  libgssapi-perl libio-pty-perl libtext-wrapper-perl libfcgi-perl libfcgi-procmanager-perl libmodule-refresh-perl libhijk-perl libhtml-lint-perl libtype-tiny-xs-perl tcpd libwww-form-urlencoded-xs-perl libxml-sax-expat-perl
  libtie-ixhash-perl libxml-xpathengine-perl | libxml-xpath-perl libterm-readkey-perl bzip2 file xz-utils xauth rename psmisc libserver-starter-perl

I think that this probably will have unintended consequences, so I'm thinking it's best to fail this one for now. 

I think the original idea of using Suggests rather than Recommends might be the safest.
Comment 9 Mason James 2020-11-04 02:36:25 UTC
Created attachment 112972 [details] [review]
Bug 26741: Remove rabbitmq-server requirements (replace with suggestions)

Signed-off-by: Mason James <mtj@kohaaloha.com>
Comment 10 Mason James 2020-11-04 02:38:34 UTC
(In reply to David Cook from comment #8)
> Note that there are a lot of recommended packages that aren't installed when
> using "--no-install-recommends":
> 
> I think the original idea of using Suggests rather than Recommends might be
> the safest.

i'm happy with this idea, so i sign-off :)
Comment 11 David Cook 2020-11-04 02:41:50 UTC
(In reply to Mason James from comment #10)
>
> i'm happy with this idea, so i sign-off :)

Great!
Comment 12 David Cook 2020-11-10 23:32:12 UTC
When this and related bugs are pushed, we can also update koha-testing-docker to use a separate Docker container for the RabbitMQ server...
Comment 13 Victor Grousset/tuxayo 2020-11-27 19:10:40 UTC
> 4. Copy the built koha-common*.deb package into the new empty Docker container

Like with a volume?

Also, got an error when building, reported here:
https://gitlab.com/minusdavid/koha-deb-builder-docker/-/issues/1
Comment 14 David Cook 2020-11-29 22:26:01 UTC
(In reply to Victor Grousset/tuxayo from comment #13)
> > 4. Copy the built koha-common*.deb package into the new empty Docker container
> 
> Like with a volume?
> 

Nah just with "docker cp"

> Also, got an error when building, reported here:
> https://gitlab.com/minusdavid/koha-deb-builder-docker/-/issues/1

Yeah, I'm fairly familiar with that error at this point. I'll comment there.
Comment 15 Victor Grousset/tuxayo 2020-12-11 13:55:45 UTC
Why was the shebang changed in /debian/koha-common.postinst ?

-#!/bin/sh
+a!/bin/sh
Comment 16 Victor Grousset/tuxayo 2020-12-11 14:25:54 UTC
13. Review "The following NEW packages will be installed" and note rabbitmq-server is included

Not included right?
Comment 17 David Cook 2020-12-14 00:46:08 UTC
(In reply to Victor Grousset/tuxayo from comment #15)
> Why was the shebang changed in /debian/koha-common.postinst ?
> 
> -#!/bin/sh
> +a!/bin/sh

That's definitely a vim typo
Comment 18 David Cook 2020-12-14 00:47:16 UTC
(In reply to Victor Grousset/tuxayo from comment #16)
> 13. Review "The following NEW packages will be installed" and note
> rabbitmq-server is included
> 
> Not included right?

Hopefully... October feels a long time ago.

I'd probably mark this as Failed QA. 

I doubt I'm going to work on it again though. Plus, I think that this is handled by a different bug now anyway...
Comment 19 Victor Grousset/tuxayo 2020-12-14 15:04:01 UTC
For the record,

> 11. Review "The following NEW packages will be installed" and note
> rabbitmq-server is included

Indeed, rabbitmq-server is listed in:
- The following additional packages will be installed:
- The following NEW packages will be installed:

> 13. Review "The following NEW packages will be installed" and note
> rabbitmq-server is included

Indeed, rabbitmq-server is listed in:
- The following additional packages will be installed:
- The following NEW packages will be installed:


(In reply to David Cook from comment #18)
> (In reply to Victor Grousset/tuxayo from comment #16)
> > 13. Review "The following NEW packages will be installed" and note
> > rabbitmq-server is included
> > 
> > Not included right?
> 
> Hopefully... October feels a long time ago.

I don't know, the original text matches the test plan results, so maybe I just confused you ^^

> I'd probably mark this as Failed QA. 
> 
> I doubt I'm going to work on it again though. Plus, I think that this is
> handled by a different bug now anyway...

Failed QA (+unassigned) is because that would better indicate that this can be eventually rescued right? Compared to in discussion. (not an expert in statuses ^^)
Comment 20 David Cook 2020-12-14 22:38:11 UTC
(In reply to Victor Grousset/tuxayo from comment #19)
> Failed QA (+unassigned) is because that would better indicate that this can
> be eventually rescued right? Compared to in discussion. (not an expert in
> statuses ^^)

You're probably right.

Although I keep thinking that Mason, myself, and others talked about how we're going to stay with "requires" for the time being. I can't find that conversation now though.

Plus Bug 26672 provides some alternatives for people who don't want to install rabbitmq-server on the same server, although I'm not sure how functional those are in practice..
Comment 21 Jonathan Druart 2021-02-16 07:51:31 UTC
We answer this problem with the new debian packages: koha-core vs koha-full.