Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • mmoo97/flask_user_reg
  • tr27p/flask_user_reg
  • ishan747/flask_user_reg
  • louistw/flask_user_reg
  • krish94/flask_user_reg
  • rrand11/flask_user_reg
  • ravi89/flask_user_reg
7 results
Show changes
Commits on Source (111)
# Introduction
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.
# Project Setup
To clone this repo use the command:
```
$ git clone https://gitlab.rc.uab.edu/mmoo97/flask_user_reg.git
$ cd flask_user_reg
```
## Prerequisites
- Ensure `pip` is installed (see: https://packaging.python.org/guides/installing-using-pip-and-virtualenv/ ).
- 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)
- Ensure Flask and other dependencies are installed using the following commands:
### Setup a Virtual Environment
- Ensure you have created a [virtual environment](https://docs.python.org/3/library/venv.html)
called `venv` setup running python3.
- Note, this project requires a virtual environment running __python3__ (__3.6.8__ in this case).
- Create this by navigating to you home directory via typing `$ cd` and entering the following commands:<br>
```
$ python3 -m venv ~/venv
$ source ~/venv
```
- Upon Activation, you should see the prompt update accordingly:
```
[centos@ood ~]$ <------Old Prompt
(venv) [centos@ood ~]$ <------New Prompt
```
In this case, the env name is displayed as `venv` but would change to reflect whatever name you initialized it with
in the previous step. Additionally, this example is running on the `ood node` provisioned
via __OpenStack__.
- Ensure [pip](https://docs.python.org/3/installing/index.html) is installed.
- #### Mac/Linux
- Check if installed by typing `$ pip`
- Install pip using `$ python -m pip install --user --upgrade pip`.
- #### Windows
- Check if installed using `$ py`
- Install pip using `$ py -m pip install --upgrade pip`<br><br>
- Ensure Flask and other dependencies are installed to you virtual environment using the following commands:
```
$ cd ~/your/repo/path/flask_user_reg
$ source venv/bin/activate
$ pip install -r requirements.txt
```
- Note, to install flask in your own `$HOME` use `pip install --user Flask`.
- Note, to install flask in your own `$HOME` use `pip install --user Flask`.
### 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`.
- 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.
# Run Project
## 1. Connect to OHPC/OOD
1. Network Setup: <br>
Assuming proper steps have been run to provision your openstack cluster, your network
topology should look like the following:<br>
![Openstack Network Topology](/docs/images/network_topology.png)
2. Locate Floating Ip for each instance: <br>
![Research Computing Network](/docs/images/rc-network%20.png)<br>
According to this diagram of the network infrastructure, the IP Addresses that you will need to
connect to in order to ssh into each machine will be `164.111.161.xxx` where
`.xxx` is the last octet of your assigned Floating IP Addresses shown below.<br>
![Floating IP Addresses](/docs/images/floating_ips.png)<br>
Note that these numbers will typically vary depending on factors in the provisioning
process.
3. SSH into each machine: <br>
Now that you have the IP Addresses of the OHPC and OOD nodes, you can connect
to them via the following command in two separate shell windows/tabs: <br>
```
$ ssh centos@164.111.161.xxx
```
4. Drop Firewall: <br>
Currently, the firewall prevents us from connecting to our soon to be running flask app.
To check if the firewall is active, type: <br>
`$ sudo systemctl status firewalld` <br>
In the case the firewall is still active, type: <br>
`$ sudo systemctl stop firewalld` <br>
In the case you need to turn the firewall back on, type: <br>
`sudo systemctl start firewalld`
5. Edit Security Rules: <br>
Lastly, we want to make sure that our network it open to run on our flask application
which runs on `localhost:5000` by default. Modify your __Default__ security group to
reflect the following rules: <br>
![Security Rules](/docs/images/security_rules.png) <br>
The main takeaway/modification in these rules is that traffic is allowed in and out of port 5000.
## 2. Initialize RabbitMQ
Make sure that you are running rabbitmq via the command `sudo rabbitmq server`.
## 3. Test RabbitMQ
For a simple example on the functionality of RabbitMQ, do the following:
- Open up a new ssh terminal and ssh into your ohpc node and, in a separate window, ssh into your ood node.
- Additionally, ensure you have a rabbitmq user configured with the username and password as `reggie`.
```
# Run consumer on ohpc node
$ python base_consumer.py ohpc
```
You will notice that the script is awaiting a message to display.
To produce a message, run the following on the ood node terminal session:
```
$ python test_producer.py ohpc
```
You should now see that the message has been sent and displayed on the ohpc node.
## 4. Celery Worker
In order to execute our tasks asychronously, we create a celery worker using the fllowing: <br>
`$ celery -A tasks worker --loglevel=info --concurrency=4 1> ~/celery.out 2> ~/celery.err &` <br><br>
In this case, the `celery -A tasks worker --loglevel=info --concurrency=4` portion of the command
is what is initiating the worker and the remainder serves to write the stdout and stderr to two separate files
located in the home directory and to run the process in the background. <br>
## 5. Initialize the Flask App
Simply type `$ python run.py` <br>
Alternatively, type `$ python run.py > ~/flask.out 2> ~/flask.err &` to run the process in the background
and output to files in the home directory.
## 6. Check Job status
If all goes well, you should have your processes running in the background. Check the status of these by typing
`$ jobs`. You should now see the something similar to the following: <br>
```
(venv) [centos@ood flask_user_reg]$ jobs
[1]- Running celery -A tasks worker --loglevel=info --concurrency=4 > ~/celery.out 2> ~/celery.err &
[2]+ Running python run.py > ~/server.out 2> ~/server.err &
(venv) [centos@ood flask_user_reg]$
```
## 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>
![Self Registration Site](/docs/images/site_example.png) <br>
## 8. Key Info/Observe
- Fill out the form and hit "Submit"
- 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`.
\ No newline at end of file
# app/__init__.py
# app/__init__.py
# local imports
from __future__ import print_function
import os
import sys
import subprocess
import time
import vars
# third-party imports
import uuid
from flask import Flask, redirect, url_for, request, render_template, flash, session
from flask_wtf import FlaskForm
from flask_bootstrap import Bootstrap
from wtforms import StringField, SubmitField, TextAreaField, validators
from flask_socketio import SocketIO
# global declarations
global time_stamp
import random
def create_app(config_name):
app = Flask(__name__) # initialization of the flask app
Bootstrap(app) # allowing app to use bootstrap
socketio = SocketIO(app)
global return_url
return_url = ''
class MainForm(FlaskForm): # class for the form itself
fullname = StringField('Full Name: ', [validators.DataRequired(), validators.length(max=50)])
reason = TextAreaField('Reason for Requesting Account: ', [validators.DataRequired(), validators.length(max=150)])
submit = SubmitField('Submit')
@app.route('/', methods=['GET', 'POST']) # initial route to display the reg page
def index():
global return_url
username = "mmoo97"
if "redir" in request.args and return_url == "": # check for redir arg in url
return_url = request.args.get("redir") or "/pun/sys/dashboard"
fullname = False
form = MainForm() # initialize form object
if form.is_submitted():
session["fullname"] = form.fullname.data
session['reason'] = form.reason.data
form.fullname.data = '' # reset form data upon capture
form.fullname.data = '' # reset form data upon capture
return redirect(url_for('request_sent', username=username))
return render_template('auth/SignUp.html', form=form, user=username)
@app.route('/request_sent/<username>')
def request_sent(username):
if 'uid' not in session:
session['uid']=str(uuid.uuid4())
fullname = session.get('fullname', None)
reason = session.get('reason', None)
if "redir" in request.args and 'return_url' not in session: # check for redir arg in url
session['return_url'] = request.args.get("redir")
elif "redir" not in request.args and 'return_url' not in session:
session['return_url'] = vars.default_referrer
else:
session['return_url'] = request.referrer
global return_url
global time_stamp
print(username, fullname, return_url, file=sys.stdout)
# Deliver arguments to script. (for local vagrant implementation)
tempString = 'ssh ohpc "sudo /opt/ohpc_user_create/user_create ' + username + " " + fullname + '"'
print(tempString, file=sys.stdout)
try:
# function to write out a flatdb with the name of the file being a timestamp and the content
# of the file beieng blazerID the user submitted from the flask form (fullname)
time_stamp = time.strftime("%m-%d-%Y_%H:%M:%S")
directory = "flat_db/"
complete_file_name = os.path.join(directory, time_stamp + "_" + username + ".txt")
if not os.path.exists(directory):
os.makedirs(directory)
file = open(complete_file_name, "w") # create time stamped file to be queued
file.write(fullname + "\n")
file.write(reason)
file.close()
return render_template("auth/request_received.html") # Todo: replace template with redirect
# return redirect(return_url, 302)
except Exception as e:
print(e)
flash("Registration Failed. Please try again.") # show error message upon failure
return redirect(url_for('index'))
return render_template('auth/SignUp.html', room_id=session['uid'], referrer=session['return_url'])
# misc page error catching
@app.errorhandler(403)
def forbidden(error):
return render_template('errors/403.html', title='Forbidden'), 403
......
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 300 157"><title>Supercomputer-logo</title><image width="300" height="157" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAACdCAYAAAAOnEURAAAACXBIWXMAAAsSAAALEgHS3X78AAAgAElEQVR4Xu2dfZAc5X3nP30VUi5cLq3FH7hipzQDzYtUEG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ptuyF06vXSXI1vOdV+6u5CVkIUsXJvj0i0CqlzsRVb6umfp5d8kYuUNWnnlxiI67d9CpntGyrxzCy0XxoBKs44UoqGoL/nuNzT/RNh6eyPjieOxWyT7Ueq+lfmnwUCbp6PY808zgdaJJnU0u2nqsDVbKdvzT12B7E/N2c7ck1Rg7mkqc2qnXmHL5nqhT81ZCOyI7Yt9972GVpno+NScQB71p/shHZQLOJX2g7TcIJ7tb4m7Vk3+8cpPpqdCBUklWEVCJ1gGQ1qiBMvQW2K7hAaDwZAXjGAZDIbCYATLYDAUBiNYBoOhMBjBMhgMhcEIlsFgKAyLdlqDwWBYfJgWlsFgKAxGsAwGQ2EwgmUwGArD/weo98DC2yYdnQAAAABJRU5ErkJggg=="/></svg>
\ No newline at end of file
function displayloading() {
document.getElementById("notification_window").innerHTML = "" +
"<div class=\"joyride-tip-guide\" data-index=\"0\" style=\"visibility: visible; display: block; top: 77.5px; left: 570px;\"><span class=\"joyride-nub\" style=\"display: none;\"></span><div class=\"joyride-content-wrapper\" role=\"dialog\"><ol>\n" +
" <h4>\n" +
"\n" +
" Your account is pending creation...\n" +
"\n" +
" </h4>\n" +
" <br><p>\n" +
" This can take between 5-10 min.\n" +
" </p>\n" +
" </ol>\n" +
" <img src=\"/static/img/loading.gif\" style=\"width: 35px; height: auto\"> Pending...\n" +
" </div></div>\n" +
"\n" +
" <div class=\"joyride-modal-bg\" style=\"display: block;\"></div>"
$('#myModal').modal('show');
}
function request_account() {
socket.emit('request account', {
fullname: document.getElementById("fullname").value,
reason: document.getElementById("reason").value,
username: document.getElementById("bid").value
})
}
}
\ No newline at end of file
function refresh() {
document.location.reload(true);
}
source diff could not be displayed: it is too large. Options to address this: view the blob.
{% extends "auth/base.html" %}
<html class="gr__rc_uab_edu">
{% block title %} User Registration {% endblock %}
{% block head %}
{{ super() }}
<title>User Registration </title>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
<script src="{{ url_for('static', filename='scripts/function.js') }}"></script>
<script src="{{ url_for('static', filename='scripts/application.js') }}"></script>
<script>
console.info('Room ID: {{ room_id }}');
var socket = io.connect('http://' + document.domain + ':' + location.port);
socket.on( 'connect', function() {
socket.emit( 'join_room', {
referrer: '{{ referrer }}'
});
socket.on( 'creating account', function( msg ) {
document.getElementById("error").innerText = "";
displayloading();
});
socket.on( 'account ready', function( msg ) {
$('#myModal').modal('hide');
alert("Account has been created!");
window.location.replace('{{ referrer }}');
});
socket.on( 'Account creation failed', function( msg ) {
document.getElementById("error").innerText = "Registration Failed. Please try again.";
});
});
</script>
<style type="text/css">
.important { color: #336699; }
</style>
<link rel="shortcut icon" type="image/x-icon" href="/public/favicon.ico">
<link rel="stylesheet" media="all" href="/static/style/application.css">
<link rel="stylesheet" media="all" href="/static/style/app2.css">
<link rel="stylesheet" media="all" href="{{ url_for('static', filename='style/application.css') }}">
<link rel="stylesheet" media="all" href="{{ url_for('static', filename='style/app2.css') }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
......@@ -19,13 +47,11 @@
}
</style>
{% endblock %}
</head>
<body data-gr-c-s-loaded="true">
<header>
{% block body %}
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
......@@ -52,50 +78,58 @@
<div class="container content" role="main" style="width: 625px">
<div style="position:relative;">
<img alt="logo" height="100" style="margin-bottom: 20px" src="/static/img/cheaha-logo-a605de0aecd3006b82a5ee30a6d0cb8cd9bf8b7e836296cc293eac746a4c2b11.png">
<img alt="logo" height="auto" width="100%" style="margin-bottom: 20px" src="{{ url_for('static', filename='img/cheaha-logo-a605de0aecd3006b82a5ee30a6d0cb8cd9bf8b7e836296cc293eac746a4c2b11.png') }}">
<a href="https://tinyurl.com/cheahaAL" target="_blank">
<div style="float:left;position:absolute;display:block;left:310px;top:-6px;padding:10px 20px;"> </div>
</a>
</div>
<h2>Hello, {{ user }}!</h2>
<!-- <h2>Hello, <span id="username">{{ user }}</span>!</h2> -->
<form action="." method="post" onsubmit="displayloading()">
<h2>Hi, </h2>
<div id="test">
<form action="." method="post" onsubmit="">
<div class="signUpContainer">
<label><b>{{ form.fullname.label }}<br></b></label>
{{ form.fullname(class_="form-control", placeholder="Enter Full Name") }}
<label><b>{{ form.reason.label }}<br></b></label>
{{ form.reason(class_="form-control", placeholder="Enter Reason for Account Request") }}
{{ form.submit(class_="btn btn-primary btn-block" ) }}
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div>
<strong style="color: #be051b; text-align: center;">{{ message }}</strong>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<label><b><label for="username">Blazer Id: </label><br></b></label>
<input class="form-control" id="bid" name="bid" placeholder="Enter BlazerId" required="" type="text">
<label><b><label for="fullname">Full Name: </label><br></b></label>
<input class="form-control" id="fullname" name="fullname" placeholder="Enter Full Name" required="" type="text">
<label><b><label for="reason">Reason for Requesting Account: </label><br></b></label>
<textarea class="form-control" id="reason" name="reason" placeholder="Enter Reason for Account Request" required=""></textarea>
<input class="btn btn-primary btn-block" id="submit" name="submit" type="button" value="Submit" onclick="request_account()">
<div>
<strong id="error" style="color: #be051b; text-align: center;"></strong>
</div>
</div>
</form>
</div>
<div id="notification_window" >
</div>
</div>
{% endblock %}
</body>
{% block footer %}
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Account Request Received!</h4>
</div>
<div class="modal-body">
<span>Please wait while we create your account. This may take up to 5-10 minutes.</span>
<img src="{{ url_for('static', filename='img/loading.gif') }}" width="40px">
</div>
</div>
</div>
</div>
<footer>
<div class="container-fluid">
<div class="row">
<div class="col-md-6 col-sm-6">
<a href="https://osc.github.io/Open-OnDemand/">
<img class="footer-logo" alt="Powered by Open OnDemand" height="40" style="margin-bottom: 20px" src="/static/img/OpenOnDemand_powered_by_RGB-cb3aad5ff5350c7994f250fb334ddcc72e343233ce99eb71fda93beddd76a847.svg">
<img class="footer-logo" alt="Powered by Open OnDemand" height="40" style="margin-bottom: 20px" src="{{ url_for('static', filename='img/OpenOnDemand_powered_by_RGB-cb3aad5ff5350c7994f250fb334ddcc72e343233ce99eb71fda93beddd76a847.svg') }}">
</a>
</div>
</div>
</div><!-- /.container -->
{% endblock %}
</footer>
</body>
</html>
#!/usr/bin/env python
import pika # python client
import sys
credentials = pika.PlainCredentials('reggie', 'reggie')
parameters = pika.ConnectionParameters('ood',
5672,
'/',
credentials)
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
channel.exchange_declare(exchange='direct_logs', exchange_type='direct') # create exchange to pass messages
result = channel.queue_declare(queue='', exclusive=True)
queue_name = result.method.queue # creates a random name for the newly generated queue
nodes = sys.argv[1:]
if not nodes:
sys.stderr.write("Usage: %s [ood] [ohpc] [manager]\n" % sys.argv[0])
sys.exit(1)
for node in nodes:
channel.queue_bind(
exchange='direct_logs', queue=queue_name, routing_key=node) # combine exchange, queue, and define routing name
print(' [*] Waiting for logs. To exit press CTRL+C')
def callback(ch, method, properties, body):
print(" [x] %r:%r" % (method.routing_key, body))
print('[%r] User creation task is done.' % method.routing_key)
channel.basic_consume(
queue=queue_name, on_message_callback=callback, auto_ack=True) # ingest messages, and assume delivered via auto_ack
channel.start_consuming() # initiate message ingestion
docs/images/floating_ips.png

219 KiB

docs/images/network_topology.png

127 KiB

docs/images/rc-network .png

106 KiB

docs/images/security_rules.png

311 KiB

docs/images/site_example.png

478 KiB

alembic==0.9.9
argh==0.26.2
blinker==1.4
certifi==2019.6.16
chardet==3.0.4
amqp==2.5.2
billiard==3.6.2.0
celery==4.4.0
Click==7.0
dominate==2.3.5
eventlet==0.17.4
Flask==1.0.2
dominate==2.4.0
Flask==1.1.1
Flask-Bootstrap==3.3.7.1
Flask-Dance==0.14.0
Flask-DebugToolbar==0.10.1
Flask-Login==0.4.1
Flask-Migrate==2.1.1
Flask-OAuth==0.12
Flask-OAuthlib==0.9.4
Flask-SocketIO==4.2.1
Flask-SQLAlchemy==2.3.2
Flask-Testing==0.7.1
Flask-WTF==0.14.2
gevent==1.4.0
greenlet==0.4.15
gunicorn==18.0
httplib2==0.11.3
idna==2.6
importlib-metadata==1.5.0
itsdangerous==1.1.0
Jinja2==2.10.1
lazy==1.3
Mako==1.0.7
Jinja2==2.11.1
kombu==4.6.7
MarkupSafe==1.1.1
oauth2==1.9.0.post1
oauthlib==2.0.7
pathtools==0.1.2
pbr==5.1.3
python-dateutil==1.5
python-editor==1.0.4
python-engineio==3.10.0
python-socketio==4.3.1
pytz==2013.7
PyYAML==5.1.2
requests==2.18.4
requests-oauthlib==0.8.0
six==1.12.0
SQLAlchemy==1.2.6
SQLAlchemy-Utils==0.33.2
stevedore==1.30.1
urllib3==1.22
URLObject==2.4.3
virtualenv==16.4.3
virtualenv-clone==0.5.1
virtualenvwrapper==4.8.4
pika==1.1.0
python-engineio==3.11.2
python-socketio==4.4.0
pytz==2019.3
six==1.14.0
vine==1.3.0
visitor==0.1.3
watchdog==0.9.0
Werkzeug==0.14.1
wincertstore==0.2
WTForms==2.2.1
Werkzeug==1.0.0
zipp==3.0.0
# run.py
import os
import time
import tasks
import vars
from flask import session
from flask_socketio import SocketIO, join_room
from app import create_app
from gevent import monkey
monkey.patch_all(subprocess=True)
config_name = os.getenv('FLASK_CONFIG')
app = create_app(config_name)
app.secret_key = 'randomString'
app.config['SECRET_KEY'] = vars.key
socketio = SocketIO(app, message_queue= vars.message_queue)
@socketio.on('connect')
def socket_connect():
pass
@socketio.on('join_room')
def on_room(json):
room = str(session['uid'])
referrer = json['referrer']
join_room(room)
print('\t\t\t|-----Room ID: ' + room)
print('\t\t\t|-----Referrer: ' + referrer)
@socketio.on('request account')
def request_account(json, methods=['GET', 'POST']):
print (time.strftime("%m-%d-%Y_%H:%M:%S") + '\tQueue request received: ' + str(json))
room = str(session['uid'])
print("Room: {}".format(room))
try:
tasks.celery_create_account.delay(json['username'], json['fullname'], json['reason'], session=room)
except Exception as e:
print(time.strftime("%m-%d-%Y_%H:%M:%S") + "\tError in account creation: ", e)
socketio.emit("Account creation failed", room)
if __name__ == '__main__':
app.run()
socketio.run(app, host='0.0.0.0')
from celery import Celery
import time
from flask_socketio import SocketIO
import subprocess
import vars
from gevent import monkey
monkey.patch_all(subprocess=True)
broker_url = vars.broker_url
celery = Celery('flask_user_reg', broker=broker_url)
socketio = SocketIO(message_queue=vars.message_queue)
def send_msg(event, room):
print("Post '{}' to room '{}'".format(event,room))
socketio.emit(event, room=room)
@celery.task
def celery_create_account(username, fullname, reason, session):
room = session
print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tUser ' + username + ' added to queue')
send_msg('creating account', room)
print(username)
subprocess.call(["/opt/rabbitmq_agents/flask_producer.py", "ohpc_account_create", username])
print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tAccount successfully created for ' + username)
send_msg('account ready', room)
import pika
import sys
# Begin RabbitMQ process.
credentials = pika.PlainCredentials('reggie', 'reggie')
parameters = pika.ConnectionParameters('ood',
5672,
'/',
credentials)
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
channel.exchange_declare(exchange='direct_logs', exchange_type='direct')
node = sys.argv[1] if len(sys.argv) > 1 else 'info'
message = ' '.join(sys.argv[2:]) or 'Hello World!'
channel.basic_publish(
exchange='direct_logs', routing_key=node, body=message)
print(" [x] Sent %r:%r" % (node, message))
connection.close()
id = ''
password = ''
key = ''
broker_url = 'amqp://' + id + ':' + password + '@ohpc:5672/'
message_queue = broker_url + 'socketio'
default_referrer = "https://docs.uabgrid.uab.edu/wiki/Cheaha_Quick_Start"