-
Mitchell Moore authored4646d2eb
README.md 2.12 KiB
Project Setup
To clone this repo use the command:
$ git clone https://gitlab.rc.uab.edu/mmoo97/flask_user_reg.git
Prerequisites
###Clone Repository
- Ensure
pip
is installed (see: https://packaging.python.org/guides/installing-using-pip-and-virtualenv/ ). - Ensure you have created a virtual environment
called
venv
setup within the cloned project.- Note, this project requires a virtual environment running python2 (2.7)
- Ensure Flask and other dependencies are installed using the following commands:
$ git checkout version-1b-local-rabbitmq
$ cd ~/your/repo/path/flask_user_reg
$ source venv/bin/activate
$ pip install -r requirements.txt
- Note, to install flask in your own
$HOME
usepip install --user Flask
.
RabbitMQ
(Reference Tutorial Part Four)
- Install RabbitMQ server on the host machine. (Tutorials here.)
- Additionally, if on a Mac, it is recommended that you add the following line to your
.bash_profile
:
export PATH=$PATH:/usr/local/opt/rabbitmq/sbin
.
- Additionally, if on a Mac, it is recommended that you add the following line to your
- Run the command
$ rabbitmq-server
. (Note, this implementation assumes RabbitMQ is running on localhost on standard port 5672)
Test RabbitMQ
For a simple example on the functionality of RabbitMQ, do the following:
- Open 4 separate terminal sessions whilst in the
flask_user_reg
directory and enter one of the following commands per window:
# Run in First
$ python ohpc_consumer.py
# Run in Second
$ python ood_consumer.py
# Run in Third
$ python message_manager.py
- You will notice that the scripts are all awaiting a message to be sent to them.
- To produce a message run the following in the forth terminal session:
# Run in Forth Window
$ python test_producer.py
- Notice that the producer sends only to the specified
ood
andohpc
consumers and not to themessage_manager
consumer.-
Note, that the
test_producer.py
script is identical to the code within theingest_data()
function inrun.py
.
-
Note, that the