bohr-agent-sdk 0.1.22__py3-none-any.whl → 0.1.24__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bohr-agent-sdk
3
- Version: 0.1.22
3
+ Version: 0.1.24
4
4
  Summary: SDK for scientific agents
5
5
  Home-page: https://github.com/dptech-corp/bohr-agent-sdk/
6
6
  Author: DP Technology
@@ -26,15 +26,15 @@ dp/agent/server/utils.py,sha256=8jgYZEW4XBp86AF2Km6QkwHltBmrnS-soTpHov7ZEJw,4501
26
26
  dp/agent/server/executor/__init__.py,sha256=s95M5qKQk39Yi9qaVJZhk_nfj54quSf7EDghR3OCFUA,248
27
27
  dp/agent/server/executor/base_executor.py,sha256=EFJBsYVYAvuRbiLAbLOwLTw3h7ScjN025xnSP4uJHrQ,2052
28
28
  dp/agent/server/executor/dispatcher_executor.py,sha256=urpzmKH_tBOgblBdJEa3y8eEhXqUDrdcdWCnUdJpfZk,9420
29
- dp/agent/server/executor/local_executor.py,sha256=9JEtZTEbKsmHAY5nsdLZ36gH5M_rSG6En0W9IrCUwm0,5803
29
+ dp/agent/server/executor/local_executor.py,sha256=wYCclNZFkLb3v7KpW1nCnupO8piBES-esYlDAuz86zk,6120
30
30
  dp/agent/server/storage/__init__.py,sha256=Sgsyp5hb0_hhIGugAPfQFzBHt_854rS_MuMuE3sn8Gs,389
31
31
  dp/agent/server/storage/base_storage.py,sha256=728-oNG6N8isV95gZVnyi4vTznJPJhSjxw9Gl5Y_y5o,2356
32
32
  dp/agent/server/storage/bohrium_storage.py,sha256=EsKX4dWWvZTn2TEhZv4zsvihfDK0mmPFecrln-Ytk40,10488
33
33
  dp/agent/server/storage/http_storage.py,sha256=KiySq7g9-iJr12XQCKKyJLn8wJoDnSRpQAR5_qPJ1ZU,1471
34
34
  dp/agent/server/storage/local_storage.py,sha256=t1wfjByjXew9ws3PuUxWxmZQ0-Wt1a6t4wmj3fW62GI,1352
35
35
  dp/agent/server/storage/oss_storage.py,sha256=pgjmi7Gir3Y5wkMDCvU4fvSls15fXT7Ax-h9MYHFPK0,3359
36
- bohr_agent_sdk-0.1.22.dist-info/METADATA,sha256=IyYt8bph_mRJ06nyUlf1BQnAm1HBIR2jssavB4nTrwU,6329
37
- bohr_agent_sdk-0.1.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
- bohr_agent_sdk-0.1.22.dist-info/entry_points.txt,sha256=5n5kneF5IbDQtoQ2WfF-QuBjDtsimJte9Rv9baSGgc0,86
39
- bohr_agent_sdk-0.1.22.dist-info/top_level.txt,sha256=87xLUDhu_1nQHoGLwlhJ6XlO7OsjILh6i1nX6ljFzDo,3
40
- bohr_agent_sdk-0.1.22.dist-info/RECORD,,
36
+ bohr_agent_sdk-0.1.24.dist-info/METADATA,sha256=kmGJv8gXvQUdMe_P2QOBp_gz0IeP5oe9VUjmdSsmuZo,6329
37
+ bohr_agent_sdk-0.1.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
+ bohr_agent_sdk-0.1.24.dist-info/entry_points.txt,sha256=5n5kneF5IbDQtoQ2WfF-QuBjDtsimJte9Rv9baSGgc0,86
39
+ bohr_agent_sdk-0.1.24.dist-info/top_level.txt,sha256=87xLUDhu_1nQHoGLwlhJ6XlO7OsjILh6i1nX6ljFzDo,3
40
+ bohr_agent_sdk-0.1.24.dist-info/RECORD,,
@@ -34,6 +34,8 @@ class Tee(io.TextIOBase):
34
34
 
35
35
  def wrapped_fn(fn, kwargs, redirect_file=None):
36
36
  pid = os.getpid()
37
+ # explicitly reload dflow config
38
+ reload_dflow_config()
37
39
  if redirect_file:
38
40
  stdout = sys.stdout
39
41
  flog = open(redirect_file, "w")
@@ -61,7 +63,8 @@ def reload_dflow_config():
61
63
  s3_config = sys.modules["dflow"].s3_config
62
64
  s3_config["storage_client"] = None
63
65
  importlib.reload(sys.modules["dflow.config"])
64
- if "dflow.plugins.bohrium" in sys.modules:
66
+ reload_bohrium = "dflow.plugins.bohrium" in sys.modules
67
+ if reload_bohrium:
65
68
  bohrium_config = sys.modules["dflow.plugins.bohrium"].config
66
69
  importlib.reload(sys.modules["dflow.plugins.bohrium"])
67
70
  importlib.reload(sys.modules["dflow"])
@@ -69,7 +72,7 @@ def reload_dflow_config():
69
72
  sys.modules["dflow"].config = config
70
73
  s3_config.update(sys.modules["dflow"].s3_config)
71
74
  sys.modules["dflow"].s3_config = s3_config
72
- if "dflow.plugins.bohrium" in sys.modules:
75
+ if reload_bohrium:
73
76
  bohrium_config.update(sys.modules["dflow.plugins.bohrium"].config)
74
77
  sys.modules["dflow.plugins.bohrium"].config = bohrium_config
75
78
 
@@ -127,7 +130,12 @@ class LocalExecutor(BaseExecutor):
127
130
  extra_info["workflow_link"] = wf_link
128
131
  break
129
132
  if not alive:
130
- break
133
+ if os.path.isfile("err"):
134
+ with open("err", "r") as f:
135
+ err_msg = f.read()
136
+ else:
137
+ err_msg = "No workflow submitted"
138
+ raise RuntimeError(err_msg)
131
139
  logger.info("Waiting workflow to be submitted")
132
140
  time.sleep(1)
133
141
  self.recover_env(old_env)
@@ -167,7 +175,7 @@ class LocalExecutor(BaseExecutor):
167
175
  os.environ["DP_AGENT_RUNNING_MODE"] = "1"
168
176
  old_env = self.set_env()
169
177
  try:
170
- # explicitly reload dflow config in sync mode
178
+ # explicitly reload dflow config
171
179
  reload_dflow_config()
172
180
  if inspect.iscoroutinefunction(fn):
173
181
  result = await fn(**kwargs)