dbos 0.10.0a0__tar.gz → 0.10.0a1__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.10.0a0 → dbos-0.10.0a1}/PKG-INFO +1 -1
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/dbos-config.schema.json +4 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/dbos_config.py +7 -1
- {dbos-0.10.0a0 → dbos-0.10.0a1}/pyproject.toml +1 -1
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_config.py +34 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/LICENSE +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/README.md +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/__init__.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/admin_sever.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/application_database.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/cli.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/context.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/core.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/dbos.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/decorators.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/error.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/fastapi.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/flask.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/kafka.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/kafka_message.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/logger.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/migrations/env.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/migrations/script.py.mako +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/migrations/versions/50f3227f0b4b_fix_job_queue.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/migrations/versions/5c361fc04708_added_system_tables.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/migrations/versions/a3b18ad34abe_added_triggers.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/migrations/versions/d76646551a6b_job_queue_limiter.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/migrations/versions/d76646551a6c_workflow_queue.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/migrations/versions/eab0cc1d9a14_job_queue.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/py.typed +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/queue.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/recovery.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/registrations.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/request.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/roles.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/scheduler/croniter.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/scheduler/scheduler.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/schemas/__init__.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/schemas/application_database.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/schemas/system_database.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/system_database.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/templates/hello/README.md +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/templates/hello/__package/__init__.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/templates/hello/__package/main.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/templates/hello/__package/schema.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/templates/hello/alembic.ini +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/templates/hello/dbos-config.yaml.dbos +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/templates/hello/migrations/env.py.dbos +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/templates/hello/migrations/script.py.mako +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/templates/hello/migrations/versions/2024_07_31_180642_init.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/templates/hello/start_postgres_docker.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/tracer.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/utils.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/__init__.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/atexit_no_ctor.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/atexit_no_launch.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/classdefs.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/conftest.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/more_classdefs.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/scheduler/test_croniter.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/scheduler/test_scheduler.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_admin_server.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_classdecorators.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_concurrency.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_dbos.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_failures.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_fastapi.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_fastapi_roles.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_flask.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_kafka.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_package.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_queue.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_schema_migration.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/tests/test_singleton.py +0 -0
- {dbos-0.10.0a0 → dbos-0.10.0a1}/version/__init__.py +0 -0
|
@@ -59,6 +59,10 @@
|
|
|
59
59
|
"type": "string",
|
|
60
60
|
"description": "If using SSL/TLS to securely connect to a database, path to an SSL root certificate file"
|
|
61
61
|
},
|
|
62
|
+
"local_suffix": {
|
|
63
|
+
"type": "boolean",
|
|
64
|
+
"description": "Whether to suffix app_db_name with '_local'. Set to true when doing local development using a DBOS Cloud database."
|
|
65
|
+
},
|
|
62
66
|
"app_db_client": {
|
|
63
67
|
"type": "string",
|
|
64
68
|
"description": "Specify the database client to use to connect to the application database",
|
|
@@ -2,7 +2,7 @@ import json
|
|
|
2
2
|
import os
|
|
3
3
|
import re
|
|
4
4
|
from importlib import resources
|
|
5
|
-
from typing import Any, Dict, List, Optional, TypedDict
|
|
5
|
+
from typing import Any, Dict, List, Optional, TypedDict, cast
|
|
6
6
|
|
|
7
7
|
import yaml
|
|
8
8
|
from jsonschema import ValidationError, validate
|
|
@@ -27,6 +27,7 @@ class DatabaseConfig(TypedDict, total=False):
|
|
|
27
27
|
sys_db_name: Optional[str]
|
|
28
28
|
ssl: Optional[bool]
|
|
29
29
|
ssl_ca: Optional[str]
|
|
30
|
+
local_suffix: Optional[bool]
|
|
30
31
|
app_db_client: Optional[str]
|
|
31
32
|
migrate: Optional[List[str]]
|
|
32
33
|
rollback: Optional[List[str]]
|
|
@@ -164,6 +165,11 @@ def load_config(config_file_path: str = "dbos-config.yaml") -> ConfigFile:
|
|
|
164
165
|
if "runtimeConfig" not in data or "start" not in data["runtimeConfig"]:
|
|
165
166
|
raise DBOSInitializationError(f"dbos-config.yaml must specify a start command")
|
|
166
167
|
|
|
168
|
+
data = cast(ConfigFile, data)
|
|
169
|
+
|
|
170
|
+
if "local_suffix" in data["database"] and data["database"]["local_suffix"]:
|
|
171
|
+
data["database"]["app_db_name"] = f"{data['database']['app_db_name']}_local"
|
|
172
|
+
|
|
167
173
|
# Return data as ConfigFile type
|
|
168
174
|
return data # type: ignore
|
|
169
175
|
|
|
@@ -197,3 +197,37 @@ def test_config_no_start(mocker):
|
|
|
197
197
|
load_config(mock_filename)
|
|
198
198
|
|
|
199
199
|
assert "start command" in str(exc_info.value)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def test_local_config(mocker):
|
|
203
|
+
mock_config = """
|
|
204
|
+
name: "some app"
|
|
205
|
+
language: "python"
|
|
206
|
+
runtimeConfig:
|
|
207
|
+
start:
|
|
208
|
+
- "python3 main.py"
|
|
209
|
+
admin_port: 8001
|
|
210
|
+
database:
|
|
211
|
+
hostname: 'some host'
|
|
212
|
+
port: 1234
|
|
213
|
+
username: 'some user'
|
|
214
|
+
password: ${PGPASSWORD}
|
|
215
|
+
app_db_name: 'some_db'
|
|
216
|
+
connectionTimeoutMillis: 3000
|
|
217
|
+
local_suffix: true
|
|
218
|
+
"""
|
|
219
|
+
os.environ["BARBAR"] = "FOOFOO"
|
|
220
|
+
mocker.patch(
|
|
221
|
+
"builtins.open", side_effect=generate_mock_open(mock_filename, mock_config)
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
configFile = load_config(mock_filename)
|
|
225
|
+
assert configFile["name"] == "some app"
|
|
226
|
+
assert configFile["database"]["local_suffix"] == True
|
|
227
|
+
assert configFile["language"] == "python"
|
|
228
|
+
assert configFile["database"]["hostname"] == "some host"
|
|
229
|
+
assert configFile["database"]["port"] == 1234
|
|
230
|
+
assert configFile["database"]["username"] == "some user"
|
|
231
|
+
assert configFile["database"]["password"] == os.environ["PGPASSWORD"]
|
|
232
|
+
assert configFile["database"]["app_db_name"] == "some_db_local"
|
|
233
|
+
assert configFile["database"]["connectionTimeoutMillis"] == 3000
|
|
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
|
{dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/migrations/versions/5c361fc04708_added_system_tables.py
RENAMED
|
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
|
{dbos-0.10.0a0 → dbos-0.10.0a1}/dbos/templates/hello/migrations/versions/2024_07_31_180642_init.py
RENAMED
|
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
|