-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pipeline dependencies version update
- Loading branch information
1 parent
a442fad
commit 996c5cb
Showing
20 changed files
with
470 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
runtime/bamboo-pipeline/pipeline/contrib/celery_tools/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community | ||
Edition) available. | ||
Copyright (C) 2017 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. | ||
""" |
48 changes: 48 additions & 0 deletions
48
runtime/bamboo-pipeline/pipeline/contrib/celery_tools/periodic.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community | ||
Edition) available. | ||
Copyright (C) 2017 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 celery import Task, current_app | ||
from celery.schedules import maybe_schedule | ||
|
||
|
||
class PipelinePeriodicTask(Task): | ||
"""A task that adds itself to the :setting:`beat_schedule` setting.""" | ||
|
||
abstract = True | ||
ignore_result = True | ||
relative = False | ||
options = None | ||
compat = True | ||
|
||
def __init__(self): | ||
if not hasattr(self, 'run_every'): | ||
raise NotImplementedError( | ||
'Periodic tasks must have a run_every attribute') | ||
self.run_every = maybe_schedule(self.run_every, self.relative) | ||
super(PipelinePeriodicTask, self).__init__() | ||
|
||
@classmethod | ||
def on_bound(cls, app): | ||
app.conf.beat_schedule[cls.name] = { | ||
'task': cls.name, | ||
'schedule': cls.run_every, | ||
'args': (), | ||
'kwargs': {}, | ||
'options': cls.options or {}, | ||
'relative': cls.relative, | ||
} | ||
|
||
|
||
def periodic_task(*args, **options): | ||
"""Deprecated decorator, please use :setting:`beat_schedule`.""" | ||
return current_app.task(**dict({'base': PipelinePeriodicTask}, **options)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.