Skip to content

Commit

Permalink
rename webconsole to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
nlevitt committed Nov 5, 2016
1 parent fef7d6a commit 5ac8994
Show file tree
Hide file tree
Showing 27 changed files with 103 additions and 103 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "brozzler/webconsole/static/noVNC"]
path = brozzler/webconsole/static/noVNC
[submodule "noVNC"]
path = brozzler/dashboard/static/noVNC
url = https://github.com/kanaka/noVNC.git
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Getting Started

The easiest way to get started with brozzler for web archiving is with
``brozzler-easy``. Brozzler-easy runs brozzler-worker, warcprox,
`pywb <https://github.com/ikreymer/pywb>`_, and brozzler-webconsole, configured
`pywb <https://github.com/ikreymer/pywb>`_, and brozzler-dashboard, configured
to work with each other, in a single process.

Mac instructions:
Expand Down Expand Up @@ -118,24 +118,24 @@ must be specified, everything else is optional. For details, see
scope:
surt: http://(org,example,

Brozzler Web Console
--------------------
Brozzler Dashboard
------------------

Brozzler comes with a rudimentary web application for viewing crawl job status.
To install the brozzler with dependencies required to run this app, run

::

pip install brozzler[webconsole]
pip install brozzler[dashboard]


To start the app, run

::

brozzler-webconsole
brozzler-dashboard

See ``brozzler-webconsole --help`` for configuration options.
See ``brozzler-dashboard --help`` for configuration options.

Headless Chromium
-----------------
Expand Down
2 changes: 1 addition & 1 deletion ansible/hosts-localhost
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ localhost
[brozzler-worker]
localhost

[brozzler-webconsole]
[brozzler-dashboard]
localhost

[pywb]
Expand Down
2 changes: 1 addition & 1 deletion ansible/hosts-vagrant
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ work_dir=/vagrant
[brozzler-worker]
10.9.9.9

[brozzler-webconsole]
[brozzler-dashboard]
10.9.9.9

[pywb]
Expand Down
6 changes: 3 additions & 3 deletions ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
roles:
- brozzler-worker

- name: deploy brozzler-webconsole
hosts: brozzler-webconsole
- name: deploy brozzler-dashboard
hosts: brozzler-dashboard
roles:
- brozzler-webconsole
- brozzler-dashboard

- name: deploy pywb
hosts: pywb
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/brozzler-dashboard/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: restart brozzler-dashboard
service: name=brozzler-dashboard state=restarted
become: true
20 changes: 20 additions & 0 deletions ansible/roles/brozzler-dashboard/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: mkdir {{venv_root}}/brozzler-dashboard-ve34
file: path={{venv_root}}/brozzler-dashboard-ve34 state=directory
owner={{user}}
become: true
- name: install brozzler[dashboard] in virtualenv
pip: name='{{brozzler_pip_name}}[dashboard]'
virtualenv={{venv_root}}/brozzler-dashboard-ve34
virtualenv_python=python3.4
extra_args='--no-input --upgrade --pre --cache-dir=/tmp/pip-cache'
become: true
become_user: '{{user}}'
notify:
- restart brozzler-dashboard
- name: install upstart config /etc/init/brozzler-dashboard.conf
become: true
template: src=templates/brozzler-dashboard.conf.j2
dest=/etc/init/brozzler-dashboard.conf
notify:
- restart brozzler-dashboard
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
description "brozzler-webconsole"
description "brozzler-dashboard"

start on runlevel [2345]
stop on runlevel [!2345]

env PYTHONPATH={{venv_root}}/brozzler-webconsole-ve34/lib/python3.4/site-packages
env PATH={{venv_root}}/brozzler-webconsole-ve34/bin:/usr/bin:/bin
env PYTHONPATH={{venv_root}}/brozzler-dashboard-ve34/lib/python3.4/site-packages
env PATH={{venv_root}}/brozzler-dashboard-ve34/bin:/usr/bin:/bin
env LC_ALL=C.UTF-8

env WAYBACK_BASEURL=http://{{groups['pywb'][0]}}:8880/brozzler
Expand All @@ -15,4 +15,4 @@ setuid {{user}}

console log

exec gunicorn --bind=0.0.0.0:8881 brozzler.webconsole:app
exec gunicorn --bind=0.0.0.0:8881 brozzler.dashboard:app
4 changes: 0 additions & 4 deletions ansible/roles/brozzler-webconsole/handlers/main.yml

This file was deleted.

20 changes: 0 additions & 20 deletions ansible/roles/brozzler-webconsole/tasks/main.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ console log
env PYTHONPATH={{venv_root}}/websockify-ve34/lib/python3.4/site-packages
env PATH={{venv_root}}/websockify-ve34/bin:/usr/bin:/bin

# port 8901 is hard-coded in brozzler/webconsole/static/partials/workers.html
# port 8901 is hard-coded in brozzler/dashboard/static/partials/workers.html
exec nice websockify 0.0.0.0:8901 localhost:5901

