Giter VIP home page Giter VIP logo

bull-master's Introduction

bull master NPM Version NPM Downloads PRs Welcome code style: prettier build

Screen Shot bull-master

Bull Dashboard is a UI built on top of Bull to help you visualize your queues and their jobs. With this library you get a beautiful UI for visualizing what's happening with each job in your queues, their status and some actions that will enable you to get the jobs done.

Notes

As this library provides only the visualization for your queues, keep in mind that:

  • You must have Bull installed in your projects;
  • Aside the options to retry and clean jobs, this library is not responsible for processing the jobs, reporting progress or any other thing. This must be done in your application with your own logic;
  • If you want to understand the possibilities you have with the queues please refer to Bull's docs;
  • This library doesn't hijack Bull's way of working.

If you want to learn more about queues and Redis: https://redis.io/.

Starting

To add it to your project start by adding the library to your dependencies list:

yarn add bull-master

Or

npm i bull-master

Hello World

The first step is to let bull-board know the queues you have already set up, to do so we use the queues option.

// for express
const express = require('express')
const Queue = require('bull')
const bullMaster = require('bull-master')
const app = express()

const someQueue = new Queue()
const someOtherQueue = new Queue()

const bullMasterApp = bullMaster({
  queues: [someQueue, someOtherQueue],
})
// you can get existing queues
bullMasterApp.getQueues()
// you could also choose to change the queues to display in run time
bullMasterApp.setQueues([someQueue])

app.use('/admin/queues', bullMasterApp)

// for koa
const Koa = require('koa')
const Router = require('@koa/router')
const Queue = require('bull')
const bullMaster = require('bull-master')
const app = new Koa()

const someQueue = new Queue()
const someOtherQueue = new Queue()

router.all('/admin/queues*', bullMaster.koa({
  queues: [someQueue, someOtherQueue],
  prefix: '/admin/queues',
}))

app
  .use(router.routes())
  .use(router.allowedMethods())
// other configurations for your server

That's it! Now you can access the /admin/queues route and you will be able to monitor everything that is happening in your queues 😁

Contributing

First of all, thank you for being interested in helping out, your time is always appreciated in every way. 💯

Remember to read the Code of Conduct so you also help maintaining a good Open source community around this project!

Here's some tips:

  • Check the issues page for already opened issues (or maybe even closed ones) that might already address your question/bug/feature request.
  • When opening a bug report provide as much information as you can, some things might be useful for helping debugging and understading the problem
    • Node, Redis, Bull, bull-board versions
    • Sample code that reproduces the problem
    • Some of your environment details
    • Framework you're using (Express, Koa, Hapi, etc).
  • Feature requests are welcomed! Provide some details on why it would be helpful for you and others, explain how you're using bull-board and if possible even some screenshots if you are willing to mock something!

Developing

If you want to help us solving the issues, be it a bug, a feature or a question, you might need to fork and clone this project.

To fork a project means you're going to have your own version of it under your own GitHub profile, you do it by clicking the "Fork" button on the top of any project's page on GitHub.

Cloning a project means downloading it to your local machine, you do it in the command line:

git clone [email protected]:YOUR_GITHUB_USERNAME/bull-master.git

That will create a bull-master folder inside the directory you executed the command, so you need to navigate inside it:

cd bull-master

This project requires that you have yarn installed

Also make sure you are running Redis for this project (bull-master's example connects to Redis' default port 6379).

Now, to try it out locally you can run:

yarn --pure-lockfile 
yarn dev:client 
yarn dev:server

Acknowledgements ❤️

  • Juan for building the first version of this library
  • Vitor this project is basically a radical rewrite from Vitor's bull-board project

License

This project is licensed under the MIT License, so it means it's completely free to use and copy, but if you do fork this project with nice additions that we could have here, remember to send a PR 👍

bull-master's People

Contributors

dependabot[bot] avatar hans-lizihan avatar renovate-bot avatar renovate[bot] 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

bull-master's Issues

Provide a way to sort jobs lists

Providing a way to sort the jobs lists by certain attributes, specifically for us delay time (being able to see which one will run next) would be very nice. Maybe something along the lines of clicking on the column name to sort asc / desc?

Secondly, along these same lines. I deal with some queues that have thousands of jobs. Would it be possible to add a page number selector instead of just incrementing through them?

Thanks for this UI tool, its great!

Follow the Step-by-Step Guide to Claim Your Tokens! 📌

Introduction:

Welcome to the exciting world of crypto airdrops! Here's a curated list of active airdrops that you wouldn't want to miss. Dive in and explore the opportunities:

