Giter Site home page Giter Site logo

parallels / rq-dashboard Goto Github PK

View Code? Open in Web Editor NEW
1.4K 44.0 327.0 940 KB

Flask-based web front-end for monitoring RQ queues

Home Page: http://python-rq.org/

License: Other

Python 46.73% CSS 3.38% JavaScript 24.26% HTML 22.31% Makefile 0.70% Dockerfile 0.33% Shell 2.29%
python rq

rq-dashboard's Introduction

Introduction

rq-dashboard is a general purpose, lightweight, Flask-based web front-end to monitor your RQ queues, jobs, and workers in realtime.

Build Pull Request Publish Release Python Support PyPI Downloads

Maturity notes

The RQ dashboard is currently being developed and is in beta stage. How migrate to version 1.0 you can find here

You can find help in the discussion page in github or join our discord server

Installing with Docker

You can also run the dashboard inside of docker:

  • copy the docker-compose.yml file from the root of the repository to docker-compose.override.yml and change the environment variables to your liking.

  • run the following command:

    $ docker-compose up
    

You can also find the official image on cjlapao/rq-dashboard:latest

Installing from PyPI

$ pip install rq-dashboard

Running the dashboard

Run the dashboard standalone, like this:

$ rq-dashboard
* Running on http://127.0.0.1:9181/
...
$ rq-dashboard --help
Usage: rq-dashboard [OPTIONS]

  Run the RQ Dashboard Flask server.

  All configuration can be set on the command line or through environment
  variables of the form RQ_DASHBOARD_*. For example RQ_DASHBOARD_USERNAME.

  A subset of the configuration (the configuration parameters used by the
  underlying flask blueprint) can also be provided in a Python module
  referenced using --config, or with a .cfg file referenced by the
  RQ_DASHBOARD_SETTINGS environment variable.

Options:
  -b, --bind TEXT                 IP or hostname on which to bind HTTP server
  -p, --port INTEGER              Port on which to bind HTTP server
  --url-prefix TEXT               URL prefix e.g. for use behind a reverse
                                  proxy
  --username TEXT                 HTTP Basic Auth username (not used if not
                                  set)
  --password TEXT                 HTTP Basic Auth password
  -c, --config TEXT               Configuration file (Python module on search
                                  path)
  -u, --redis-url TEXT            Redis URL. Can be specified multiple times.
                                  Default: redis://127.0.0.1:6379
  --poll-interval, --interval INTEGER
                                  Refresh interval in ms
  --extra-path TEXT               Append specified directories to sys.path
  --disable-delete                Disable delete jobs, clean up registries
  --debug / --normal              Enter DEBUG mode
  -v, --verbose                   Enable verbose logging
  -j, --json                      Enable JSONSerializer
  --help                          Show this message and exit.

Integrating the dashboard in your Flask app

The dashboard can be integrated in to your own Flask app by accessing the blueprint directly in the normal way, e.g.:

from flask import Flask
import rq_dashboard

app = Flask(__name__)
app.config.from_object(rq_dashboard.default_settings)
rq_dashboard.web.setup_rq_connection(app)
app.register_blueprint(rq_dashboard.blueprint, url_prefix="/rq")

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

If you start the Flask app on the default port, you can access the dashboard at http://localhost:5000/rq. The cli.py:main entry point provides a simple working example.

Running on Heroku

Consider using third-party project rq-dashboard-on-heroku, which installs rq-dashboard from PyPI and wraps in in Gunicorn for deployment to Heroku. rq-dashboard-on-heroku is maintained indepdently.

Running behind a Reverse Proxy

You can run the dashboard as a systemd service in Linux or via a suprevisor script and then use Apache or NGINX to direct traffic to the dashboard.

This is for non-production functionality!

Apache Reverse Proxy example:

ProxyPass /rq http://127.0.0.1:5001/rq
ProxyPassReverse /rq http://127.0.0.1:5001/rq

Systemd service example:

[Unit]
Description=Redis Queue Dashboard
[Install]