40 changes: 20 additions & 20 deletions ansible/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
## # get latest pip (had problems with version from apt-get, specifically
## # "pip install pyopenssl" did not install the dependency "cryptography")
## # http://stackoverflow.com/questions/34587473/what-is-get-pip-py-checksum-where-can-i-get-it-for-sure
## - name: install setuptools for python 2 and 3
## become: true
## apt: name={{item}} state=present
## with_items:
## - python-setuptools
## - python3-setuptools
## - name: download pip-8.1.2.tar.gz
## get_url:
## url: https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/pip-8.1.2.tar.gz
## dest: /tmp
## checksum: sha1:1c13c247967ec5bee6de5fd104c5d78ba30951c7
## - name: extract pip-8.1.2.tar.gz
## unarchive: src=/tmp/pip-8.1.2.tar.gz dest=/tmp copy=no
## - name: run "python3 setup.py install" in /tmp/pip-8.1.2
## command: python3 setup.py install chdir=/tmp/pip-8.1.2
## creates=/usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg/pip/__init__.py
## become: true
# get latest pip (had problems with version from apt-get, specifically
# "pip install pyopenssl" did not install the dependency "cryptography")
# http://stackoverflow.com/questions/34587473/what-is-get-pip-py-checksum-where-can-i-get-it-for-sure
- name: install setuptools for python 2 and 3
become: true
apt: name={{item}} state=present
with_items:
- python-setuptools
- python3-setuptools
- name: download pip-8.1.2.tar.gz
get_url:
url: https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/pip-8.1.2.tar.gz
dest: /tmp
checksum: sha1:1c13c247967ec5bee6de5fd104c5d78ba30951c7
- name: extract pip-8.1.2.tar.gz
unarchive: src=/tmp/pip-8.1.2.tar.gz dest=/tmp copy=no
- name: run "python3 setup.py install" in /tmp/pip-8.1.2
command: python3 setup.py install chdir=/tmp/pip-8.1.2
creates=/usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg/pip/__init__.py
become: true
- command: id {{user}}
register: id_user
ignore_errors: true
Expand Down
20 changes: 10 additions & 10 deletions brozzler/webconsole/__init__.py → brozzler/dashboard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
brozzler/webconsole/__init__.py - flask app for brozzler web console, defines
api endspoints etc
brozzler/dashboard/__init__.py - flask app for brozzler dashboard, defines api
endspoints etc
Copyright (C) 2014-2016 Internet Archive
Expand All @@ -24,7 +24,7 @@
except ImportError as e:
logging.critical(
'%s: %s\n\nYou might need to run "pip install '
'brozzler[webconsole]".\nSee README.rst for more information.',
'brozzler[dashboard]".\nSee README.rst for more information.',
type(e).__name__, e)
sys.exit(1)
import rethinkstuff
Expand Down Expand Up @@ -210,11 +210,11 @@ def root(path):
import gunicorn.app.base
from gunicorn.six import iteritems

class GunicornBrozzlerWebConsole(gunicorn.app.base.BaseApplication):
class GunicornBrozzlerDashboard(gunicorn.app.base.BaseApplication):
def __init__(self, app, options=None):
self.options = options or {}
self.application = app
super(GunicornBrozzlerWebConsole, self).__init__()
super(GunicornBrozzlerDashboard, self).__init__()

