Skip to content

Commit

Permalink
Merge pull request mozilla-services#2107 from rhelmer/bug965590-unify…
Browse files Browse the repository at this point in the history
…-virtualenv

fix bug 965590 - unify socorro to a single virtualenv
  • Loading branch information
rhelmer committed Jun 12, 2014
2 parents 176d5ed + dfd32b0 commit 3349555
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 52 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test-socorro: bootstrap
$(ENV) $(PG_RESOURCES) $(RMQ_RESOURCES) $(ES_RESOURCES) PYTHONPATH=$(PYTHONPATH) $(COVERAGE) run $(NOSE)
$(COVERAGE) xml

test-webapp:
test-webapp: bootstrap-webapp
cd webapp-django; ./bin/jenkins.sh

bootstrap:
Expand Down Expand Up @@ -76,8 +76,6 @@ install-socorro: bootstrap-webapp
rsync -a scripts/stackwalk.sh $(PREFIX)/stackwalk/bin/
rsync -a analysis $(PREFIX)/
rsync -a alembic $(PREFIX)/application
# purge the virtualenv
[ -d webapp-django/virtualenv ] || rm -rf webapp-django/virtualenv
rsync -a webapp-django $(PREFIX)/
# copy default config files
cd $(PREFIX)/application/scripts/config; for file in *.py.dist; do cp $$file `basename $$file .dist`; done
Expand Down Expand Up @@ -110,7 +108,7 @@ json_enhancements_pg_extension: bootstrap
# every time Socorro is built
if [ ! -f `pg_config --pkglibdir`/json_enhancements.so ]; then sudo env PATH=$$PATH $(VIRTUALENV)/bin/python -c "from pgxnclient import cli; cli.main(['install', 'json_enhancements'])"; fi

bootstrap-webapp:
bootstrap-webapp: bootstrap
cd webapp-django; ./bin/bootstrap.sh

stackwalker:
Expand Down
3 changes: 2 additions & 1 deletion config/apache.conf-dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
NameVirtualHost *:80
WSGIPythonPath /data/socorro/application:/data/socorro/socorro-virtualenv/lib/python2.6/site-packages/:/data/socorro/webapp-django/virtualenv/lib/python2.6/site-packages
WSGIPythonPath /data/socorro/application
WSGIPythonHome /data/socorro/socorro-virtualenv

# Django app, public web UI
<VirtualHost *:80>
Expand Down
3 changes: 2 additions & 1 deletion puppet/files/etc_httpd_conf.d/socorro.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
NameVirtualHost *:80
WSGIPythonPath /data/socorro/application:/data/socorro/socorro-virtualenv/lib/python2.6/site-packages/:/data/socorro/webapp-django/virtualenv/lib/python2.6/site-packages
WSGIPythonPath /data/socorro/application
WSGIPythonHome /data/socorro/socorro-virtualenv

# Django app, public web UI
<VirtualHost *:80>
Expand Down
24 changes: 24 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,27 @@ crontabber==0.8
# sha256: vP9eVeRaj-DDdx6AVgIdSHFN6WQh0e3uw20S9zdQOZc
# sha256: wVmeZhdKbKtjPLa_XsJZDM4QTCPRY5XAK9pe2T6nlHw
boto==2.28.0
# sha256: cyu7F1hQihKEtT_Nzp2WqlPLY86T1Us40ob0KBoSrCQ
pyquery==1.2.6
# sha256: ZrvGLZUZ-dUxsfd-aH2fL15SHLkG8f1yMfQDmX4BEMQ
python-memcached==1.48
# sha256: aoy0QBER4BG1ecjFKlHNq5cAQcxUOBS72Vd6RSn-HNs
BeautifulSoup==3.2.1
# sha256: eMMXu8KuFpoT6MW9MarmEau3bCZKZMPf1xOR5nZ5Jd8
django-ratelimit==0.3.0
# sha256: nrxAU2-bxTW8IhTg8Kbxfm6ylrHh2OxNKOqeAyIPA0Q
django-waffle==0.9.1
# sha256: IvlnXkLcZAxEadT30hC67LXmlYI6-VTIE9UckwI1Z10
Jinja2==2.5.5
# sha256: rxL5lFTolenkMMdXI8O5QZwLzNDqd4A2YtaprFb2Qls
py-bcrypt==0.3
# sha256: BTWn4nAUh0snrjpNM-h0njRb36YnZhlSCLeZa_EQBoI
cssselect==0.9.1
# sha256: 1ugIz8yalSg5O269fnT23pd4f22syV4o9cg2d7YAdRc
https://github.com/jbalogh/check/archive/9c314d7c16408f876ee89f06a62e40dea4c98a02.zip#egg=check
# sha256: l2sTklJ8dzg-uCfef9RNrK8Sl6Y6oN9Sb0evMC9HnVQ
path.py==5.1
# sha256: FbQhMbJfN2Fl0ZX-ThewooMRGCqvkzDV61dbvtpaaYk
pep8>=1.4.5
# sha256: P6gKELNtUWhr93RPXcmWIs1cmM6O1kAi5imGiq_Bd2k
pyflakes==0.8.1
2 changes: 1 addition & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ do
done

echo "Running Django syncdb"
/data/socorro/webapp-django/virtualenv/bin/python \
/data/socorro/socorro-virtualenv/bin/python \
/data/socorro/webapp-django/manage.py syncdb --noinput \
&> /var/log/socorro/django-syncdb.log
error $? "django syncdb failed `cat /var/log/socorro/django-syncdb.log`"
Expand Down
13 changes: 1 addition & 12 deletions webapp-django/bin/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,12 @@
# by WSGI.
set -e

VENV=./virtualenv
. ../socorro-virtualenv/bin/activate

if [ ! -f crashstats/settings/local.py ]
then
cp crashstats/settings/local.py-dist crashstats/settings/local.py
fi
if [ ! -d "$VENV/bin" ]; then
echo "No virtualenv found. Making one..."
virtualenv $VENV --python=python2.6
source $VENV/bin/activate
pip install --upgrade pip
pip install coverage
fi

source $VENV/bin/activate

pip install -r requirements.txt

export PATH=$PATH:./node_modules/.bin/

Expand Down
11 changes: 2 additions & 9 deletions webapp-django/bin/jenkins-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,21 @@ set -e
DB_HOST="localhost"
DB_USER="hudson"

VENV=./virtualenv

echo "Starting build on executor $EXECUTOR_NUMBER..."

. ../socorro-virtualenv/bin/activate

# Make sure there's no old pyc files around.
find . -name '*.pyc' -exec rm {} \;

# RHEL postgres 9 RPM installs pg_config here, psycopg2 needs it
export PATH=$PATH:/usr/pgsql-9.2/bin/

if [ ! -d "$VENV/bin" ]; then
echo "No virtualenv found. Bootstrapping..."
"$(dirname "$0")/bootstrap.sh" "$@" || exit 1
fi

if [ ! -d "vendor" ]; then
echo "No /vendor... crap."
exit 1
fi

source $VENV/bin/activate

echo "Linting..."
git ls-files crashstats | xargs check.py | bin/linting.py

Expand Down
24 changes: 0 additions & 24 deletions webapp-django/requirements.txt

This file was deleted.

0 comments on commit 3349555

Please sign in to comment.