dbos 1.13.0a7__py3-none-any.whl → 1.13.0a8__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.
@@ -0,0 +1,67 @@
1
+ import os
2
+ import subprocess
3
+ import sys
4
+ import time
5
+
6
+ # Default PostgreSQL port
7
+ port = "5432"
8
+
9
+ # Set the host PostgreSQL port with the -p/--port flag
10
+ for i, arg in enumerate(sys.argv):
11
+ if arg in ["-p", "--port"]:
12
+ if i + 1 < len(sys.argv):
13
+ port = sys.argv[i + 1]
14
+
15
+ if "PGPASSWORD" not in os.environ:
16
+ print("Error: PGPASSWORD is not set.")
17
+ sys.exit(1)
18
+
19
+ try:
20
+ subprocess.run(
21
+ [
22
+ "docker",
23
+ "run",
24
+ "--rm",
25
+ "--name=dbos-db",
26
+ f'--env=POSTGRES_PASSWORD={os.environ["PGPASSWORD"]}',
27
+ "--env=PGDATA=/var/lib/postgresql/data",
28
+ "--volume=/var/lib/postgresql/data",
29
+ "-p",
30
+ f"{port}:5432",
31
+ "-d",
32
+ "pgvector/pgvector:pg16",
33
+ ],
34
+ check=True,
35
+ )
36
+
37
+ print("Waiting for PostgreSQL to start...")
38
+ attempts = 30
39
+
40
+ while attempts > 0:
41
+ try:
42
+ subprocess.run(
43
+ [
44
+ "docker",
45
+ "exec",
46
+ "dbos-db",
47
+ "psql",
48
+ "-U",
49
+ "postgres",
50
+ "-c",
51
+ "SELECT 1;",
52
+ ],
53
+ check=True,
54
+ capture_output=True,
55
+ )
56
+ print("PostgreSQL started!")
57
+ print("Database started successfully!")
58
+ break
59
+ except subprocess.CalledProcessError:
60
+ attempts -= 1
61
+ time.sleep(1)
62
+
63
+ if attempts == 0:
64
+ print("Failed to start PostgreSQL.")
65
+
66
+ except subprocess.CalledProcessError as error:
67
+ print(f"Error starting PostgreSQL in Docker: {error}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbos
3
- Version: 1.13.0a7
3
+ Version: 1.13.0a8
4
4
  Summary: Ultra-lightweight durable execution in Python
5
5
  Author-Email: "DBOS, Inc." <contact@dbos.dev>
6
6
  License: MIT
@@ -1,7 +1,7 @@
1
- dbos-1.13.0a7.dist-info/METADATA,sha256=cqQQNrFsEmPBW7VJC40n6ieoNOd2Amm3CbDsM_Og2is,13268
2
- dbos-1.13.0a7.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
- dbos-1.13.0a7.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
4
- dbos-1.13.0a7.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
1
+ dbos-1.13.0a8.dist-info/METADATA,sha256=xHerLqbu56YFzOpgA2dPx8h2eDosOUDXhRkNTd7z56U,13268
2
+ dbos-1.13.0a8.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
+ dbos-1.13.0a8.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
4
+ dbos-1.13.0a8.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
5
5
  dbos/__init__.py,sha256=NssPCubaBxdiKarOWa-wViz1hdJSkmBGcpLX_gQ4NeA,891
6
6
  dbos/__main__.py,sha256=G7Exn-MhGrVJVDbgNlpzhfh8WMX_72t3_oJaFT9Lmt8,653
7
7
  dbos/_admin_server.py,sha256=e8ELhcDWqR3_PNobnNgUvLGh5lzZq0yFSF6dvtzoQRI,16267
@@ -64,6 +64,7 @@ dbos/_templates/dbos-db-starter/dbos-config.yaml.dbos,sha256=0wPktElM7kMB3OPHTXw
64
64
  dbos/_templates/dbos-db-starter/migrations/env.py.dbos,sha256=IBB_gz9RjC20HPfOTGZzS6kTbv3jXhiOrnWpbJNk1Gk,2509
65
65
  dbos/_templates/dbos-db-starter/migrations/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
66
66
  dbos/_templates/dbos-db-starter/migrations/versions/2024_07_31_180642_init.py,sha256=MpS7LGaJS0CpvsjhfDkp9EJqvMvVCjRPfUp4c0aE2ys,941
67
+ dbos/_templates/dbos-db-starter/start_postgres_docker.py,sha256=lQVLlYO5YkhGPEgPqwGc7Y8uDKse9HsWv5fynJEFJHM,1681
67
68
  dbos/_tracer.py,sha256=8aOAVTBnj2q9DcOb5KJCfo56CVZ1ZvsWBscaNlIX-7k,3150
68
69
  dbos/_utils.py,sha256=ZdoM1MDbHnlJrh31zfhp3iX62bAxK1kyvMwXnltC_84,1779
69
70
  dbos/_workflow_commands.py,sha256=EmmAaQfRWeOZm_WPTznuU-O3he3jiSzzT9VpYrhxugE,4835
@@ -74,4 +75,4 @@ dbos/cli/migration.py,sha256=5GiyagLZkyVvDz3StYxtFdkFoKFCmh6eSXjzsIGhZ_A,3330
74
75
  dbos/dbos-config.schema.json,sha256=LyUT1DOTaAwOP6suxQGS5KemVIqXGPyu_q7Hbo0neA8,6192
75
76
  dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
76
77
  version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
77
- dbos-1.13.0a7.dist-info/RECORD,,
78
+ dbos-1.13.0a8.dist-info/RECORD,,