Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runner timeout #65

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion reasoner_pydantic/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def constant(s: str):

class RunnerAllowList(BaseModel):
allowlist: Optional[HashableSequence[str]]
timeout: Optional[float]
_nonzero_allowlist = validator("allowlist", allow_reuse=True)(nonzero_validator)

class Config:
Expand All @@ -24,14 +25,22 @@ class Config:

class RunnerDenyList(BaseModel):
denylist: Optional[HashableSequence[str]]
timeout: Optional[float]
_nonzero_denylist = validator("denylist", allow_reuse=True)(nonzero_validator)

class Config:
extra = "forbid"


class RunnerTimeout(BaseModel):
timeout: Optional[float]

class Config:
extra = "forbid"


class RunnerParameters(BaseModel):
__root__: Optional[Union[RunnerAllowList, RunnerDenyList]]
__root__: Optional[Union[RunnerAllowList, RunnerDenyList, RunnerTimeout]]


class BaseOperation(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name="reasoner-pydantic",
version="4.1.1",
version="4.1.2",
author="Abrar Mesbah",
author_email="[email protected]",
url="https://github.com/TranslatorSRI/reasoner-pydantic",
Expand Down
6 changes: 4 additions & 2 deletions tests/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
{
"id": "fill",
"parameters": {"denylist": ["ARAX"]},
"runner_parameters": {"allowlist": ["ARAGORN"]},
"runner_parameters": {"allowlist": ["ARAGORN"], "timeout": 60.0},
},
{"id": "bind"},
{
"id": "bind",
"runner_parameters": {"denylist": ["ARAGORN"]}},
{
"id": "overlay_compute_ngd",
"parameters": {
Expand Down
Loading