scalable-pypeline 2.1.23__py2.py3-none-any.whl → 2.1.25__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of scalable-pypeline might be problematic. Click here for more details.
- pypeline/__init__.py +1 -1
- pypeline/barrier.py +28 -2
- pypeline/constants.py +1 -1
- pypeline/dramatiq.py +3 -3
- {scalable_pypeline-2.1.23.dist-info → scalable_pypeline-2.1.25.dist-info}/METADATA +1 -1
- {scalable_pypeline-2.1.23.dist-info → scalable_pypeline-2.1.25.dist-info}/RECORD +10 -10
- {scalable_pypeline-2.1.23.dist-info → scalable_pypeline-2.1.25.dist-info}/LICENSE +0 -0
- {scalable_pypeline-2.1.23.dist-info → scalable_pypeline-2.1.25.dist-info}/WHEEL +0 -0
- {scalable_pypeline-2.1.23.dist-info → scalable_pypeline-2.1.25.dist-info}/entry_points.txt +0 -0
- {scalable_pypeline-2.1.23.dist-info → scalable_pypeline-2.1.25.dist-info}/top_level.txt +0 -0
pypeline/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2.1.
|
|
1
|
+
__version__ = "2.1.25"
|
pypeline/barrier.py
CHANGED
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
import time
|
|
2
|
-
|
|
3
2
|
import redis
|
|
3
|
+
from redis.sentinel import Sentinel
|
|
4
|
+
from urllib.parse import urlparse
|
|
5
|
+
from pypeline.constants import (
|
|
6
|
+
REDIS_SENTINEL_MASTER_NAME,
|
|
7
|
+
DEFAULT_REDIS_SOCKET_CONNECT_TIMEOUT,
|
|
8
|
+
DEFAULT_REDIS_SOCKET_TIMEOUT,
|
|
9
|
+
DEFAULT_REDIS_RETRY_ON_TIMEOUT,
|
|
10
|
+
DEFAULT_REDIS_SOCKET_KEEPALIVE,
|
|
11
|
+
DEFAULT_REDIS_HEALTH_CHECK_INTERVAL,
|
|
12
|
+
)
|
|
4
13
|
|
|
5
14
|
|
|
6
15
|
class LockingParallelBarrier:
|
|
7
16
|
def __init__(self, redis_url, task_key="task_counter", lock_key="task_lock"):
|
|
8
17
|
# Connect to Redis using the provided URL
|
|
9
|
-
|
|
18
|
+
if REDIS_SENTINEL_MASTER_NAME is not None:
|
|
19
|
+
parsed_redis_url = urlparse(redis_url)
|
|
20
|
+
redis_sentinel = Sentinel(
|
|
21
|
+
sentinels=[(parsed_redis_url.hostname, parsed_redis_url.port)],
|
|
22
|
+
)
|
|
23
|
+
self.redis = redis_sentinel.master_for(
|
|
24
|
+
REDIS_SENTINEL_MASTER_NAME,
|
|
25
|
+
db=int(parsed_redis_url.path[1]) if parsed_redis_url.path else 0,
|
|
26
|
+
password=parsed_redis_url.password,
|
|
27
|
+
socket_connect_timeout=DEFAULT_REDIS_SOCKET_CONNECT_TIMEOUT,
|
|
28
|
+
socket_timeout=DEFAULT_REDIS_SOCKET_TIMEOUT,
|
|
29
|
+
retry_on_timeout=DEFAULT_REDIS_RETRY_ON_TIMEOUT,
|
|
30
|
+
socket_keepalive=DEFAULT_REDIS_SOCKET_KEEPALIVE,
|
|
31
|
+
health_check_interval=DEFAULT_REDIS_HEALTH_CHECK_INTERVAL,
|
|
32
|
+
decode_responses=True,
|
|
33
|
+
)
|
|
34
|
+
else:
|
|
35
|
+
self.redis = redis.StrictRedis.from_url(redis_url, decode_responses=True)
|
|
10
36
|
self.task_key = task_key
|
|
11
37
|
self.lock_key = lock_key
|
|
12
38
|
|
pypeline/constants.py
CHANGED
|
@@ -14,7 +14,7 @@ DEFAULT_BROKER_CALLABLE = os.environ.get(
|
|
|
14
14
|
# Pypeline broker connections
|
|
15
15
|
RABBIT_URL = os.environ.get("RABBIT_URL", "amqp://admin:password@127.0.0.1:5672")
|
|
16
16
|
REDIS_URL = os.environ.get("REDIS_URL", "redis://localhost:6379/0")
|
|
17
|
-
|
|
17
|
+
REDIS_SENTINEL_MASTER_NAME = os.environ.get("REDIS_SENTINEL_MASTER_NAME", None)
|
|
18
18
|
|
|
19
19
|
# Pypeline task defaults
|
|
20
20
|
PARALLEL_PIPELINE_CALLBACK_BARRIER_TTL = int(
|
pypeline/dramatiq.py
CHANGED
|
@@ -30,7 +30,7 @@ from flask.cli import with_appcontext
|
|
|
30
30
|
|
|
31
31
|
from pypeline.constants import (
|
|
32
32
|
REDIS_URL,
|
|
33
|
-
|
|
33
|
+
REDIS_SENTINEL_MASTER_NAME,
|
|
34
34
|
RABBIT_URL,
|
|
35
35
|
DEFAULT_BROKER_CALLABLE,
|
|
36
36
|
DEFAULT_BROKER_CONNECTION_HEARTBEAT,
|
|
@@ -70,13 +70,13 @@ logger = logging.getLogger(__name__)
|
|
|
70
70
|
|
|
71
71
|
def configure_default_broker(broker: Broker = None):
|
|
72
72
|
redis_client = None
|
|
73
|
-
if
|
|
73
|
+
if REDIS_SENTINEL_MASTER_NAME is not None:
|
|
74
74
|
parsed_redis_url = urlparse(REDIS_URL)
|
|
75
75
|
redis_sentinel = Sentinel(
|
|
76
76
|
sentinels=[(parsed_redis_url.hostname, parsed_redis_url.port)],
|
|
77
77
|
)
|
|
78
78
|
redis_client = redis_sentinel.master_for(
|
|
79
|
-
|
|
79
|
+
REDIS_SENTINEL_MASTER_NAME,
|
|
80
80
|
db=int(parsed_redis_url.path[1]) if parsed_redis_url.path else 0,
|
|
81
81
|
password=parsed_redis_url.password,
|
|
82
82
|
socket_connect_timeout=DEFAULT_REDIS_SOCKET_CONNECT_TIMEOUT,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
pypeline/__init__.py,sha256=
|
|
2
|
-
pypeline/barrier.py,sha256=
|
|
3
|
-
pypeline/constants.py,sha256=
|
|
4
|
-
pypeline/dramatiq.py,sha256=
|
|
1
|
+
pypeline/__init__.py,sha256=eNwueZdE6xOPV8_Xyr7CpRZhy-MW6j5G9dkoGmwRE54,23
|
|
2
|
+
pypeline/barrier.py,sha256=ojSgbuZnGKpKiSBYXTV4CxG9j1Z01YdzBSORli4MnzI,2376
|
|
3
|
+
pypeline/constants.py,sha256=7COt9jfmLDvCNAFeN6ddRpwdvv2LpbYOCIQs6dPXpOQ,3592
|
|
4
|
+
pypeline/dramatiq.py,sha256=XPpgPgiOaEFK8zORx9eveJ45wzcUXMjVGryFKY5Xiwg,15527
|
|
5
5
|
pypeline/executable_job_config_schema.py,sha256=P2Z8SO057Jgyt4I5oZxcbEi1iaZkLoAh7qp8PtuqcqU,1010
|
|
6
6
|
pypeline/extensions.py,sha256=BzOTnXhNxap3N7uIUUh_hO6dDwx08Vc_RJDE93_K0Lo,610
|
|
7
7
|
pypeline/pipeline_config_schema.py,sha256=kRZcCMlk2FIITDzVrAfcSmHnxi1mIWmDzasTW0TnaAU,11169
|
|
@@ -33,9 +33,9 @@ pypeline/utils/module_utils.py,sha256=-yEJIukDCoXnmlZVXB6Dww25tH6GdPE5SoFqv6pfdV
|
|
|
33
33
|
pypeline/utils/pipeline_utils.py,sha256=kGP1QwCJikGC5QNRtzRXCDVewyRMpWIqERTNnxGLlSY,4795
|
|
34
34
|
pypeline/utils/schema_utils.py,sha256=Fgl0y9Cuo_TZeEx_S3gaSVnLjn6467LTkjb2ek7Ms98,851
|
|
35
35
|
tests/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
|
-
scalable_pypeline-2.1.
|
|
37
|
-
scalable_pypeline-2.1.
|
|
38
|
-
scalable_pypeline-2.1.
|
|
39
|
-
scalable_pypeline-2.1.
|
|
40
|
-
scalable_pypeline-2.1.
|
|
41
|
-
scalable_pypeline-2.1.
|
|
36
|
+
scalable_pypeline-2.1.25.dist-info/LICENSE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
|
|
37
|
+
scalable_pypeline-2.1.25.dist-info/METADATA,sha256=QMI9GTwNr1B_dg7P0Fk64PpWDZzJj_BVXPrCrJ8wOBA,5985
|
|
38
|
+
scalable_pypeline-2.1.25.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
|
|
39
|
+
scalable_pypeline-2.1.25.dist-info/entry_points.txt,sha256=uWs10ODfHSBKo2Cx_QaUjPHQTpZ3e77j9VlAdRRmMyg,119
|
|
40
|
+
scalable_pypeline-2.1.25.dist-info/top_level.txt,sha256=C7dpkEOc_-nnsAQb28BfQknjD6XHRyS9ZrvVeoIbV7s,15
|
|
41
|
+
scalable_pypeline-2.1.25.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|