WantedBy=multi-user.target
[Service]
ExecStart=/bin/rq-dashboard -b 127.0.0.1 -p 5001 --url-prefix /rq -c rq_settings_dashboard --debug -v
StandardOutput=file:/var/log/redis/rq-dasbhoard.log
StandardError=file:/var/log/redis/rq-dashboard.log
User=redis-dash
Group=redis-dash
RemainAfterExit=yes
Type=simple
PermissionsStartOnly=false
PrivateTmp=no
  • --debug,-v are optional -- they will write stdout to your specified files.
  • rq_settings_dashboard is a Python file, with settings defined. You can use options that are available as environmental variables. (EX. RQ_DASHBOARD_REDIS_PASSWORD = password)

Developing

Develop in a virtualenv and make sure you have all the necessary build time (and run time) dependencies with

$ pip install -r requirements.txt

Develop in the normal way with

$ python setup.py develop

Stats

rq-dashboard's People

Contributors

1nf0rmed avatar caub avatar cjlapao avatar coolhacker avatar dependabot-preview[bot] avatar dependabot[bot] avatar dopc avatar dstufft avatar ducu avatar eddiecorrigall avatar eoranged avatar flopraden avatar gerardsoleca avatar gnomeby avatar hnykda avatar hugovk avatar jlopex avatar joowani avatar klinkin avatar mastervolkov avatar mgax avatar njmei avatar nvie avatar onilton avatar peter4431 avatar rquigley avatar sburns avatar skavie avatar tcorbettclark avatar voith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rq-dashboard's Issues

not retuen json when get fail jobs

