Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuke Celery #4521

Merged
merged 38 commits into from
Jan 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ed925d5
enforce hard limits on non-responsive work horses by workers
Nov 13, 2019
859fe2a
move differences from Worker to helper methods to help make the speci…
Nov 13, 2019
d120100
move HardLimitingWorker to redash/tasks
Nov 14, 2019
86b9075
Merge branch 'master' into hard-time-limit
Nov 14, 2019
1fa6abf
move schedule.py to /tasks
Nov 16, 2019
1251b9b
explain the motivation for HardLimitingWorker
Nov 16, 2019
4ae624b
pleasing CodeClimate
Nov 17, 2019
9cfd453
pleasing CodeClimate
Nov 17, 2019
9c855cb
port query execution to RQ
Nov 18, 2019
0c8f0b4
get rid of argsrepr
Nov 18, 2019
768f0f6
avoid star imports
Nov 26, 2019
916557d
Merge branch 'master' into execute-query-in-rq
Nov 28, 2019
5983541
Merge branch 'hard-time-limit' into execute-query-in-rq
Nov 28, 2019
edd656f
allow queries to be cancelled in RQ
Nov 28, 2019
1d8af9c
return QueryExecutionErrors as job results
Nov 28, 2019
a96ee82
fix TestTaskEnqueue and QueryExecutorTests
Dec 2, 2019
37a74ea
remove Celery monitoring
Dec 4, 2019
faf5166
get rid of QueryTask and use RQ jobs directly (with a job serializer)
Dec 4, 2019
66f3db9
Revert "remove Celery monitoring"
Dec 4, 2019
045cb96
reduce occurences of the word 'task'
Dec 4, 2019
d486cbb
use Worker, Queue and Job instead of spreading names that share behav…
Dec 4, 2019
8b1a471
remove locks for failed jobs as well
Dec 5, 2019
75bbbf8
did I not commit that colon? oh my
Dec 5, 2019
0637080
push the redis connection to RQ's stack on every request to avoid ver…
Dec 5, 2019
f086b81
use a connection context for tests
Dec 9, 2019
c0b7440
remove Celery monitoring
Dec 4, 2019
35d91a5
👋 Celery
Dec 11, 2019
c1def01
remove Celery from Cypress
Dec 26, 2019
9a9b702
black it up
Dec 30, 2019
89bc35c
Merge branch 'master' into nuke-celery
Jan 5, 2020
4550dc2
some more black
Jan 5, 2020
cc7fc2f
return all started/queued job ids (for future monitoring
Jan 5, 2020
d9f0e83
Restyled by prettier (#4522)
restyled-io[bot] Jan 5, 2020
0d02477
remove celery.py
Jan 7, 2020
e78aa52
remove some frontend residuals that reappeared after a merge
Jan 7, 2020
55233c2
Merge branch 'master' into nuke-celery
Jan 7, 2020
f8f3e83
Merge branch 'nuke-celery' of github.com:getredash/redash into nuke-c…
Jan 7, 2020
785dbde
Merge branch 'master' into nuke-celery
Jan 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .circleci/docker-compose.cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,12 @@ services:
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
celery_worker:
build: ../
command: celery_worker
depends_on:
- server
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
QUEUES: "queries,scheduled_queries"
WORKERS_COUNT: 2
cypress:
build:
context: ../
dockerfile: .circleci/Dockerfile.cypress
depends_on:
- server
- celery_worker
- worker
- scheduler
environment:
Expand Down
37 changes: 0 additions & 37 deletions bin/docker-entrypoint
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#!/bin/bash
set -e

celery_worker() {
WORKERS_COUNT=${WORKERS_COUNT:-2}
QUEUES=${QUEUES:-queries,scheduled_queries}
WORKER_EXTRA_OPTIONS=${WORKER_EXTRA_OPTIONS:-}

echo "Starting $WORKERS_COUNT workers for queues: $QUEUES..."
exec /usr/local/bin/celery worker --app=redash.worker -c$WORKERS_COUNT -Q$QUEUES -linfo --max-tasks-per-child=10 -Ofair $WORKER_EXTRA_OPTIONS
}

scheduler() {
echo "Starting RQ scheduler..."

Expand Down Expand Up @@ -37,15 +28,6 @@ dev_worker() {
exec watchmedo auto-restart --directory=./redash/ --pattern=*.py --recursive -- ./manage.py rq worker $QUEUES
}

dev_celery_worker() {
WORKERS_COUNT=${WORKERS_COUNT:-2}
QUEUES=${QUEUES:-queries,scheduled_queries}

echo "Starting $WORKERS_COUNT workers for queues: $QUEUES..."

exec watchmedo auto-restart --directory=./redash/ --pattern=*.py --recursive -- /usr/local/bin/celery worker --app=redash.worker -c$WORKERS_COUNT -Q$QUEUES -linfo --max-tasks-per-child=10 -Ofair
}

server() {
# Recycle gunicorn workers every n-th request. See http://docs.gunicorn.org/en/stable/settings.html#max-requests for more details.
MAX_REQUESTS=${MAX_REQUESTS:-1000}
Expand All @@ -57,10 +39,6 @@ create_db() {
exec /app/manage.py database create_tables
}

celery_healthcheck() {
exec /usr/local/bin/celery inspect ping --app=redash.worker -d celery@$HOSTNAME
}

rq_healthcheck() {
exec /app/manage.py rq healthcheck
}
Expand All @@ -72,13 +50,10 @@ help() {
echo ""

echo "server -- start Redash server (with gunicorn)"
echo "celery_worker -- start Celery worker"
echo "dev_celery_worker -- start Celery worker process which picks up code changes and reloads"
echo "worker -- start a single RQ worker"
echo "dev_worker -- start a single RQ worker with code reloading"
echo "scheduler -- start an rq-scheduler instance"
echo "dev_scheduler -- start an rq-scheduler instance with code reloading"
echo "celery_healthcheck -- runs a Celery healthcheck. Useful for Docker's HEALTHCHECK mechanism."
echo "rq_healthcheck -- runs a RQ healthcheck that verifies that all local workers are active. Useful for Docker's HEALTHCHECK mechanism."
echo ""
echo "shell -- open shell"
Expand Down Expand Up @@ -117,14 +92,6 @@ case "$1" in
shift
dev_scheduler
;;
celery_worker)
shift
celery_worker
;;
dev_celery_worker)
shift
dev_celery_worker
;;
dev_worker)
shift
dev_worker
Expand All @@ -133,10 +100,6 @@ case "$1" in
shift
rq_healthcheck
;;
celery_healthcheck)
shift
celery_healthcheck
;;
dev_server)
export FLASK_DEBUG=1
exec /app/manage.py runserver --debugger --reload -h 0.0.0.0
Expand Down
89 changes: 0 additions & 89 deletions client/app/components/admin/CeleryStatus.jsx

