forked from internet2/InCommonTAP-Examples
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
RabbitMQ with combined config for complex demo and TIER demo SORs
Showing
5 changed files
with
250 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
#to do | ||
FROM tier/rabbitmq:latest | ||
|
||
COPY container_files/etc-rabbitmq/* /etc/rabbitmq/ | ||
COPY container_files/usr-local-bin/* /usr/local/bin/ | ||
|
||
ENV RABBITMQ_PID_FILE=/var/run/rabbitmq/pid | ||
|
||
# Must be on /var/lib/rabbitmq (this is the same place where queues are defined) | ||
ENV RABBITMQ_INIT_DONE_FILE=/var/lib/rabbitmq/initialization.done | ||
|
||
ENTRYPOINT ["/usr/local/bin/demo-entrypoint.sh"] | ||
|
||
CMD ["rabbitmq-server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Allow guest access from anywhere (change this in production!) | ||
loopback_users = none | ||
management.load_definitions = /etc/rabbitmq/rabbitmq.json |
215 changes: 215 additions & 0 deletions
215
Util/RabbitMQ/container_files/etc-rabbitmq/rabbitmq.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,215 @@ | ||
{ | ||
"bindings": [ | ||
{ | ||
"arguments": {}, | ||
"destination": "firehose.topic", | ||
"destination_type": "exchange", | ||
"routing_key": "#", | ||
"source": "amq.rabbitmq.trace", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"destination": "midpoint_hr", | ||
"destination_type": "queue", | ||
"routing_key": "midpoint_hr", | ||
"source": "midpoint", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"destination": "sor_person", | ||
"destination_type": "queue", | ||
"routing_key": "sor_person", | ||
"source": "sor", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"destination": "ACCT101", | ||
"destination_type": "queue", | ||
"routing_key": "basis.courses.ACCT101", | ||
"source": "amq.topic", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"destination": "CS101", | ||
"destination_type": "queue", | ||
"routing_key": "basis.courses.CS101", | ||
"source": "amq.topic", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"destination": "CS102", | ||
"destination_type": "queue", | ||
"routing_key": "basis.courses.CS102", | ||
"source": "amq.topic", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"destination": "MATH101", | ||
"destination_type": "queue", | ||
"routing_key": "basis.courses.MATH101", | ||
"source": "amq.topic", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"destination": "TIER101", | ||
"destination_type": "queue", | ||
"routing_key": "basis.courses.TIER101", | ||
"source": "amq.topic", | ||
"vhost": "/" | ||
} | ||
], | ||
"exchanges": [ | ||
{ | ||
"arguments": {}, | ||
"auto_delete": false, | ||
"durable": true, | ||
"internal": false, | ||
"name": "midpoint", | ||
"type": "topic", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"auto_delete": false, | ||
"durable": true, | ||
"internal": false, | ||
"name": "sor", | ||
"type": "topic", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"auto_delete": false, | ||
"durable": true, | ||
"internal": false, | ||
"name": "firehose.topic", | ||
"type": "topic", | ||
"vhost": "/" | ||
} | ||
], | ||
"parameters": [], | ||
"permissions": [ | ||
{ | ||
"configure": ".*", | ||
"read": ".*", | ||
"user": "guest", | ||
"vhost": "/", | ||
"write": ".*" | ||
}, | ||
{ | ||
"configure": ".*", | ||
"read": ".*", | ||
"user": "mysql", | ||
"vhost": "/", | ||
"write": ".*" | ||
}, | ||
{ | ||
"configure": ".*", | ||
"read": ".*", | ||
"user": "sis_user", | ||
"vhost": "/", | ||
"write": ".*" | ||
}, | ||
{ | ||
"configure": ".*", | ||
"read": ".*", | ||
"user": "midpoint", | ||
"vhost": "/", | ||
"write": ".*" | ||
} | ||
], | ||
"policies": [], | ||
"queues": [ | ||
{ | ||
"arguments": {}, | ||
"auto_delete": false, | ||
"durable": true, | ||
"name": "firehose", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"auto_delete": false, | ||
"durable": true, | ||
"name": "midpoint_hr", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"auto_delete": false, | ||
"durable": true, | ||
"name": "sor_person", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"auto_delete": false, | ||
"durable": true, | ||
"name": "CS102", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"auto_delete": false, | ||
"durable": true, | ||
"name": "CS101", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"auto_delete": false, | ||
"durable": true, | ||
"name": "MATH101", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"auto_delete": false, | ||
"durable": true, | ||
"name": "ACCT101", | ||
"vhost": "/" | ||
}, | ||
{ | ||
"arguments": {}, | ||
"auto_delete": false, | ||
"durable": true, | ||
"name": "TIER101", | ||
"vhost": "/" | ||
} | ||
], | ||
"rabbit_version": "3.3.5", | ||
"users": [ | ||
{ | ||
"name": "midpoint", | ||
"password_hash": "NPRHRH/7sII4hjRpMjx7nGv8Hts=", | ||
"tags": "" | ||
}, | ||
{ | ||
"name": "mysql", | ||
"password_hash": "F/ngi0JcvYcXYbloSEISdlYqKfo=", | ||
"tags": "" | ||
}, | ||
{ | ||
"name": "sis_user", | ||
"password_hash": "5x3yS5eXea8iSGejDoh4L9Ex2xk=", | ||
"tags": "administrator" | ||
}, | ||
{ | ||
"name": "guest", | ||
"password_hash": "4e2kx67rm/QsibQrLcfxyMQMDv4=", | ||
"tags": "administrator" | ||
} | ||
], | ||
"vhosts": [ | ||
{ | ||
"name": "/" | ||
} | ||
] | ||
} |
8 changes: 8 additions & 0 deletions
8
Util/RabbitMQ/container_files/usr-local-bin/demo-entrypoint.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -e $RABBITMQ_INIT_DONE_FILE ]; then | ||
/usr/local/bin/initialize-rabbitmq.sh & | ||
else | ||
echo "RabbitMQ was already initialized" | ||
fi | ||
/usr/local/bin/entrypoint.sh "$@" |
11 changes: 11 additions & 0 deletions
11
Util/RabbitMQ/container_files/usr-local-bin/initialize-rabbitmq.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo "Executing RabbitMQ initialization" | ||
echo "Waiting for the server to start up..." | ||
rabbitmqctl -t 30 wait $RABBITMQ_PID_FILE | ||
echo "OK, creating sampleQueue..." | ||
rabbitmqadmin declare queue name=sampleQueue | ||
echo "Done" | ||
touch $RABBITMQ_INIT_DONE_FILE |