[root@master rq-dashboard]# curl -v "http://127.0.0.1:9181//jobs/failed/1.json"
* About to connect() to 127.0.0.1 port 9181 (#0)
*   Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 9181 (#0)
> GET //jobs/failed/1.json HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
> Host: 127.0.0.1:9181
> Accept: */*
>
* Closing connection #0
* Failure when receiving data from the peer
curl: (56) Failure when receiving data from the peer
[root@master rq-dashboard]# curl -v "http://127.0.0.1:9181//jobs/failed/1.json"
* About to connect() to 127.0.0.1 port 9181 (#0)
*   Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 9181 (#0)
> GET //jobs/failed/1.json HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
> Host: 127.0.0.1:9181
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Content-Type: text/html; charset=utf-8
< Content-Length: 16407
< Server: Werkzeug/0.9.4 Python/2.6.6
< Date: Fri, 25 Apr 2014 16:11:32 GMT
<
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1.0">
  <title>RQ dashboard</title>

  <link rel="stylesheet" href="/static/css/bootstrap.min.css">
  <link href="/static/css/main.css" rel="stylesheet">
</head>

<body>

<div class="container">



<div class="row">
    <div class="span6">
        <div class="section">

            <h1>Queues</h1>
            <p class="fixed intro">This list below contains all the registered queues with the number of jobs currently in the queue.  Select a queue from above to view all jobs currently pending on the queue.</p>

            <table id="queues" class="table table-bordered">
                <thead>
                    <tr>
                        <th>Queue</th>
                        <th class="narrow">Jobs</th>
                    </tr>
                </thead>
                <tbody>
                    <tr data-role="loading-placeholder">
                        <td colspan="2">Loading...</td>
                    </tr>
                </tbody>
            </table>

            <script name="queue-row" type="text/template">
                <tr data-role="queue" <% if (d.name === 'failed' && d.count > 0) { %> class="failed"<% } %>>
                    <td><i class="icon-inbox" style="opacity: .5;"></i> <a href="<%= d.url %>"><%= d.name %></a></td>
                    <td class="narrow"><%= d.count %></td>
                </tr>
            </script>

            <script name="no-queues-row" type="text/template">
                <tr>
                    <td colspan="3">No queues.</td>
                </tr>
            </script>

        </div>
    </div>

    <div class="span6">
        <div class="section">

        <h1>Workers</h1>
        <p class="fixed intro">This list below contains all the registered workers.</p>

        <table id="workers" class="table table-bordered">
            <thead>
                <tr>
                    <th style="width:48px">State</th>
                    <th>Worker</th>
                    <th>Queues</th>
                </tr>
            </thead>
            <tbody>
                <tr data-role="loading-placeholder">
                    <td colspan="3">Loading...</td>
                </tr>
            </tbody>
        </table>

        <script name="worker-row" type="text/template">
            <tr data-role="worker">
                <td><i class="icon-<%= d.state %>"></i></td>
                <td><%= d.name %></td>
                <td><%= d.queues.join(', ') %></td>
            </tr>
        </script>

        <script name="no-workers-row" type="text/template">
            <tr>
                <td colspan="3">No workers.</td>
            </tr>
        </script>

        </div>
    </div>
</div>

<div class="row">
    <div class="span12">
        <div class="section">

        <h1>Jobs on <strong class="failed">failed</strong></h1>
        <p class="intro">
        <a href="/queue/failed/empty" id="empty-btn" class="btn btn-danger btn-small" style="float: right" data-toggle="tooltip" title="Remove all jobs from this queue (<b>destructive</b>)" data-html=true ><i class="icon-trash icon-white"></i> Empty</a>
        <a href="/queue/failed/compact" id="compact-btn" class="btn btn-small" style="float: right; margin-right: 8px;" data-toggle="tooltip" title="Remove all stale jobs from this queue (non-destructive)" ><i class="icon-resize-small"></i> Compact</a>
        <a href="/requeue-all" id="requeue-all-btn" class="btn btn-small" style="float: right; margin-right: 8px;"><i class="icon-retweet"></i> Requeue All</a>
        This list below contains all the registered jobs on queue <strong>failed</strong>, sorted by age (oldest on top).</p>

        <table id="jobs" class="table table-bordered">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Age</th>
                    <th class="narrow">Actions</th>
                </tr>
            </thead>
            <tbody>
                <tr data-role="loading-placeholder">
                    <td colspan="2">Loading...</td>
                </tr>
            </tbody>
        </table>

        <script name="job-row" type="text/template">
            <tr data-role="job" data-job-id="<%= d.id %>">
                <td>
                    <i class="icon-file" style="opacity: .5;"></i>
                    <span class="description"><%= $('<div/>').text(d.description).html() %></span>
                    <% if (d.exc_info) { %>
                        <span class="origin">from <strong><%= d.origin %></strong></span>
                    <% } %>
                    <div class="job_id"><%= d.id %></div>
                    <% if (d.exc_info) { %>

and the server return 200

10.58.104.79 - - [26/Apr/2014 00:11:31] "GET /queues.json HTTP/1.1" 200 -
127.0.0.1 - - [26/Apr/2014 00:11:32] "GET //jobs/failed/1.json HTTP/1.1" 200 -
10.58.104.79 - - [26/Apr/2014 00:11:32] "GET /workers.json HTTP/1.1" 200 -

strangeness when using blueprint

I took a screencast of this issue, you can see it here.

From the same machine, rqinfo runs fine while the RQDashboard blueprint hooked into an existing flask app is very flaky.

Notably, when running the dashboard as a standalone app ($ rq-dashboard -u …) the dashboard shows none of this wonkiness.

Crash when lazy initialise with flask app

I was trying to integrate rq-dashboard into my flask app, with the following lines:

from rq_dashboard import RQDashboard
dashboard = RQDashboard()                    # crash here!!

then initialise the app from create_app function:

dashboard.init_app(app)

However, it crash immediately on creation. I believe this has been fixed with commit: 84b9cf2

My question is, when are you going to release this piece of code that fixed 8 months ago?

› python manage.py runserver
Traceback (most recent call last):
  File "manage.py", line 7, in <module>
    import application
  File "/Users/jiequanli/Dropbox/Code/shopping2/application/__init__.py", line 4, in <module>
    import models
  File "/Users/jiequanli/Dropbox/Code/shopping2/application/models/__init__.py", line 2, in <module>
    from inventory import *
  File "/Users/jiequanli/Dropbox/Code/shopping2/application/models/inventory/__init__.py", line 3, in <module>
    from item import *
  File "/Users/jiequanli/Dropbox/Code/shopping2/application/models/inventory/item.py", line 6, in <module>
    from application.extensions import db
  File "/Users/jiequanli/Dropbox/Code/shopping2/application/extensions.py", line 48, in <module>
    dashboard = RQDashboard()
  File "/Users/jiequanli/Dropbox/Code/shopping2/env/lib/python2.7/site-packages/rq_dashboard/__init__.py", line 13, in __init__
    self.app.auth_handler = auth_handler
AttributeError: 'NoneType' object has no attribute 'auth_handler'

paginate dashboard items

Currently, say if I have many jobs (10's of thousands) in a certain queue the dashboard attempts to load every job that is inside of that queue. This causes rq-dash to crash because it attempts to load too many jobs at once. I believe it would have a better UX if the job list was paginated.

The worker list would also be nice to have a count of number of workers and paginated as well.

Issue with Apache mod_wsgi and threading

Hi,

And thanks for this valuable tool.

As part of a bigger app, I wanted to deploy rq-dashboard through Apache/mod_wsgi, but the function rq.connections.get_current_connection() returns None in a - appearently - random manner. This is an example of trace of what returns this function.

[Tue Dec 17 15:32:22 2013] [error] <redis.client.Redis object at 0x7f172896a050>
[Tue Dec 17 15:32:22 2013] [error] None
[Tue Dec 17 15:32:22 2013] [error]  None
[Tue Dec 17 15:32:24 2013] [error] None
[Tue Dec 17 15:32:24 2013] [error] None
[Tue Dec 17 15:32:24 2013] [error]  None
[Tue Dec 17 15:32:27 2013] [error] <redis.client.Redis object at 0x7f172896a050>
[Tue Dec 17 15:32:27 2013] [error] <redis.client.Redis object at 0x7f172896a050>
[Tue Dec 17 15:32:27 2013] [error]  None
[Tue Dec 17 15:32:29 2013] [error] None
[Tue Dec 17 15:32:29 2013] [error] <redis.client.Redis object at 0x7f172896a050>
[Tue Dec 17 15:32:29 2013] [error]  None
[Tue Dec 17 15:32:31 2013] [error] None

Here is an example of traceback I can read in the error log :

Traceback (most recent call last):
  File "/home/loix-devint/loix.buildout/parts/rq-dashboard-wsgiscript/rq-dashboard.wsgi", line 57, in application
    return _application(environ, start_response)
  File "/home/loix-devint/loix.buildout/eggs/Flask-0.10.1-py2.7.egg/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/loix-devint/loix.buildout/eggs/Flask-0.10.1-py2.7.egg/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/home/loix-devint/loix.buildout/eggs/Flask-0.10.1-py2.7.egg/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/loix-devint/loix.buildout/eggs/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/loix-devint/loix.buildout/eggs/Flask-0.10.1-py2.7.egg/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/loix-devint/loix.buildout/eggs/Flask-0.10.1-py2.7.egg/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/loix-devint/loix.buildout/eggs/Flask-0.10.1-py2.7.egg/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/loix-devint/loix.buildout/eggs/Flask-0.10.1-py2.7.egg/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/loix-devint/loix.buildout/eggs/rq_dashboard-0.3.3-py2.7.egg/rq_dashboard/dashboard.py", line 100, in overview
    failed = Queue('failed')
  File "/home/loix-devint/loix.buildout/eggs/rq-0.3.12-py2.7.egg/rq/queue.py", line 48, in __init__
    self.connection = resolve_connection(connection)
  File "/home/loix-devint/loix.buildout/eggs/rq-0.3.12-py2.7.egg/rq/connections.py", line 65, in resolve_connection
    'Could not resolve a Redis connection.')
NoRedisConnectionException: Could not resolve a Redis connection.

This can be "fixed" only when limiting the number of threads to "1" in the Apache config part of the WSGI app.

I suspect there is an issue in the initialization part that makes the thread local stack of connections in rq.connections._connection_stack from rq_dashboard.dashboard.setup_rq_connection()

The Apache config part :

  <VirtualHost *:80>
    ServerName rq-dashboard.tld
    ServerAdmin [email protected]

    # Note the "threads=1"
    WSGIDaemonProcess rq-dashboard.tld user=loix-devint group=apache threads=1

    SetEnv RQ_DASHBOARD_SETTINGS /home/loix-devint/loix.buildout/etc/rq_dashboard_settings.py

    WSGIScriptAlias / /home/loix-devint/loix.buildout/parts/rq-dashboard-wsgiscript/rq-dashboard.wsgi
    <Directory /home/loix-devint/loix.buildout/parts/rq-dashboard-wsgiscript>
      WSGIProcessGroup rq-dashboard.tld
      WSGIApplicationGroup %{GLOBAL}
      Order deny,allow
      Allow from all
    </Directory>
    LogLevel debug
    ErrorLog /home/loix-devint/loix.buildout/var/log/httpd/rq-dashboard/errors.log
    CustomLog /home/loix-devint/loix.buildout/var/log/httpd/rq-dashboard/access.log common
  </VirtualHost>

The /home/loix-devint/loix.buildout/etc/rq_dashboard_settings.py file:

REDIS_URL = "redis://localhost:6379/0"
RQ_POLL_INTERVAL = 2500

The wsgi bootstraper file /home/loix-devint/loix.buildout/parts/rq-dashboard-wsgiscript/rq-dashboard.wsgi

import sys
import os

sys.path[0:0] = [
    '/home/loix-devint/loix.buildout/eggs/rq_dashboard-0.3.3-py2.7.egg',
    '/home/loix-devint/loix.buildout/eggs/times-0.6.2-py2.7.egg',
    '/home/loix-devint/loix.buildout/eggs/simplejson-3.3.1-py2.7-linux-x86_64.egg',
    '/home/loix-devint/loix.buildout/eggs/redis-2.8.0-py2.7.egg',
    '/home/loix-devint/loix.buildout/eggs/Flask-0.10.1-py2.7.egg',
    '/home/loix-devint/loix.buildout/eggs/rq-0.3.12-py2.7.egg',
    '/home/loix-devint/loix.buildout/eggs/python_dateutil-2.2-py2.7.egg',
    '/home/loix-devint/loix.buildout/eggs/pytz-2013.8-py2.7.egg',
    '/home/loix-devint/loix.buildout/eggs/itsdangerous-0.23-py2.7.egg',
    '/home/loix-devint/loix.buildout/eggs/Jinja2-2.7.1-py2.7.egg',
    '/home/loix-devint/loix.buildout/eggs/Werkzeug-0.9.4-py2.7.egg',
    '/home/loix-devint/loix.buildout/eggs/six-1.4.1-py2.7.egg',
    '/usr/local/lib/python2.7/site-packages/MarkupSafe-0.18-py2.7-linux-x86_64.egg',
]

# Apache + WSGI env vars pushed to os.environ
envvars = [
    'RQ_DASHBOARD_SETTINGS',
]

_application = None
def application(environ, start_response):
    global _application
    for envvar in envvars:
        if envvar in environ:
            os.environ[envvar] = environ[envvar]
    if _application is None:
        from rq_dashboard.app import app as _application
    return _application(environ, start_response)

Any hint would be appreciated.

@Annakan follows this too...

New version release

Would love to get a new official release, specifically for the worker display fix #63 Happy to patch it locally for now, but for production lets get a 3.4 ver out there when possible.

Thanks!

environment variables

def setup_rq_connection():
if current_app.config.get('REDIS_URL'):

I do not know Flash, but I believe it would be better to get REDIS_URL from os.getenv instead of Flash current_app.

With this, we can integrate RQ-Dashboard inside other frameworks easily.

Upgrade rq

The dashboard is currently pinned to rq >=0.3.8, I think pinning to at least rq >=0.4.0 would be wise, due to bugfixes that rq-dashboard does not benefit from.

make rq dashboard multi-tenant?

is it possible to integrate rq dashboard to a flask app that has login and register user function? so a user would login and see their own set of jobs in the rq dashboard? a login would be required to access the rq dashboard.

Display finished and pending jobs

It would be useful to be able to show jobs that have finished and jobs that depend on other jobs to finish before they can be queued. The jobs in different groups (queued, succeeded, failed, waiting-to-be-queued) should probably be shown separately.

db variable

What is the 'db' variable?

Is your type (int) correct?

parser.add_option('-D', '--redis-database', dest='redis_database', type='int',
                  metavar='DB',
                  help='database of Redis server')

Internal Server Error?

Failed to start:

"The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."

Cant run rq-dashboard - DistributionNotFound times message

Trying to run rq-dashboard.... after successful installation... but errors out... Any idea?

$ rq-dashboard
Traceback (most recent call last):
File "/usr/local/bin/rq-dashboard", line 5, in
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in
working_set.require(requires)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: times

Integration with rq-scheduler?

Hello,

Do you know if there is any work on integrating rq-dashboard with rq-scheduler? Would you accept a PR?

For instance, if a conditional import for rq_scheduler works, then a new section would be added to the web interface containing details on scheduled jobs. It would be optional.

It may also be possible to take the blueprint from this package and use it in a new flask app that contains the rq-scheduler functionality (as a separate package or something, if you don't want rq-scheduler code to live in this project).

Anyway, just wanted to see what other folks thought, since it'd be nice to see both in one web interface.

Support multiple Redis connections at the same time

This is kind of a thought experiment, really. I'm not sure whether this would really be useful, even. But if there is a good use case for this, it should be interesting to add this. The UI could present a drop down list to select which Redis connection to show the RQ details for.

raise RuntimeError('working outside of application context')

This appears to be a Flash issue. The redis instance is in another domain. This is my suspect. Or maybe is something in my configuration. Any ideas? Thanks in advance

  File "<stdin>", line 1, in <module>
  File "/app/.heroku/python/lib/python2.7/site-packages/werkzeug/local.py", line 336, in __getattr__
    return getattr(self._get_current_object(), name)
  File "/app/.heroku/python/lib/python2.7/site-packages/werkzeug/local.py", line 295, in _get_current_object
    return self.__local()
  File "/app/.heroku/python/lib/python2.7/site-packages/flask/globals.py", line 26, in _find_app
    raise RuntimeError('working outside of application context')

500 Error when accessing /rq route.

Does it support redis connections via unix sockets? That's the only reason I can come up with for this error?

ERROR
/usr/local/lib/python2.7/dist-packages/flask/app.py: 1423
app
log_exception
2014-07-28 07:24:37,202
Msg: Exception on /rq/ [GET]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python2.7/dist-packages/rq_dashboard/dashboard.py", line 100, in overview
failed = Queue('failed')
File "/usr/local/lib/python2.7/dist-packages/rq/queue.py", line 59, in __init__
self.connection = resolve_connection(connection)
File "/usr/local/lib/python2.7/dist-packages/rq/connections.py", line 70, in resolve_connection
raise NoRedisConnectionException('Could not resolve a Redis connection.')
NoRedisConnectionException: Could not resolve a Redis connection.

Unable to see data on dashboard

I have made a default setup as told by you on my site. But I dont see the data on the dashboard.

I can access the redis using the default connection parameters , but I cant see data on dashboard.

How can I debug or check the error?

Rewrite the queue data model

The current model of serialising jobs and putting them on queues directly poses some limitations on the advanced stuff we want to build into RQ. Mainly:

  • jobs aren't addressable individually anymore (which is just as bad as the Celery behaviour)
  • due to the above, messages can't be pulled off from queues, and can't be easily requeued (at least not in random order)
  • tracking jobs isn't possible easily

We can make a simple change to the persistence model for jobs, namely by only storing the job ID, and putting all of the job data inside separate Redis keys (one key per job), containing the serialised (pickled) properties as values.

This solves the following problems:

  • this fundamentally makes jobs addressable directly (i.e. their properties can be grabbed directly if you know their job ID)
  • jobs can be taken off from queues ("unqueued") by simply removing their job key (workers could be changed to ignore any job ID on a queue if there exists no corresponding job key)
  • job status information can eventually be added directly inside the job key (whatever implementation is suitable here)
  • requeueing jobs is now extremely easy, as it will be equivalent to pushing the job ID onto any queue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.