This file was deleted.

3 changes: 0 additions & 3 deletions client/app/components/admin/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ export default function Layout({ activeTab, children }) {
<Tabs.TabPane key="system_status" tab={<a href="admin/status">System Status</a>}>
{activeTab === "system_status" ? children : null}
</Tabs.TabPane>
<Tabs.TabPane key="tasks" tab={<a href="admin/queries/tasks">Celery Status</a>}>
{activeTab === "tasks" ? children : null}
</Tabs.TabPane>
<Tabs.TabPane key="jobs" tab={<a href="admin/queries/jobs">RQ Status</a>}>
{activeTab === "jobs" ? children : null}
</Tabs.TabPane>
Expand Down
25 changes: 25 additions & 0 deletions client/app/components/admin/RQStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,34 @@ import React from "react";
import PropTypes from "prop-types";

import Badge from "antd/lib/badge";
import Card from "antd/lib/card";
import Spin from "antd/lib/spin";
import Table from "antd/lib/table";
import { Columns } from "@/components/items-list/components/ItemsTable";

// CounterCard

export function CounterCard({ title, value, loading }) {
return (
<Spin spinning={loading}>
<Card>
{title}
<div className="f-20">{value}</div>
</Card>
</Spin>
);
}

CounterCard.propTypes = {
title: PropTypes.string.isRequired,
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
loading: PropTypes.bool.isRequired,
};

CounterCard.defaultProps = {
value: "",
};

// Tables

const otherJobsColumns = [
Expand Down
3 changes: 1 addition & 2 deletions client/app/pages/admin/Jobs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import Alert from "antd/lib/alert";
import Tabs from "antd/lib/tabs";
import * as Grid from "antd/lib/grid";
import Layout from "@/components/admin/Layout";
import { CounterCard } from "@/components/admin/CeleryStatus";
import { WorkersTable, QueuesTable, OtherJobsTable } from "@/components/admin/RQStatus";
import { CounterCard, WorkersTable, QueuesTable, OtherJobsTable } from "@/components/admin/RQStatus";

import { $http, $location, $rootScope } from "@/services/ng";
import recordEvent from "@/services/recordEvent";
Expand Down
136 changes: 0 additions & 136 deletions client/app/pages/admin/Tasks.jsx

This file was deleted.

Loading