📌 Follow the Step-by-Step Guide to Claim Your Tokens!

  1. Share on Social Media:

    🚀 Claim Your Share: Pyth Network Airdrop 🚀 Unlock the potential of $PYTH tokens in this step-by-step guide. Claim yours now! Share on Twitter

    — Pyth Network (@pythnetwork) November 28, 2023
  2. Verify Eligibility:
    After sharing and connecting your walle

Active Airdrops:

  1. Layer Zero Airdrop

    Layer Zero Banner
  2. Pyth Network Airdrop

    Pyth Network Banner
  3. Mantle Network Airdrop

    Mantle Network Banner

Low version Redis will cause the dashboard crash

Below is the response of api /api/redis-stats

  • Redis version lower then 5.0
{
  "redisVersion": "3.0.6",
  "usedMemory": "66331368",
  "memFragmentationRatio": "1.03",
  "connectedClients": "660",
  "blockedClients": "2"
}
  • Redis version upper then 5.0
{
  "redisVersion": "5.0.5",
  "usedMemory": "1406312",
  "memFragmentationRatio": "2.89",
  "connectedClients": "7",
  "blockedClients": "2",
  "totalSystemMemory": "2087837696"
}

the lost property totalSystemMemory will trigger the dashboard crash,

image

bull 3 require redis version > 2.8.18,

so this amazing UI could compatible with lower versions?

many thanks!

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Blank Dashboard

Problem: I get a blank dashboard with just a header and footer at /admin/queues

Relevant Code Snippets:
queues.ts

import Queue from 'bull';
import bullMaster from "bull-master";

const dataQueue = new Queue<IMetadataJobData>('metadata-queue', queueOptions);
const upgradeQueue = new Queue<IUpgradeJobData>('upgrade-queue', queueOptions);

const bullMasterApp = bullMaster({
    queues: [dataQueue, upgradeQueue]
});

export default {
    dataQueue,
    upgradeQueue,
    bullMasterApp
}

index.ts

app.use('/admin/queues', queues.bullMasterApp)

Screenshot:
image

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • ⬆️ Update babel monorepo to v7.24.5 (@babel/core, @babel/eslint-parser)
  • ⬆️ Update dependency bull to v4.12.7
  • ⬆️ Update dependency webpack-bundle-analyzer to v4.10.2
  • ⬆️ Update react monorepo (eslint-plugin-react-hooks, react, react-dom)
  • ⬆️ Update redis Docker tag to v7.2.5
  • ⬆️ Update dependency css-loader to v6.11.0
  • ⬆️ Update actions/setup-node action to v4
  • ⬆️ Update dependency axios to v1
  • ⬆️ Update dependency babel-loader to v9
  • ⬆️ Update dependency bullmq to v5
  • ⬆️ Update dependency clsx to v2
  • ⬆️ Update dependency css-loader to v7
  • ⬆️ Update dependency date-fns to v3
  • ⬆️ Update dependency eslint to v9
  • ⬆️ Update dependency eslint-config-prettier to v9
  • ⬆️ Update dependency eslint-plugin-prettier to v5
  • ⬆️ Update dependency husky to v9
  • ⬆️ Update dependency lint-staged to v15
  • ⬆️ Update dependency nodemon to v3
  • ⬆️ Update dependency prettier to v3
  • ⬆️ Update dependency prettier-eslint to v16
  • ⬆️ Update dependency style-loader to v4
  • ⬆️ Update dependency supertest to v7
  • ⬆️ Update dependency webpack-cli to v5
  • ⬆️ Update dependency webpack-dev-server to v5
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
  • redis 7.2.4-alpine
