Skip to content

Commit

Permalink
Added server logs page
Browse files Browse the repository at this point in the history
  • Loading branch information
felipesanches committed Apr 5, 2017
1 parent 0e52a63 commit 1a6cd61
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
1 change: 1 addition & 0 deletions dashboard/containers/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ COPY templates/dashboard.html /templates/
COPY templates/under_deployment.html /templates/
COPY templates/family_details.html /templates/
COPY templates/testsuite.html /templates/
COPY templates/error_log.html /templates/
COPY static/css/dashboard.css /static/css/
COPY static/css/family_details.css /static/css/
COPY static/css/testsuite.css /static/css/
Expand Down
16 changes: 16 additions & 0 deletions dashboard/containers/web/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@

app = Flask(__name__, static_url_path='')


@app.route('/css/<path>')
def send_css(path):
return send_from_directory('static/css', path)


@app.route('/js/<path>')
def send_js(path):
return send_from_directory('static/js', path)


@app.route('/')
def dashboard():
if 1: #try:
Expand Down Expand Up @@ -64,6 +67,19 @@ def testsuite_overview():
# return render_template("under_deployment.html")


@app.route('/details/<familyname>/errorlog')
def family_error_log(familyname):
db_host = os.environ.get("RETHINKDB_DRIVER_SERVICE_HOST", 'db')
r.connect(db_host, 28015).repl()
db = r.db('fontbakery')
family = db.table('fb_log').filter({"familyname": familyname}).run()

logs = list(family)

return render_template("error_log.html",
logs=logs)


@app.route('/details/<familyname>')
def family_details(familyname):
try:
Expand Down
1 change: 1 addition & 0 deletions dashboard/containers/web/templates/family_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<div class="details">
<h1><a href="/">Fontbakery Dashboard</a></h1>
<h2>Details for {{ familyname }}</h2>
<a href="/details/{{ familyname }}/errorlog"><small>View full server logs.</small></a>
<div>
<div id="piechart"></div>
<div id="tabs" style="display:hidden">
Expand Down
21 changes: 8 additions & 13 deletions dashboard/deploy_to_gke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ PROJECT=fontbakery
GCLOUD="sudo /home/felipe/devel/prebuilt/google-cloud-sdk/bin/gcloud"
DOCKER="sudo docker"



# update_database:
$DOCKER build -t rethinkdb-2.3.5 containers/rethinkdb
$DOCKER tag rethinkdb-2.3.5 gcr.io/$PROJECT/rethinkdb-2.3.5
$GCLOUD docker -- push gcr.io/$PROJECT/rethinkdb-2.3.5
kubectl delete rc rethinkdb-rc
kubectl create -f services/rethinkdb-driver-service.yaml
kubectl create -f services/rethinkdb-rc.yaml
kubectl create -f services/rethinkdb-admin-service.yaml


# update_frontend:
Expand All @@ -17,17 +23,6 @@ kubectl create -f services/flask-service.yaml
kubectl create -f services/dashboard-rc.yaml


# update_database:
$DOCKER build -t rethinkdb-2.3.5 containers/rethinkdb
$DOCKER tag rethinkdb-2.3.5 gcr.io/$PROJECT/rethinkdb-2.3.5
$GCLOUD docker -- push gcr.io/$PROJECT/rethinkdb-2.3.5
kubectl delete rc rethinkdb-rc
kubectl create -f services/rethinkdb-driver-service.yaml
kubectl create -f services/rethinkdb-rc.yaml
kubectl create -f services/rethinkdb-admin-service.yaml



# -> "kill all":
kubectl delete svc rabbitmq-service
kubectl delete rc rabbitmq-controller
Expand Down

0 comments on commit 1a6cd61

Please sign in to comment.