Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Flask_User_Reg
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mitchell Moore
Flask_User_Reg
Commits
d0d0526b
Commit
d0d0526b
authored
5 years ago
by
Mitchell Moore
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
a3fc9d30
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!35
Version 1b openstack rabbitmq
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+42
-25
42 additions, 25 deletions
README.md
with
42 additions
and
25 deletions
README.md
+
42
−
25
View file @
d0d0526b
...
...
@@ -4,51 +4,68 @@
To clone this repo use the command:
```
$ git clone https://gitlab.rc.uab.edu/mmoo97/flask_user_reg.git
```
## Prerequisites
###Clone Repository
###
Clone Repository
-
Ensure
`pip`
is installed (see: https://packaging.python.org/guides/installing-using-pip-and-virtualenv/ ).
-
Check if installed by typing
`$ pip`
for Mac/Linux or
`$ py`
for Windows.
-
Mac/Linux: Install pip using
`$ python -m pip install --user --upgrade pip`
.
-
Windows: Install pip using
`$ py -m pip install --upgrade pip`
-
Ensure you have created a
[
virtual environment
](
https://packaging.python.org/guides/installing-using-pip-and-virtual-environments
)
called
`venv`
setup within the cloned project.
-
Note, this project requires a virtual environment running python2 (2.7)
-
Note, this project requires a virtual environment running python2 (2.7
.x
)
-
Ensure Flask and other dependencies are installed using the following commands:
```
$ git checkout version-1b-local-rabbitmq
$ cd ~/your/repo/path/flask_user_reg
$ git checkout version-1b-openstack-rabbitmq
$ source venv/bin/activate
$ pip install -r requirements.txt
```
-
Note, to install flask in your own
`$HOME`
use
`pip install --user Flask`
.
### RabbitMQ
(Reference
[
Tutorial Part Four
](
https://www.rabbitmq.com/tutorials/tutorial-four-python.html
)
)
-
Install RabbitMQ server on the host machine. (Tutorials
[
here
](
https://www.rabbitmq.com/download.html
)
.)
-
Additionally, if on a Mac, it is recommended that you add the following line to your
`.bash_profile`
:
### Install RabbitMQ
(Reference:
[
here
](
https://www.rabbitmq.com/tutorials/tutorial-four-python.html
)
)
-
Install RabbitMQ server on the host machine. (
[
Installation Guide
](
https://www.rabbitmq.com/download.html
)
)
-
#### Mac/Linux
-
`$ brew update`
-
`$ brew install rabbitmq`
-
it is recommended that you add the following line to your
`.bash_profile`
:
`export PATH=$PATH:/usr/local/opt/rabbitmq/sbin`
.
-
Run the command
`$ rabbitmq-server`
. (Note, this implementation assumes RabbitMQ is running on localhost on standard port 5672)
-
Start server using the command
`$ rabbitmq-server`
. (Note, this implementation assumes RabbitMQ is running on localhost on standard port 5672)
-
#### Windows
-
Download the installer from
[
here
](
https://github.com/rabbitmq/rabbitmq-server/releases
)
and run.
-
Post install, the server should be running. To check, run
`$ rabbitmqctl.bat status`
.
-
#### CentOS 7
-
First, import signing key using
`$ rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc`
-
Next, install Erlang using
`$ yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm`
-
Finally, install RabbitMq using
`$ yum install rabbitmq-server-3.8.2-1.el8.noarch.rpm`
-
The server is not started as a daemon by default when the RabbitMQ server package is installed. To start the
daemon by default when the system boots, as an administrator run:
`$ chkconfig rabbitmq-server on`
.
-
As an administrator, start and stop the server as usual:
<br/>
`/sbin/service rabbitmq-server start`
<br/>
`/sbin/service rabbitmq-server stop`
-
Add the user "reggie" using the command
`$ rabbitmqctl add_user reggie reggie`
.
-
The current configuration assumes the following username password combination. To change the password, type
`$ rabbitmqctl change_password reggie <new_password>`
.
-
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.
## 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:
-
Open up a new ssh terminal and ssh into your ohpc node and, in a separate window, ssh into your ood node.
-
Once in, ensure your rabbitmq server is running using the command
` `
-
Additionally, ensure you have a rabbitmq user configured with the username and password as
`reggie`
.
-
```
# Run in First
$ python ohpc_consumer.py
# Run in Second
$ python ood_consumer.py
# Run in Third
$ python message_manager.py
# Run consumer on ohpc node
$ python base_consumer.py ohpc
```
-
You will notice that the script
s are all
awaiting a message to
be sent to them
.
-
To produce a message run the following
i
n the
forth
terminal session:
You will notice that the script
is
awaiting a message to
display
.
To produce a message
,
run the following
o
n the
ood node
terminal session:
```
# Run in Forth Window
$ python test_producer.py
$ python test_producer.py ohpc
```
-
Notice that the producer sends only to the specified
`ood`
and
`ohpc`
consumers and not to the
`message_manager`
consumer.
-
**Note,**
that the
`test_producer.py`
script is identical to the code within the
`ingest_data()`
function in
`run.py`
.
You should now see that the message has been sent and displayed on the ohpc node.
-
**Note,**
that the
`test_producer.py`
script is identical to the code within the
`ingest_data()`
function in
`run.py`
.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment