Skip to content

Add RabbitMQ and dedicated Erlang package - #4437

Merged
hgy59 merged 18 commits into
SynoCommunity:masterfrom
DigitalBox98:rabbitmq-server
Feb 24, 2021
Merged

hgy59 merged 18 commits into
SynoCommunity:masterfrom
DigitalBox98:rabbitmq-server

Conversation

@DigitalBox98

@DigitalBox98 DigitalBox98 commented Feb 10, 2021 •

Copy link
Copy Markdown
Contributor

Motivation: have RabbitMQ Server working on NAS Synology
Linked Issues: closes #4436

Checklist

  • Build rule all-supported completed successfully
  • Package upgrade completed successfully
  • New installation of package completed successfully

Remarks:

This PR includes an updated version of the standalone Erlang package of #4436.

Most of the following description is outdated:

Some part of this PR are working and others don't.
Comments are welcome for any hint on how to improve the packaging part which is failing.
Note : the pure cross compilation part is working fine and RabbitMQ Server can be launched manually on the NAS.

Notes :

  1. native/elixir : this part is working fine but has to be improved because manual export of the PATH was necessary to "native/erlang/work-native/install/usr/local/bin" (including it in the makefile wasn't recognized)
  2. cross/rabbitmq-server : this part is working fine (a patch has been created for the Makefile else the rabbitmq-sever.plist was empty)
  3. spk/rabbitmq-server : this part is failing during the stripping process, and I didn't identify the root cause , ie why the files are missing in the staging dir.

Below is one of the error raised :
===> Stripping binaries and libraries of rabbitmq-server
Stripping lib/erlang/lib/rabbitmq_server-3.7.15/ebin/rabbit.app... chmod: impossible d'accéder à 'XXX/spksrc/spk/rabbitmq-server/work-braswell-6.1/staging/lib/erlang/lib/rabbitmq_server-3.7.15/ebin/rabbit.app': Aucun fichier ou dossier de ce type

Investigation for the spk/rabbitmq-server part :
Looking for the important part, ie the script which is launching the server "rabbitmq-server ", I can see that :

  1. It's correctly located in the "install/usr/local/rabbitmq-server/" dir : ie, work-braswell-6.1/install/usr/local/rabbitmq-server/lib/erlang/lib/rabbitmq_server-3.7.15/sbin/rabbitmq-server
  2. It's not located in the "install/var/packages/rabbitmq-server/target " as this directory is empty
  3. It's not located in the "work-braswell-6.1/staging" as this directory is empty

Verifying the pure cross compiled part is OK :

  • Create a tar.gz of the directory "install/usr/local/rabbitmq-server" from the "cross" part
  • Put this archive on the NAS and extract it
  • Indicate the path to Erlang : export PATH=/var/packages/erlang/target/bin/:$PATH
  • Launch the server : sudo env "PATH=$PATH" ./rabbitmq-server (from rabbitmq-server/lib/erlang/lib/rabbitmq_server-3.7.15/sbin)
    Note : pre-requisite is that Erlang is installed on the NAS

Checking on DSM 7.0 below :
server

@ymartin59

Copy link
Copy Markdown
Contributor

@DigitalBox98

Copy link
Copy Markdown
Contributor Author

Thank you, I will have a look at the "demoservice" spk and check if the results are better : )

@DigitalBox98

Copy link
Copy Markdown
Contributor Author

@hgy59 thank you very much for the advices, all is working fine now ! (compiled fine for DSM 6 & DSM 7, tested fine on DSM 7)

I will try to improve the service part as suggested by ymartin59.
The installation part will require also some improvements because of the "/etc/rabbitmq" folder which need to be created post installation.

@th0ma7

th0ma7 commented Feb 17, 2021

Copy link
Copy Markdown
Contributor

@DigitalBox98

The installation part will require also some improvements because of the "/etc/rabbitmq" folder which need to be created post installation.

Actually, you should use proper --prefix option at configure time to ensure the /etc folder ends-up being /var/packages/rabbitmq/target/etc. Or at install time (or both) like what @hgy59 was proposing such as $(RUN) $(MAKE) DESTDIR=$(INSTALL_DIR) PREFIX=$(INSTALL_PREFIX) install

