Skip to content

Commit 1505693

Browse files
committed
fix: remove used wait_ function
1 parent c3ab00f commit 1505693

5 files changed

Lines changed: 33 additions & 21 deletions

File tree

api/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ dependencies = [
77
"motia[otel]==1.0.0rc17",
88
"iii-sdk==0.2.0",
99
"pydantic>=2.0",
10+
"PyYAML>=6.0",
1011
]
1112

1213
[project.optional-dependencies]

api/steps/pegasus/01_verilog_api.step.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from motia import ApiRequest, ApiResponse, FlowContext, api
22

33
from utils.path import get_buckyball_path
4-
from utils.event_common import wait_for_result
54

65
config = {
76
"name": "Pegasus Verilog",
@@ -16,14 +15,11 @@ async def handler(req: ApiRequest, ctx: FlowContext) -> ApiResponse:
1615
bbdir = get_buckyball_path()
1716
body = req.body or {}
1817

19-
# Default config for Pegasus; allow override
2018
config_name = body.get("config", "sims.pegasus.PegasusConfig")
2119

2220
data = {
2321
"config": config_name,
2422
"output_dir": body.get("output_dir", f"{bbdir}/arch/build/pegasus/"),
2523
}
26-
2724
await ctx.enqueue({"topic": "pegasus.verilog", "data": {**data, "_trace_id": ctx.trace_id}})
28-
result = await wait_for_result(ctx)
29-
return result
25+
return ApiResponse(status=202, body={"trace_id": ctx.trace_id})

api/steps/pegasus/02_buildbitstream_api.step.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from motia import ApiRequest, ApiResponse, FlowContext, api
22

3-
from utils.event_common import wait_for_result
4-
53
config = {
64
"name": "Pegasus Buildbitstream",
75
"description": "build pegasus bitstream",
@@ -14,5 +12,4 @@
1412
async def handler(req: ApiRequest, ctx: FlowContext) -> ApiResponse:
1513
body = req.body or {}
1614
await ctx.enqueue({"topic": "pegasus.buildbitstream", "data": {**body, "_trace_id": ctx.trace_id}})
17-
result = await wait_for_result(ctx)
18-
return result
15+
return ApiResponse(status=202, body={"trace_id": ctx.trace_id})

api/steps/yosys/01_synth_api.step.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from motia import ApiRequest, ApiResponse, FlowContext, api
22

33
from utils.path import get_buckyball_path
4-
from utils.event_common import wait_for_result
54

65
config = {
76
"name": "Yosys Synth",
@@ -22,9 +21,4 @@ async def handler(req: ApiRequest, ctx: FlowContext) -> ApiResponse:
2221
"config": body.get("config"),
2322
}
2423
await ctx.enqueue({"topic": "yosys.synth", "data": {**data, "_trace_id": ctx.trace_id}})
25-
26-
# ==================================================================================
27-
# Wait for synthesis result
28-
# ==================================================================================
29-
result = await wait_for_result(ctx)
30-
return result
24+
return ApiResponse(status=202, body={"trace_id": ctx.trace_id})

bbdev

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,40 @@ def wait_for_http(url: str, check_fn, timeout: int, error_msg: str):
255255
return False
256256

257257

258+
_ENGINE_INFRA_MODULES = (
259+
"iii::modules::worker",
260+
"iii::modules::config",
261+
"iii::modules::rest_api",
262+
"iii::modules::api",
263+
"iii::modules::queue",
264+
"iii::modules::state",
265+
"iii::modules::pubsub",
266+
"iii::modules::shell",
267+
"iii::modules::telemetry",
268+
"iii::builtins",
269+
"iii::trigger",
270+
"iii::function",
271+
"function_name",
272+
"service_name",
273+
"iii::services",
274+
"iii::workers",
275+
"motia.runtime",
276+
"motia.tracing",
277+
"motia.cli",
278+
)
279+
280+
258281
def forward_iii_output(pipe, active_event: threading.Event, quiet: bool = False):
259-
"""Forward task output to stdout. In quiet mode, suppress engine INFO/WARN logs."""
282+
"""Forward task output to stdout. In quiet mode, suppress engine infrastructure logs."""
260283
for line in iter(pipe.readline, ""):
261284
if not active_event.is_set():
262285
continue
263286
if quiet:
264-
# Pass through: ANSI-colored step output and ERROR lines; drop engine INFO/WARN
265-
if line.startswith("\033[") or "[ERROR]" in line:
266-
sys.stdout.write(line)
267-
sys.stdout.flush()
287+
# Suppress engine infrastructure INFO/WARN; pass everything else
288+
if any(mod in line for mod in _ENGINE_INFRA_MODULES):
289+
continue
290+
sys.stdout.write(line)
291+
sys.stdout.flush()
268292
else:
269293
sys.stdout.write(line)
270294
sys.stdout.flush()

0 commit comments

Comments
 (0)