Issues with RabbitMQ in Singularity container

One of our users was experiencing some trouble starting the RabbitMQ server inside a Singularity container, see the following post on the (deprecated) mailing list:

https://groups.google.com/g/aiidausers/c/VocNFWL-pBk/m/d3Wv6hTvAwAJ

I’m reposting the question below. Maybe @jusong.yu has some ideas as our resident container expert?

We are facing some issues during building singularity image (apptainer version 1.1.2-1.el7) of AiiDA v2.3.1, while installing and running the rabbitmq-server. We have tried using rabbitmq-server-3.8.3 but we cannot start the rabbitmq, when we are trying to start the server using

  rabbitmq-server -detached

there is no message that the server started. and when we do verdi status, we are getting the following error:

Unable to connect to rabbitmq with URL: amgp://guest: guest@127.0.0.1:5672?heartbeat=600
Error: ConnectionError: [Erro 111] Connect call failed ('127.0.0.1', 5672)

Not a rabbitmq expert but here are some thoughts on things to try.

Maybe try starting it without -detached and look at the output to know whether it works?

Once you know this, check e.g. with ps -ef whether the rabbitmq-server process continues running after rabbitmq-server -detached

If that is the case, check whether the port is reachable, e.g. via nc -v 127.0.0.1 5672

I don’t know whether localhost==127.0.0.1 in your singularity container - if not, that may explain it.

@mbercx Thanks for moving the discussion to discourse.

Hi @rita021989, sorry for the late reply. From my experience with singularity, it can use docker image to create container. Did you create a image from scratch and install aiida-core and RMQ/PostgreSQL? We now have a new docker image that handles these two services inside the container. Maybe you can give it a try.
To pull the image with apptainer (or singularity) you can run:

apptainer run docker://aiidateam/aiida-core-with-services:edge