Updating supervisor scripts with new virtualenv path.

This commit is contained in:
Samuel Clay 2016-02-08 20:24:27 -08:00
parent ee3db7391d
commit fe59f588a8
12 changed files with 29 additions and 23 deletions

View file

@ -28,8 +28,6 @@ kombu==2.5.7
lxml==3.3.5
mongoengine==0.8.2
nltk==2.0.5
numpy==1.10.4
scipy==0.17.0
oauth2==1.5.211
psutil==2.1.0
pyes==0.99.5
@ -53,3 +51,5 @@ django-cors-headers==1.0.0
pyOpenSSL==0.14
pyasn1==0.1.7
ndg-httpsclient==0.3.2
numpy==1.10.4
scipy==0.17.0

View file

@ -1,7 +1,7 @@
[program:celerybeat]
command=/srv/newsblur/manage.py celery beat --schedule=/srv/newsblur/data/celerybeat-schedule.db --loglevel=INFO
directory=/srv/newsblur
environment=PATH="/srv/newsblur/venv/bin"
environment=PATH="/srv/newsblur/venv/newsblur/bin"
user=sclay
numprocs=1
stdout_logfile=/var/log/celerybeat.log

View file

@ -1,6 +1,6 @@
[program:celery]
command=/srv/newsblur/manage.py celery worker --loglevel=INFO -Q new_feeds,push_feeds,update_feeds
environment=PATH="/srv/newsblur/venv/bin"
environment=PATH="/srv/newsblur/venv/newsblur/bin"
directory=/srv/newsblur
user=sclay
numprocs=1

View file

@ -1,7 +1,7 @@
[program:celeryd_beat]
command=/srv/newsblur/manage.py celery worker --loglevel=INFO -Q beat_tasks -c 3
directory=/srv/newsblur
environment=PATH="/srv/newsblur/venv/bin"
environment=PATH="/srv/newsblur/venv/newsblur/bin"
user=sclay
numprocs=1
stdout_logfile=/var/log/celeryd_beat.log

View file

@ -1,7 +1,7 @@
[program:celeryd_beat_feeds]
command=/srv/newsblur/manage.py celery worker --loglevel=INFO -Q beat_feeds_task -c 1
directory=/srv/newsblur
environment=PATH="/srv/newsblur/venv/bin"
environment=PATH="/srv/newsblur/venv/newsblur/bin"
user=sclay
numprocs=1
stdout_logfile=/var/log/celeryd_beat_feeds.log

View file

@ -1,7 +1,7 @@
[program:celery]
command=/srv/newsblur/manage.py celery worker --loglevel=INFO -Q new_feeds,push_feeds
directory=/srv/newsblur
environment=PATH="/srv/newsblur/venv/bin"
environment=PATH="/srv/newsblur/venv/newsblur/bin"
user=sclay
numprocs=1
stdout_logfile=/var/log/celeryd.log

View file

@ -1,7 +1,7 @@
[program:celeryd_search_indexer]
command=/srv/newsblur/manage.py celery worker --loglevel=INFO -Q search_indexer -c 16
directory=/srv/newsblur
environment=PATH="/srv/newsblur/venv/bin"
environment=PATH="/srv/newsblur/venv/newsblur/bin"
user=sclay
numprocs=1
stdout_logfile=/var/log/celeryd_searchindexer.log

View file

@ -1,7 +1,7 @@
[program:celeryd_search_indexer_tasker]
command=/srv/newsblur/manage.py celery worker --loglevel=INFO -Q search_indexer_tasker -c 2
directory=/srv/newsblur
environment=PATH="/srv/newsblur/venv/bin"
environment=PATH="/srv/newsblur/venv/newsblur/bin"
user=sclay
numprocs=1
stdout_logfile=/var/log/celeryd_searchindexer_tasker.log

View file

@ -1,7 +1,7 @@
[program:celeryd_work_queue]
command=/srv/newsblur/manage.py celery worker --loglevel=INFO -Q work_queue
directory=/srv/newsblur
environment=PATH="/srv/newsblur/venv/bin"
environment=PATH="/srv/newsblur/venv/newsblur/bin"
user=sclay
numprocs=1
stdout_logfile=/var/log/celeryd_workqueue.log

View file

@ -1,7 +1,7 @@
[program:gunicorn]
command=gunicorn -c config/gunicorn_conf.py wsgi
directory=/srv/newsblur
environment=PATH="/srv/newsblur/venv/bin"
environment=PATH="/srv/newsblur/venv/newsblur/bin"
user=sclay
autostart=true
autorestart=true

View file

@ -2,16 +2,17 @@ export ZSH=$HOME/.oh-my-zsh
export CLICOLOR='1'
export ZSH_THEME="risto"
export DISABLE_AUTO_UPDATE=true
export WORKON_HOME=/srv/newsblur/venv
export PROJECT_HOME=/srv/newsblur
source /usr/local/bin/virtualenvwrapper.sh
plugins=(git github pip zsh-syntax-highlighting virtualenvwrapper)
source $ZSH/oh-my-zsh.sh
export PYTHONSTARTUP=$HOME/.pystartup
export LSCOLORS='gxgxcxdxBxegedabagacad'
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/newsblur
source /usr/local/bin/virtualenvwrapper.sh
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31"
setopt COMPLETE_IN_WORD

21
fabfile.py vendored
View file

@ -457,20 +457,25 @@ def setup_virtualenv():
sudo('pip install --upgrade virtualenv')
sudo('pip install --upgrade virtualenvwrapper')
setup_local_files()
with virtualenv():
run('mkvirtualenv newsblur')
run('echo "import sys; sys.setdefaultencoding(\'utf-8\')" | sudo tee ~/.virtualenvs/newsblur/lib/python2.7/sitecustomize.py')
with prefix('WORKON_HOME=%s' % os.path.join(env.NEWSBLUR_PATH, 'venv')):
with prefix('source /usr/local/bin/virtualenvwrapper.sh'):
with cd(env.NEWSBLUR_PATH):
# sudo('rmvirtualenv newsblur')
# sudo('rm -fr venv')
run('mkvirtualenv --no-site-packages newsblur')
run('echo "import sys; sys.setdefaultencoding(\'utf-8\')" | sudo tee venv/newsblur/lib/python2.7/sitecustomize.py')
@_contextmanager
def virtualenv():
with prefix('WORKON_HOME=$HOME/.virtualenvs'):
with prefix('WORKON_HOME=%s' % os.path.join(env.NEWSBLUR_PATH, 'venv')):
with prefix('source /usr/local/bin/virtualenvwrapper.sh'):
with cd(env.NEWSBLUR_PATH):
yield
with prefix('workon newsblur'):
yield
def setup_pip():
pull()
sudo('easy_install -U pip')
run('easy_install -U pip')
@parallel
def pip():
@ -481,8 +486,8 @@ def pip():
sudo('chmod 600 /swapfile')
sudo('mkswap /swapfile')
sudo('swapon /swapfile')
sudo('easy_install -U pip')
sudo('pip install --upgrade pip')
run('easy_install -U pip')
run('pip install --upgrade pip')
run('pip install -r requirements.txt')
sudo('swapoff /swapfile')