Bug 26741 - Make rabbitmq-server suggested rather than required
Summary: Make rabbitmq-server suggested rather than required
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: David Cook
QA Contact: Testopia
URL:
Keywords:
Depends on: 22417
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-20 00:33 UTC by David Cook
Modified: 2020-11-10 23:32 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
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...