def load_config(self):
config = dict(
Expand All @@ -227,12 +227,12 @@ def load(self):
return self.application

def run(**options):
logging.info('running brozzler-webconsole using gunicorn')
GunicornBrozzlerWebConsole(app, options).run()
logging.info('running brozzler-dashboard using gunicorn')
GunicornBrozzlerDashboard(app, options).run()

except ImportError:
def run():
logging.info('running brozzler-webconsole using simple flask app.run')
logging.info('running brozzler-dashboard using simple flask app.run')
app.run()

def main():
Expand All @@ -241,10 +241,10 @@ def main():
prog=os.path.basename(sys.argv[0]),
formatter_class=argparse.RawDescriptionHelpFormatter,
description=(
'brozzler-webconsole - web application for viewing brozzler '
'brozzler-dashboard - web application for viewing brozzler '
'crawl status'),
epilog=(
'brozzler-webconsole has no command line options, but can be '
'brozzler-dashboard has no command line options, but can be '
'configured using the following environment variables:\n\n'
' RETHINKDB_SERVERS rethinkdb servers, e.g. db0.foo.org,'
'db0.foo.org:38015,db1.foo.org (default: localhost)\n'
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* brozzler-webconsole/static/js/app.js - brozzler console angularjs code
* brozzler/dashboard/static/js/app.js - brozzler dashboard angularjs code
*
* Copyright (C) 2014-2016 Internet Archive
*
Expand All @@ -18,12 +18,12 @@

"use strict";

var brozzlerConsoleApp = angular.module("brozzlerConsoleApp", [
var brozzlerDashboardApp = angular.module("brozzlerDashboardApp", [
"ngRoute",
"brozzlerControllers",
]);

brozzlerConsoleApp.config(["$routeProvider", "$locationProvider",
brozzlerDashboardApp.config(["$routeProvider", "$locationProvider",
function($routeProvider, $locationProvider) {
$routeProvider.
when("/workers", {
Expand Down Expand Up @@ -53,7 +53,7 @@ brozzlerConsoleApp.config(["$routeProvider", "$locationProvider",
}]);

// copied from https://bitbucket.org/webarchive/ait5/src/master/archiveit/static/app/js/filters/ByteFormat.js
brozzlerConsoleApp.filter("byteformat", function() {
brozzlerDashboardApp.filter("byteformat", function() {
return function(bytes, precision) {
var bytes_f = parseFloat(bytes);
if (bytes_f == 0 || isNaN(bytes_f) || !isFinite(bytes_f)) return "0";
Expand Down
1 change: 1 addition & 0 deletions brozzler/dashboard/static/noVNC
Submodule noVNC added at ef887c
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!doctype html>
<html lang="en" ng-app="brozzlerConsoleApp">
<html lang="en" ng-app="brozzlerDashboardApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>Brozzler Console</title>
<title>Brozzler Dashboard</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap-theme.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.css">
Expand Down
34 changes: 17 additions & 17 deletions brozzler/easy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
'''
brozzler-easy - brozzler-worker, warcprox, pywb, and brozzler-webconsole all
brozzler-easy - brozzler-worker, warcprox, pywb, and brozzler-dashboard all
working together in a single process
Copyright (C) 2016 Internet Archive
Expand All @@ -27,7 +27,7 @@
import brozzler.pywb
import wsgiref.simple_server
import wsgiref.handlers
import brozzler.webconsole
import brozzler.dashboard
except ImportError as e:
logging.critical(
'%s: %s\n\nYou might need to run "pip install '
Expand All @@ -51,7 +51,7 @@ def _build_arg_parser(prog=os.path.basename(sys.argv[0])):
prog=prog, formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description=(
'brozzler-easy - easy deployment of brozzler, with '
'brozzler-worker, warcprox, pywb, and brozzler-webconsole all '
'brozzler-worker, warcprox, pywb, and brozzler-dashboard all '
'running in a single process'))

# common args
Expand Down Expand Up @@ -104,14 +104,14 @@ def _build_arg_parser(prog=os.path.basename(sys.argv[0])):
'--pywb-port', dest='pywb_port', type=int,
default=8880, help='pywb wayback port')

# webconsole args
# dashboard args
arg_parser.add_argument(
'--webconsole-address', dest='webconsole_address',
'--dashboard-address', dest='dashboard_address',
default='localhost',
help='brozzler web console address to listen on')
help='brozzler dashboard address to listen on')
arg_parser.add_argument(
'--webconsole-port', dest='webconsole_port',
type=int, default=8881, help='brozzler web console port')
'--dashboard-port', dest='dashboard_port',
type=int, default=8881, help='brozzler dashboard port')

# common at the bottom args
arg_parser.add_argument(
Expand Down Expand Up @@ -143,12 +143,12 @@ def __init__(self, args):
self._warcprox_args(args))
self.brozzler_worker = self._init_brozzler_worker(args)
self.pywb_httpd = self._init_pywb(args)
self.webconsole_httpd = self._init_brozzler_webconsole(args)
self.dashboard_httpd = self._init_brozzler_dashboard(args)

def _init_brozzler_webconsole(self, args):
def _init_brozzler_dashboard(self, args):
return wsgiref.simple_server.make_server(
args.webconsole_address, args.webconsole_port,
brozzler.webconsole.app, ThreadingWSGIServer)
args.dashboard_address, args.dashboard_port,
brozzler.dashboard.app, ThreadingWSGIServer)

def _init_brozzler_worker(self, args):
r = rethinkstuff.Rethinker(
Expand Down Expand Up @@ -212,13 +212,13 @@ def start(self):
threading.Thread(target=self.pywb_httpd.serve_forever).start()

self.logger.info(
'starting brozzler-webconsole at %s:%s',
*self.webconsole_httpd.server_address)
threading.Thread(target=self.webconsole_httpd.serve_forever).start()
'starting brozzler-dashboard at %s:%s',
*self.dashboard_httpd.server_address)
threading.Thread(target=self.dashboard_httpd.serve_forever).start()

def shutdown(self):
self.logger.info('shutting down brozzler-webconsole')
self.webconsole_httpd.shutdown()
self.logger.info('shutting down brozzler-dashboard')
self.dashboard_httpd.shutdown()

self.logger.info('shutting down brozzler-worker')
self.brozzler_worker.shutdown_now()
Expand Down
1 change: 0 additions & 1 deletion brozzler/webconsole/static/noVNC
Submodule noVNC deleted from 6a9080
Loading

0 comments on commit 5ac8994

Please sign in to comment.