dbos 0.9.0a1__tar.gz → 0.10.0a0__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.
Files changed (75) hide show
  1. {dbos-0.9.0a1 → dbos-0.10.0a0}/PKG-INFO +1 -1
  2. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/dbos-config.schema.json +4 -0
  3. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/dbos.py +4 -1
  4. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/dbos_config.py +1 -0
  5. {dbos-0.9.0a1 → dbos-0.10.0a0}/pyproject.toml +1 -1
  6. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_admin_server.py +36 -0
  7. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_config.py +1 -0
  8. {dbos-0.9.0a1 → dbos-0.10.0a0}/LICENSE +0 -0
  9. {dbos-0.9.0a1 → dbos-0.10.0a0}/README.md +0 -0
  10. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/__init__.py +0 -0
  11. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/admin_sever.py +0 -0
  12. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/application_database.py +0 -0
  13. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/cli.py +0 -0
  14. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/context.py +0 -0
  15. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/core.py +0 -0
  16. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/decorators.py +0 -0
  17. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/error.py +0 -0
  18. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/fastapi.py +0 -0
  19. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/flask.py +0 -0
  20. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/kafka.py +0 -0
  21. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/kafka_message.py +0 -0
  22. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/logger.py +0 -0
  23. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/migrations/env.py +0 -0
  24. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/migrations/script.py.mako +0 -0
  25. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/migrations/versions/50f3227f0b4b_fix_job_queue.py +0 -0
  26. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/migrations/versions/5c361fc04708_added_system_tables.py +0 -0
  27. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/migrations/versions/a3b18ad34abe_added_triggers.py +0 -0
  28. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/migrations/versions/d76646551a6b_job_queue_limiter.py +0 -0
  29. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/migrations/versions/d76646551a6c_workflow_queue.py +0 -0
  30. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/migrations/versions/eab0cc1d9a14_job_queue.py +0 -0
  31. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/py.typed +0 -0
  32. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/queue.py +0 -0
  33. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/recovery.py +0 -0
  34. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/registrations.py +0 -0
  35. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/request.py +0 -0
  36. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/roles.py +0 -0
  37. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/scheduler/croniter.py +0 -0
  38. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/scheduler/scheduler.py +0 -0
  39. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/schemas/__init__.py +0 -0
  40. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/schemas/application_database.py +0 -0
  41. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/schemas/system_database.py +0 -0
  42. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/system_database.py +0 -0
  43. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/templates/hello/README.md +0 -0
  44. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/templates/hello/__package/__init__.py +0 -0
  45. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/templates/hello/__package/main.py +0 -0
  46. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/templates/hello/__package/schema.py +0 -0
  47. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/templates/hello/alembic.ini +0 -0
  48. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/templates/hello/dbos-config.yaml.dbos +0 -0
  49. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/templates/hello/migrations/env.py.dbos +0 -0
  50. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/templates/hello/migrations/script.py.mako +0 -0
  51. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/templates/hello/migrations/versions/2024_07_31_180642_init.py +0 -0
  52. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/templates/hello/start_postgres_docker.py +0 -0
  53. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/tracer.py +0 -0
  54. {dbos-0.9.0a1 → dbos-0.10.0a0}/dbos/utils.py +0 -0
  55. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/__init__.py +0 -0
  56. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/atexit_no_ctor.py +0 -0
  57. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/atexit_no_launch.py +0 -0
  58. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/classdefs.py +0 -0
  59. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/conftest.py +0 -0
  60. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/more_classdefs.py +0 -0
  61. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/scheduler/test_croniter.py +0 -0
  62. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/scheduler/test_scheduler.py +0 -0
  63. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_classdecorators.py +0 -0
  64. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_concurrency.py +0 -0
  65. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_dbos.py +0 -0
  66. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_failures.py +0 -0
  67. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_fastapi.py +0 -0
  68. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_fastapi_roles.py +0 -0
  69. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_flask.py +0 -0
  70. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_kafka.py +0 -0
  71. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_package.py +0 -0
  72. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_queue.py +0 -0
  73. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_schema_migration.py +0 -0
  74. {dbos-0.9.0a1 → dbos-0.10.0a0}/tests/test_singleton.py +0 -0
  75. {dbos-0.9.0a1 → dbos-0.10.0a0}/version/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbos
