Skip to content

Commit

Permalink
Using s6 service ready notification instead of sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Jun 7, 2024
1 parent ccb5628 commit 31c6a0b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .docker/aiida-core-base/s6-assets/init/aiida-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if [[ ${SETUP_DEFAULT_AIIDA_PROFILE:-true} == true ]] && ! verdi profile show ${
# For the container that includes the services, this script is called as soon as the RabbitMQ startup script has
# been launched, but it can take a while for the service to come up. If ``verdi presto`` is called straight away
# it is possible it tries to connect to the service before that and it will configure the profile without a broker.
sleep 5
rabbitmq-diagnostics check_running

# Create AiiDA profile.
verdi presto \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exec rabbitmq-diagnostics check_running > /dev/null
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

with-contenv

foreground { s6-echo "Calling /etc/init/rabbitmq.sh" }
rabbitmq-server
foreground { s6-echo "Starting RMQ server and notifying back when the service is ready" }

# -w 500: 500 ms between two invocations of ./data/check
s6-notifyoncheck -w 500 rabbitmq-server

0 comments on commit 31c6a0b

Please sign in to comment.