@DigitalBox98

DigitalBox98 commented Feb 17, 2021 •

Copy link
Copy Markdown
Contributor Author

Ok after investigating all the issues and thanks to all the advices, I have now a package compiling and working fine on DSM7. The service is also working fine with start/stop fully recognized.

I have updated the DSM6 version in this PR but I can't test it, especially the SPK_LINKS part added for Erlang.
Any additional comments are welcomed as I had to patch the rabbitmqserver script for this PR (the server was not started at the beginning due to HOME set to blank...)

For those who would like to access to the admin GUI, they are still some improvements required, but you can test it by typing :

sudo su - sc-rabbitmq -s /bin/sh
export RABBITMQ_HOME=/var/packages/rabbitmq/target
export RABBITMQ_CONF_ENV_FILE=${RABBITMQ_HOME}/etc/rabbitmq/rabbitmq-env.conf
export RABBITMQ_ENABLED_PLUGINS_FILE=/var/packages/rabbitmq/target/etc/rabbitmq/enabled_plugins
cd /var/packages/rabbitmq/target/lib/rabbitmq_server-3.8.12/sbin
./rabbitmq-plugins enable rabbitmq_management

rabbitmq

Comment thread spk/erlang/Makefile Resolved
Comment on lines +8 to +11
service_preinst ()
{
echo "service_preinst ${SYNOPKG_PKG_STATUS}" >> $INST_LOG
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you must not implement empty functions here (and below)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok it has been removed


service_postinst ()
{
echo "service_postinst ${SYNOPKG_PKG_STATUS}" >> $INST_LOG

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

such a log entry is done by the framework and is obsolete here.

@hgy59

hgy59 commented Feb 17, 2021

Copy link
Copy Markdown
Contributor

@DigitalBox98 thanks for bringing us RabbitMQ!

I rather would name this package RabbitMQ (instead of RabbitMQ-Server) as it is obvious that this is the server part (the web gui and the CLI login display RabbitMQ too).
(i.e. cross/rabbitmq, spk/rabbitmq and DISPLAY_NAME=RabbitMQ)

- add native/rsync and native/zip to fix 'make install'
@hgy59

hgy59 commented Feb 19, 2021

Copy link
Copy Markdown
Contributor

@DigitalBox98 as rsync and zip are not installed in the synocommunity/spksrc docker image I have added those native packages.

@hgy59

hgy59 commented Feb 19, 2021

Copy link
Copy Markdown
Contributor

unfortunatley the github build action still fails due to ejabberd - but rabbitmq now builds successfully.

@DigitalBox98

Copy link
Copy Markdown
Contributor Author

Ok I've completed the renaming of the package to RabbitMQ with the other minor fixes.

I will try to improve the installation of RabbitMQ : request to indicate the admin name/password and process the plugins installation in the post install. It would allow to have access to the admin part by default

Comment thread spk/rabbitmq/Makefile Resolved
- fix patch of rabbitmq-defaults in service_postinst()
- add default config files to package
- move config files to target/var to use generic backup/restore on package update
- install enabled_plugins with active management plugin
- fix rabbitmq-env.conf (remove RABBITMQ_ prefixes)
- fix cross/rabbitmq/PLIST file types (use rsc for files that are neither bin nor lib type)
@hgy59

hgy59 commented Feb 21, 2021 •

Copy link
Copy Markdown
Contributor

RabbitMQ installs now with management plugin:

Sun Feb 21 20:39:37 CET 2021
Starting rabbitmq command /volume1/@appstore/rabbitmq/lib/rabbitmq_server-3.8.12/sbin/rabbitmq-server
Configuring logger redirection

  ##  ##      RabbitMQ 3.8.12
  ##  ##
  ##########  Copyright (c) 2007-2021 VMware, Inc. or its affiliates.
  ######  ##
  ##########  Licensed under the MPL 2.0. Website: https://rabbitmq.com

  Doc guides: https://rabbitmq.com/documentation.html
  Support:    https://rabbitmq.com/contact.html
  Tutorials:  https://rabbitmq.com/getstarted.html
  Monitoring: https://rabbitmq.com/monitoring.html

  Logs: /var/packages/rabbitmq/target/var/rabbit@{Diskstation}.log
        /var/packages/rabbitmq/target/var/rabbit@{Diskstation}_upgrade.log

  Config file(s): /var/packages/rabbitmq/target/var/rabbitmq.conf

  Starting broker... completed with 3 plugins.

This is running on DS-115j (armada370) with DSM 6.2.3. The package is compiled for armv7-6.1.

@hgy59

This comment has been minimized.

@@ -0,0 +1 @@
loopback_users.guest = false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@DigitalBox98 I have removed log.dir definition here, as LOG_BASE in rabbitmq-env.conf seems to be enough.

- use github repo to download more current releases
- adjust license information (as seen in github repo)
- adjust PLIST file
- use github user name as maintainer
- reset SPK_REV to 1
- use current erlang icon
- add port configurations grouped by plugin
- remove service port (keep admin port only)
@hgy59

hgy59 commented Feb 22, 2021

Copy link
Copy Markdown
Contributor

@DigitalBox98 I have included the port configuration. The ports used by any plugin is included, so it is possible to configure the DSM firewall for any of the RabbitMQ provided plugins.

Can you please verify the current version with DSM 7?
May be we need the Port Config Worker and Resource Acquisition on DSM7?

@publicarray what is your experience with Port Configuration for packages on DSM7?.

On DSM 6 everything works as expected.

@hgy59 hgy59 changed the title RabbitMQ Server Add RabbitMQ and dedicated Erlang package Feb 22, 2021
@hgy59 hgy59 mentioned this pull request Feb 22, 2021
3 tasks done
@DigitalBox98

Copy link
Copy Markdown
Contributor Author

@hgy59 many thanks for the various improvements.

Here are my findings for the DSM7 version :

  • The new cross/erlang digests links were not recognized, I had to fix them (not relative to DSM7)
  • On my DSM7 version, I have also added in the Erlang SPK Makefile : SPK_USR_LOCAL_LINKS = bin:bin/erlc bin:bin/erl (I don't remember if this was specific for DSM7)
  • I have found an issue on the logging part on DSM7 preventing the server to work: removing the " >> ${INST_LOG} 2>&1" in the service_postinst fix the issue. I suspect on DSM7, the INST_LOG is referencing an unauthorized folder

After that, all seems to work fine ! (plugins installed & GUI admin available)

@hgy59

hgy59 commented Feb 23, 2021 •

Copy link
Copy Markdown
Contributor
* The new cross/erlang digests links were not recognized, I had to fix them (not relative to DSM7)

You reverted my update to Erlang 23.2.5 (and github repository).
It worked well with 23.2.5. May be you did not completly update your local repo?
And it works on #4333 too.

@DigitalBox98

Copy link
Copy Markdown
Contributor Author

My bad. I've checked again and indeed the 23.2.5 links are fine.
I've reverted back the changes and it should be ok now.

@hgy59
hgy59 merged commit 15a7984 into SynoCommunity:master Feb 24, 2021
@hgy59 hgy59 added the status/published Published and activated (may take up to 48h until visible in DSM package manager) label Feb 25, 2021
@DigitalBox98
DigitalBox98 deleted the rabbitmq-server branch February 26, 2021 11:30
AlexPresso pushed a commit to AlexPresso/spksrc that referenced this pull request Jan 30, 2025
* Add Erlang v23.2.5
* Add RabbitMQ Server of latest version
- add native/rsync and native/zip to fix 'make install'
* installation improvements
- add default config files to package
- install enabled_plugins with active management plugin
* RabbitMQ: add port configurations
- add port configurations grouped by plugin
- remove service port (keep admin port only)

Co-authored-by: sadmin <[email protected]>
Co-authored-by: hgy59 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/published Published and activated (may take up to 48h until visible in DSM package manager)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants