зеркало из https://github.com/mozilla/treeherder.git
Bug 1169916 - Stop using Cython to build the log parser
Since it only speeds up parsing by a few percent of total runtime, and is therefore not worth the added complexity for deployment and local hack-test-debug cycles when working on the log parser. The .gitignore and update.py entries will be removed in a later commit, once the stage/prod src directories have been cleaned up.
This commit is contained in:
Родитель
6b1e4f602b
Коммит
58813b0c51
|
@ -4,6 +4,3 @@ docs
|
||||||
htmlcov
|
htmlcov
|
||||||
puppet
|
puppet
|
||||||
treeherder/etl/data/credentials.json
|
treeherder/etl/data/credentials.json
|
||||||
treeherder/log_parser/artifactbuildercollection.so
|
|
||||||
treeherder/log_parser/artifactbuilders.so
|
|
||||||
treeherder/log_parser/parsers.so
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ before_script:
|
||||||
# Required for Karma tests (http://docs.travis-ci.com/user/gui-and-headless-browsers/)
|
# Required for Karma tests (http://docs.travis-ci.com/user/gui-and-headless-browsers/)
|
||||||
- export DISPLAY=:99.0
|
- export DISPLAY=:99.0
|
||||||
- sh -e /etc/init.d/xvfb start
|
- sh -e /etc/init.d/xvfb start
|
||||||
- python setup.py build_ext --inplace
|
|
||||||
- mysql -e 'create database treeherder;'
|
- mysql -e 'create database treeherder;'
|
||||||
script:
|
script:
|
||||||
- npm test
|
- npm test
|
||||||
|
|
|
@ -12,5 +12,4 @@ COPY ./requirements/common.txt /app/requirements.txt
|
||||||
COPY ./docker/etc/profile.d/treeherder.sh /etc/profile.d/treeherder.sh
|
COPY ./docker/etc/profile.d/treeherder.sh /etc/profile.d/treeherder.sh
|
||||||
COPY . /app
|
COPY . /app
|
||||||
RUN ./bin/peep.py install -r requirements.txt
|
RUN ./bin/peep.py install -r requirements.txt
|
||||||
RUN ./setup.py build_ext --inplace
|
|
||||||
RUN mkdir -p /var/log/gunicorn && mkdir -p /var/log/treeherder/
|
RUN mkdir -p /var/log/gunicorn && mkdir -p /var/log/treeherder/
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#! /bin/bash -e
|
|
||||||
|
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
|
|
||||||
python setup.py build_ext --inplace
|
|
|
@ -60,8 +60,6 @@ def update(ctx):
|
||||||
with ctx.lcd(th_service_src):
|
with ctx.lcd(th_service_src):
|
||||||
# Collect the static files (eg for the Persona or Django admin UI)
|
# Collect the static files (eg for the Persona or Django admin UI)
|
||||||
ctx.local("python2.7 manage.py collectstatic --noinput")
|
ctx.local("python2.7 manage.py collectstatic --noinput")
|
||||||
# Rebuild the Cython code (eg the log parser)
|
|
||||||
ctx.local("python2.7 setup.py build_ext --inplace")
|
|
||||||
# Update the database schema, if necessary.
|
# Update the database schema, if necessary.
|
||||||
ctx.local("python2.7 manage.py migrate --noinput")
|
ctx.local("python2.7 manage.py migrate --noinput")
|
||||||
# Update reference data & tasks config from the in-repo fixtures.
|
# Update reference data & tasks config from the in-repo fixtures.
|
||||||
|
|
|
@ -6,12 +6,6 @@ This is a list of maintenance tasks you may have to execute on a treeherder depl
|
||||||
Apply a change in the code
|
Apply a change in the code
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
If you changed something in the log parser, you need to do a compilation step:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
> ./setup.py build_ext --inplace
|
|
||||||
|
|
||||||
In order to make the various services aware of a change in the code you need to restart supervisor:
|
In order to make the various services aware of a change in the code you need to restart supervisor:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
|
@ -38,12 +38,6 @@ class treeherder {
|
||||||
group => "${APP_GROUP}",
|
group => "${APP_GROUP}",
|
||||||
}
|
}
|
||||||
|
|
||||||
exec{"build-extensions":
|
|
||||||
command => "${VENV_DIR}/bin/python ${PROJ_DIR}/setup.py build_ext --inplace",
|
|
||||||
user => "${APP_USER}",
|
|
||||||
cwd => "${PROJ_DIR}",
|
|
||||||
}
|
|
||||||
|
|
||||||
file { [
|
file { [
|
||||||
"/var/log/gunicorn",
|
"/var/log/gunicorn",
|
||||||
"/var/log/celery",
|
"/var/log/celery",
|
||||||
|
|
|
@ -22,9 +22,6 @@ kombu==3.0.26
|
||||||
# sha256: KjGJ950ce4ohSaDng8C0IX-tmzCm59YEUPJVPcLA5X4
|
# sha256: KjGJ950ce4ohSaDng8C0IX-tmzCm59YEUPJVPcLA5X4
|
||||||
simplejson==3.6.5
|
simplejson==3.6.5
|
||||||
|
|
||||||
# sha256: FDB-emmvmg0OACTURq9-UcwOPk0N-xDTa6g35eWEQBU
|
|
||||||
Cython==0.22
|
|
||||||
|
|
||||||
# Required by datasource
|
# Required by datasource
|
||||||
# sha256: gRBAtkfl1WhvhNtBXv1pfmJQAIsRK2kJunesBZ4UDHQ
|
# sha256: gRBAtkfl1WhvhNtBXv1pfmJQAIsRK2kJunesBZ4UDHQ
|
||||||
MySQL-python==1.2.5
|
MySQL-python==1.2.5
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
[pep8]
|
[pep8]
|
||||||
filename = *.py,*.pyx
|
exclude = .git,__pycache__,.vagrant,bin/peep.py,node_modules
|
||||||
exclude = .git,__pycache__,.vagrant,bin/peep.py,build,node_modules
|
|
||||||
# E121,E123,E126,E226,E24,E704: Ignored in default pep8 config:
|
# E121,E123,E126,E226,E24,E704: Ignored in default pep8 config:
|
||||||
# https://github.com/jcrocholl/pep8/blob/8ca030e2d8f6d377631bae69a18307fb2d051049/pep8.py#L68
|
# https://github.com/jcrocholl/pep8/blob/8ca030e2d8f6d377631bae69a18307fb2d051049/pep8.py#L68
|
||||||
# Our additions...
|
# Our additions...
|
||||||
|
@ -16,8 +15,7 @@ max-line-length = 140
|
||||||
# flake8 is a combination of pyflakes & pep8.
|
# flake8 is a combination of pyflakes & pep8.
|
||||||
# Unfortunately we have to mostly duplicate the above, since some tools use
|
# Unfortunately we have to mostly duplicate the above, since some tools use
|
||||||
# pep8's config (eg autopep8) so we can't just define everything under [flake8].
|
# pep8's config (eg autopep8) so we can't just define everything under [flake8].
|
||||||
filename = *.py,*.pyx
|
exclude = .git,__pycache__,.vagrant,bin/peep.py,node_modules
|
||||||
exclude = .git,__pycache__,.vagrant,bin/peep.py,build,node_modules
|
|
||||||
# The ignore list for pep8 above, plus our own PyFlakes addition:
|
# The ignore list for pep8 above, plus our own PyFlakes addition:
|
||||||
# F403: 'from module import *' used; unable to detect undefined names
|
# F403: 'from module import *' used; unable to detect undefined names
|
||||||
ignore = E121,E123,E126,E226,E24,E704,E501,F403
|
ignore = E121,E123,E126,E226,E24,E704,E501,F403
|
||||||
|
|
13
setup.py
13
setup.py
|
@ -4,18 +4,9 @@
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
import os
|
from setuptools import setup
|
||||||
from distutils.core import setup
|
|
||||||
|
|
||||||
# Prevents an ImportError on Read the Docs, since they don't use
|
|
||||||
# (or need) the packages in common.txt, which includes Cython.
|
|
||||||
if os.environ.get('READTHEDOCS'):
|
|
||||||
ext_modules = []
|
|
||||||
else:
|
|
||||||
from Cython.Build import cythonize
|
|
||||||
ext_modules = cythonize("treeherder/log_parser/*.pyx")
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="treeherder",
|
name="treeherder",
|
||||||
ext_modules=ext_modules
|
url="https://github.com/mozilla/treeherder"
|
||||||
)
|
)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче