dbos 1.6.0a5__py3-none-any.whl → 1.7.0a2__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.
dbos/_admin_server.py CHANGED
@@ -3,12 +3,14 @@ from __future__ import annotations
3
3
  import json
4
4
  import re
5
5
  import threading
6
+ from dataclasses import asdict
6
7
  from functools import partial
7
8
  from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
8
9
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, TypedDict
9
10
 
10
11
  from dbos._workflow_commands import garbage_collect, global_timeout
11
12
 
13
+ from ._conductor import protocol as conductor_protocol
12
14
  from ._context import SetWorkflowID
13
15
  from ._error import DBOSException
14
16
  from ._logger import dbos_logger
@@ -326,20 +328,24 @@ class AdminRequestHandler(BaseHTTPRequestHandler):
326
328
 
327
329
  def _handle_workflows(self, filters: Dict[str, Any]) -> None:
328
330
  workflows = self.dbos.list_workflows(
329
- workflow_ids=filters.get("workflow_ids"),
330
- name=filters.get("name"),
331
+ workflow_ids=filters.get("workflow_uuids"),
332
+ user=filters.get("authenticated_user"),
331
333
  start_time=filters.get("start_time"),
332
334
  end_time=filters.get("end_time"),
333
335
  status=filters.get("status"),
334
336
  app_version=filters.get("application_version"),
337
+ name=filters.get("workflow_name"),
335
338
  limit=filters.get("limit"),
336
339
  offset=filters.get("offset"),
337
340
  sort_desc=filters.get("sort_desc", False),
338
341
  workflow_id_prefix=filters.get("workflow_id_prefix"),
339
342
  )
340
-
343
+ workflows_output = [
344
+ conductor_protocol.WorkflowsOutput.from_workflow_information(i)
345
+ for i in workflows
346
+ ]
341
347
  response_body = json.dumps(
342
- [workflow.__dict__ for workflow in workflows]
348
+ [workflow.__dict__ for workflow in workflows_output]
343
349
  ).encode("utf-8")
344
350
  self.send_response(200)
345
351
  self.send_header("Content-Type", "application/json")
@@ -349,18 +355,21 @@ class AdminRequestHandler(BaseHTTPRequestHandler):
349
355
 
350
356
  def _handle_queued_workflows(self, filters: Dict[str, Any]) -> None:
351
357
  workflows = self.dbos.list_queued_workflows(
352
- queue_name=filters.get("queue_name"),
353
- name=filters.get("name"),
354
358
  start_time=filters.get("start_time"),
355
359
  end_time=filters.get("end_time"),
356
360
  status=filters.get("status"),
361
+ name=filters.get("workflow_name"),
357
362
  limit=filters.get("limit"),
358
363
  offset=filters.get("offset"),
364
+ queue_name=filters.get("queue_name"),
359
365
  sort_desc=filters.get("sort_desc", False),
360
366
  )
361
-
367
+ workflows_output = [
368
+ conductor_protocol.WorkflowsOutput.from_workflow_information(i)
369
+ for i in workflows
370
+ ]
362
371
  response_body = json.dumps(
363
- [workflow.__dict__ for workflow in workflows]
372
+ [workflow.__dict__ for workflow in workflows_output]
364
373
  ).encode("utf-8")
365
374
  self.send_response(200)
366
375
  self.send_header("Content-Type", "application/json")
dbos/_dbos.py CHANGED
@@ -7,7 +7,6 @@ import inspect
7
7
  import os
8
8
  import sys
9
9
  import threading
10
- import traceback
11
10
  import uuid
12
11
  from concurrent.futures import ThreadPoolExecutor
13
12
  from logging import Logger
@@ -28,6 +27,7 @@ from typing import (
28
27
  )
29
28
 
30
29
  from opentelemetry.trace import Span
30
+ from rich import print
31
31
 
32
32
  from dbos._conductor.conductor import ConductorWebsocket
33
33
  from dbos._sys_db import WorkflowStatus
@@ -517,6 +517,16 @@ class DBOS:
517
517
 
518
518
  dbos_logger.info("DBOS launched!")
519
519
 
