Commit 4dcb84c1 authored by Daniele Venzano's avatar Daniele Venzano

Update README

parent bbaa5e8b
......@@ -13,14 +13,15 @@ It is composed of three components:
* MySQL to keep all the state
* Docker Swarm
* A Docker registry containing Spark images
* Redis
* Apache to act as a reverse proxy
## Configuration
Zoe configuration is kept, for now, in a Python file: `common/configuration.py`
Zoe configuration is read from an 'ini' file, the following locations are searched for a file names `zoe.conf`:
* working path (.)
* /etc/zoe
The cookie secret key is defined in `zoe_web/__init__.py`.
A sample configuration file, containing default values for all options can be generated by running `zoectl.py write-conf zoe.conf`
### Swarm/Docker
......@@ -45,11 +46,6 @@ bypassing the Hub.
The images are quite standard and can be used also without Zoe, for examples
on how to do that, see the `scripts/start_cluster.sh` script.
### Redis
Redis is used for storing Spark applications and logs, in zip archives. It is not the best use of redis, but it provides a
very simple to use interface. We are looking for a different solution and this requirement will likely disappear soon.
### Apache configuration
Zoe generates dynamically proxy entries to let users access to the various web interfaces contained in the Spark containers.
......
from flask import render_template, redirect, url_for, abort
from zoe_web import app
from zoe_client import ZoeClient
@app.route("/web/<int:user_id>/cluster/<int:app_id>/inspect")
def web_inspect(user_id, app_id):
client = ZoeClient()
if not client.user_check(user_id):
return redirect(url_for('index'))
application = client.application_get(app_id)
if application.user_id != user_id:
abort(404)
app_report = client.application_status(app_id)
template_vars = {
"application": app_report,
"user_id": user_id
}
return render_template('inspect.html', **template_vars)
@app.route("/web/<int:user_id>/container/<int:container_id>/logs")
def web_logs(user_id, container_id):
client = ZoeClient()
if not client.user_check(user_id):
return redirect(url_for('index'))
cont = client.container_get(container_id)
if user_id != cont["user_id"]:
abort(404)
logs = client.log_get(container_id)
if logs is None:
abort(404)
else:
ret = {
'user_id': user_id,
'cont_contents': cont['contents'],
"cont_logs": logs
}
return render_template('logs.html', **ret)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment