This is a flask application that leverages [RabbitMQ](https://www.rabbitmq.com/) and [Celery](https://docs.celeryproject.org/en/latest/getting-started/introduction.html)
to asynchronously create a Cheaha user account. Currently the project is being developed on an Openstack cluster.
- Note that rabbitmqctl may require sudo permissions and that changing the password will require a password
change in the credentials within `test_producer.py` and `base_consumer.py` as well.
# Introduction
### Setup pre commit hook
- via Homebrew(Mac)
This is a flask application that leverages [RabbitMQ](https://www.rabbitmq.com/) and [Celery](https://docs.celeryproject.org/en/latest/getting-started/introduction.html)
```shell
brew install pre-commit
```
to asynchronously create a Cheaha user account. Currently the project is being developed on an Openstack cluster.
- via pip
# Project Setup
```shell
pip install pre-commit
```
Since this project is currently being developed only on an Openstack cluster all you will need to do to get started is to either create a new cluster referencing the steps [here](https://gitlab.rc.uab.edu/rc/cod-heat-stack) or work off of your existing one that will already have everything set up as part of the cluster creation through ansible.
After pre-commit is installed, run install in the repo directory:
```shell
$ pre-commit install
> pre-commit installed at .git/hooks/pre-commit
```
# Run Project
## 1. Connect to OHPC/OOD
1. Network Setup: <br>
Assuming proper steps have been run to provision your openstack cluster, your network
The project should already be running if your cluster deployment ran completely and correctly. You will need to edit your hosts file to point to the node you are wanting to work on if you haven't already done so in your cluster setup.
## 7. Connect to Server
Open a new browser window and connect to the __OOD__ node by typing `http://164.111.161.xxx:5000` in the
address bar replacing `.xxx` with the final octet of the __OOD__ node. You should see something like this: <br>
- You should see an overlay signifying the account is being created. After 5 seconds it should disappear and signify the account creation has been successful.
- You can now enter the command `kill %1 %2` to terminate the celery worker and the flask server.
- You can view the output/errors of either the worker and flask server by opening `flask.out`, `flask.err`,
`celery.out`, or `celery.err`.
From here you can confirm that the account-app is working by navigating to rc.uab.edu/flask_user_reg or the node IP and port 5000 if you prefer.