dbos 0.5.0a11__py3-none-any.whl → 0.5.0a12__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 dbos might be problematic. Click here for more details.
- dbos/admin_sever.py +2 -2
- dbos/cli.py +19 -6
- dbos/system_database.py +1 -1
- dbos-0.5.0a12.dist-info/METADATA +130 -0
- {dbos-0.5.0a11.dist-info → dbos-0.5.0a12.dist-info}/RECORD +8 -8
- dbos-0.5.0a11.dist-info/METADATA +0 -78
- {dbos-0.5.0a11.dist-info → dbos-0.5.0a12.dist-info}/WHEEL +0 -0
- {dbos-0.5.0a11.dist-info → dbos-0.5.0a12.dist-info}/entry_points.txt +0 -0
- {dbos-0.5.0a11.dist-info → dbos-0.5.0a12.dist-info}/licenses/LICENSE +0 -0
dbos/admin_sever.py
CHANGED
|
@@ -28,11 +28,11 @@ class AdminServer:
|
|
|
28
28
|
self.server_thread = threading.Thread(target=self.server.serve_forever)
|
|
29
29
|
self.server_thread.daemon = True
|
|
30
30
|
|
|
31
|
-
dbos_logger.
|
|
31
|
+
dbos_logger.debug("Starting DBOS admin server on port %d", self.port)
|
|
32
32
|
self.server_thread.start()
|
|
33
33
|
|
|
34
34
|
def stop(self) -> None:
|
|
35
|
-
dbos_logger.
|
|
35
|
+
dbos_logger.debug("Stopping DBOS admin server")
|
|
36
36
|
self.server.shutdown()
|
|
37
37
|
self.server.server_close()
|
|
38
38
|
self.server_thread.join()
|
dbos/cli.py
CHANGED
|
@@ -119,7 +119,7 @@ def copy_template_dir(src_dir: str, dst_dir: str, ctx: dict[str, str]) -> None:
|
|
|
119
119
|
shutil.copy(src, dst)
|
|
120
120
|
|
|
121
121
|
|
|
122
|
-
def copy_template(src_dir: str, project_name: str) -> None:
|
|
122
|
+
def copy_template(src_dir: str, project_name: str, config_mode: bool) -> None:
|
|
123
123
|
|
|
124
124
|
dst_dir = path.abspath(".")
|
|
125
125
|
|
|
@@ -131,10 +131,17 @@ def copy_template(src_dir: str, project_name: str) -> None:
|
|
|
131
131
|
"db_name": db_name,
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
if config_mode:
|
|
135
|
+
copy_dbos_template(
|
|
136
|
+
os.path.join(src_dir, "dbos-config.yaml.dbos"),
|
|
137
|
+
os.path.join(dst_dir, "dbos-config.yaml"),
|
|
138
|
+
ctx,
|
|
139
|
+
)
|
|
140
|
+
else:
|
|
141
|
+
copy_template_dir(src_dir, dst_dir, ctx)
|
|
142
|
+
copy_template_dir(
|
|
143
|
+
path.join(src_dir, "__package"), path.join(dst_dir, package_name), ctx
|
|
144
|
+
)
|
|
138
145
|
|
|
139
146
|
|
|
140
147
|
def get_project_name() -> typing.Union[str, None]:
|
|
@@ -173,6 +180,10 @@ def init(
|
|
|
173
180
|
typing.Optional[str],
|
|
174
181
|
typer.Option("--template", "-t", help="Specify template to use"),
|
|
175
182
|
] = None,
|
|
183
|
+
config: Annotated[
|
|
184
|
+
bool,
|
|
185
|
+
typer.Option("--config", "-c", help="Only add dbos-config.yaml"),
|
|
186
|
+
] = False,
|
|
176
187
|
) -> None:
|
|
177
188
|
try:
|
|
178
189
|
if project_name is None:
|
|
@@ -199,7 +210,9 @@ def init(
|
|
|
199
210
|
if template not in templates:
|
|
200
211
|
raise Exception(f"template {template} not found in {templates_dir}")
|
|
201
212
|
|
|
202
|
-
copy_template(
|
|
213
|
+
copy_template(
|
|
214
|
+
path.join(templates_dir, template), project_name, config_mode=config
|
|
215
|
+
)
|
|
203
216
|
except Exception as e:
|
|
204
217
|
print(f"[red]{e}[/red]")
|
|
205
218
|
|
dbos/system_database.py
CHANGED
|
@@ -230,7 +230,7 @@ class SystemDatabase:
|
|
|
230
230
|
def wait_for_buffer_flush(self) -> None:
|
|
231
231
|
# Wait until the buffers are flushed.
|
|
232
232
|
while self._is_flushing_status_buffer or not self._is_buffers_empty:
|
|
233
|
-
dbos_logger.
|
|
233
|
+
dbos_logger.debug("Waiting for system buffers to be exported")
|
|
234
234
|
time.sleep(1)
|
|
235
235
|
|
|
236
236
|
def update_workflow_status(
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: dbos
|
|
3
|
+
Version: 0.5.0a12
|
|
4
|
+
Summary: Ultra-lightweight durable execution in Python
|
|
5
|
+
Author-Email: "DBOS, Inc." <contact@dbos.dev>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.9
|
|
8
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
9
|
+
Requires-Dist: jsonschema>=4.23.0
|
|
10
|
+
Requires-Dist: alembic>=1.13.2
|
|
11
|
+
Requires-Dist: psycopg2-binary>=2.9.9
|
|
12
|
+
Requires-Dist: typing-extensions>=4.12.2; python_version < "3.10"
|
|
13
|
+
Requires-Dist: typer>=0.12.3
|
|
14
|
+
Requires-Dist: jsonpickle>=3.2.2
|
|
15
|
+
Requires-Dist: opentelemetry-api>=1.26.0
|
|
16
|
+
Requires-Dist: opentelemetry-sdk>=1.26.0
|
|
17
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.26.0
|
|
18
|
+
Requires-Dist: python-dateutil>=2.9.0.post0
|
|
19
|
+
Requires-Dist: fastapi[standard]>=0.112.1
|
|
20
|
+
Requires-Dist: psutil>=6.0.0
|
|
21
|
+
Requires-Dist: tomlkit>=0.13.2
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
## 🚀 DBOS Transact - Ultra-Lightweight Durable Execution in Python 🚀
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
📚 **Documentation**: Under Construction 🚧
|
|
29
|
+
|
|
30
|
+
💬 **Join the Discussion**: [Discord Community](https://discord.gg/fMwQjeW5zg)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
**DBOS Python is under construction! 🚧🚧🚧 Check back regularly for updates, release coming in mid-September!**
|
|
36
|
+
|
|
37
|
+
DBOS Transact is a **Python library** providing ultra-lightweight durable execution.
|
|
38
|
+
For example:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
@DBOS.step()
|
|
42
|
+
def step_one():
|
|
43
|
+
...
|
|
44
|
+
|
|
45
|
+
@DBOS.step()
|
|
46
|
+
def step_two():
|
|
47
|
+
...
|
|
48
|
+
|
|
49
|
+
@DBOS.workflow()
|
|
50
|
+
def workflow()
|
|
51
|
+
step_one()
|
|
52
|
+
step_two()
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Durable execution means your program is **resilient to any failure**.
|
|
56
|
+
If it is ever interrupted or crashes, all your workflows will automatically resume from the last completed step.
|
|
57
|
+
If you want to see durable execution in action, check out [this demo app](https://demo-widget-store.cloud.dbos.dev/) (source code [here](https://github.com/dbos-inc/dbos-demo-apps/tree/main/python/widget-store)).
|
|
58
|
+
No matter how many times you try to crash it, it always resumes from exactly where it left off!
|
|
59
|
+
|
|
60
|
+
Under the hood, DBOS Transact works by storing your program's execution state (which workflows are currently executing and which steps they've completed) in a Postgres database.
|
|
61
|
+
So all you need to use it is a Postgres database to connect to—there's no need for a "workflow server."
|
|
62
|
+
This approach is also incredibly fast, for example [25x faster than AWS Step Functions](https://www.dbos.dev/blog/dbos-vs-aws-step-functions-benchmark).
|
|
63
|
+
|
|
64
|
+
Some more cool features include:
|
|
65
|
+
|
|
66
|
+
- Scheduled jobs—run your workflows exactly-once per time interval.
|
|
67
|
+
- Exactly-once event processing—use workflows to process incoming events (for example, from a Kafka topic) exactly-once.
|
|
68
|
+
- Observability—all workflows automatically emit [OpenTelemetry](https://opentelemetry.io/) traces.
|
|
69
|
+
|
|
70
|
+
## Getting Started
|
|
71
|
+
|
|
72
|
+
To try out the latest pre-release version, install and configure with:
|
|
73
|
+
|
|
74
|
+
```shell
|
|
75
|
+
pip install --pre dbos
|
|
76
|
+
dbos init --config
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Try it out with this simple program (requires Postgres):
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from fastapi import FastAPI
|
|
83
|
+
from dbos import DBOS
|
|
84
|
+
|
|
85
|
+
app = FastAPI()
|
|
86
|
+
DBOS(fastapi=app)
|
|
87
|
+
|
|
88
|
+
@DBOS.step()
|
|
89
|
+
def step_one():
|
|
90
|
+
print("Step one completed!")
|
|
91
|
+
|
|
92
|
+
@DBOS.step()
|
|
93
|
+
def step_two():
|
|
94
|
+
print("Step two completed!")
|
|
95
|
+
|
|
96
|
+
@DBOS.workflow()
|
|
97
|
+
def workflow():
|
|
98
|
+
step_one()
|
|
99
|
+
for _ in range(5):
|
|
100
|
+
print("Press Control + \ to stop the app...")
|
|
101
|
+
DBOS.sleep(1)
|
|
102
|
+
step_two()
|
|
103
|
+
|
|
104
|
+
@app.get("/")
|
|
105
|
+
def endpoint():
|
|
106
|
+
workflow()
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Save the program into `main.py`, tell it your local Postgres password via `export PGPASSWORD=<your password>` and start it with `fastapi run`.
|
|
110
|
+
Visit `localhost:8000` in your browser (or curl it) to start the workflow.
|
|
111
|
+
When prompted, press `Control + \` to force quit your application.
|
|
112
|
+
It should crash midway through the workflow, having completed step one but not step two.
|
|
113
|
+
Then, restart your app with `fastapi run`.
|
|
114
|
+
It should resume the workflow from where it left off, completing step two without re-executing step one.
|
|
115
|
+
|
|
116
|
+
To learn how to build more complex examples, see our programming guide (coming soon).
|
|
117
|
+
|
|
118
|
+
## Documentation
|
|
119
|
+
|
|
120
|
+
Coming soon! 🚧
|
|
121
|
+
|
|
122
|
+
## Examples
|
|
123
|
+
|
|
124
|
+
Check out some cool demo apps here: [https://github.com/dbos-inc/dbos-demo-apps/tree/main/python](https://github.com/dbos-inc/dbos-demo-apps/tree/main/python)
|
|
125
|
+
|
|
126
|
+
## Community
|
|
127
|
+
|
|
128
|
+
If you're interested in building with us, please star our repository and join our community on [Discord](https://discord.gg/fMwQjeW5zg)!
|
|
129
|
+
If you see a bug or have a feature request, don't hesitate to open an issue here on GitHub.
|
|
130
|
+
If you're interested in contributing, check out our [contributions guide](./CONTRIBUTING.md).
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
dbos-0.5.
|
|
2
|
-
dbos-0.5.
|
|
3
|
-
dbos-0.5.
|
|
4
|
-
dbos-0.5.
|
|
1
|
+
dbos-0.5.0a12.dist-info/METADATA,sha256=w33L3epCZ1uqAdgc-4WZftuNGB61yVGSchxW_j13BFI,4444
|
|
2
|
+
dbos-0.5.0a12.dist-info/WHEEL,sha256=rSwsxJWe3vzyR5HCwjWXQruDgschpei4h_giTm0dJVE,90
|
|
3
|
+
dbos-0.5.0a12.dist-info/entry_points.txt,sha256=3PmOPbM4FYxEmggRRdJw0oAsiBzKR8U0yx7bmwUmMOM,39
|
|
4
|
+
dbos-0.5.0a12.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
|
|
5
5
|
dbos/__init__.py,sha256=X1LdP36NomDtvPfFwoMNtgXf81TO05jj7vltsp79UUw,787
|
|
6
|
-
dbos/admin_sever.py,sha256=
|
|
6
|
+
dbos/admin_sever.py,sha256=Qg5T3YRrbPW05PR_99yAaxgo1ugQrAp_uTeTqSfjm_k,3397
|
|
7
7
|
dbos/application_database.py,sha256=1K3kE96BgGi_QWOd2heXluyNTwFAwlUVuAR6JKKUqf0,5659
|
|
8
|
-
dbos/cli.py,sha256=
|
|
8
|
+
dbos/cli.py,sha256=YARlQiWHUwFni-fEOr0k5P_-pqPS4xkywj_B0oTMXn0,8318
|
|
9
9
|
dbos/context.py,sha256=qAVj_pAIV4YBOAbI0WCv-Roq7aNwPzAoj3CeQaVqlrU,15666
|
|
10
10
|
dbos/core.py,sha256=HfKnPpIaQqIBAHzP2hD67aSIchTHp87NgD21CcujKkE,28300
|
|
11
11
|
dbos/dbos-config.schema.json,sha256=azpfmoDZg7WfSy3kvIsk9iEiKB_-VZt03VEOoXJAkqE,5331
|
|
@@ -29,7 +29,7 @@ dbos/scheduler/scheduler.py,sha256=uO4_9jmWW2rLv1ODL3lc1cE_37ZaVTgnvmFx_FAlN50,1
|
|
|
29
29
|
dbos/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
30
|
dbos/schemas/application_database.py,sha256=q_Wr2XbiZNBYFkOtu7uKavo1T_cSOBblxKGHThYGGsY,962
|
|
31
31
|
dbos/schemas/system_database.py,sha256=5V3vqnEzry0Hn7ZbVS9Gs_dJKia8uX8p7mGC82Ru8rk,4303
|
|
32
|
-
dbos/system_database.py,sha256=
|
|
32
|
+
dbos/system_database.py,sha256=K2PYGRjXOJxhYW0_wDvu49CwE5L1HH_s0fAhHZw1HO8,39636
|
|
33
33
|
dbos/templates/hello/README.md,sha256=GhxhBj42wjTt1fWEtwNriHbJuKb66Vzu89G4pxNHw2g,930
|
|
34
34
|
dbos/templates/hello/__package/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
dbos/templates/hello/__package/main.py,sha256=LFN48qBWt-xsf21Cg1llf5Grr0e7Il_7lcyi60sK4ec,2984
|
|
@@ -43,4 +43,4 @@ dbos/templates/hello/start_postgres_docker.py,sha256=lQVLlYO5YkhGPEgPqwGc7Y8uDKs
|
|
|
43
43
|
dbos/tracer.py,sha256=RPW9oxmX9tSc0Yq7O-FAhpQWBg1QT7Ni1Q06uwhtNDk,2237
|
|
44
44
|
dbos/utils.py,sha256=hWj9iWDrby2cVEhb0pG-IdnrxLqP64NhkaWUXiLc8bA,402
|
|
45
45
|
version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
|
|
46
|
-
dbos-0.5.
|
|
46
|
+
dbos-0.5.0a12.dist-info/RECORD,,
|
dbos-0.5.0a11.dist-info/METADATA
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: dbos
|
|
3
|
-
Version: 0.5.0a11
|
|
4
|
-
Summary: A Python framework for backends that scale
|
|
5
|
-
Author-Email: "DBOS, Inc." <contact@dbos.dev>
|
|
6
|
-
License: MIT
|
|
7
|
-
Requires-Python: >=3.9
|
|
8
|
-
Requires-Dist: pyyaml>=6.0.2
|
|
9
|
-
Requires-Dist: jsonschema>=4.23.0
|
|
10
|
-
Requires-Dist: alembic>=1.13.2
|
|
11
|
-
Requires-Dist: psycopg2-binary>=2.9.9
|
|
12
|
-
Requires-Dist: typing-extensions>=4.12.2; python_version < "3.10"
|
|
13
|
-
Requires-Dist: typer>=0.12.3
|
|
14
|
-
Requires-Dist: jsonpickle>=3.2.2
|
|
15
|
-
Requires-Dist: opentelemetry-api>=1.26.0
|
|
16
|
-
Requires-Dist: opentelemetry-sdk>=1.26.0
|
|
17
|
-
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.26.0
|
|
18
|
-
Requires-Dist: python-dateutil>=2.9.0.post0
|
|
19
|
-
Requires-Dist: fastapi[standard]>=0.112.1
|
|
20
|
-
Requires-Dist: psutil>=6.0.0
|
|
21
|
-
Requires-Dist: tomlkit>=0.13.2
|
|
22
|
-
Description-Content-Type: text/markdown
|
|
23
|
-
|
|
24
|
-
# DBOS Transact Python
|
|
25
|
-
|
|
26
|
-
**DBOS Python is under construction! 🚧🚧🚧 Check back regularly for updates, release coming in mid-September!**
|
|
27
|
-
|
|
28
|
-
DBOS Transact is a **Python library** for building durable and scalable applications.
|
|
29
|
-
|
|
30
|
-
You want to use DBOS Transact in your application because you need:
|
|
31
|
-
|
|
32
|
-
- **Resilience to any failure**. If your app is interrupted for any reason, it automatically resumes from where it left off. Reliable message delivery is built in. Idempotency is built in.
|
|
33
|
-
- **Reliable event processing**. Need to consume Kafka events exactly-once? Just add one line of code to your app. Need to run a task exactly once per hour, day, or month? Just one more line of code.
|
|
34
|
-
- **Built-in observability**. Automatically emit [OpenTelemetry](https://opentelemetry.io/)-compatible logs and traces from any application. Query your app's history from the command line or with SQL.
|
|
35
|
-
- **Blazing-fast, developer-friendly serverless**. Develop your project locally and run it anywhere. When you're ready, [deploy it for free to DBOS Cloud](https://docs.dbos.dev/getting-started/quickstart#deploying-to-dbos-cloud) and we'll host it for you, [25x faster](https://www.dbos.dev/blog/dbos-vs-aws-step-functions-benchmark) and [15x cheaper](https://www.dbos.dev/blog/dbos-vs-lambda-cost) than AWS Lambda.
|
|
36
|
-
|
|
37
|
-
## Getting Started
|
|
38
|
-
|
|
39
|
-
To try out the latest pre-release version, install with:
|
|
40
|
-
|
|
41
|
-
```shell
|
|
42
|
-
pip install --pre dbos
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Documentation
|
|
46
|
-
|
|
47
|
-
Coming soon! 🚧
|
|
48
|
-
|
|
49
|
-
But we have some cool demo apps for you to check out: [https://github.com/dbos-inc/dbos-demo-apps/tree/main/python](https://github.com/dbos-inc/dbos-demo-apps/tree/main/python)
|
|
50
|
-
|
|
51
|
-
## Main Features
|
|
52
|
-
|
|
53
|
-
Here are some of the core features of DBOS Transact:
|
|
54
|
-
|
|
55
|
-
| Feature | Description
|
|
56
|
-
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
57
|
-
| [Transactions](https://www.dbos.dev/dbos-transact-python) | Easily and safely query your application database using [SQLAlchemy](https://www.sqlalchemy.org/) or raw SQL.
|
|
58
|
-
| [Workflows](https://www.dbos.dev/dbos-transact-python) | Reliable workflow orchestration—resume your program after any failure.
|
|
59
|
-
| [Idempotency](https://www.dbos.dev/dbos-transact-python) | Automatically make any request idempotent, so your requests happen exactly once.
|
|
60
|
-
| [Authentication and Authorization](https://www.dbos.dev/dbos-transact-python) | Secure your HTTP endpoints so only authorized users can access them.
|
|
61
|
-
| [Kafka Integration](https://www.dbos.dev/dbos-transact-python) | Consume Kafka messages exactly-once with transactions or workflows.
|
|
62
|
-
| [Scheduled Workflows](https://www.dbos.dev/dbos-transact-python) | Schedule your workflows to run exactly-once per time interval with cron-like syntax.
|
|
63
|
-
| [Self-Hosting](https://www.dbos.dev/dbos-transact-python) | Host your applications anywhere, as long as they have a Postgres database to connect to.
|
|
64
|
-
|
|
65
|
-
And DBOS Cloud:
|
|
66
|
-
|
|
67
|
-
| Feature | Description
|
|
68
|
-
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
69
|
-
| [Serverless App Deployment](https://docs.dbos.dev/cloud-tutorials/application-management) | Deploy apps to DBOS Cloud in minutes.
|
|
70
|
-
| [Interactive Time Travel](https://docs.dbos.dev/cloud-tutorials/interactive-timetravel) | Query your application database as of any past point in time.
|
|
71
|
-
| [Cloud Database Management](https://docs.dbos.dev/cloud-tutorials/database-management) | Provision cloud Postgres instances for your applications. Alternatively, [bring your own database](https://docs.dbos.dev/cloud-tutorials/byod-management).
|
|
72
|
-
| [Built-in Observability](https://docs.dbos.dev/cloud-tutorials/monitoring-dashboard) | Built-in log capture, request tracing, and dashboards.
|
|
73
|
-
|
|
74
|
-
## Community
|
|
75
|
-
|
|
76
|
-
If you're interested in building with us, please star our repository and join our community on [Discord](https://discord.gg/fMwQjeW5zg)!
|
|
77
|
-
If you see a bug or have a feature request, don't hesitate to open an issue here on GitHub.
|
|
78
|
-
If you're interested in contributing, check out our [contributions guide](./CONTRIBUTING.md).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|