scalable-pypeline 2.1.24__py2.py3-none-any.whl → 2.1.26__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 CHANGED
@@ -1 +1 @@
1
- __version__ = "2.1.24"
1
+ __version__ = "2.1.26"
pypeline/barrier.py CHANGED
@@ -2,7 +2,7 @@ import time
2
2
  import redis
3
3
  from redis.sentinel import Sentinel
4
4
  from urllib.parse import urlparse
5
- from constants import (
5
+ from pypeline.constants import (
6
6
  REDIS_SENTINEL_MASTER_NAME,
7
7
  DEFAULT_REDIS_SOCKET_CONNECT_TIMEOUT,
8
8
  DEFAULT_REDIS_SOCKET_TIMEOUT,
@@ -5,12 +5,22 @@ import json
5
5
  import time
6
6
  import typing
7
7
  from uuid import uuid4
8
+ from urllib.parse import urlparse
8
9
 
9
10
  from dramatiq.broker import get_broker
10
11
  from dramatiq.results import ResultMissing
11
12
  from db_medley.redis_conf import RedisConnector
12
13
  from redis.exceptions import RedisError
13
-
14
+ from redis.sentinel import Sentinel
15
+ from pypeline.constants import (
16
+ REDIS_URL,
17
+ REDIS_SENTINEL_MASTER_NAME,
18
+ DEFAULT_REDIS_SOCKET_CONNECT_TIMEOUT,
19
+ DEFAULT_REDIS_SOCKET_TIMEOUT,
20
+ DEFAULT_REDIS_RETRY_ON_TIMEOUT,
21
+ DEFAULT_REDIS_SOCKET_KEEPALIVE,
22
+ DEFAULT_REDIS_HEALTH_CHECK_INTERVAL,
23
+ )
14
24
  from pypeline.barrier import LockingParallelBarrier
15
25
  from pypeline.constants import DEFAULT_RESULT_TTL
16
26
  from pypeline.dramatiq import REDIS_URL
@@ -240,9 +250,26 @@ class PipelineResult:
240
250
  self.pipeline: parallel_pipeline = None
241
251
  self.execution_id = execution_id
242
252
  self.redis_key = f"{execution_id}-results-key"
243
- self.redis_conn = RedisConnector().get_connection()
244
253
  self.result_ttl = result_ttl
245
254
 
255
+ if REDIS_SENTINEL_MASTER_NAME is not None:
256
+ parsed_redis_url = urlparse(REDIS_URL)
257
+ redis_sentinel = Sentinel(
258
+ sentinels=[(parsed_redis_url.hostname, parsed_redis_url.port)],
259
+ )
260
+ self.redis_conn = redis_sentinel.master_for(
261
+ REDIS_SENTINEL_MASTER_NAME,
262
+ db=int(parsed_redis_url.path[1]) if parsed_redis_url.path else 0,
263
+ password=parsed_redis_url.password,
264
+ socket_connect_timeout=DEFAULT_REDIS_SOCKET_CONNECT_TIMEOUT,
265
+ socket_timeout=DEFAULT_REDIS_SOCKET_TIMEOUT,
266
+ retry_on_timeout=DEFAULT_REDIS_RETRY_ON_TIMEOUT,
267
+ socket_keepalive=DEFAULT_REDIS_SOCKET_KEEPALIVE,
268
+ health_check_interval=DEFAULT_REDIS_HEALTH_CHECK_INTERVAL,
269
+ )
270
+ else:
271
+ self.redis_conn = RedisConnector().get_connection()
272
+
246
273
  def create_result_entry(self, pipeline_json_str: str):
247
274
  """
248
275
  Store the serialized pipeline data in Redis with a specified TTL.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scalable-pypeline
3
- Version: 2.1.24
3
+ Version: 2.1.26
4
4
  Summary: PypeLine - Python pipelines for the Real World
5
5
  Home-page: https://gitlab.com/bravos2/pypeline
6
6
  Author: Bravos Power Corporation
@@ -1,5 +1,5 @@
1
- pypeline/__init__.py,sha256=qc6AJ16ihdkGGzdf0nDZHdeSsAAbLwShB1HyYj8ASPE,23
2
- pypeline/barrier.py,sha256=lIWKikEtE34PQf4ZfSl6RNBu0n5vP8x-oy2Pe2S0tqM,2367
1
+ pypeline/__init__.py,sha256=kDsQujSOEts9DhAOHBOlEjAEDf0lqYMUYrA9xzjlvh0,23
2
+ pypeline/barrier.py,sha256=ojSgbuZnGKpKiSBYXTV4CxG9j1Z01YdzBSORli4MnzI,2376
3
3
  pypeline/constants.py,sha256=7COt9jfmLDvCNAFeN6ddRpwdvv2LpbYOCIQs6dPXpOQ,3592
4
4
  pypeline/dramatiq.py,sha256=XPpgPgiOaEFK8zORx9eveJ45wzcUXMjVGryFKY5Xiwg,15527
5
5
  pypeline/executable_job_config_schema.py,sha256=P2Z8SO057Jgyt4I5oZxcbEi1iaZkLoAh7qp8PtuqcqU,1010
@@ -17,7 +17,7 @@ pypeline/flask/api/schedules.py,sha256=8PKCMdPucaer8opchNlI5aDssK2UqT79hHpeg5BMt
17
17
  pypeline/pipelines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  pypeline/pipelines/factory.py,sha256=ftm6AwXIdkC8LEzy3c4CLPzXtoQonBKUo3yojbYTsUE,3309
19
19
  pypeline/pipelines/composition/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- pypeline/pipelines/composition/parallel_pipeline_composition.py,sha256=pTw9Xb9h4JnV4siFc3JStm5lB-i9djUADo3Kh5K3s7g,12976
20
+ pypeline/pipelines/composition/parallel_pipeline_composition.py,sha256=JrEsIxaB36wLWg5ztCMkANye9VizGuRIhyxyCP4DCl8,14162
21
21
  pypeline/pipelines/composition/pypeline_composition.py,sha256=lY1RO7luLqDBLfoX99YbBatx1Qov1cxGoS5lRAjB_DQ,8534
22
22
  pypeline/pipelines/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  pypeline/pipelines/middleware/get_active_worker_id_middleware.py,sha256=X4ZfRk3L8MD00DTsGHth7oOdy-W7LQV96T8vu5UC42A,755
@@ -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.24.dist-info/LICENSE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
37
- scalable_pypeline-2.1.24.dist-info/METADATA,sha256=Ai98ywPiFPQ01sTYY-H1HV_XcoHQH6R6UYwMVm1_iLw,5985
38
- scalable_pypeline-2.1.24.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
39
- scalable_pypeline-2.1.24.dist-info/entry_points.txt,sha256=uWs10ODfHSBKo2Cx_QaUjPHQTpZ3e77j9VlAdRRmMyg,119
40
- scalable_pypeline-2.1.24.dist-info/top_level.txt,sha256=C7dpkEOc_-nnsAQb28BfQknjD6XHRyS9ZrvVeoIbV7s,15
41
- scalable_pypeline-2.1.24.dist-info/RECORD,,
36
+ scalable_pypeline-2.1.26.dist-info/LICENSE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
37
+ scalable_pypeline-2.1.26.dist-info/METADATA,sha256=T-yqcbiyL6nJ6SvJkmrH9n0lPvXjdJ9m4QLny-VPHyU,5985
38
+ scalable_pypeline-2.1.26.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
39
+ scalable_pypeline-2.1.26.dist-info/entry_points.txt,sha256=uWs10ODfHSBKo2Cx_QaUjPHQTpZ3e77j9VlAdRRmMyg,119
40
+ scalable_pypeline-2.1.26.dist-info/top_level.txt,sha256=C7dpkEOc_-nnsAQb28BfQknjD6XHRyS9ZrvVeoIbV7s,15
41
+ scalable_pypeline-2.1.26.dist-info/RECORD,,