520
+ if self.conductor_key is None and os.environ.get("DBOS__CLOUD") != "true":
521
+ # Hint the user to open the URL to register and set up Conductor
522
+ app_name = self._config["name"]
523
+ conductor_registration_url = (
524
+ f"https://console.dbos.dev/self-host?appname={app_name}"
525
+ )
526
+ print(
527
+ f"[bold]To view and manage workflows, connect to DBOS Conductor at:[/bold] [bold blue]{conductor_registration_url}[/bold blue]"
528
+ )
529
+
520
530
  # Flush handlers and add OTLP to all loggers if enabled
521
531
  # to enable their export in DBOS Cloud
522
532
  for handler in dbos_logger.handlers:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbos
3
- Version: 1.6.0a5
3
+ Version: 1.7.0a2
4
4
  Summary: Ultra-lightweight durable execution in Python
5
5
  Author-Email: "DBOS, Inc." <contact@dbos.dev>
6
6
  License: MIT
@@ -1,10 +1,10 @@
1
- dbos-1.6.0a5.dist-info/METADATA,sha256=IVcP3LMYY56MWqRLSEYfDNyOyZC2Jn2N75esPSn_Ksc,13267
2
- dbos-1.6.0a5.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
- dbos-1.6.0a5.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
4
- dbos-1.6.0a5.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
1
+ dbos-1.7.0a2.dist-info/METADATA,sha256=cv0iRmtSfwgBhECvLi62ErKrKa0hbM4KW2YPX3UL4-A,13267
2
+ dbos-1.7.0a2.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
+ dbos-1.7.0a2.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
4
+ dbos-1.7.0a2.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
- dbos/_admin_server.py,sha256=l46ZX4NpvBP9W8cl9gE7OqMNwUCevLMt2VztM7crBv0,15465
7
+ dbos/_admin_server.py,sha256=86rL_aQmmi_zZ4a7PGVNbF6ey9tP27WC1wazQedFLWo,15927
8
8
  dbos/_app_db.py,sha256=htblDPfqrpb_uZoFcvaud7cgQ-PDyn6Bn-cBidxdCTA,10603
9
9
  dbos/_classproperty.py,sha256=f0X-_BySzn3yFDRKB2JpCbLYQ9tLwt1XftfshvY7CBs,626
10
10
  dbos/_client.py,sha256=DeiJHo5fTedWsipr7qlQQIcDmVAPjzzX94X01121oQM,14780
@@ -13,7 +13,7 @@ dbos/_conductor/protocol.py,sha256=DOTprPSd7oHDcvwWSyZpnlPds_JfILtcKzHZa-qBsF4,7
13
13
  dbos/_context.py,sha256=zhje6jObpBcRALYfHyyIEumHtk_enl_PxLl01j4oDME,24897
14
14
  dbos/_core.py,sha256=m3e1WZ_210p2DT8c1sTh4S_CVM748UjkBdiGO846mVg,49269
15
15
  dbos/_croniter.py,sha256=XHAyUyibs_59sJQfSNWkP7rqQY6_XrlfuuCxk4jYqek,47559
16
- dbos/_dbos.py,sha256=qzXD55bGJJW2SxI6HESykDRIpBmODNwIUt_jRkcRBVw,47588
16
+ dbos/_dbos.py,sha256=BprKIGPT-QDeoxtKM6kjRUK9dyF8sPCFfHIyIt0u7CE,48142
17
17
  dbos/_dbos_config.py,sha256=JUG4V1rrP0p1AYESgih4ea80qOH_13UsgoIIm8X84pw,20562
18
18
  dbos/_debug.py,sha256=99j2SChWmCPAlZoDmjsJGe77tpU2LEa8E2TtLAnnh7o,1831
19
19
  dbos/_docker_pg_helper.py,sha256=tLJXWqZ4S-ExcaPnxg_i6cVxL6ZxrYlZjaGsklY-s2I,6115
@@ -69,4 +69,4 @@ dbos/cli/cli.py,sha256=IcfaX4rrSrk6f24S2jrlR33snYMyNyEIx_lNQtuVr2E,22081
69
69
  dbos/dbos-config.schema.json,sha256=CjaspeYmOkx6Ip_pcxtmfXJTn_YGdSx_0pcPBF7KZmo,6060
70
70
  dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
71
71
  version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
72
- dbos-1.6.0a5.dist-info/RECORD,,
72
+ dbos-1.7.0a2.dist-info/RECORD,,
File without changes