Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix several problems with analytics #129

Merged
merged 1 commit into from
Oct 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cvat/apps/tf_annotation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import tensorflow as tf
import numpy as np
from PIL import Image
from .log import slogger
from cvat.apps.engine.log import slogger

def load_image_into_numpy(image):
(im_width, im_height) = image.size
Expand Down
6 changes: 6 additions & 0 deletions cvat/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'filters': [],
'formatter': 'standard',
},
'server_file': {
Expand Down Expand Up @@ -222,6 +223,11 @@
'revproxy': {
'handlers': ['console', 'server_file'],
'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG')
},
'django': {
'handlers': ['console', 'server_file'],
'level': 'INFO',
'propagate': True
}
},
}
Expand Down
11 changes: 7 additions & 4 deletions cvat/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from django.apps import apps
import os

urlpatterns = [
Expand All @@ -30,9 +31,11 @@
path('dashboard/', include('cvat.apps.dashboard.urls')),
path('django-rq/', include('django_rq.urls')),
path('auth/', include('cvat.apps.authentication.urls')),
path('documentation/', include('cvat.apps.documentation.urls')),
path('analytics/', include('cvat.apps.log_viewer.urls'))
path('documentation/', include('cvat.apps.documentation.urls'))
]

if 'yes' == os.environ.get('TF_ANNOTATION', 'no'):
urlpatterns += [path('tf_annotation/', include('cvat.apps.tf_annotation.urls'))]
if apps.is_installed('cvat.apps.tf_annotation'):
urlpatterns.append(path('tf_annotation/', include('cvat.apps.tf_annotation.urls')))

if apps.is_installed('cvat.apps.log_viewer'):
urlpatterns.append(path('analytics/', include('cvat.apps.log_viewer.urls')))
6 changes: 6 additions & 0 deletions supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ command=%(ENV_HOME)s/wait-for-it.sh redis:6379 -t 0 -- bash -ic \
numprocs=1

[program:runserver]
; Here need to run a couple of commands to initialize DB and copy static files.
; We cannot initialize DB on build because the DB should be online. Also some
; apps are dynamically loaded by an environment variable. It can lead to issues
; with docker cache. Thus it is necessary to run collectstatic here for such
; apps.
command=%(ENV_HOME)s/wait-for-it.sh db:5432 -t 0 -- bash -ic \
"/usr/bin/python3 ~/manage.py migrate && \
/usr/bin/python3 ~/manage.py collectstatic --no-input && \
exec /usr/bin/python3 $HOME/manage.py runmodwsgi --log-to-terminal --port 8080 \
--limit-request-body 1073741824 --log-level INFO --include-file ~/mod_wsgi.conf \
%(ENV_DJANGO_MODWSGI_EXTRA_ARGS)s --locale %(ENV_LC_ALL)s"