working on including pywb in vagrant environment (not finished)

This commit is contained in:
Noah Levitt 2016-09-14 17:08:00 -07:00
parent c864499a64
commit 38af0f347b
13 changed files with 102 additions and 30 deletions

View file

@ -32,7 +32,7 @@ def find_package_data(package):
setuptools.setup( setuptools.setup(
name='brozzler', name='brozzler',
version='1.1b6.dev81', version='1.1b6.dev82',
description='Distributed web crawling with browsers', description='Distributed web crawling with browsers',
url='https://github.com/internetarchive/brozzler', url='https://github.com/internetarchive/brozzler',
author='Noah Levitt', author='Noah Levitt',

View file

@ -24,7 +24,7 @@
roles: roles:
- brozzler-webconsole - brozzler-webconsole
# - name: deploy pywb - name: deploy pywb
# hosts: pywb hosts: pywb
# roles: roles:
# - pywb - pywb

View file

@ -1,6 +1,5 @@
--- ---
- name: install brozzler[webconsole] in virtualenv - name: install brozzler[webconsole] in virtualenv
become: true
pip: name='-e /brozzler[webconsole]' pip: name='-e /brozzler[webconsole]'
virtualenv=/home/vagrant/brozzler-webconsole-ve34 virtualenv=/home/vagrant/brozzler-webconsole-ve34
virtualenv_python=python3.4 virtualenv_python=python3.4

View file

@ -26,7 +26,6 @@
- ttf-indic-fonts - ttf-indic-fonts
- fonts-thai-tlwg - fonts-thai-tlwg
- fonts-lklug-sinhala - fonts-lklug-sinhala
- python3-pip
- git - git
- libjpeg-turbo8-dev - libjpeg-turbo8-dev
- zlib1g-dev - zlib1g-dev
@ -49,7 +48,6 @@
notify: notify:
- restart vnc-websock - restart vnc-websock
- name: install brozzler in virtualenv - name: install brozzler in virtualenv
become: true
pip: # name=git+https://github.com/internetarchive/brozzler.git#egg=brozzler pip: # name=git+https://github.com/internetarchive/brozzler.git#egg=brozzler
name='-e /brozzler' name='-e /brozzler'
virtualenv=/home/vagrant/brozzler-ve34 virtualenv=/home/vagrant/brozzler-ve34

View file

@ -1,4 +1,24 @@
--- ---
- name: ensure logs directory exists ## # 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
- name: mkdir /vagrant/logs
file: path=/vagrant/logs state=directory file: path=/vagrant/logs state=directory
become: true become: true

View file

@ -0,0 +1,5 @@
---
- name: restart pywb
service: name=pywb state=restarted
become: true

View file

@ -0,0 +1,27 @@
---
- name: install pywb in virtualenv
pip: name=pywb
virtualenv=/home/vagrant/pywb-ve34
virtualenv_python=python3.4
extra_args='--no-input --upgrade --pre'
notify:
- restart pywb
- name: install brozzler in pywb virtualenv
pip: name='-e /brozzler'
virtualenv=/home/vagrant/pywb-ve34
virtualenv_python=python3.4
extra_args='--no-input --upgrade --pre'
notify:
- restart pywb
- name: pywb config file /etc/pywb.yml
template: src=templates/pywb.yml.j2
dest=/etc/pywb.yml
become: true
notify:
- restart pywb
- name: upstart config file /etc/init/pywb.conf
template: src=templates/pywb.conf.j2
dest=/etc/init/pywb.conf
become: true
notify:
- restart pywb

View file

@ -0,0 +1,14 @@
description "pywb"
start on runlevel [2345]
stop on runlevel [!2345]
env PYTHONPATH=/home/vagrant/pywb-ve34/lib/python3.4/site-packages
env PATH=/home/vagrant/pywb-ve34/bin:/usr/bin:/bin
env PYWB_CONFIG_FILE=/etc/pywb.yml
setuid vagrant
# console log
exec nice brozzler-wayback >>/vagrant/logs/pywb.log 2>&1

View file

@ -0,0 +1,12 @@
archive_paths: /vagrant/warcs/
collections:
brozzler:
index_paths: !!python/object:brozzler.pywb.RethinkCDXSource
db: brozzler
servers: [localhost]
table: captures
enable_auto_colls: false
enable_cdx_api: true
framed_replay: true
port: 8880

View file

@ -11,11 +11,13 @@
become: true become: true
notify: notify:
- restart rethinkdb - restart rethinkdb
# XXX rethinkdb fails to start in spite of this, I think because /vagrant
# gets mounted too late, and it tries to log there
- name: ensure rethinkdb starts on reboot - name: ensure rethinkdb starts on reboot
service: name=rethinkdb enabled=yes service: name=rethinkdb enabled=yes
- name: ensure rethinkdb instance config file is installed - name: ensure rethinkdb instance config file is installed
template: src=templates/rethinkdb-brozzler-easy.conf.j2 template: src=templates/rethinkdb-brozzler-vagrant-1.conf.j2
dest=/etc/rethinkdb/instances.d/rethinkdb-brozzler-easy.conf dest=/etc/rethinkdb/instances.d/rethinkdb-brozzler-vagrant-1.conf
become: true become: true
notify: notify:
- restart rethinkdb - restart rethinkdb

View file

@ -1,5 +0,0 @@
runuser=vagrant
bind=0.0.0.0
# directory=/var/lib/rethinkdb
# log-file=/var/log/rethinkdb.log
log-file=/vagrant/logs/rethinkdb.log # synced dir