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

Update schemas to support async runs #477

Merged
merged 2 commits into from
Jul 31, 2024
Merged
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
18 changes: 12 additions & 6 deletions pipeline/cloud/schemas/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,16 @@ class ContainerRunError(BaseModel):

class ContainerRunCreate(BaseModel):
# run_id is optional since it's just used for attaching logs to a run
run_id: t.Optional[str]
inputs: t.List[RunInput]
run_id: str | None
inputs: list[RunInput]
async_run: bool = False
callback_url: str | None
rossgray marked this conversation as resolved.
Show resolved Hide resolved


class ContainerRunResult(BaseModel):
inputs: t.Optional[t.List[RunInput]]
outputs: t.Optional[t.List[RunOutput]]
error: t.Optional[ContainerRunError]
inputs: list[RunInput] | None
outputs: list[RunOutput] | None
error: ContainerRunError | None

def outputs_formatted(self) -> t.List[t.Any]:
outputs = self.outputs or []
Expand Down Expand Up @@ -319,10 +321,14 @@ class RunStateTransitions(BaseModel):
data: t.List[RunStateTransition]


class RunCreate(ContainerRunCreate):
class RunCreate(BaseModel):
# pipeline id or pointer
pipeline: str
inputs: list[RunInput]
async_run: bool = False
# flag to determine whether the run will wait for compute resources to be
# become available if none are currently running the pipeline
wait_for_resources: bool | None = None
# run_id is not used and should not be provided (it is kept here for
# backwards compatibility)
run_id: str | None = None
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pipeline-ai"
version = "2.5.0"
version = "2.5.1"
description = "Pipelines for machine learning workloads."
authors = [
"Paul Hetherington <ph@mystic.ai>",
Expand Down
Loading