mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-07-31 10:58:21 -07:00
dev-python/celery: Clean old versions up
This commit is contained in:
@@ -1,6 +1,2 @@
|
||||
DIST celery-3.1.17.tar.gz 1297008 SHA256 cfe2b653268bd586e2d08a75e886f7be3be55ba372f72e2f5747aeb76c470362 SHA512 f45f92161c134f528719768ad863df6b49fa69e022b47ea801e590de8579c24c6a5ec9dd88f712e180ed7d23f4510cecf4f17a959c3338d4bad79f8d7d202453 WHIRLPOOL c0f4ddab40eab2afe579c88bc9e47d46a650a73212abb7cb1d343d7ba72c1d96913c1c04a6e9920789bd6f9bf6907c09e6326aa08e6ba3cf68545e44432b95de
|
||||
DIST celery-3.1.18.tar.gz 1298756 SHA256 0924f94070c6fc57d408b169848c5b38832668fffe060e48b4803fb23e0e3eaf SHA512 219291a64c72a0c95a2b184903e491d5b6b1396b4b519d54503bb059af305c2f118865b71510d5685b8f5946135596c9d80d6ca10162a938ed90baaf4c3c48c3 WHIRLPOOL 0d27eda95fea5b6235afd7d5f90de249eec6d7c58a7563afb0cc73d29b84cb6903eced4b9515fe574206111fc4a304c5f24d3c476b4315416b441f324f2ebfa5
|
||||
DIST celery-3.1.19.tar.gz 1302241 SHA256 bd6a21290c822ecf78947a7dbc8b2270d88a5fa08a7a2bfcd908bb3d5ed66b71 SHA512 47aef118fb4178a4874608a8e9370d6f81d5594aba6d25e679a78bd530b57f0566a27db4fdb50786a237b1747dfc2b662462f107230d0653da28ac1d4b64b703 WHIRLPOOL 37076e3d414cdd74e4b2d2145189a11380da58f77fe1acd44d190f8de1744b909512d895c00ec2c0252c23d9300b7b011f06b388a45526d9573fa00bc71986d7
|
||||
DIST celery-3.1.20.tar.gz 1308238 SHA256 d02f191c3d92a851c9d2028e91baf2a0f2734cd3b659743d3624011d1ef7a6d5 SHA512 70fda5336e36bd8a15ac8a7488dd1b86a73256a0290c76c8c04a199b044922fb284129f51d0d1bcea6a0a3503081c89851632e4d44f68625181a61dce373f7db WHIRLPOOL a8f07e8189a14dd7ad9556c4946bf0cc48443ad7145d5a5714a6a726bbcb6af8e1dddf45d9bf2f4ccdc5b50addfff735c7c51a271b95593243fa502824804bbd
|
||||
DIST celery-3.1.24.tar.gz 1330180 SHA256 99b8085ff3013c8cebb9211857fadf5f402882ccada863d67c4d74db60be027a SHA512 6f2e1c5fe417183bc44f39deee669957800b805790475bea1c93d9efb37e0bb6db5aed9606ff79350f404c145908e3af6fa5ce94d86fb70238f2c2f2425ddd3c WHIRLPOOL cc16895b3641a78cfe6de4f5012520ec78a5c5e831e39b1d2a75897a12cb9ec18ea3366f682650d86620d10b27898bbefa7f2b8ed81a7649a97f40b1ab7fb57c
|
||||
DIST celery-4.0.2.tar.gz 1337804 SHA256 e3d5a6c56a73ff8f2ddd4d06dc37f4c2afe4bb4da7928b884d0725ea865ef54d SHA512 1110b634cafa13f9d9ab0b0a7a17042325271bd5ea45a5f442e36e871db87b87e3f496d54b771d274a1676900d9dfdc7e21887943dfd1a299a9fcd8b3f6d2189 WHIRLPOOL 050a041d32a4fb2a9b9658b2e70972cd5606fb13f848fdb7848faeb0116be7d1e061ed8e1d631be46b2740a4307d474396fe1599daea2c20ac58111fb6c99d55
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
# Copyright 1999-2016 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=5
|
||||
|
||||
PYTHON_COMPAT=( python{2_7,3_4} )
|
||||
|
||||
inherit distutils-r1 bash-completion-r1
|
||||
|
||||
DESCRIPTION="Asynchronous task queue/job queue based on distributed message passing"
|
||||
HOMEPAGE="http://celeryproject.org/ https://pypi.python.org/pypi/celery"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 x86"
|
||||
# There are a number of other optional 'extras' which overlap with those of kombu, however
|
||||
# there has been no apparent expression of interest or demand by users for them. See requires.txt
|
||||
IUSE="doc examples redis sqs test yaml zeromq"
|
||||
|
||||
PY27_USEDEP=$(python_gen_usedep python2_7)
|
||||
RDEPEND="<dev-python/kombu-3.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/kombu-3.0.24[${PYTHON_USEDEP}]
|
||||
>=dev-python/anyjson-0.3.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/billiard-3.3.0.19[${PYTHON_USEDEP}]
|
||||
<dev-python/billiard-3.4[${PYTHON_USEDEP}]
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
dev-python/greenlet[${PYTHON_USEDEP}]"
|
||||
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
sqs? ( >=dev-python/boto-2.13.3[${PY27_USEDEP}] )
|
||||
zeromq? ( >=dev-python/pyzmq-13.1.0[${PYTHON_USEDEP}] )
|
||||
yaml? ( >=dev-python/pyyaml-3.10[${PYTHON_USEDEP}] )
|
||||
test? ( ${RDEPEND}
|
||||
dev-python/gevent[${PY27_USEDEP}]
|
||||
>=dev-python/mock-1.0.1[${PY27_USEDEP}]
|
||||
dev-python/pyopenssl[${PYTHON_USEDEP}]
|
||||
dev-python/nose-cover3[${PYTHON_USEDEP}]
|
||||
dev-python/sqlalchemy[${PYTHON_USEDEP}]
|
||||
>=dev-python/pymongo-2.6.2[${PYTHON_USEDEP}]
|
||||
redis? ( dev-python/redis-py[${PYTHON_USEDEP}]
|
||||
>=dev-db/redis-2.8.0 )
|
||||
>=dev-python/python-dateutil-2.1[${PYTHON_USEDEP}] )
|
||||
doc? (
|
||||
dev-python/docutils[${PYTHON_USEDEP}]
|
||||
dev-python/sphinx[${PYTHON_USEDEP}]
|
||||
dev-python/jinja[${PYTHON_USEDEP}]
|
||||
dev-python/sqlalchemy[${PYTHON_USEDEP}] )"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/celery-docs.patch
|
||||
"${FILESDIR}"/${PN}-3.1.11-test.patch )
|
||||
|
||||
# testsuite needs it own source
|
||||
DISTUTILS_IN_SOURCE_BUILD=1
|
||||
|
||||
python_compile_all() {
|
||||
if use doc; then
|
||||
mkdir docs/.build || die
|
||||
emake -C docs html
|
||||
fi
|
||||
}
|
||||
|
||||
python_test() {
|
||||
nosetests || die "Tests failed with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
# Main celeryd init.d and conf.d
|
||||
newinitd "${FILESDIR}/celery.initd-r1" celery
|
||||
newconfd "${FILESDIR}/celery.confd-r1" celery
|
||||
|
||||
use examples && local EXAMPLES=( examples/. )
|
||||
|
||||
use doc && local HTML_DOCS=( docs/.build/html/. )
|
||||
|
||||
newbashcomp extra/bash-completion/celery.bash ${PN}
|
||||
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
# Copyright 1999-2016 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=5
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_4 )
|
||||
|
||||
inherit distutils-r1 bash-completion-r1
|
||||
|
||||
DESCRIPTION="Asynchronous task queue/job queue based on distributed message passing"
|
||||
HOMEPAGE="http://celeryproject.org/ https://pypi.python.org/pypi/celery"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
# There are a number of other optional 'extras' which overlap with those of kombu, however
|
||||
# there has been no apparent expression of interest or demand by users for them. See requires.txt
|
||||
IUSE="doc examples redis sqs test yaml zeromq"
|
||||
|
||||
RDEPEND="
|
||||
<dev-python/kombu-3.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/kombu-3.0.25[${PYTHON_USEDEP}]
|
||||
>=dev-python/anyjson-0.3.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/billiard-3.3.0.20[${PYTHON_USEDEP}]
|
||||
<dev-python/billiard-3.4[${PYTHON_USEDEP}]
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
dev-python/greenlet[${PYTHON_USEDEP}]
|
||||
sqs? ( >=dev-python/boto-2.13.3[${PYTHON_USEDEP}] )
|
||||
zeromq? ( >=dev-python/pyzmq-13.1.0[${PYTHON_USEDEP}] )
|
||||
yaml? ( >=dev-python/pyyaml-3.10[${PYTHON_USEDEP}] )
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
test? ( ${RDEPEND}
|
||||
dev-python/gevent[$(python_gen_usedep python2_7)]
|
||||
>=dev-python/mock-1.0.1[${PYTHON_USEDEP}]
|
||||
dev-python/nose-cover3[${PYTHON_USEDEP}]
|
||||
>=dev-python/pymongo-2.6.2[${PYTHON_USEDEP}]
|
||||
dev-python/pyopenssl[${PYTHON_USEDEP}]
|
||||
>=dev-python/python-dateutil-2.1[${PYTHON_USEDEP}]
|
||||
dev-python/sqlalchemy[${PYTHON_USEDEP}]
|
||||
redis? (
|
||||
dev-python/redis-py[${PYTHON_USEDEP}]
|
||||
>=dev-db/redis-2.8.0
|
||||
)
|
||||
)
|
||||
doc? (
|
||||
dev-python/docutils[${PYTHON_USEDEP}]
|
||||
dev-python/sphinx[${PYTHON_USEDEP}]
|
||||
dev-python/jinja[${PYTHON_USEDEP}]
|
||||
dev-python/sqlalchemy[${PYTHON_USEDEP}]
|
||||
)"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/celery-docs.patch
|
||||
"${FILESDIR}"/${PN}-3.1.11-test.patch
|
||||
)
|
||||
|
||||
# testsuite needs it own source
|
||||
DISTUTILS_IN_SOURCE_BUILD=1
|
||||
|
||||
python_compile_all() {
|
||||
if use doc; then
|
||||
mkdir docs/.build || die
|
||||
emake -C docs html
|
||||
fi
|
||||
}
|
||||
|
||||
python_test() {
|
||||
nosetests || die "Tests failed with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
# Main celeryd init.d and conf.d
|
||||
newinitd "${FILESDIR}/celery.initd-r2" celery
|
||||
newconfd "${FILESDIR}/celery.confd-r2" celery
|
||||
|
||||
use examples && local EXAMPLES=( examples/. )
|
||||
|
||||
use doc && local HTML_DOCS=( docs/.build/html/. )
|
||||
|
||||
newbashcomp extra/bash-completion/celery.bash ${PN}
|
||||
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
# Copyright 1999-2016 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=5
|
||||
|
||||
PYTHON_COMPAT=( python{2_7,3_4} )
|
||||
|
||||
inherit distutils-r1 bash-completion-r1
|
||||
|
||||
DESCRIPTION="Asynchronous task queue/job queue based on distributed message passing"
|
||||
HOMEPAGE="http://celeryproject.org/ https://pypi.python.org/pypi/celery"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
# There are a number of other optional 'extras' which overlap with those of kombu, however
|
||||
# there has been no apparent expression of interest or demand by users for them. See requires.txt
|
||||
IUSE="doc examples redis sqs test yaml zeromq"
|
||||
|
||||
PY27_USEDEP=$(python_gen_usedep python2_7)
|
||||
RDEPEND="<dev-python/kombu-3.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/kombu-3.0.25[${PYTHON_USEDEP}]
|
||||
>=dev-python/anyjson-0.3.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/billiard-3.3.0.20[${PYTHON_USEDEP}]
|
||||
<dev-python/billiard-3.4[${PYTHON_USEDEP}]
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
dev-python/greenlet[${PYTHON_USEDEP}]"
|
||||
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
sqs? ( >=dev-python/boto-2.13.3[${PY27_USEDEP}] )
|
||||
zeromq? ( >=dev-python/pyzmq-13.1.0[${PYTHON_USEDEP}] )
|
||||
yaml? ( >=dev-python/pyyaml-3.10[${PYTHON_USEDEP}] )
|
||||
test? ( ${RDEPEND}
|
||||
dev-python/gevent[${PY27_USEDEP}]
|
||||
>=dev-python/mock-1.0.1[${PY27_USEDEP}]
|
||||
dev-python/pyopenssl[${PYTHON_USEDEP}]
|
||||
dev-python/nose-cover3[${PYTHON_USEDEP}]
|
||||
dev-python/sqlalchemy[${PYTHON_USEDEP}]
|
||||
>=dev-python/pymongo-2.6.2[${PYTHON_USEDEP}]
|
||||
redis? ( dev-python/redis-py[${PYTHON_USEDEP}]
|
||||
>=dev-db/redis-2.8.0 )
|
||||
>=dev-python/python-dateutil-2.1[${PYTHON_USEDEP}] )
|
||||
doc? (
|
||||
dev-python/docutils[${PYTHON_USEDEP}]
|
||||
dev-python/sphinx[${PYTHON_USEDEP}]
|
||||
dev-python/jinja[${PYTHON_USEDEP}]
|
||||
dev-python/sqlalchemy[${PYTHON_USEDEP}] )"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/celery-docs.patch
|
||||
"${FILESDIR}"/${PN}-3.1.11-test.patch )
|
||||
|
||||
# testsuite needs it own source
|
||||
DISTUTILS_IN_SOURCE_BUILD=1
|
||||
|
||||
python_compile_all() {
|
||||
if use doc; then
|
||||
mkdir docs/.build || die
|
||||
emake -C docs html
|
||||
fi
|
||||
}
|
||||
|
||||
python_test() {
|
||||
nosetests || die "Tests failed with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
# Main celeryd init.d and conf.d
|
||||
newinitd "${FILESDIR}/celery.initd-r1" celery
|
||||
newconfd "${FILESDIR}/celery.confd-r1" celery
|
||||
|
||||
use examples && local EXAMPLES=( examples/. )
|
||||
|
||||
use doc && local HTML_DOCS=( docs/.build/html/. )
|
||||
|
||||
newbashcomp extra/bash-completion/celery.bash ${PN}
|
||||
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
# Copyright 1999-2016 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=5
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_4 )
|
||||
|
||||
inherit distutils-r1 bash-completion-r1
|
||||
|
||||
DESCRIPTION="Asynchronous task queue/job queue based on distributed message passing"
|
||||
HOMEPAGE="http://celeryproject.org/ https://pypi.python.org/pypi/celery"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
# There are a number of other optional 'extras' which overlap with those of kombu, however
|
||||
# there has been no apparent expression of interest or demand by users for them. See requires.txt
|
||||
IUSE="doc examples redis sqs test yaml zeromq"
|
||||
|
||||
RDEPEND="
|
||||
<dev-python/kombu-3.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/kombu-3.0.29[${PYTHON_USEDEP}]
|
||||
>=dev-python/anyjson-0.3.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/billiard-3.3.0.21[${PYTHON_USEDEP}]
|
||||
<dev-python/billiard-3.4[${PYTHON_USEDEP}]
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
dev-python/greenlet[${PYTHON_USEDEP}]
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
test? ( ${RDEPEND}
|
||||
dev-python/gevent[$(python_gen_usedep python2_7)]
|
||||
>=dev-python/mock-1.0.1[${PYTHON_USEDEP}]
|
||||
dev-python/nose-cover3[${PYTHON_USEDEP}]
|
||||
>=dev-python/pymongo-2.6.2[${PYTHON_USEDEP}]
|
||||
dev-python/pyopenssl[${PYTHON_USEDEP}]
|
||||
>=dev-python/python-dateutil-2.1[${PYTHON_USEDEP}]
|
||||
dev-python/sqlalchemy[${PYTHON_USEDEP}]
|
||||
dev-python/redis-py[${PYTHON_USEDEP}]
|
||||
>=dev-db/redis-2.8.0
|
||||
>=dev-python/boto-2.13.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/pyzmq-13.1.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/pyyaml-3.10[${PYTHON_USEDEP}]
|
||||
)
|
||||
doc? (
|
||||
dev-python/docutils[${PYTHON_USEDEP}]
|
||||
dev-python/sphinx[${PYTHON_USEDEP}]
|
||||
dev-python/jinja[${PYTHON_USEDEP}]
|
||||
dev-python/sqlalchemy[${PYTHON_USEDEP}]
|
||||
)"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/celery-docs.patch
|
||||
"${FILESDIR}"/${P}-test.patch
|
||||
)
|
||||
|
||||
# testsuite needs it own source
|
||||
DISTUTILS_IN_SOURCE_BUILD=1
|
||||
|
||||
python_compile_all() {
|
||||
if use doc; then
|
||||
mkdir docs/.build || die
|
||||
emake -C docs html
|
||||
fi
|
||||
}
|
||||
|
||||
python_test() {
|
||||
nosetests --verbose || die "Tests failed with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
# Main celeryd init.d and conf.d
|
||||
newinitd "${FILESDIR}/celery.initd-r2" celery
|
||||
newconfd "${FILESDIR}/celery.confd-r2" celery
|
||||
|
||||
use examples && local EXAMPLES=( examples/. )
|
||||
|
||||
use doc && local HTML_DOCS=( docs/.build/html/. )
|
||||
|
||||
newbashcomp extra/bash-completion/celery.bash ${PN}
|
||||
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
optfeature "zookeper support" dev-python/kazoo
|
||||
optfeature "msgpack support" dev-python/msgpack
|
||||
#optfeature "rabbitmq support" dev-python/librabbitmq
|
||||
#optfeature "slmq support" dev-python/softlayer_messaging
|
||||
optfeature "eventlet support" dev-python/eventlet
|
||||
#optfeature "couchbase support" dev-python/couchbase
|
||||
optfeature "redis support" dev-db/redis dev-python/redis-py
|
||||
optfeature "couchdb support" dev-db/couchdb dev-python/couchdb-python
|
||||
optfeature "gevent support" dev-python/gevent
|
||||
optfeature "auth support" dev-python/pyopenssl
|
||||
optfeature "pyro support" dev-python/pyro:4
|
||||
optfeature "yaml support" dev-python/pyyaml
|
||||
optfeature "beanstalk support" dev-python/beanstalkc
|
||||
optfeature "memcache support" dev-python/pylibmc
|
||||
#optfeature "threads support" dev-python/threadpool
|
||||
optfeature "mongodb support" dev-python/pymongo
|
||||
optfeature "zeromq support" dev-python/pyzmq
|
||||
optfeature "sqlalchemy support" dev-python/sqlalchemy
|
||||
optfeature "sqs support" dev-python/boto
|
||||
#optfeature "cassandra support" dev-python/pycassa
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
# Copyright 1999-2016 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=5
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{4,5} )
|
||||
|
||||
inherit distutils-r1 bash-completion-r1
|
||||
|
||||
DESCRIPTION="Asynchronous task queue/job queue based on distributed message passing"
|
||||
HOMEPAGE="http://celeryproject.org/ https://pypi.python.org/pypi/celery"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
# There are a number of other optional 'extras' which overlap with those of kombu, however
|
||||
# there has been no apparent expression of interest or demand by users for them. See requires.txt
|
||||
IUSE="doc examples redis sqs test yaml zeromq"
|
||||
|
||||
RDEPEND="
|
||||
<dev-python/kombu-3.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/kombu-3.0.33[${PYTHON_USEDEP}]
|
||||
>=dev-python/anyjson-0.3.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/billiard-3.3.0.22[${PYTHON_USEDEP}]
|
||||
<dev-python/billiard-3.4[${PYTHON_USEDEP}]
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
dev-python/greenlet[${PYTHON_USEDEP}]
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
test? ( ${RDEPEND}
|
||||
dev-python/gevent[$(python_gen_usedep python2_7)]
|
||||
>=dev-python/mock-1.0.1[${PYTHON_USEDEP}]
|
||||
dev-python/nose-cover3[${PYTHON_USEDEP}]
|
||||
>=dev-python/pymongo-2.6.2[${PYTHON_USEDEP}]
|
||||
dev-python/pyopenssl[${PYTHON_USEDEP}]
|
||||
>=dev-python/python-dateutil-2.1[${PYTHON_USEDEP}]
|
||||
dev-python/sqlalchemy[${PYTHON_USEDEP}]
|
||||
dev-python/redis-py[${PYTHON_USEDEP}]
|
||||
>=dev-db/redis-2.8.0
|
||||
>=dev-python/boto-2.13.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/pyzmq-13.1.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/pyyaml-3.10[${PYTHON_USEDEP}]
|
||||
)
|
||||
doc? (
|
||||
dev-python/docutils[${PYTHON_USEDEP}]
|
||||
dev-python/sphinx[${PYTHON_USEDEP}]
|
||||
dev-python/jinja[${PYTHON_USEDEP}]
|
||||
dev-python/sqlalchemy[${PYTHON_USEDEP}]
|
||||
)"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/celery-docs.patch
|
||||
"${FILESDIR}"/${PN}-3.1.19-test.patch
|
||||
)
|
||||
|
||||
# testsuite needs it own source
|
||||
DISTUTILS_IN_SOURCE_BUILD=1
|
||||
|
||||
python_compile_all() {
|
||||
if use doc; then
|
||||
mkdir docs/.build || die
|
||||
emake -C docs html
|
||||
fi
|
||||
}
|
||||
|
||||
python_test() {
|
||||
nosetests --verbose || die "Tests failed with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
# Main celeryd init.d and conf.d
|
||||
newinitd "${FILESDIR}/celery.initd-r2" celery
|
||||
newconfd "${FILESDIR}/celery.confd-r2" celery
|
||||
|
||||
use examples && local EXAMPLES=( examples/. )
|
||||
|
||||
use doc && local HTML_DOCS=( docs/.build/html/. )
|
||||
|
||||
newbashcomp extra/bash-completion/celery.bash ${PN}
|
||||
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
optfeature "zookeper support" dev-python/kazoo
|
||||
optfeature "msgpack support" dev-python/msgpack
|
||||
#optfeature "rabbitmq support" dev-python/librabbitmq
|
||||
#optfeature "slmq support" dev-python/softlayer_messaging
|
||||
optfeature "eventlet support" dev-python/eventlet
|
||||
#optfeature "couchbase support" dev-python/couchbase
|
||||
optfeature "redis support" dev-db/redis dev-python/redis-py
|
||||
optfeature "couchdb support" dev-db/couchdb dev-python/couchdb-python
|
||||
optfeature "gevent support" dev-python/gevent
|
||||
optfeature "auth support" dev-python/pyopenssl
|
||||
optfeature "pyro support" dev-python/pyro:4
|
||||
optfeature "yaml support" dev-python/pyyaml
|
||||
optfeature "beanstalk support" dev-python/beanstalkc
|
||||
optfeature "memcache support" dev-python/pylibmc
|
||||
#optfeature "threads support" dev-python/threadpool
|
||||
optfeature "mongodb support" dev-python/pymongo
|
||||
optfeature "zeromq support" dev-python/pyzmq
|
||||
optfeature "sqlalchemy support" dev-python/sqlalchemy
|
||||
optfeature "sqs support" dev-python/boto
|
||||
#optfeature "cassandra support" dev-python/pycassa
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
https://github.com/celery/celery/commit/fb48b1f357f7a416d1413d0056158a74191185af.diff
|
||||
diff --git a/celery/tests/backends/test_mongodb.py b/celery/tests/backends/test_mongodb.py
|
||||
index f7546d3..a32d9ed 100644
|
||||
--- a/celery/tests/backends/test_mongodb.py
|
||||
+++ b/celery/tests/backends/test_mongodb.py
|
||||
@@ -253,8 +253,8 @@ def test_restore_group(self, mock_get_database):
|
||||
mock_collection.find_one.assert_called_once_with(
|
||||
{'_id': sentinel.taskset_id})
|
||||
self.assertEqual(
|
||||
- ['date_done', 'result', 'task_id'],
|
||||
- list(ret_val.keys()),
|
||||
+ list(sorted(['date_done', 'result', 'task_id'])),
|
||||
+ list(sorted(ret_val.keys())),
|
||||
)
|
||||
|
||||
@patch('celery.backends.mongodb.MongoBackend._get_database')
|
||||
@@ -1,70 +0,0 @@
|
||||
# /etc/conf.d/celery
|
||||
|
||||
##############################################################################
|
||||
# GLOBAL CONFIGURATION
|
||||
|
||||
# User and group
|
||||
#CELERY_USER="celery"
|
||||
#CELERY_GROUP="celery"
|
||||
|
||||
# Is this for a django project ?
|
||||
# If 'yes' it will automatically setup CELERYD, CELERYCTL
|
||||
# CELERYD_MULTI, CELERYBEAT, CELERYEV and CELERYEV_CAM for a
|
||||
# django project, but you can still override them here.
|
||||
#CELERY_DJANGO="yes"
|
||||
|
||||
# This is generaly a good idea to set the environment correctly
|
||||
# because a lot of python package try to use HOME on init
|
||||
#export HOME="/var/lib/myproject"
|
||||
|
||||
# Full path to the python project directory.
|
||||
#CELERY_PROJDIR="/var/lib/myproject"
|
||||
|
||||
##############################################################################
|
||||
# CELERYD
|
||||
|
||||
#CELERYD_ENABLED="yes"
|
||||
|
||||
# celeryd notes
|
||||
#CELERYD_NODES="celery"
|
||||
|
||||
# celeryd options
|
||||
# Example: 5 minute hard time limit for tasks
|
||||
#CELERYD_OPTS="--time-limit=300"
|
||||
|
||||
# Location and level of the celeryd log file
|
||||
#CELERYD_LOG_FILE=/var/log/celery/celeryd@%n.log
|
||||
#CELERYD_LOG_LEVEL="INFO"
|
||||
|
||||
# Location of the celeryd pid file
|
||||
#CELERYD_PID_FILE=/var/run/celery/celeryd@%n.pid
|
||||
|
||||
##############################################################################
|
||||
# CELERYBEAT
|
||||
|
||||
#CELERYBEAT_ENABLED="yes"
|
||||
|
||||
# celerybeat options
|
||||
#CELERYBEAT_OPTS=""
|
||||
|
||||
# Location and level of the celerybeat log file
|
||||
#CELERYBEAT_LOG_FILE=/var/log/celery/celerybeat.log
|
||||
#CELERYBEAT_LOG_LEVEL="INFO"
|
||||
|
||||
# Location of the celerybeat pid file
|
||||
#CELERYBEAT_PID_FILE=/var/run/celery/celerybeat.pid
|
||||
|
||||
##############################################################################
|
||||
# CELERYEV
|
||||
|
||||
#CELERYEV_ENABLED="yes"
|
||||
|
||||
# celeryev options
|
||||
#CELERYEV_OPTS=""
|
||||
|
||||
# Location and level of the celeryev log file
|
||||
#CELERYEV_LOG_FILE=/var/log/celery/celeryev.log
|
||||
#CELERYEV_LOG_LEVEL="INFO"
|
||||
|
||||
# Location of the celeryev pid file
|
||||
#CELERYEV_PID_FILE=/var/run/celery/celeryev.pid
|
||||
@@ -1,50 +0,0 @@
|
||||
# /etc/conf.d/celery
|
||||
|
||||
##############################################################################
|
||||
# GLOBAL CONFIGURATION
|
||||
|
||||
# User and group
|
||||
#CELERY_USER="celery"
|
||||
#CELERY_GROUP="celery"
|
||||
|
||||
# This is generaly a good idea to set the environment correctly
|
||||
# because a lot of python package try to use HOME on init
|
||||
#export HOME="/var/lib/myproject"
|
||||
|
||||
# Full path to the python project directory.
|
||||
#CELERY_PROJDIR="/var/lib/myproject"
|
||||
|
||||
##############################################################################
|
||||
# CELERYD
|
||||
|
||||
#CELERYD_ENABLED="yes"
|
||||
|
||||
# celeryd notes
|
||||
#CELERYD_NODES="celery"
|
||||
|
||||
# celeryd options
|
||||
# Example: set a 5 minute hard time limit for tasks, disable queue process prefetching and specify an app module from CELERY_PROJDIR
|
||||
#CELERYD_OPTS="--time-limit=300 -Ofair -A celeryapp"
|
||||
|
||||
# Location and level of the celeryd log file
|
||||
#CELERYD_LOG_FILE=/var/log/celery/celeryd@%n.log
|
||||
#CELERYD_LOG_LEVEL="INFO"
|
||||
|
||||
# Location of the celeryd pid file
|
||||
#CELERYD_PID_FILE=/var/run/celery/celeryd@%n.pid
|
||||
|
||||
##############################################################################
|
||||
# CELERYBEAT
|
||||
|
||||
#CELERYBEAT_ENABLED="yes"
|
||||
|
||||
# celerybeat options
|
||||
#CELERYBEAT_OPTS=""
|
||||
|
||||
# Location and level of the celerybeat log file
|
||||
#CELERYBEAT_LOG_FILE=/var/log/celery/celerybeat.log
|
||||
#CELERYBEAT_LOG_LEVEL="INFO"
|
||||
|
||||
# Location of the celerybeat pid file
|
||||
#CELERYBEAT_PID_FILE=/var/run/celery/celerybeat.pid
|
||||
|
||||
@@ -1,267 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the BSD license
|
||||
|
||||
extra_started_commands="reload"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use rabbitmq logger dns
|
||||
}
|
||||
|
||||
CELERYD_ENABLED=${CELERYD_ENABLED:-"no"}
|
||||
CELERYD_PID_FILE=${CELERYD_PID_FILE:-"/var/run/celery/celeryd@%n.pid"}
|
||||
CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-"/var/log/celery/celeryd@%n.log"}
|
||||
CELERYD_LOG_LEVEL=${CELERYD_LOG_LEVEL:-"INFO"}
|
||||
CELERYD_NODES=${CELERYD_NODES:-"celery"}
|
||||
|
||||
CELERYBEAT_ENABLED=${CELERYBEAT_ENABLED:-"no"}
|
||||
CELERYBEAT_PID_FILE=${CELERYBEAT_PID_FILE:-"/var/run/celery/celerybeat.pid"}
|
||||
CELERYBEAT_LOG_FILE=${CELERYBEAT_LOG_FILE:-"/var/log/celery/celerybeat.log"}
|
||||
CELERYBEAT_LOG_LEVEL=${CELERYBEAT_LOG_LEVEL:-"INFO"}
|
||||
|
||||
CELERYEV_ENABLED=${CELERYEV_ENABLED:-"no"}
|
||||
CELERYEV_PID_FILE=${CELERYEV_PID_FILE:-"/var/run/celery/celeryev.pid"}
|
||||
CELERYEV_LOG_FILE=${CELERYEV_LOG_FILE:-"/var/log/celery/celeryev.log"}
|
||||
CELERYEV_LOG_LEVEL=${CELERYEV_LOG_LEVEL:-"INFO"}
|
||||
|
||||
export CELERY_LOADER
|
||||
|
||||
if yesno "$CELERY_DJANGO"; then
|
||||
CELERYD=${CELERYD:-"celeryd_detach"}
|
||||
CELERYCTL=${CELERYCTL:-"python manage.py celery"}
|
||||
CELERYD_MULTI=${CELERYD_MULTI:-"python manage.py celeryd_multi"}
|
||||
CELERYBEAT=${CELERYBEAT:-"python manage.py celerybeat"}
|
||||
CELERYEV=${CELERYEV:-"python manage.py celeryev"}
|
||||
CELERYEV_CAM=${CELERYEV_CAM:-"djcelery.snapshot.Camera"}
|
||||
else
|
||||
CELERYD=${CELERYD:-"-m celery.bin.celeryd_detach"}
|
||||
CELERYD_MULTI=${CELERYD_MULTI:-"celeryd-multi"}
|
||||
CELERYCTL=${CELERYCTL:-"celeryctl"}
|
||||
CELERYBEAT=${CELERYBEAT:-"celerybeat"}
|
||||
CELERYEV=${CELERYEV:-"celeryev"}
|
||||
fi
|
||||
|
||||
CELERYD_OPTS="$CELERYD_OPTS"
|
||||
CELERYBEAT_OPTS="$CELERYBEAT_OPTS -f $CELERYBEAT_LOG_FILE -l $CELERYBEAT_LOG_LEVEL"
|
||||
CELERYEV_OPTS="$CELERYEV_OPTS -f $CELERYEV_LOG_FILE -l $CELERYEV_LOG_LEVEL -c $CELERYEV_CAM"
|
||||
|
||||
create_dirs() {
|
||||
local logfile="$1"
|
||||
local pidfile="$2"
|
||||
local logdir=$(dirname $logfile)
|
||||
local piddir=$(dirname $pidfile)
|
||||
|
||||
checkpath -d -q -m 0750 -o ${CELERY_USER:-"root"}:${CELERY_GROUP:-"root"} $logdir $piddir
|
||||
}
|
||||
|
||||
if [ -n "$CELERY_USER" ]; then
|
||||
DAEMON_OPTS="$DAEMON_OPTS --uid=$CELERY_USER"
|
||||
fi
|
||||
if [ -n "$CELERY_GROUP" ]; then
|
||||
DAEMON_OPTS="$DAEMON_OPTS --gid=$CELERY_GROUP"
|
||||
fi
|
||||
|
||||
checkconfig() {
|
||||
if [ ! -c /dev/null ]; then
|
||||
eerror "/dev/null is not a character device!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "$CELERY_PROJDIR" ]; then
|
||||
eerror "Missing CELERY_PROJDIR variable"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if yesno "$CELERYD_ENABLED"; then
|
||||
create_dirs "$CELERYD_LOG_FILE" "$CELERYD_PID_FILE"
|
||||
fi
|
||||
|
||||
if yesno "$CELERYBEAT_ENABLED"; then
|
||||
create_dirs "$CELERYBEAT_LOG_FILE" "$CELERYBEAT_PID_FILE"
|
||||
fi
|
||||
|
||||
if yesno "$CELERYEV_ENABLED"; then
|
||||
create_dirs "$CELERYEV_LOG_FILE" "$CELERYEV_PID_FILE"
|
||||
|
||||
if [ -z "$CELERYEV_CAM" ]; then
|
||||
eerror "Missing CELERYEV_CAM variable"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
celery_chdir() {
|
||||
if [ -n "$CELERY_PROJDIR" ]; then
|
||||
cd "$CELERY_PROJDIR"
|
||||
fi
|
||||
}
|
||||
|
||||
wait_pid () {
|
||||
local pidfile=$1
|
||||
local timeout=${STOPTIMEOUT:-"10"}
|
||||
local PID=$(cat "${pidfile}" 2>/dev/null)
|
||||
|
||||
while [[ -n "$PID" && "${timeout}" -ge 1 ]] ; do
|
||||
kill -0 $PID 2>/dev/null || break
|
||||
kill -TERM "$PID"
|
||||
timeout=$(($timeout - 1))
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
[[ "${timeout}" -lt 1 ]] && return 1
|
||||
[ -f $pidfile ] && rm -f $pidfile
|
||||
return 0
|
||||
}
|
||||
|
||||
# celeryd
|
||||
start_workers() {
|
||||
yesno "${CELERYD_ENABLED}" || return 0
|
||||
|
||||
$CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS \
|
||||
--pidfile="$CELERYD_PID_FILE" \
|
||||
--logfile="$CELERYD_LOG_FILE" \
|
||||
--loglevel="$CELERYD_LOG_LEVEL" \
|
||||
--cmd="$CELERYD" \
|
||||
$CELERYD_OPTS
|
||||
}
|
||||
|
||||
stop_workers() {
|
||||
yesno "${CELERYD_ENABLED}" || return 0
|
||||
|
||||
local timeout=${STOPTIMEOUT:-"10"}
|
||||
|
||||
$CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE" || return 1
|
||||
|
||||
# Wait for each node
|
||||
for node in $CELERYD_NODES; do
|
||||
local pidfile=${CELERYD_PID_FILE/\%n/$node}
|
||||
local PID=$(cat "${pidfile}" 2>/dev/null)
|
||||
while [[ -n "$PID" && "${timeout}" -ge 1 ]] ; do
|
||||
kill -0 $PID 2>/dev/null || break
|
||||
timeout=$(($timeout - 1))
|
||||
sleep 0.5
|
||||
done
|
||||
done
|
||||
|
||||
[[ "${timeout}" -lt 1 ]] && return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
restart_workers() {
|
||||
yesno "${CELERYD_ENABLED}" || return 0
|
||||
|
||||
$CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS \
|
||||
--pidfile="$CELERYD_PID_FILE" \
|
||||
--logfile="$CELERYD_LOG_FILE" \
|
||||
--loglevel="$CELERYD_LOG_LEVEL" \
|
||||
--cmd="$CELERYD" \
|
||||
$CELERYD_OPTS
|
||||
}
|
||||
|
||||
# celeryev
|
||||
start_ev() {
|
||||
yesno "${CELERYEV_ENABLED}" || return 0
|
||||
|
||||
ebegin "Starting celeryev"
|
||||
$CELERYEV $CELERYEV_OPTS $DAEMON_OPTS --detach \
|
||||
--pidfile="$CELERYEV_PID_FILE"
|
||||
eend $?
|
||||
}
|
||||
|
||||
|
||||
stop_ev() {
|
||||
yesno "${CELERYEV_ENABLED}" || return 0
|
||||
|
||||
ebegin "Stopping celeryev"
|
||||
if [ -f "$CELERYEV_PID_FILE" ]; then
|
||||
wait_pid "$CELERYEV_PID_FILE"
|
||||
else
|
||||
ewarn "not running"
|
||||
fi
|
||||
eend $?
|
||||
}
|
||||
|
||||
# celerybeat
|
||||
start_beat() {
|
||||
yesno "${CELERYBEAT_ENABLED}" || return 0
|
||||
|
||||
ebegin "Starting celerybeat"
|
||||
$CELERYBEAT $CELERYBEAT_OPTS $DAEMON_OPTS --detach \
|
||||
--pidfile="$CELERYBEAT_PID_FILE"
|
||||
eend $?
|
||||
}
|
||||
|
||||
|
||||
stop_beat() {
|
||||
yesno "${CELERYBEAT_ENABLED}" || return 0
|
||||
|
||||
ebegin "Stopping celerybeat"
|
||||
if [ -f "$CELERYBEAT_PID_FILE" ]; then
|
||||
wait_pid "$CELERYBEAT_PID_FILE"
|
||||
else
|
||||
ewarn "not running"
|
||||
fi
|
||||
eend $?
|
||||
}
|
||||
|
||||
|
||||
start() {
|
||||
local cr=0
|
||||
|
||||
checkconfig || return 1
|
||||
|
||||
ebegin "Starting ${SVCNAME}"
|
||||
eindent
|
||||
|
||||
celery_chdir && \
|
||||
start_workers && \
|
||||
start_beat && \
|
||||
start_ev || cr=1
|
||||
|
||||
eoutdent
|
||||
eend $cr
|
||||
}
|
||||
|
||||
stop() {
|
||||
local cr=0
|
||||
|
||||
checkconfig || return 1
|
||||
|
||||
ebegin "Stopping ${SVCNAME}"
|
||||
eindent
|
||||
|
||||
celery_chdir
|
||||
stop_workers || cr=1
|
||||
stop_beat || cr=1
|
||||
stop_ev || cr=1
|
||||
|
||||
eoutdent
|
||||
eend $cr
|
||||
}
|
||||
|
||||
reload() {
|
||||
local cr=0
|
||||
|
||||
checkconfig || return 1
|
||||
|
||||
ebegin "Restarting ${SVCNAME}"
|
||||
eindent
|
||||
|
||||
celery_chdir
|
||||
restart_workers || cr=1
|
||||
stop_beat && start_beat || cr=1
|
||||
stop_ev && start_ev || cr=1
|
||||
|
||||
eoutdent
|
||||
eend $cr
|
||||
}
|
||||
|
||||
status() {
|
||||
checkconfig || return 1
|
||||
|
||||
celery_chdir && \
|
||||
${CELERYCTL} status
|
||||
}
|
||||
@@ -1,213 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Distributed under the terms of the BSD license
|
||||
|
||||
extra_started_commands="reload"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use rabbitmq redis logger dns
|
||||
}
|
||||
|
||||
CELERYD_ENABLED=${CELERYD_ENABLED:-"no"}
|
||||
CELERYD_PID_FILE=${CELERYD_PID_FILE:-"/var/run/celery/celeryd@%n.pid"}
|
||||
CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-"/var/log/celery/celeryd@%n.log"}
|
||||
CELERYD_LOG_LEVEL=${CELERYD_LOG_LEVEL:-"INFO"}
|
||||
CELERYD_NODES=${CELERYD_NODES:-"celery"}
|
||||
|
||||
CELERYBEAT_ENABLED=${CELERYBEAT_ENABLED:-"no"}
|
||||
CELERYBEAT_PID_FILE=${CELERYBEAT_PID_FILE:-"/var/run/celery/celerybeat.pid"}
|
||||
CELERYBEAT_LOG_FILE=${CELERYBEAT_LOG_FILE:-"/var/log/celery/celerybeat.log"}
|
||||
CELERYBEAT_LOG_LEVEL=${CELERYBEAT_LOG_LEVEL:-"INFO"}
|
||||
|
||||
export CELERY_LOADER
|
||||
|
||||
CELERYD_MULTI=${CELERYD_MULTI:-"celery multi"}
|
||||
CELERYCTL=${CELERYCTL:-"celery"}
|
||||
CELERYBEAT=${CELERYBEAT:-"celery beat"}
|
||||
|
||||
CELERYD_OPTS="$CELERYD_OPTS"
|
||||
CELERYBEAT_OPTS="$CELERYBEAT_OPTS -f $CELERYBEAT_LOG_FILE -l $CELERYBEAT_LOG_LEVEL"
|
||||
|
||||
create_dirs() {
|
||||
local logfile="$1"
|
||||
local pidfile="$2"
|
||||
local logdir=$(dirname $logfile)
|
||||
local piddir=$(dirname $pidfile)
|
||||
|
||||
checkpath -d -q -m 0750 -o ${CELERY_USER:-"root"}:${CELERY_GROUP:-"root"} $logdir $piddir
|
||||
}
|
||||
|
||||
if [ -n "$CELERY_USER" ]; then
|
||||
DAEMON_OPTS="$DAEMON_OPTS --uid=$CELERY_USER"
|
||||
fi
|
||||
if [ -n "$CELERY_GROUP" ]; then
|
||||
DAEMON_OPTS="$DAEMON_OPTS --gid=$CELERY_GROUP"
|
||||
fi
|
||||
|
||||
checkconfig() {
|
||||
if [ ! -c /dev/null ]; then
|
||||
eerror "/dev/null is not a character device!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "$CELERY_PROJDIR" ]; then
|
||||
eerror "Missing CELERY_PROJDIR variable"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if yesno "$CELERYD_ENABLED"; then
|
||||
create_dirs "$CELERYD_LOG_FILE" "$CELERYD_PID_FILE"
|
||||
fi
|
||||
|
||||
if yesno "$CELERYBEAT_ENABLED"; then
|
||||
create_dirs "$CELERYBEAT_LOG_FILE" "$CELERYBEAT_PID_FILE"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
celery_chdir() {
|
||||
if [ -n "$CELERY_PROJDIR" ]; then
|
||||
cd "$CELERY_PROJDIR"
|
||||
fi
|
||||
}
|
||||
|
||||
wait_pid () {
|
||||
local pidfile=$1
|
||||
local timeout=${STOPTIMEOUT:-"10"}
|
||||
local PID=$(cat "${pidfile}" 2>/dev/null)
|
||||
|
||||
while [[ -n "$PID" && "${timeout}" -ge 1 ]] ; do
|
||||
kill -0 $PID 2>/dev/null || break
|
||||
kill -TERM "$PID"
|
||||
timeout=$(($timeout - 1))
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
[[ "${timeout}" -lt 1 ]] && return 1
|
||||
[ -f $pidfile ] && rm -f $pidfile
|
||||
return 0
|
||||
}
|
||||
|
||||
# celeryd
|
||||
start_workers() {
|
||||
yesno "${CELERYD_ENABLED}" || return 0
|
||||
|
||||
$CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS \
|
||||
--pidfile="$CELERYD_PID_FILE" \
|
||||
--logfile="$CELERYD_LOG_FILE" \
|
||||
--loglevel="$CELERYD_LOG_LEVEL" \
|
||||
$CELERYD_OPTS
|
||||
}
|
||||
|
||||
stop_workers() {
|
||||
yesno "${CELERYD_ENABLED}" || return 0
|
||||
|
||||
local timeout=${STOPTIMEOUT:-"10"}
|
||||
|
||||
$CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE" || return 1
|
||||
|
||||
# Wait for each node
|
||||
for node in $CELERYD_NODES; do
|
||||
local pidfile=${CELERYD_PID_FILE/\%n/$node}
|
||||
local PID=$(cat "${pidfile}" 2>/dev/null)
|
||||
while [[ -n "$PID" && "${timeout}" -ge 1 ]] ; do
|
||||
kill -0 $PID 2>/dev/null || break
|
||||
timeout=$(($timeout - 1))
|
||||
sleep 0.5
|
||||
done
|
||||
done
|
||||
|
||||
[[ "${timeout}" -lt 1 ]] && return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
restart_workers() {
|
||||
yesno "${CELERYD_ENABLED}" || return 0
|
||||
|
||||
$CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS \
|
||||
--pidfile="$CELERYD_PID_FILE" \
|
||||
--logfile="$CELERYD_LOG_FILE" \
|
||||
--loglevel="$CELERYD_LOG_LEVEL" \
|
||||
$CELERYD_OPTS
|
||||
}
|
||||
|
||||
# celerybeat
|
||||
start_beat() {
|
||||
yesno "${CELERYBEAT_ENABLED}" || return 0
|
||||
|
||||
ebegin "Starting celerybeat"
|
||||
$CELERYBEAT $CELERYBEAT_OPTS $DAEMON_OPTS --detach \
|
||||
--pidfile="$CELERYBEAT_PID_FILE"
|
||||
eend $?
|
||||
}
|
||||
|
||||
|
||||
stop_beat() {
|
||||
yesno "${CELERYBEAT_ENABLED}" || return 0
|
||||
|
||||
ebegin "Stopping celerybeat"
|
||||
if [ -f "$CELERYBEAT_PID_FILE" ]; then
|
||||
wait_pid "$CELERYBEAT_PID_FILE"
|
||||
else
|
||||
ewarn "not running"
|
||||
fi
|
||||
eend $?
|
||||
}
|
||||
|
||||
|
||||
start() {
|
||||
local cr=0
|
||||
|
||||
checkconfig || return 1
|
||||
|
||||
ebegin "Starting ${SVCNAME}"
|
||||
eindent
|
||||
|
||||
celery_chdir && \
|
||||
start_workers && \
|
||||
start_beat || cr=1
|
||||
|
||||
eoutdent
|
||||
eend $cr
|
||||
}
|
||||
|
||||
stop() {
|
||||
local cr=0
|
||||
|
||||
checkconfig || return 1
|
||||
|
||||
ebegin "Stopping ${SVCNAME}"
|
||||
eindent
|
||||
|
||||
celery_chdir
|
||||
stop_workers || cr=1
|
||||
stop_beat || cr=1
|
||||
|
||||
eoutdent
|
||||
eend $cr
|
||||
}
|
||||
|
||||
reload() {
|
||||
local cr=0
|
||||
|
||||
checkconfig || return 1
|
||||
|
||||
ebegin "Restarting ${SVCNAME}"
|
||||
eindent
|
||||
|
||||
celery_chdir
|
||||
restart_workers || cr=1
|
||||
stop_beat && start_beat || cr=1
|
||||
|
||||
eoutdent
|
||||
eend $cr
|
||||
}
|
||||
|
||||
status() {
|
||||
checkconfig || return 1
|
||||
|
||||
celery_chdir && \
|
||||
${CELERYCTL} status
|
||||
}
|
||||
Reference in New Issue
Block a user