LoggerOutputCommand:
class IPAHelperCompileStep(LoggerOutputCommandStep):
manifest_path: Path
target_path: Path
+ gate_type: GateType
+ stall_detection: bool
logger: loguru.Logger = field(repr=False)
status: ClassVar[Status] = Status.COMPILING
@classmethod
- def build_from_query(cls, query: IPAQuery):
+ def build_from_query(cls, query: IPAHelperQuery):
manifest_path = query.paths.repo_path / Path("Cargo.toml")
target_path = query.paths.repo_path / Path(f"target-{query.paths.commit_hash}")
+ gate_type = query.gate_type
+ stall_detection = query.stall_detection
return cls(
manifest_path=manifest_path,
target_path=target_path,
+ gate_type=gate_type,
+ stall_detection=stall_detection,
logger=query.logger,
)
def build_command(self) -> LoggerOutputCommand:
return LoggerOutputCommand(
cmd=f"cargo build --bin helper --manifest-path={self.manifest_path} "
- f'--features="web-app real-world-infra compact-gate stall-detection" '
+ f'--features="web-app real-world-infra {self.gate_type} '
+ f"{'stall-detection' if self.stall_detection else ''}\" "
f"--no-default-features --target-dir={self.target_path} "
f"--release",
logger=self.logger,
@@ -383,6 +396,8 @@ def build_command(self) -> LoggerOutputCommand:
@dataclass(kw_only=True)
class IPAHelperQuery(IPAQuery):
port: int
+ gate_type: GateType
+ stall_detection: bool
step_classes: ClassVar[list[type[Step]]] = [
IPACloneStep,
diff --git a/sidecar/app/routes/start.py b/sidecar/app/routes/start.py
index 2b42304..635da73 100644
--- a/sidecar/app/routes/start.py
+++ b/sidecar/app/routes/start.py
@@ -6,7 +6,7 @@
from ..local_paths import Paths
from ..query.base import Query
from ..query.demo_logger import DemoLoggerQuery
-from ..query.ipa import IPACoordinatorQuery, IPAHelperQuery
+from ..query.ipa import GateType, IPACoordinatorQuery, IPAHelperQuery
from ..query.step import Status
from ..settings import settings
@@ -39,6 +39,8 @@ def demo_logger(
def start_ipa_helper(
query_id: str,
commit_hash: Annotated[str, Form()],
+ gate_type: Annotated[str, Form()],
+ stall_detection: Annotated[bool, Form()],
background_tasks: BackgroundTasks,
):
role = settings.role
@@ -53,6 +55,8 @@ def start_ipa_helper(
query = IPAHelperQuery(
paths=paths,
query_id=query_id,
+ gate_type=GateType[gate_type.upper()],
+ stall_detection=stall_detection,
port=settings.helper_port,
)
background_tasks.add_task(query.start)