From c163bb9aee45bb392b8b71f016314085b7de7f55845e2e10e63762eec8d730e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 20 Feb 2019 09:58:24 +0000 Subject: [PATCH 1/2] Accepting request 677621 from home:jayvdb:branches:devel:languages:python - Remove flower-test_control.diff merged upstream - Add remove-faulty-test.patch for useless test case - Add more missing runtime dependencies Babel & pytz not covered by tests - Update to v0.8.4 * Fix /api/tasks #460 * Disable tornado access logs * Fix #462 * Improve error handling for unsupported brokers * Make sure Babel is at least 1.0 * Updated a test to use assert_called_once_with * Updating readme for OAuth * The viewer tasks, has been enhanced to display the key word arguments and arguments showing now indented way information * Add logging.NullHandler backport #501 * Fix github auth python3 support #498 * Use timezone from celery settings if configured. * Add option `unix_socket`, deploy on docker and expose the sock file * Discover tests in tests/*.py * Fix bug, `events.Task.as_dict` is new in `Celery 3.1.7` * events.Task.as_dict is new in Celery 3.1.7 * Refactor /api/tasks/ #515 * Use pprint instead of ast #491 * Define CELERY_ACCEPT_CONTENT for examples * Fix task searching #480 OBS-URL: https://build.opensuse.org/request/show/677621 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flower?expand=0&rev=2 --- flower-0.8.3.tar.gz | 3 --- flower-0.8.4.tar.gz | 3 +++ flower-test_control.diff | 16 ---------------- python-flower.changes | 28 ++++++++++++++++++++++++++++ python-flower.spec | 11 +++++++---- remove-faulty-test.patch | 14 ++++++++++++++ 6 files changed, 52 insertions(+), 23 deletions(-) delete mode 100644 flower-0.8.3.tar.gz create mode 100644 flower-0.8.4.tar.gz delete mode 100644 flower-test_control.diff create mode 100644 remove-faulty-test.patch diff --git a/flower-0.8.3.tar.gz b/flower-0.8.3.tar.gz deleted file mode 100644 index 6531200..0000000 --- a/flower-0.8.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ca6ae26361e58491d51eaded0ee7134087f4ea3cdd00ac158d903dc02dd0e85b -size 2217575 diff --git a/flower-0.8.4.tar.gz b/flower-0.8.4.tar.gz new file mode 100644 index 0000000..d76e9cb --- /dev/null +++ b/flower-0.8.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:982c2aff14b1b01024cf3356ff90309bc19fba99f47faba3cdb6c3262331c66e +size 2224949 diff --git a/flower-test_control.diff b/flower-test_control.diff deleted file mode 100644 index 71824f4..0000000 --- a/flower-test_control.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- flower-0.8.3/tests/api/test_control.py 2015-04-05 02:09:44.000000000 +0200 -+++ flower-0.8.4/tests/api/test_control.py 2016-01-19 02:55:07.000000000 +0100 -@@ -34,7 +34,12 @@ def test_pool_restart(self): - celery.control.broadcast = MagicMock(return_value=[{'test': 'ok'}]) - r = self.post('/api/worker/pool/restart/test', body={}) - self.assertEqual(200, r.code) -- celery.control.broadcast.assert_called_once() -+ celery.control.broadcast.assert_called_once_with( -+ 'pool_restart', -+ arguments={'reload': False}, -+ destination=['test'], -+ reply=True, -+ ) - - def test_pool_grow(self): - celery = self._app.capp diff --git a/python-flower.changes b/python-flower.changes index dd4ecae..038c470 100644 --- a/python-flower.changes +++ b/python-flower.changes @@ -1,3 +1,31 @@ +------------------------------------------------------------------- +Wed Feb 20 08:09:01 UTC 2019 - John Vandenberg + +- Remove flower-test_control.diff merged upstream +- Add remove-faulty-test.patch for useless test case +- Add more missing runtime dependencies Babel & pytz not covered by tests +- Update to v0.8.4 + * Fix /api/tasks #460 + * Disable tornado access logs + * Fix #462 + * Improve error handling for unsupported brokers + * Make sure Babel is at least 1.0 + * Updated a test to use assert_called_once_with + * Updating readme for OAuth + * The viewer tasks, has been enhanced to display the key word arguments + and arguments showing now indented way information + * Add logging.NullHandler backport #501 + * Fix github auth python3 support #498 + * Use timezone from celery settings if configured. + * Add option `unix_socket`, deploy on docker and expose the sock file + * Discover tests in tests/*.py + * Fix bug, `events.Task.as_dict` is new in `Celery 3.1.7` + * events.Task.as_dict is new in Celery 3.1.7 + * Refactor /api/tasks/ #515 + * Use pprint instead of ast #491 + * Define CELERY_ACCEPT_CONTENT for examples + * Fix task searching #480 + ------------------------------------------------------------------- Sat Feb 16 02:31:41 UTC 2019 - John Vandenberg diff --git a/python-flower.spec b/python-flower.spec index c108a61..6c59f81 100644 --- a/python-flower.spec +++ b/python-flower.spec @@ -17,15 +17,15 @@ Name: python-flower -Version: 0.8.3 +Version: 0.8.4 Release: 0 Summary: A web frontend for monitoring and administrating Celery clusters License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/mher/flower Source: https://files.pythonhosted.org/packages/source/f/flower/flower-%{version}.tar.gz -Patch1: flower-test_control.diff -BuildRequires: %{python_module Babel} +Patch0: remove-faulty-test.patch +BuildRequires: %{python_module Babel >= 1.0} BuildRequires: %{python_module celery >= 2.5.0} BuildRequires: %{python_module certifi} BuildRequires: %{python_module kombu} @@ -35,8 +35,10 @@ BuildRequires: %{python_module setuptools} BuildRequires: %{python_module tornado >= 4.0.0} BuildRequires: fdupes BuildRequires: python-futures +Requires: python-Babel >= 1.0 Requires: python-celery >= 2.5.0 Requires: python-certifi +Requires: python-pytz Requires: python-tornado >= 4.0.0 Requires(post): update-alternatives Requires(postun): update-alternatives @@ -51,7 +53,8 @@ Flower is a web based tool for monitoring and administrating Celery clusters. %prep %setup -q -n flower-%{version} -%patch1 -p1 +%patch0 -p1 +sed -i 's/==/>=/' requirements/default.txt requirements/test.txt %build %python_build diff --git a/remove-faulty-test.patch b/remove-faulty-test.patch new file mode 100644 index 0000000..52ab086 --- /dev/null +++ b/remove-faulty-test.patch @@ -0,0 +1,14 @@ +--- flower-0.8.4/tests/test_command.py.orig 2019-02-20 15:47:03.279318000 +0700 ++++ flower-0.8.4/tests/test_command.py 2019-02-20 15:47:12.083402871 +0700 +@@ -1,11 +1 @@ +-import unittest + +-from tests import AsyncHTTPTestCase +-from flower.command import FlowerCommand +- +- +-class TestFlowerCommand(AsyncHTTPTestCase): +- def test_command(self): +- flower = FlowerCommand() +- #flower.execute_from_commandline() +- assert False From b3e8455506b6ec30e3067c0a7c491699d9bbf48ddff73368c7253e0495338480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 22 Mar 2019 10:22:30 +0000 Subject: [PATCH 2/2] Accepting request 687482 from home:jayvdb:django - Remove no longer needed remove-faulty-test.patch - Use backport_run_in_executor.patch to be compatible with Tornado 4 - Increase minimum dependencies for celery >= 3.1.0 and Tornado >= 4.2.0 - Update to v0.9.3 * Fix numeric sort and sort ordering * Support filtering tasks by received time * Fix "not JSON serializable" `TypeError` for /api/task/info * Fixed Auth redirect when -url_prefix is given * OpenAPI 2.0 swagger spec initial commit * Update tasks datatable to use POST method * Fix hanging issues with tornado 5.0.0 * Add 'signal' query parameter to endpoint /api/task/revoke * Use parse_version instead of tuple comparisons * /tasks endpoint fails with 500 * Add links for parent and root jobs * Make dropdown font colour white instead of grey * Fix incorrect response body * Removed some legacy code for Python 2.6 * Document the GetQueueLengths API endpoint * Enable broker support for redis+socket connections * Fix docs for default inspect_timeout value * Fix typo in Google OAuth 2 redirect uri env variable * Upgrade tornado * Fix the out-dated doc link in Worker.html * Declare futures dependency using environment markers * Fixing GitHub OAuth callback handling * Correct spelling error * Correct spelling and grammatical errors * Switch away from Google+ OAuth2 * restrict release dependencies with version upper-bound - from v0.9.2 * Add logout button * Fix a bug in humanizing timestamps on the tasks page * Handle errors in custom format_task functions * Pending tasks don't have a worker * Fix result encoding * Removed 500px height limitation * Do not show debug information on 500 error * Fixed Python 3 mistake in Github Login Handler * Support environment variables in tornado 4.2.0 and >=4.3 * Fix XSS on tasks page * Enable cross-origin websockets * Fix bugreport * Resolve relative config file names * Fix broker api validation * Loosen broker api validation * Replace websokets with ajax * Fix bug in tasks page template * Fix celery version comparsion * Refactor version comparision * Fixes in config documents * Fix invalid URL used for datatable query * Use redis as default broker * Update dashboard counters on worker table updates * Move shut down group button to worker page * Update navbar title * Add a script for calling tasks * Add a link to worker name * Remove active task start time from worker page * Fix py3 json serialization * Fix Error 500 because task.worker is None * HTML escape task args * Disable broker cert verification * Enable all tasks columns with --tasks-options=all * Add runtime to default tasks columns * Document --tasks-columns=all * Refactor redis broker * Support CELERY_QUEUES option * Remove rabbitmq-plugins enable warning * Fix broken link to celery configuration document - from v0.9.1 * Improve envvar handling * By default update worker cache * Fix task sorting for py3 * Fix missing workername * Fix monitor tab problem of missing graphs - from v0.9.0 * workers can be sorted and filtered * tasks can be sorted, filtered by name, state, worker, runtime, etc. * tasks columns can be reordered and customized * tasks columns for worker, retries, revoked, expires, eta, etc. * pagination of tasks * GitHub Auth support --max_workers option for limiting the number of workers --unix_socket option for running with unix socket * bug fixes OBS-URL: https://build.opensuse.org/request/show/687482 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flower?expand=0&rev=4 --- backport_run_in_executor.patch | 48 ++++++++++++++++++ flower-0.8.4.tar.gz | 3 -- flower-0.9.3.tar.gz | 3 ++ python-flower.changes | 90 ++++++++++++++++++++++++++++++++++ python-flower.spec | 17 ++++--- remove-faulty-test.patch | 14 ------ 6 files changed, 150 insertions(+), 25 deletions(-) create mode 100644 backport_run_in_executor.patch delete mode 100644 flower-0.8.4.tar.gz create mode 100644 flower-0.9.3.tar.gz delete mode 100644 remove-faulty-test.patch diff --git a/backport_run_in_executor.patch b/backport_run_in_executor.patch new file mode 100644 index 0000000..033c184 --- /dev/null +++ b/backport_run_in_executor.patch @@ -0,0 +1,48 @@ +From 5741cbcbc5c2a75c2552326018ee97b8fe5f257f Mon Sep 17 00:00:00 2001 +From: John Vandenberg +Date: Fri, 22 Mar 2019 08:28:34 +0700 +Subject: [PATCH] Backport run_in_executor + +--- + flower/api/tasks.py | 21 +++++++++++++++++++-- + 1 file changed, 19 insertions(+), 2 deletions(-) + +diff --git a/flower/api/tasks.py b/flower/api/tasks.py +index 1f172422..f0395dea 100644 +--- a/flower/api/tasks.py ++++ b/flower/api/tasks.py +@@ -78,6 +78,24 @@ def safe_result(self, result): + return result + + ++def inline_run_in_executor(func, *args): ++ from tornado.concurrent import Future, chain_future ++ ++ io_loop = IOLoop.current() ++ if not hasattr(io_loop, "_executor"): ++ import concurrent.futures ++ from tornado.process import cpu_count ++ ++ io_loop._executor = concurrent.futures.ThreadPoolExecutor( ++ max_workers=(cpu_count() * 5) ++ ) ++ executor = io_loop._executor ++ c_future = executor.submit(func, *args) ++ t_future = Future() ++ io_loop.add_future(c_future, lambda f: chain_future(f, t_future)) ++ return t_future ++ ++ + class TaskApply(BaseTaskHandler): + @web.authenticated + @gen.coroutine +@@ -138,8 +156,7 @@ def post(self, taskname): + result = task.apply_async(args=args, kwargs=kwargs, **options) + response = {'task-id': result.task_id} + +- response = yield IOLoop.current().run_in_executor( +- None, self.wait_results, result, response) ++ response = yield inline_run_in_executor(self.wait_results, result, response) + self.write(response) + + def wait_results(self, result, response): diff --git a/flower-0.8.4.tar.gz b/flower-0.8.4.tar.gz deleted file mode 100644 index d76e9cb..0000000 --- a/flower-0.8.4.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:982c2aff14b1b01024cf3356ff90309bc19fba99f47faba3cdb6c3262331c66e -size 2224949 diff --git a/flower-0.9.3.tar.gz b/flower-0.9.3.tar.gz new file mode 100644 index 0000000..8d9d47b --- /dev/null +++ b/flower-0.9.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f45acb297ab7cf3dd40140816143a2588f6938dbd70b8c46b59c7d8d1e93d55 +size 1290081 diff --git a/python-flower.changes b/python-flower.changes index 038c470..239fdbd 100644 --- a/python-flower.changes +++ b/python-flower.changes @@ -1,3 +1,93 @@ +------------------------------------------------------------------- +Fri Mar 22 01:59:49 UTC 2019 - John Vandenberg + +- Remove no longer needed remove-faulty-test.patch +- Use backport_run_in_executor.patch to be compatible with Tornado 4 +- Increase minimum dependencies for celery >= 3.1.0 and Tornado >= 4.2.0 +- Update to v0.9.3 + * Fix numeric sort and sort ordering + * Support filtering tasks by received time + * Fix "not JSON serializable" `TypeError` for /api/task/info + * Fixed Auth redirect when -url_prefix is given + * OpenAPI 2.0 swagger spec initial commit + * Update tasks datatable to use POST method + * Fix hanging issues with tornado 5.0.0 + * Add 'signal' query parameter to endpoint /api/task/revoke + * Use parse_version instead of tuple comparisons + * /tasks endpoint fails with 500 + * Add links for parent and root jobs + * Make dropdown font colour white instead of grey + * Fix incorrect response body + * Removed some legacy code for Python 2.6 + * Document the GetQueueLengths API endpoint + * Enable broker support for redis+socket connections + * Fix docs for default inspect_timeout value + * Fix typo in Google OAuth 2 redirect uri env variable + * Upgrade tornado + * Fix the out-dated doc link in Worker.html + * Declare futures dependency using environment markers + * Fixing GitHub OAuth callback handling + * Correct spelling error + * Correct spelling and grammatical errors + * Switch away from Google+ OAuth2 + * restrict release dependencies with version upper-bound +- from v0.9.2 + * Add logout button + * Fix a bug in humanizing timestamps on the tasks page + * Handle errors in custom format_task functions + * Pending tasks don't have a worker + * Fix result encoding + * Removed 500px height limitation + * Do not show debug information on 500 error + * Fixed Python 3 mistake in Github Login Handler + * Support environment variables in tornado 4.2.0 and >=4.3 + * Fix XSS on tasks page + * Enable cross-origin websockets + * Fix bugreport + * Resolve relative config file names + * Fix broker api validation + * Loosen broker api validation + * Replace websokets with ajax + * Fix bug in tasks page template + * Fix celery version comparsion + * Refactor version comparision + * Fixes in config documents + * Fix invalid URL used for datatable query + * Use redis as default broker + * Update dashboard counters on worker table updates + * Move shut down group button to worker page + * Update navbar title + * Add a script for calling tasks + * Add a link to worker name + * Remove active task start time from worker page + * Fix py3 json serialization + * Fix Error 500 because task.worker is None + * HTML escape task args + * Disable broker cert verification + * Enable all tasks columns with --tasks-options=all + * Add runtime to default tasks columns + * Document --tasks-columns=all + * Refactor redis broker + * Support CELERY_QUEUES option + * Remove rabbitmq-plugins enable warning + * Fix broken link to celery configuration document +- from v0.9.1 + * Improve envvar handling + * By default update worker cache + * Fix task sorting for py3 + * Fix missing workername + * Fix monitor tab problem of missing graphs +- from v0.9.0 + * workers can be sorted and filtered + * tasks can be sorted, filtered by name, state, worker, runtime, etc. + * tasks columns can be reordered and customized + * tasks columns for worker, retries, revoked, expires, eta, etc. + * pagination of tasks + * GitHub Auth support + --max_workers option for limiting the number of workers + --unix_socket option for running with unix socket + * bug fixes + ------------------------------------------------------------------- Wed Feb 20 08:09:01 UTC 2019 - John Vandenberg diff --git a/python-flower.spec b/python-flower.spec index 6c59f81..4f89b5f 100644 --- a/python-flower.spec +++ b/python-flower.spec @@ -17,29 +17,31 @@ Name: python-flower -Version: 0.8.4 +Version: 0.9.3 Release: 0 Summary: A web frontend for monitoring and administrating Celery clusters License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/mher/flower Source: https://files.pythonhosted.org/packages/source/f/flower/flower-%{version}.tar.gz -Patch0: remove-faulty-test.patch +# Tornado 5+ update blocked by salt, so backport the missing piece +Patch0: backport_run_in_executor.patch BuildRequires: %{python_module Babel >= 1.0} -BuildRequires: %{python_module celery >= 2.5.0} +BuildRequires: %{python_module celery >= 3.1.0} BuildRequires: %{python_module certifi} BuildRequires: %{python_module kombu} BuildRequires: %{python_module mock} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytz} BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module tornado >= 4.0.0} +BuildRequires: %{python_module tornado >= 4.2.0} BuildRequires: fdupes BuildRequires: python-futures Requires: python-Babel >= 1.0 -Requires: python-celery >= 2.5.0 +Requires: python-celery >= 3.1.0 Requires: python-certifi Requires: python-pytz -Requires: python-tornado >= 4.0.0 +Requires: python-tornado >= 4.2.0 Requires(post): update-alternatives Requires(postun): update-alternatives BuildArch: noarch @@ -54,7 +56,6 @@ Flower is a web based tool for monitoring and administrating Celery clusters. %prep %setup -q -n flower-%{version} %patch0 -p1 -sed -i 's/==/>=/' requirements/default.txt requirements/test.txt %build %python_build @@ -75,7 +76,7 @@ sed -i 's/==/>=/' requirements/default.txt requirements/test.txt %files %{python_files} %license LICENSE -%doc AUTHORS CHANGES README.rst +%doc CHANGES README.rst %{python_sitelib}/* %python_alternative %{_bindir}/flower diff --git a/remove-faulty-test.patch b/remove-faulty-test.patch deleted file mode 100644 index 52ab086..0000000 --- a/remove-faulty-test.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- flower-0.8.4/tests/test_command.py.orig 2019-02-20 15:47:03.279318000 +0700 -+++ flower-0.8.4/tests/test_command.py 2019-02-20 15:47:12.083402871 +0700 -@@ -1,11 +1 @@ --import unittest - --from tests import AsyncHTTPTestCase --from flower.command import FlowerCommand -- -- --class TestFlowerCommand(AsyncHTTPTestCase): -- def test_command(self): -- flower = FlowerCommand() -- #flower.execute_from_commandline() -- assert False