diff --git a/docker/base/install.sh b/docker/base/install.sh index 9ca3ac66..b056c00d 100755 --- a/docker/base/install.sh +++ b/docker/base/install.sh @@ -61,7 +61,6 @@ apt-get install -y \ oxframe \ ffmpeg \ mkvtoolnix \ - gpac \ imagemagick \ poppler-utils \ ipython3 \ diff --git a/etc/systemd/system/pandora-encoding.service b/etc/systemd/system/pandora-encoding.service index fa791feb..ee8725ce 100644 --- a/etc/systemd/system/pandora-encoding.service +++ b/etc/systemd/system/pandora-encoding.service @@ -15,7 +15,7 @@ ExecStart=/srv/pandora/bin/celery \ -Q encoding -n pandora-encoding \ --pidfile /run/pandora/encoding.pid \ -c $CONCURRENCY \ - --maxtasksperchild $MAX_TASKS_PER_CHILD \ + --max-tasks-per-child $MAX_TASKS_PER_CHILD \ -l $LOGLEVEL ExecReload=/bin/kill -TERM $MAINPID diff --git a/etc/systemd/system/pandora-tasks.service b/etc/systemd/system/pandora-tasks.service index d8fe1b58..d1d49420 100644 --- a/etc/systemd/system/pandora-tasks.service +++ b/etc/systemd/system/pandora-tasks.service @@ -15,7 +15,7 @@ ExecStart=/srv/pandora/bin/celery \ -Q default,celery -n pandora-default \ --pidfile /run/pandora/tasks.pid \ -c $CONCURRENCY \ - --maxtasksperchild $MAX_TASKS_PER_CHILD \ + --max-tasks-per-child $MAX_TASKS_PER_CHILD \ -l $LOGLEVEL ExecReload=/bin/kill -TERM $MAINPID diff --git a/pandora/archive/queue.py b/pandora/archive/queue.py index 8a8ff4ce..edae2c42 100644 --- a/pandora/archive/queue.py +++ b/pandora/archive/queue.py @@ -1,11 +1,9 @@ # -*- coding: utf-8 -*- from datetime import datetime -from time import time - -import celery.task.control -import kombu.five +from time import time, monotonic +from app.celery import app from .models import File @@ -18,7 +16,7 @@ def parse_job(job): 'file': f.oshash } if job['time_start']: - start_time = datetime.fromtimestamp(time() - (kombu.five.monotonic() - job['time_start'])) + start_time = datetime.fromtimestamp(time() - (monotonic() - job['time_start'])) r.update({ 'started': start_time, 'running': (datetime.now() - start_time).total_seconds() @@ -30,7 +28,7 @@ def parse_job(job): def status(): status = [] encoding_jobs = ('archive.tasks.extract_stream', 'archive.tasks.process_stream') - c = celery.task.control.inspect() + c = app.control.inspect() for job in c.active(safe=True).get('celery@pandora-encoding', []): if job['name'] in encoding_jobs: status.append(parse_job(job)) diff --git a/pandora/oxdjango/fields.py b/pandora/oxdjango/fields.py index daebd27c..6227ffdc 100644 --- a/pandora/oxdjango/fields.py +++ b/pandora/oxdjango/fields.py @@ -5,12 +5,12 @@ import copy from django.db import models from django.utils import datetime_safe -import django.contrib.postgres.fields from django.core.serializers.json import DjangoJSONEncoder from ox.utils import json -class JSONField(django.contrib.postgres.fields.JSONField): + +class JSONField(models.JSONField): def __init__(self, *args, **kwargs): if 'encoder' not in kwargs: diff --git a/pandora/oxdjango/query.py b/pandora/oxdjango/query.py index 46500717..474f894a 100644 --- a/pandora/oxdjango/query.py +++ b/pandora/oxdjango/query.py @@ -37,12 +37,12 @@ class NullsLastQuery(Query): obj.nulls_last = self.nulls_last return obj - def get_compiler(self, using=None, connection=None): + def get_compiler(self, using=None, connection=None, elide_empty=True): if using is None and connection is None: raise ValueError("Need either using or connection") if using: connection = connections[using] - return NullLastSQLCompiler(self, connection, using) + return NullLastSQLCompiler(self, connection, using, elide_empty) class QuerySet(django.db.models.query.QuerySet): diff --git a/pandora/taskqueue/models.py b/pandora/taskqueue/models.py index 214f9a41..baf18a86 100644 --- a/pandora/taskqueue/models.py +++ b/pandora/taskqueue/models.py @@ -8,10 +8,11 @@ from django.contrib.auth import get_user_model from django.conf import settings from django.db import models from django.db.models import Q -import celery.task.control -import kombu.five import ox +from app.celery import app + + User = get_user_model() def get_tasks(username): @@ -111,7 +112,7 @@ class Task(models.Model): return False def get_job(self): - c = celery.task.control.inspect() + c = app.control.inspect() active = c.active(safe=True) if active: for queue in active: diff --git a/requirements.txt b/requirements.txt index 737f77ce..73d5d21d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ -Django==3.0.10 +Django==4.2.3 simplejson chardet -celery<5.0,>4.3 -django-celery-results<2 -django-celery-beat -django-extensions==2.2.9 +celery==5.3.1 +django-celery-results==2.5.1 +django-celery-beat==2.5.0 +django-extensions==3.2.3 libsass django-compressor django-sass-processor diff --git a/static/js/infoView.js b/static/js/infoView.js index 2307e109..b74c6e01 100644 --- a/static/js/infoView.js +++ b/static/js/infoView.js @@ -516,12 +516,12 @@ pandora.ui.infoView = function(data, isMixed) { } $('').html(formatKey(key)).appendTo($element); Ox.EditableContent({ - editable: canEdit, clickLink: pandora.clickLink, + editable: canEdit, format: function(value) { return formatValue(key, value); }, - placeholder: formatLight(Ox._( isMixed[key] ? 'mixed' : 'unknown')), + placeholder: formatLight(Ox._(isMixed[key] ? 'mixed' : 'unknown')), tooltip: canEdit ? pandora.getEditTooltip() : '', value: getValue(key, data[key]) }) @@ -542,6 +542,7 @@ pandora.ui.infoView = function(data, isMixed) { }); $element.appendTo($text); } + return $element; } function renderRemainingKeys() { diff --git a/static/js/infoView.padma.js b/static/js/infoView.padma.js index 5f90f139..824849be 100644 --- a/static/js/infoView.padma.js +++ b/static/js/infoView.padma.js @@ -655,8 +655,8 @@ pandora.ui.infoView = function(data, isMixed) { } $('').html(formatKey(key)).appendTo($element); Ox.EditableContent({ - editable: canEdit, clickLink: pandora.clickLink, + editable: canEdit, format: function(value) { return formatValue(key, value); }, @@ -670,10 +670,18 @@ pandora.ui.infoView = function(data, isMixed) { } }) .appendTo($element); + if (isMixed[key] && Ox.contains(listKeys, key)) { + pandora.ui.addRemoveKeyDialog({ + ids: ui.listSelection, + key: key, + section: ui.section + }).appendTo($element) + } } }); $element.appendTo($text); } + return $element; } function toggleIconSize() { diff --git a/update.py b/update.py index c10ab8c1..de560ec6 100755 --- a/update.py +++ b/update.py @@ -305,6 +305,8 @@ if __name__ == "__main__": run('./bin/pip', 'install', '-r', 'requirements.txt') if old < 6500: run('./bin/pip', 'install', '-r', 'requirements.txt') + if old <= 6517: + run('./bin/pip', 'install', '-r', 'requirements.txt') else: if len(sys.argv) == 1: branch = get_branch() diff --git a/vm/pandora_install.sh b/vm/pandora_install.sh index a98504d3..bda61bbe 100755 --- a/vm/pandora_install.sh +++ b/vm/pandora_install.sh @@ -121,7 +121,6 @@ apt-get install -y \ python3-elasticsearch \ ffmpeg \ mkvtoolnix \ - gpac \ imagemagick \ poppler-utils \ ipython3 \