dbos 0.6.0a0__tar.gz → 0.6.0a3__tar.gz
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-0.6.0a0 → dbos-0.6.0a3}/PKG-INFO +19 -17
- {dbos-0.6.0a0 → dbos-0.6.0a3}/README.md +18 -16
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/templates/hello/__package/main.py +15 -22
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/templates/hello/__package/schema.py +2 -2
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/templates/hello/migrations/versions/2024_07_31_180642_init.py +2 -2
- {dbos-0.6.0a0 → dbos-0.6.0a3}/pyproject.toml +1 -1
- {dbos-0.6.0a0 → dbos-0.6.0a3}/LICENSE +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/__init__.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/admin_sever.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/application_database.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/cli.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/context.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/core.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/dbos-config.schema.json +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/dbos.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/dbos_config.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/decorators.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/error.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/fastapi.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/flask.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/logger.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/migrations/env.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/migrations/script.py.mako +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/migrations/versions/5c361fc04708_added_system_tables.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/migrations/versions/a3b18ad34abe_added_triggers.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/py.typed +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/recovery.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/registrations.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/request.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/roles.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/scheduler/croniter.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/scheduler/scheduler.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/schemas/__init__.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/schemas/application_database.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/schemas/system_database.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/system_database.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/templates/hello/README.md +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/templates/hello/__package/__init__.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/templates/hello/alembic.ini +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/templates/hello/dbos-config.yaml.dbos +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/templates/hello/migrations/env.py.dbos +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/templates/hello/migrations/script.py.mako +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/templates/hello/start_postgres_docker.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/tracer.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/utils.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/__init__.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/atexit_no_ctor.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/atexit_no_launch.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/classdefs.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/conftest.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/more_classdefs.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/scheduler/test_croniter.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/scheduler/test_scheduler.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_admin_server.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_classdecorators.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_concurrency.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_config.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_dbos.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_failures.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_fastapi.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_fastapi_roles.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_flask.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_package.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_schema_migration.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/tests/test_singleton.py +0 -0
- {dbos-0.6.0a0 → dbos-0.6.0a3}/version/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dbos
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.0a3
|
|
4
4
|
Summary: Ultra-lightweight durable execution in Python
|
|
5
5
|
Author-Email: "DBOS, Inc." <contact@dbos.dev>
|
|
6
6
|
License: MIT
|
|
@@ -21,20 +21,17 @@ Requires-Dist: psutil>=6.0.0
|
|
|
21
21
|
Requires-Dist: tomlkit>=0.13.2
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
|
|
24
|
-
## 🚀 DBOS Transact - Ultra-Lightweight Durable Execution in Python 🚀
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
<div align="center">
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
# DBOS Transact: Ultra-Lightweight Durable Execution
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
#### [Documentation](https://docs.dbos.dev/) • [Examples](https://docs.dbos.dev/examples) • [Github](https://github.com/dbos-inc) • [Discord](https://discord.com/invite/jsmC6pXGgX)
|
|
30
|
+
</div>
|
|
31
31
|
|
|
32
32
|
---
|
|
33
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.
|
|
34
|
+
DBOS Transact is a Python library providing **ultra-lightweight durable execution**.
|
|
38
35
|
For example:
|
|
39
36
|
|
|
40
37
|
```python
|
|
@@ -69,14 +66,14 @@ Some more cool features include:
|
|
|
69
66
|
|
|
70
67
|
## Getting Started
|
|
71
68
|
|
|
72
|
-
|
|
69
|
+
Install and configure with:
|
|
73
70
|
|
|
74
71
|
```shell
|
|
75
|
-
pip install
|
|
72
|
+
pip install dbos
|
|
76
73
|
dbos init --config
|
|
77
74
|
```
|
|
78
75
|
|
|
79
|
-
|
|
76
|
+
Then, try it out with this simple program (requires Postgres):
|
|
80
77
|
|
|
81
78
|
```python
|
|
82
79
|
from fastapi import FastAPI
|
|
@@ -106,22 +103,27 @@ def endpoint():
|
|
|
106
103
|
workflow()
|
|
107
104
|
```
|
|
108
105
|
|
|
109
|
-
Save the program into `main.py`,
|
|
110
|
-
Visit `localhost:8000` in your browser
|
|
106
|
+
Save the program into `main.py`, edit `dbos-config.yaml` to configure your Postgres connection settings, and start it with `fastapi run`.
|
|
107
|
+
Visit `localhost:8000` in your browser to start the workflow.
|
|
111
108
|
When prompted, press `Control + \` to force quit your application.
|
|
112
109
|
It should crash midway through the workflow, having completed step one but not step two.
|
|
113
110
|
Then, restart your app with `fastapi run`.
|
|
114
111
|
It should resume the workflow from where it left off, completing step two without re-executing step one.
|
|
115
112
|
|
|
116
|
-
To learn how to build more complex
|
|
113
|
+
To learn how to build more complex workflows, see our [programming guide](https://docs.dbos.dev/python/programming-guide) or [examples](https://docs.dbos.dev/examples).
|
|
117
114
|
|
|
118
115
|
## Documentation
|
|
119
116
|
|
|
120
|
-
|
|
117
|
+
[https://docs.dbos.dev](https://docs.dbos.dev)
|
|
121
118
|
|
|
122
119
|
## Examples
|
|
123
120
|
|
|
124
|
-
|
|
121
|
+
|
|
122
|
+
- [**AI-Powered Slackbot**](https://docs.dbos.dev/python/examples/rag-slackbot) — A Slackbot that answers questions about previous Slack conversations, using DBOS to durably orchestrate its RAG pipeline.
|
|
123
|
+
- [**Widget Store**](https://docs.dbos.dev/python/examples/widget-store) — An online storefront that uses DBOS durable workflows to be resilient to any failure.
|
|
124
|
+
- [**Earthquake Tracker**](https://docs.dbos.dev/python/examples/earthquake-tracker) — A real-time earthquake dashboard that uses DBOS to stream data from the USGS into Postgres, then visualizes it with Streamlit.
|
|
125
|
+
|
|
126
|
+
More examples [here](https://docs.dbos.dev/examples)!
|
|
125
127
|
|
|
126
128
|
## Community
|
|
127
129
|
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
## 🚀 DBOS Transact - Ultra-Lightweight Durable Execution in Python 🚀
|
|
2
1
|
|
|
3
|
-
|
|
2
|
+
<div align="center">
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
# DBOS Transact: Ultra-Lightweight Durable Execution
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
#### [Documentation](https://docs.dbos.dev/) • [Examples](https://docs.dbos.dev/examples) • [Github](https://github.com/dbos-inc) • [Discord](https://discord.com/invite/jsmC6pXGgX)
|
|
7
|
+
</div>
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
**DBOS Python is under construction! 🚧🚧🚧 Check back regularly for updates, release coming in mid-September!**
|
|
13
|
-
|
|
14
|
-
DBOS Transact is a **Python library** providing ultra-lightweight durable execution.
|
|
11
|
+
DBOS Transact is a Python library providing **ultra-lightweight durable execution**.
|
|
15
12
|
For example:
|
|
16
13
|
|
|
17
14
|
```python
|
|
@@ -46,14 +43,14 @@ Some more cool features include:
|
|
|
46
43
|
|
|
47
44
|
## Getting Started
|
|
48
45
|
|
|
49
|
-
|
|
46
|
+
Install and configure with:
|
|
50
47
|
|
|
51
48
|
```shell
|
|
52
|
-
pip install
|
|
49
|
+
pip install dbos
|
|
53
50
|
dbos init --config
|
|
54
51
|
```
|
|
55
52
|
|
|
56
|
-
|
|
53
|
+
Then, try it out with this simple program (requires Postgres):
|
|
57
54
|
|
|
58
55
|
```python
|
|
59
56
|
from fastapi import FastAPI
|
|
@@ -83,22 +80,27 @@ def endpoint():
|
|
|
83
80
|
workflow()
|
|
84
81
|
```
|
|
85
82
|
|
|
86
|
-
Save the program into `main.py`,
|
|
87
|
-
Visit `localhost:8000` in your browser
|
|
83
|
+
Save the program into `main.py`, edit `dbos-config.yaml` to configure your Postgres connection settings, and start it with `fastapi run`.
|
|
84
|
+
Visit `localhost:8000` in your browser to start the workflow.
|
|
88
85
|
When prompted, press `Control + \` to force quit your application.
|
|
89
86
|
It should crash midway through the workflow, having completed step one but not step two.
|
|
90
87
|
Then, restart your app with `fastapi run`.
|
|
91
88
|
It should resume the workflow from where it left off, completing step two without re-executing step one.
|
|
92
89
|
|
|
93
|
-
To learn how to build more complex
|
|
90
|
+
To learn how to build more complex workflows, see our [programming guide](https://docs.dbos.dev/python/programming-guide) or [examples](https://docs.dbos.dev/examples).
|
|
94
91
|
|
|
95
92
|
## Documentation
|
|
96
93
|
|
|
97
|
-
|
|
94
|
+
[https://docs.dbos.dev](https://docs.dbos.dev)
|
|
98
95
|
|
|
99
96
|
## Examples
|
|
100
97
|
|
|
101
|
-
|
|
98
|
+
|
|
99
|
+
- [**AI-Powered Slackbot**](https://docs.dbos.dev/python/examples/rag-slackbot) — A Slackbot that answers questions about previous Slack conversations, using DBOS to durably orchestrate its RAG pipeline.
|
|
100
|
+
- [**Widget Store**](https://docs.dbos.dev/python/examples/widget-store) — An online storefront that uses DBOS durable workflows to be resilient to any failure.
|
|
101
|
+
- [**Earthquake Tracker**](https://docs.dbos.dev/python/examples/earthquake-tracker) — A real-time earthquake dashboard that uses DBOS to stream data from the USGS into Postgres, then visualizes it with Streamlit.
|
|
102
|
+
|
|
103
|
+
More examples [here](https://docs.dbos.dev/examples)!
|
|
102
104
|
|
|
103
105
|
## Community
|
|
104
106
|
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# This is a sample app built with DBOS and FastAPI.
|
|
4
4
|
# It displays greetings to visitors and keeps track of how
|
|
5
|
-
# many times
|
|
5
|
+
# many times visitors have been greeted.
|
|
6
6
|
|
|
7
7
|
# First, let's do imports, create a FastAPI app, and initialize DBOS.
|
|
8
8
|
|
|
9
9
|
from fastapi import FastAPI
|
|
10
10
|
from fastapi.responses import HTMLResponse
|
|
11
|
-
from sqlalchemy.dialects.postgresql import insert
|
|
12
11
|
|
|
13
12
|
from dbos import DBOS
|
|
14
13
|
|
|
@@ -19,33 +18,26 @@ DBOS(fastapi=app)
|
|
|
19
18
|
|
|
20
19
|
# Next, let's write a function that greets visitors.
|
|
21
20
|
# To make it more interesting, we'll keep track of how
|
|
22
|
-
# many times
|
|
21
|
+
# many times visitors have been greeted and store
|
|
23
22
|
# the count in the database.
|
|
24
23
|
|
|
25
|
-
# We
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
24
|
+
# We implement the database operations using SQLAlchemy
|
|
25
|
+
# and serve the function from a FastAPI endpoint.
|
|
26
|
+
# We annotate it with @DBOS.transaction() to access
|
|
27
|
+
# an automatically-configured database client.
|
|
29
28
|
|
|
30
29
|
|
|
31
30
|
@app.get("/greeting/{name}")
|
|
32
31
|
@DBOS.transaction()
|
|
33
32
|
def example_transaction(name: str) -> str:
|
|
34
|
-
query = (
|
|
35
|
-
insert(dbos_hello)
|
|
36
|
-
.values(name="dbos", greet_count=1)
|
|
37
|
-
.on_conflict_do_update(
|
|
38
|
-
index_elements=["name"], set_={"greet_count": dbos_hello.c.greet_count + 1}
|
|
39
|
-
)
|
|
40
|
-
.returning(dbos_hello.c.greet_count)
|
|
41
|
-
)
|
|
33
|
+
query = dbos_hello.insert().values(name=name).returning(dbos_hello.c.greet_count)
|
|
42
34
|
greet_count = DBOS.sql_session.execute(query).scalar_one()
|
|
43
35
|
greeting = f"Greetings, {name}! You have been greeted {greet_count} times."
|
|
44
36
|
DBOS.logger.info(greeting)
|
|
45
37
|
return greeting
|
|
46
38
|
|
|
47
39
|
|
|
48
|
-
# Finally, let's use FastAPI to serve
|
|
40
|
+
# Finally, let's use FastAPI to serve an HTML + CSS readme
|
|
49
41
|
# from the root path.
|
|
50
42
|
|
|
51
43
|
|
|
@@ -74,13 +66,14 @@ def readme() -> HTMLResponse:
|
|
|
74
66
|
return HTMLResponse(readme)
|
|
75
67
|
|
|
76
68
|
|
|
77
|
-
# To run this app locally:
|
|
78
|
-
# - Make sure you have a Postgres database to connect
|
|
79
|
-
# - "dbos migrate" to set up your database tables
|
|
80
|
-
# - "dbos start" to start the app
|
|
81
|
-
# - Visit localhost:8000 to see your app!
|
|
82
|
-
|
|
83
69
|
# To deploy this app to DBOS Cloud:
|
|
84
70
|
# - "npm i -g @dbos-inc/dbos-cloud@latest" to install the Cloud CLI (requires Node)
|
|
85
71
|
# - "dbos-cloud app deploy" to deploy your app
|
|
86
72
|
# - Deploy outputs a URL--visit it to see your app!
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
# To run this app locally:
|
|
76
|
+
# - Make sure you have a Postgres database to connect to
|
|
77
|
+
# - "dbos migrate" to set up your database tables
|
|
78
|
+
# - "dbos start" to start the app
|
|
79
|
+
# - Visit localhost:8000 to see your app!
|
|
@@ -5,6 +5,6 @@ metadata = MetaData()
|
|
|
5
5
|
dbos_hello = Table(
|
|
6
6
|
"dbos_hello",
|
|
7
7
|
metadata,
|
|
8
|
-
Column("
|
|
9
|
-
Column("
|
|
8
|
+
Column("greet_count", Integer, primary_key=True, autoincrement=True),
|
|
9
|
+
Column("name", String, nullable=False),
|
|
10
10
|
)
|
{dbos-0.6.0a0 → dbos-0.6.0a3}/dbos/templates/hello/migrations/versions/2024_07_31_180642_init.py
RENAMED
|
@@ -22,9 +22,9 @@ def upgrade() -> None:
|
|
|
22
22
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
23
23
|
op.create_table(
|
|
24
24
|
"dbos_hello",
|
|
25
|
+
sa.Column("greet_count", sa.Integer(), autoincrement=True, nullable=False),
|
|
25
26
|
sa.Column("name", sa.String(), nullable=False),
|
|
26
|
-
sa.
|
|
27
|
-
sa.PrimaryKeyConstraint("name"),
|
|
27
|
+
sa.PrimaryKeyConstraint("greet_count"),
|
|
28
28
|
)
|
|
29
29
|
# ### end Alembic commands ###
|
|
30
30
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|