nebu 0.1.38__py3-none-any.whl → 0.1.40__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.
nebu/cache.py CHANGED
@@ -1,8 +1,10 @@
1
1
  import os
2
+ import socket # Add socket import
2
3
  import time
3
4
  from typing import Any, Optional, cast
4
5
 
5
6
  import redis
7
+ import socks # Add socks import
6
8
  from pydantic import BaseModel, Field
7
9
 
8
10
 
@@ -28,13 +30,27 @@ class Cache:
28
30
  Also checks for REDIS_URL and prefers that if set.
29
31
  """
30
32
  redis_url = os.environ.get("REDIS_URL")
33
+ print("REDIS_URL: ", redis_url)
31
34
  namespace = os.environ.get("NEBU_NAMESPACE")
32
35
  if not namespace:
33
36
  raise ValueError("NEBU_NAMESPACE environment variable is not set")
34
-
37
+ print("NAMESPACE: ", namespace)
35
38
  self.redis_client = None
36
39
  connection_info = ""
37
40
 
41
+ # Configure SOCKS proxy before connecting to Redis
42
+ try:
43
+ # Use the proxy settings provided by tailscaled
44
+ socks.set_default_proxy(socks.SOCKS5, "localhost", 1055)
45
+ socket.socket = socks.socksocket
46
+ print("Configured SOCKS5 proxy for socket connections via localhost:1055")
47
+ except Exception as proxy_err:
48
+ print(f"Failed to configure SOCKS proxy: {proxy_err}")
49
+ # Depending on requirements, you might want to raise an error here
50
+ # or proceed without the proxy if it's optional.
51
+ # For now, we'll print the error and continue, but the Redis connection
52
+ # will likely fail if the proxy is required.
53
+
38
54
  try:
39
55
  if redis_url:
40
56
  # Use REDIS_URL if available
@@ -57,6 +73,7 @@ class Cache:
57
73
  print(f"Successfully connected to Redis using {connection_info}")
58
74
 
59
75
  self.prefix = f"cache:{namespace}"
76
+ print("using prefix", self.prefix)
60
77
  except Exception as e:
61
78
  print(f"Error connecting to Redis: {e}")
62
79
  # Ensure client is None if connection fails at any point
@@ -221,6 +221,9 @@ try:
221
221
  try:
222
222
  exec(init_func_source, local_namespace)
223
223
  init_function = local_namespace[init_func_name]
224
+ print(
225
+ f"[Consumer] Environment before calling init_func {init_func_name}: {os.environ}"
226
+ )
224
227
  init_function() # Call the function
225
228
  print(f"Successfully executed init_func: {init_func_name}")
226
229
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nebu
3
- Version: 0.1.38
3
+ Version: 0.1.40
4
4
  Summary: A globally distributed container runtime
5
5
  Requires-Python: >=3.10.14
6
6
  Description-Content-Type: text/markdown
@@ -1,7 +1,7 @@
1
1
  nebu/__init__.py,sha256=5sepbzdAdoA_8TIxws60S4ugFY1apQd_savzn20a4cY,465
2
2
  nebu/adapter.py,sha256=X9Lc0-pm4U6v7UDgOd_RuxJqENqAO8Si4jrwGYTsMGI,418
3
3
  nebu/auth.py,sha256=N_v6SPFD9HU_UoRDTaouH03g2Hmo9C-xxqInE1FweXE,1471
4
- nebu/cache.py,sha256=1aY1plIXWOPmUY6GGq_s_QDXzIi5UMuG34XYBA8PpW8,3803
4
+ nebu/cache.py,sha256=jmluqvWnE9N8uNq6nppXSxEJK7DKWaB79GicaGg9KmY,4718
5
5
  nebu/config.py,sha256=aZzQltkobtOLHFCGcIkpKoE3ITn3Z11Dp0E72w84TA0,5769
6
6
  nebu/data.py,sha256=kIH9-JJ1-iO7P2t28bku6Gn0Y5tgQszGeTW_rpmO03A,38725
7
7
  nebu/meta.py,sha256=CzFHMND9seuewzq9zNNx9WTr6JvrCBExe7BLqDSr7lM,745
@@ -11,7 +11,7 @@ nebu/containers/container.py,sha256=yb7KaPTVXnEEAlrpdlUi4HNqF6P7z9bmwAILGlq6iqU,
11
11
  nebu/containers/decorator.py,sha256=uFtzlAXRHYZECJ-NPusY7oN9GXvdHrHDd_JNrIGr8aQ,3244
12
12
  nebu/containers/models.py,sha256=0j6NGy4yto-enRDh_4JH_ZTbHrLdSpuMOqNQPnIrwC4,6815
13
13
  nebu/containers/server.py,sha256=yFa2Y9PzBn59E1HftKiv0iapPonli2rbGAiU6r-wwe0,2513
14
- nebu/processors/consumer.py,sha256=cRYf8j7nwjQTzUT6Rtrsvso7SqzItkV9F104OqGAsPQ,20655
14
+ nebu/processors/consumer.py,sha256=vVbA6PdgkTKI5iqCDSnHO0dtbyFPiK7_1ys3ph7xPrk,20786
15
15
  nebu/processors/decorate.py,sha256=KZ43vOPzl3HVPB9P3QX6U94yTBnVi7ISoXQhUuEMO7g,38156
16
16
  nebu/processors/default.py,sha256=W4slJenG59rvyTlJ7gRp58eFfXcNOTT2Hfi6zzJAobI,365
17
17
  nebu/processors/models.py,sha256=y40HoW-MEzDWB2dm_tsYlUy3Nf3s6eiLC0iGO9BoNog,3956
@@ -19,8 +19,8 @@ nebu/processors/processor.py,sha256=068hLQKapWabNlhb_DtzqAJ7N7MGdr5UcjfZrb_MkFo,
19
19
  nebu/processors/remote.py,sha256=TeAIPGEMqnDIb7H1iett26IEZrBlcbPB_-DSm6jcH1E,1285
20
20
  nebu/redis/models.py,sha256=coPovAcVXnOU1Xh_fpJL4PO3QctgK9nBe5QYoqEcnxg,1230
21
21
  nebu/services/service.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- nebu-0.1.38.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
23
- nebu-0.1.38.dist-info/METADATA,sha256=8UJuoJ3UEfjvP9pmdyP_BmYRP-zHPNnei3tr3eUkPlE,1786
24
- nebu-0.1.38.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
25
- nebu-0.1.38.dist-info/top_level.txt,sha256=uLIbEKJeGSHWOAJN5S0i5XBGwybALlF9bYoB1UhdEgQ,5
26
- nebu-0.1.38.dist-info/RECORD,,
22
+ nebu-0.1.40.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
23
+ nebu-0.1.40.dist-info/METADATA,sha256=bYppJEpxIjbq5HgALjImHajrlBkyEp63EuKAp19drHo,1786
24
+ nebu-0.1.40.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
25
+ nebu-0.1.40.dist-info/top_level.txt,sha256=uLIbEKJeGSHWOAJN5S0i5XBGwybALlF9bYoB1UhdEgQ,5
26
+ nebu-0.1.40.dist-info/RECORD,,
File without changes