mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-14 17:43:11 -04:00
dev-python/celery: initial import
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
1
dev-python/celery/Manifest
Normal file
1
dev-python/celery/Manifest
Normal file
@@ -0,0 +1 @@
|
||||
DIST celery-5.1.0_beta2.tar.gz 1459863 BLAKE2B 1b5a49728fa97e00112cc31731998ac06b2bb77ed621321b119d44d8cf0e4ec347d92b0857f316bda48f61a0ce0bd5c9d55392a8e3053369577d503af7aafc35 SHA512 d430a33cbc34950d68cf228707e8e868834f80a7f6c40491d8a67b056af5395c03e27c2b2ba1e2b9a390598d7d8bb3609bd88b388dfb18a34d0441ed54245192
|
||||
102
dev-python/celery/celery-5.1.0_beta2.ebuild
Normal file
102
dev-python/celery/celery-5.1.0_beta2.ebuild
Normal file
@@ -0,0 +1,102 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI="7"
|
||||
DISTUTILS_USE_SETUPTOOLS=rdepend
|
||||
PYTHON_COMPAT=( python3_{7,8} )
|
||||
|
||||
inherit bash-completion-r1 distutils-r1 eutils optfeature
|
||||
|
||||
MYPV="${PV/_beta/b}"
|
||||
DESCRIPTION="Asynchronous task queue/job queue based on distributed message passing"
|
||||
HOMEPAGE="
|
||||
http://celeryproject.org
|
||||
https://pypi.org/project/celery
|
||||
https://github.com/celery/celery
|
||||
"
|
||||
SRC_URI="https://github.com/celery/celery/archive/v${MYPV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
# There are a number of other optional 'extras'
|
||||
IUSE="examples"
|
||||
#RESTRICT="!test? ( test )"
|
||||
RESTRICT="test" #'celery' not found in `markers` configuration option
|
||||
S="${WORKDIR}/${PN}-${MYPV}"
|
||||
|
||||
RDEPEND="
|
||||
>=dev-python/billiard-3.6.4.0[${PYTHON_USEDEP}]
|
||||
<dev-python/billiard-4.0.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/click-7[${PYTHON_USEDEP}]
|
||||
<dev-python/click-8[${PYTHON_USEDEP}]
|
||||
>=dev-python/click-didyoumean-0.0.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/click-plugins-1.1.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/click-repl-0.1.6[${PYTHON_USEDEP}]
|
||||
<dev-python/kombu-6.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/kombu-5[${PYTHON_USEDEP}]
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
>=dev-python/vine-5[${PYTHON_USEDEP}]
|
||||
<dev-python/vine-6[${PYTHON_USEDEP}]
|
||||
"
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
test? (
|
||||
>=dev-python/boto3-1.9.178[${PYTHON_USEDEP}]
|
||||
>=dev-python/case-1.3.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/moto-1.3.7[${PYTHON_USEDEP}]
|
||||
>=dev-python/pytest-6.2[${PYTHON_USEDEP}]
|
||||
dev-python/pytest-celery[${PYTHON_USEDEP}]
|
||||
dev-python/pytest-subtests[${PYTHON_USEDEP}]
|
||||
>=dev-python/pytest-timeout-1.4.2[${PYTHON_USEDEP}]
|
||||
>=dev-python/python-dateutil-2.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/pyyaml-3.10[${PYTHON_USEDEP}]
|
||||
>=dev-python/pyzmq-13.1.0[${PYTHON_USEDEP}]
|
||||
)
|
||||
doc? (
|
||||
dev-python/docutils[${PYTHON_USEDEP}]
|
||||
>=dev-python/sphinx_celery-2.0.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/sphinx-click-2.5.0[${PYTHON_USEDEP}]
|
||||
dev-python/jinja[${PYTHON_USEDEP}]
|
||||
dev-python/sqlalchemy[${PYTHON_USEDEP}]
|
||||
)
|
||||
"
|
||||
# testsuite needs it own source
|
||||
DISTUTILS_IN_SOURCE_BUILD=1
|
||||
distutils_enable_tests pytest
|
||||
distutils_enable_sphinx docs --no-autodoc
|
||||
|
||||
python_install_all() {
|
||||
# Main celeryd init.d and conf.d
|
||||
newinitd "${FILESDIR}/celery.initd-r2" celery
|
||||
newconfd "${FILESDIR}/celery.confd-r2" celery
|
||||
|
||||
if use examples; then
|
||||
docinto examples
|
||||
dodoc -r examples/.
|
||||
docompress -x "/usr/share/doc/${PF}/examples"
|
||||
fi
|
||||
|
||||
newbashcomp extra/bash-completion/celery.bash "${PN}"
|
||||
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
optfeature "zookeeper 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 "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 "memcache support" dev-python/pylibmc
|
||||
optfeature "mongodb support" dev-python/pymongo
|
||||
optfeature "sqlalchemy support" dev-python/sqlalchemy
|
||||
optfeature "sqs support" dev-python/boto
|
||||
#optfeature "cassandra support" dev-python/cassandra-driver
|
||||
}
|
||||
51
dev-python/celery/files/celery.confd-r2
Normal file
51
dev-python/celery/files/celery.confd-r2
Normal file
@@ -0,0 +1,51 @@
|
||||
# /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
|
||||
|
||||
# Start the Celery worker daemon
|
||||
#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=/run/celery/celeryd@%n.pid
|
||||
|
||||
##############################################################################
|
||||
# CELERYBEAT
|
||||
|
||||
# Start the Celery task scheduler daemon
|
||||
#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=/run/celery/celerybeat.pid
|
||||
205
dev-python/celery/files/celery.initd-r2
Normal file
205
dev-python/celery/files/celery.initd-r2
Normal file
@@ -0,0 +1,205 @@
|
||||
#!/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:-"/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:-"/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}
|
||||
}
|
||||
|
||||
[ -n "${CELERY_USER}" ] && DAEMON_OPTS="${DAEMON_OPTS} --uid=${CELERY_USER}"
|
||||
[ -n "${CELERY_GROUP}" ] && DAEMON_OPTS="${DAEMON_OPTS} --gid=${CELERY_GROUP}"
|
||||
|
||||
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
|
||||
|
||||
yesno "${CELERYD_ENABLED}" && \
|
||||
create_dirs "${CELERYD_LOG_FILE}" "${CELERYD_PID_FILE}"
|
||||
|
||||
yesno "${CELERYBEAT_ENABLED}" && \
|
||||
create_dirs "${CELERYBEAT_LOG_FILE}" "${CELERYBEAT_PID_FILE}"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
celery_chdir() {
|
||||
[ -n "${CELERY_PROJDIR}" ] && cd "${CELERY_PROJDIR}"
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
12
dev-python/celery/metadata.xml
Normal file
12
dev-python/celery/metadata.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<description>comaintainers welcome</description>
|
||||
<email>lssndrbarbieri@gmail.com</email>
|
||||
<name>Alessandro Barbieri</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="pypi">celery</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
Reference in New Issue
Block a user