Skip to content

Commit f5d4d1b

Browse files
committed
revert
Signed-off-by: oliver könig <[email protected]>
1 parent 4567def commit f5d4d1b

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

nemo_run/run/torchx_backend/schedulers/dgxcloud.py

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010

1111
import fiddle as fdl
1212
import fiddle._src.experimental.dataclasses as fdl_dc
13-
from torchx.schedulers.api import (AppDryRunInfo, DescribeAppResponse,
14-
ListAppResponse, Scheduler, Stream,
15-
split_lines)
16-
from torchx.specs import (AppDef, AppState, ReplicaStatus, Role, RoleStatus,
17-
runopts)
13+
from torchx.schedulers.api import (
14+
AppDryRunInfo,
15+
DescribeAppResponse,
16+
ListAppResponse,
17+
Scheduler,
18+
Stream,
19+
split_lines,
20+
)
21+
from torchx.specs import AppDef, AppState, ReplicaStatus, Role, RoleStatus, runopts
1822

1923
from nemo_run.config import get_nemorun_home
2024
from nemo_run.core.execution.base import Executor
@@ -180,22 +184,27 @@ def log_iter(
180184
stored_data = _get_job_dirs()
181185
job_info = stored_data.get(app_id)
182186
_, _, job_id = app_id.split("___")
183-
executor: Optional[DGXCloudExecutor] = job_info.get("executor", None) # type: ignore
187+
executor: DGXCloudExecutor = job_info.get("executor", None) # type: ignore
184188
if not executor:
185-
yield [""]
189+
return [""]
186190

187-
for fetched_log in executor.fetch_logs(
191+
for log in executor.fetch_logs(
188192
job_id=job_id,
189193
stream=should_tail,
190194
):
191-
if isinstance(fetched_log, str):
192-
if len(fetched_log) == 0:
193-
yield ""
195+
yield f"{log}\n"
196+
197+
logs = executor.fetch_logs(
198+
job_id=job_id,
199+
stream=should_tail,
200+
) # type: ignore
201+
if isinstance(logs, str):
202+
if len(logs) == 0:
203+
logs = []
194204
else:
195-
for splitted_line in split_lines(fetched_log):
196-
yield splitted_line
205+
logs = split_lines(logs)
197206

198-
yield fetched_log
207+
return logs
199208

200209
def _cancel_existing(self, app_id: str) -> None:
201210
"""

0 commit comments

Comments
 (0)