chris104957 / django-carrot Goto Github PK
View Code? Open in Web Editor NEWA lightweight task queue for Django using RabbitMQ
Home Page: https://django-carrot.readthedocs.io/
License: Apache License 2.0
A lightweight task queue for Django using RabbitMQ
Home Page: https://django-carrot.readthedocs.io/
License: Apache License 2.0
This would be more useful for debugging
need to think about how this impacts on the size of the query sets being returned
In django2, the queryset returned from the API returns items that have recently been deleted.
Need to make the following changes:
Version found: 0.1.1
NOT NULL constraint failed: carrot_scheduledtask.queue
This happens as the form doesn't seem to validating the queue field properly
This is probably down to the number of logging handlers. Requires further investigation
This happens even when save seems to complete successfully
This workaround is required in order to avoid a 500 error on the carrot montior
TEMPLATES = [
...
'OPTIONS': {
...
'builtins': [
...
'carrot.templatetags.filters'
]
}
]
need to fix this so that it works by default and this workaround isn't required
Memory usage seems to be through the roof, which is the cause
InvalidTemplateLibrary at /
Invalid template library specified. ImportError raised when trying to load 'carrot.templatetags.filters': No module named 'carrot.templatetags'
We currently have two readmes - one in RST format for PyPI and one MD for GitHub. Need to find a way of having just one
Can I somehow spawn the carrot process from within Django? Currently I'm running the django app in a container, and it would be convenient to just have to launch one process. If not, would you consider PRs for fixing something like this.
In order to maintain Carrot's light config approach, we should remove the bash-based daemon and implement a Django-admin command to start/stop the Carrot service, e.g.
python manage.py carrot_daemon start
python manage.py carrot_daemon stop
This will further simplify the config process
dependent on #38
Something like this:
DEBUG: grey
INFO: green
WARNING: yellow
ERROR/CRITICAL: red
Also needs to support filtering - e.g. users can select the logging level that they want to be visible
Sometimes, an ObjectNotFound error occurs during get_task(), which results in orphaned tasks in the queue
Add a 'run now' button to the scheduled task view which publishes the task immediately - would be useful at times
unpkg.com is far too unreliable
using Vuetify
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/carrot/consumer.py", line 203, in consume
args, kwargs = self.serializer.serialize_arguments(body.decode())
File "/usr/local/lib/python3.5/site-packages/carrot/objects.py", line 194, in serialize_arguments
parsed_args = [ast.literal_eval(arg.strip()) for arg in args]
File "/usr/local/lib/python3.5/site-packages/carrot/objects.py", line 194, in <listcomp>
parsed_args = [ast.literal_eval(arg.strip()) for arg in args]
File "/usr/local/lib/python3.5/ast.py", line 46, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/usr/local/lib/python3.5/ast.py", line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 1
(
^
SyntaxError: unexpected EOF while parsing
The brackets surrounding the tuple seem to have gotten written to the MessageLog.task_args field. This happens even when the original task has now positional arguments
following the steps in the readme doesn't actually work. needs bug fix/doc update
Problems:
{}
, the consumer starts but shuts down immediatelyamqp://guest:guest@localhost:5672
causes an index error, as it expects a vhost nameamqp://guest:guest@localhost:5672/test
raises pika.exceptions.ProbableAccessDeniedError: (530, 'NOT_ALLOWED - vhost default not found')
Task scheduler seems to be creating tasks incorrectly. On creating a Scheduled task with no positional or keyword arguments, when the task is published, the value is as follows:
[0, 'default', '', 'default', {}]
this seems to be the priority, queue, exchange, routing key and keyword arguments parameters. Only the very last item in the above list should be getting passed to the function
Need to make the following changes:
django_rest_framework
to the dependenciesWhen a task fails, the only thing visible in the monitor is the traceback. It would be useful to have the full log up until the moment of failure in order to make debugging easier
this is related to the fix for #43
returns the following error:
{
"active": [
"This field may not be null."
]
}
Version number currently needs to be tagged and edited both in setup.py and conf.py for the docs. this could be simplified further
On stopping or restarting the service, the existing consumers remain attached to the rabbitMQ queue. This causes all sorts of issues
I installed djang-carrot
package, added it to installed apps and ran python manage.py makemigrations
, but the migrations ended up inside the virtual environment... Why is that?
$ python manage.py makemigrations carrot
Migrations for 'carrot':
venv/lib/python3.6/site-packages/carrot/migrations/0001_initial.py
- Create model MessageLog
- Create model ScheduledTask
The problem is, as the virtual environment is not checked in to source controll I cannot check in the migration, which normally how things are done in Django. What's the thought here? What I'm I doing wrong?
I'm trying to run carrot + django + postgres + rabbitmq in a docker-compose, but carrot just bails out successfully with exit code 0... My docker-compose.yml file looks like this
version: '2'
services:
rabbit:
image: 'rabbitmq:3.7-alpine'
expose:
- "5672"
postgres:
image: 'postgres:9.6'
volumes:
- postgres_data:/var/lib/postgresql/data
django:
restart: always
build: ./
depends_on:
- postgres
- rabbit
expose:
- "8000"
ports:
- "0.0.0.0:8000:8000"
carrot:
build: ./
depends_on:
- django
- rabbit
command:
bash -c "sleep 8" && python manage.py carrot --traceback
volumes:
postgres_data:
The container does not seem to produce any output whatsoever. There is no file in /var/log/carrot.log
either. Please advice.
I fixed up another simpler django-leek yesterday, but today I saw you had fixed some stuff with the migrations, etc, so I thought I'd give carrot another try as I like the monitor and so on. However, I cannot seem to get it running at all.
Happens in the completed
tab. Not always reproducible - for example, searching for test
works fine but searching for hello
returns an error:
django.db.utils.OperationalError: too many SQL variables
This also means that the message never gets consumed - it just sits in the 'ready' state indefinitely. Presumably it would also be re-consumed on restart of the carrot service
>>> log = MessageLog.objects.first()
>>> log
<MessageLog: default.tasks.hello>
>>> log.positionals
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/carrot/models.py", line 84, in positionals
return [ast.literal_eval(arg.strip()) for arg in self.task_args[1:-1].split(',')]
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/carrot/models.py", line 84, in <listcomp>
return [ast.literal_eval(arg.strip()) for arg in self.task_args[1:-1].split(',')]
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 48, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 0
^
Traceback:
found 0 scheduled tasks to run
Successfully started scheduler
consumer-1 2017-10-13 07:15:09,821:: Started consumer consumer-1
Successfully started 1 consumers for queue default
All queues consumer sets started successfully. Full logs are at /var/log/carrot.log
0 0
Shutdown requested
Eg. clicking Completed
then Scheduled
very quickly causes the scheduled task list to show a list of completed tasks.
The easy fix for this is to clear the task list on changing the tab before attempting to fetch anything
Need to be able to call a hook on task failure so that users can be notified of failures. For example, something using IFTTT could look like this:
def failure_callback(task, exception, pk):
import requests
data = {
'Value1': task,
'Value2': exception,
'Value3': pk,
}
requests.post('https://maker.ifttt.com/trigger/my_ifttt_trigger/with/key/my-ifttt-key', data)
Findings:
.. code-block:: bash
sections are visible (MD doesn't support this). Need to maintain separate MD/RST versions of this readme as PyPi uses RSThttp://django-carrot.readthedocs.io/en/latest/index.html>
There is a ">" ;)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.