dockerfile
Dockerfile
github-actions
.github/workflows/nodejs.yml
  • actions/checkout v3
  • actions/setup-node v3
  • actions/checkout v3
  • actions/setup-node v3
  • actions/checkout v3
  • actions/setup-node v3
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • body-parser ^1.19.1
  • express 4.19.2
  • redis-info ^3.1.0
  • @babel/core 7.24.3
  • @babel/eslint-parser 7.24.1
  • @babel/plugin-proposal-optional-chaining 7.21.0
  • @commitlint/cli 16.3.0
  • @commitlint/core 16.3.0
  • @hot-loader/react-dom 17.0.2
  • @material-ui/core 4.12.4
  • @material-ui/icons 4.11.3
  • axios 0.28.1
  • babel-loader 8.3.0
  • babel-preset-react-app 10.0.1
  • clsx 1.2.1
  • commitlint-config-gitmoji 2.2.6
  • css-loader 6.10.0
  • date-fns 2.30.0
  • enzyme 3.11.0
  • enzyme-to-json 3.6.2
  • eslint 8.57.0
  • eslint-config-airbnb 19.0.4
  • eslint-config-prettier 8.10.0
  • eslint-plugin-import 2.29.1
  • eslint-plugin-jsx-a11y 6.8.0
  • eslint-plugin-prettier 4.2.1
  • eslint-plugin-react 7.31.10
  • eslint-plugin-react-hooks 4.6.0
  • husky 7.0.4
  • jest 28.1.3
  • lint-staged 12.5.0
  • nodemon 2.0.22
  • prettier 2.8.8
  • prettier-eslint 13.0.0
  • pretty-bytes 5.6.0
  • prop-types 15.8.1
  • react 18.2.0
  • react-dom 18.2.0
  • react-hot-loader 4.13.1
  • react-request-hook 2.1.1
  • react-router 6.3.0
  • react-router-dom 6.3.0
  • recharts 2.1.15
  • style-loader 3.3.4
  • supertest 6.3.4
  • webpack 5.91.0
  • webpack-bundle-analyzer 4.10.1
  • webpack-cli 4.10.0
  • webpack-dev-server 4.15.2
  • bull ^4.2.0
  • bullmq ^1.64.0

  • Check this box to trigger a request for Renovate to run again on this repository

Ability to add jobs

First of all, congrats on the neat project 🚀 I was using bull-board but decided to take a look at yours since it has some nice features :)

One thing I was really looking forward was the ability to add jobs to a given queue (something really simple like a input for the json-payload would suffice).

Are you planning on adding something like that? If it is not something on your roadmap would you be interested in a PR?

Add option to filter jobs/queues by state

In the main view, you can see the beautiful state graphs, and below the list of all queues.
It would be great to click on a state on a graph, failed for example, and it would filter the list of all queues to only the ones with at least one failed job.

It should be possible by iterating all of the queues, and search for at least one failed using the getJobs('failed') bull method.

Cannot read property 'getJob' of undefined

Congrats on a great looking package! I am running into an error when I navigate in to see the detail of a queue. Any assistance would be appreciated. I'm pretty new to the node world and not quite sure where to dig into.

TypeError: Cannot read property 'getJob' of undefined
    at module.exports (/Users/kwolf/code/granville-listener-clustered/node_modules/bull-master/server/controllers/job.js:7:27)
    at /Users/kwolf/code/granville-listener-clustered/node_modules/bull-master/server/index.js:20:19
    at Layer.handle [as handle_request] (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/layer.js:95:5)
    at /Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:281:22
    at param (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:354:14)
    at param (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:365:14)
    at param (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:365:14)
TypeError: Cannot read property 'getJob' of undefined
    at module.exports (/Users/kwolf/code/granville-listener-clustered/node_modules/bull-master/server/controllers/job.js:7:27)
    at /Users/kwolf/code/granville-listener-clustered/node_modules/bull-master/server/index.js:20:19
    at Layer.handle [as handle_request] (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/layer.js:95:5)
    at /Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:281:22
    at param (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:354:14)
    at param (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:365:14)
    at param (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:365:14)
TypeError: Cannot read property 'getJob' of undefined
    at module.exports (/Users/kwolf/code/granville-listener-clustered/node_modules/bull-master/server/controllers/job.js:7:27)
    at /Users/kwolf/code/granville-listener-clustered/node_modules/bull-master/server/index.js:20:19
    at Layer.handle [as handle_request] (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/layer.js:95:5)
    at /Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:281:22
    at param (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:354:14)
    at param (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:365:14)
    at param (/Users/kwolf/code/granville-listener-clustered/node_modules/express/lib/router/index.js:365:14)

Not an issue: Just a huge THANKS!

I needed to have separate UIs for separate workflows that may share some queues underneath. At least now I can have separate Pages for separate workflows. Great work on the crisp UI here.
It would be really cool enhancement, if we could choose based on job name.

bull-master breaks with strict Content Security Policy headers

Using CSP headers which disallow unsafe inline scripts breaks bull master. From a quick look it looks like it is mainly due to how basePath is passed to the client.

The generated HTML ends up with:

<script>
      window.basePath = '.....'
</script>

Which breaks CSP (using helmet can be used to expose this). One alternative would be to provide a way to pass the per-request nonce to bull-master (or pick it up from res.locals if set there). Or just completely avoid this mechanism for passing the basePath to the client.

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.