3
- Version: 0.9.0a1
3
+ Version: 0.10.0a0
4
4
  Summary: Ultra-lightweight durable execution in Python
5
5
  Author-Email: "DBOS, Inc." <contact@dbos.dev>
6
6
  License: MIT
@@ -140,6 +140,10 @@
140
140
  "start": {
141
141
  "type": "array",
142
142
  "description": "Specify commands to run to start your application (Python only)"
143
+ },
144
+ "admin_port": {
145
+ "type": "number",
146
+ "description": "The port number of the admin server (Default: 3001)"
143
147
  }
144
148
  }
145
149
  },
@@ -348,7 +348,10 @@ class DBOS:
348
348
  self._executor_field = ThreadPoolExecutor(max_workers=64)
349
349
  self._sys_db_field = SystemDatabase(self.config)
350
350
  self._app_db_field = ApplicationDatabase(self.config)
351
- self._admin_server_field = AdminServer(dbos=self)
351
+ admin_port = self.config["runtimeConfig"].get("admin_port")
352
+ if admin_port is None:
353
+ admin_port = 3001
354
+ self._admin_server_field = AdminServer(dbos=self, port=admin_port)
352
355
 
353
356
  if not os.environ.get("DBOS__VMID"):
354
357
  workflow_ids = self._sys_db.get_pending_workflows("local")
@@ -14,6 +14,7 @@ from dbos.logger import dbos_logger
14
14
 
15
15
  class RuntimeConfig(TypedDict, total=False):
16
16
  start: List[str]
17
+ admin_port: Optional[int]
17
18
 
18
19
 
19
20
  class DatabaseConfig(TypedDict, total=False):
@@ -23,7 +23,7 @@ dependencies = [
23
23
  ]
24
24
  requires-python = ">=3.9"
25
25
  readme = "README.md"
26
- version = "0.9.0a1"
26
+ version = "0.10.0a0"
27
27
 
28
28
  [project.license]
29
29
  text = "MIT"
@@ -123,3 +123,39 @@ def test_admin_recovery(dbos: DBOS) -> None:
123
123
  time.sleep(1)
124
124
  print(f"Attempt {attempt + 1} failed. Retrying in 1 second...")
125
125
  assert succeeded, "Workflow did not recover"
126
+
127
+
128
+ def test_admin_diff_port(cleanup_test_databases: None) -> None:
129
+ # Initialize singleton
130
+ DBOS.destroy() # In case of other tests leaving it
131
+
132
+ config_string = """name: test-app
133
+ language: python
134
+ database:
135
+ hostname: localhost
136
+ port: 5432
137
+ username: postgres
138
+ password: ${PGPASSWORD}
139
+ app_db_name: dbostestpy
140
+ runtimeConfig:
141
+ start:
142
+ - python3 main.py
143
+ admin_port: 8001
144
+ """
145
+ # Write the config to a text file for the moment
146
+ with open("dbos-config.yaml", "w") as file:
147
+ file.write(config_string)
148
+
149
+ try:
150
+ # Initialize DBOS
151
+ DBOS()
152
+ DBOS.launch()
153
+
154
+ # Test GET /dbos-healthz
155
+ response = requests.get("http://localhost:8001/dbos-healthz", timeout=5)
156
+ assert response.status_code == 200
157
+ assert response.text == "healthy"
158
+ finally:
159
+ # Clean up after the test
160
+ DBOS.destroy()
161
+ os.remove("dbos-config.yaml")
@@ -32,6 +32,7 @@ def test_valid_config(mocker):
32
32
  runtimeConfig:
33
33
  start:
34
34
  - "python3 main.py"
35
+ admin_port: 8001
35
36
  database:
36
37
  hostname: 'some host'
37
38
  port: 1234
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