diff --git a/Procfile b/Procfile index 751ea52fb2..19e4cb1840 100644 --- a/Procfile +++ b/Procfile @@ -1,4 +1,5 @@ web: gunicorn wsgi -w 8 -b :$PORT --access-logfile - --error-logfile - --access-logformat '[%(h)s] %({request_id}i)s %(u)s %(t)s "%(r)s" %(s)s %(D)s %(b)s "%(f)s" "%(a)s"' +dworker: python manage.py celery worker -Q default -n default@%h -c 6 -l info --maxtasksperchild=50 pworker: python manage.py celery worker -Q pipeline -n pipeline_worker@%h -c 6 -l info --maxtasksperchild=50 sworker: celery worker -A blueapps.core.celery -P gevent -Q service_schedule -c 6 -l info -n schedule_worker@%h --maxtasksperchild=50 cworker: python manage.py celery worker -Q pipeline_additional_task -n common_worker@%h -c 6 -l info --maxtasksperchild=50 diff --git a/pipeline/celery/settings.py b/pipeline/celery/settings.py index 8c7129a5fd..855449eb5f 100644 --- a/pipeline/celery/settings.py +++ b/pipeline/celery/settings.py @@ -46,11 +46,12 @@ } CELERY_QUEUES = ( + Queue('default', default_exchange, routing_key='default'), Queue('pipeline', default_exchange, routing_key='pipeline_push'), Queue('service_schedule', default_exchange, routing_key='schedule_service'), Queue('pipeline_additional_task', default_exchange, routing_key='additional_task') ) -CELERY_DEFAULT_QUEUE = 'pipeline_additional_task' +CELERY_DEFAULT_QUEUE = 'default' CELERY_DEFAULT_EXCHANGE = 'default' CELERY_DEFAULT_ROUTING_KEY = 'default' diff --git a/pipeline/engine/celery/__init__.py b/pipeline/engine/celery/__init__.py deleted file mode 100644 index 90524bb0e7..0000000000 --- a/pipeline/engine/celery/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community -Edition) available. -Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://opensource.org/licenses/MIT -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on -an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. -""" diff --git a/pipeline/engine/celery/settings.py b/pipeline/engine/celery/settings.py deleted file mode 100644 index 3ec9ee5c55..0000000000 --- a/pipeline/engine/celery/settings.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community -Edition) available. -Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. -You may obtain a copy of the License at -http://opensource.org/licenses/MIT -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on -an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. -""" - -from kombu import Exchange, Queue - -default_exchange = Exchange('default', type='direct') - -PIPELINE_ROUTING = { - 'queue': 'pipeline', - 'routing_key': 'pipeline_push' -} - -CELERY_ROUTES = { - # schedule - 'pipeline.engine.tasks.service_schedule': { - 'queue': 'service_schedule', - 'routing_key': 'schedule_service' - }, - # pipeline - 'pipeline.engine.tasks.batch_wake_up': PIPELINE_ROUTING, - 'pipeline.engine.tasks.dispatch': PIPELINE_ROUTING, - 'pipeline.engine.tasks.process_wake_up': PIPELINE_ROUTING, - 'pipeline.engine.tasks.start': PIPELINE_ROUTING, - 'pipeline.engine.tasks.wake_from_schedule': PIPELINE_ROUTING, - 'pipeline.engine.tasks.wake_up': PIPELINE_ROUTING -} - -CELERY_QUEUES = ( - Queue('pipeline', default_exchange, routing_key='pipeline_push'), - Queue('service_schedule', default_exchange, routing_key='schedule_service'), -) - -CELERY_DEFAULT_QUEUE = 'default' -CELERY_DEFAULT_EXCHANGE = 'default' -CELERY_DEFAULT_ROUTING_KEY = 'default'