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

feat: update TES models to v1.1 #179

Merged
merged 9 commits into from
Jul 22, 2024
54 changes: 52 additions & 2 deletions pro_tes/ga4gh/tes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ class TesExecutor(CustomBaseModel):
),
examples=[{"BLASTDB": "/data/GRC38", "HMMERDB": "/data/hmmer"}],
)
ignore_error: Optional[bool] = Field(
default=None,
description=(
"Default behavior of running an array of executors is that execution stops"
" on the first error. If `ignore_error` is `True`, then the runner will"
" record error exit codes, but will continue on to the next tesExecutor."
),
)
uniqueg marked this conversation as resolved.
Show resolved Hide resolved
uniqueg marked this conversation as resolved.
Show resolved Hide resolved
uniqueg marked this conversation as resolved.
Show resolved Hide resolved


class TesExecutorLog(CustomBaseModel):
Expand Down Expand Up @@ -181,7 +189,7 @@ class TesInput(CustomBaseModel):
),
examples=["/data/file1"],
)
type: TesFileType
type: Optional[TesFileType] = "FILE"
athith-g marked this conversation as resolved.
Show resolved Hide resolved
content: Optional[str] = Field(
default=None,
description=(
Expand All @@ -191,6 +199,19 @@ class TesInput(CustomBaseModel):
' "url" must be ignored.'
),
)
streamable: Optional[bool] = Field(
default=None,
description=(
"Indicate that a file resource could be accessed using a"
" streaming interface, ie a FUSE mounted s3 object. This flag indicates"
" that using a streaming mount, as opposed to downloading the whole file"
" to the local scratch space, may be faster despite the latency"
" and overhead. This does not mean that the backend will use a"
" streaming interface, as it may not be provided by the vendor, but if"
" the capacity is avalible it can be used without degrading"
" the performance of the underlying program."
),
)


class TesOutput(CustomBaseModel):
Expand Down Expand Up @@ -220,7 +241,7 @@ class TesOutput(CustomBaseModel):
" absolute path."
),
)
type: TesFileType
type: Optional[TesFileType] = "FILE"


class TesOutputFileLog(CustomBaseModel):
Expand Down Expand Up @@ -284,6 +305,33 @@ class TesResources(CustomBaseModel):
),
examples=["us-west-1"],
)
backend_parameters: Optional[dict[str, str]] = Field(
default=None,
description=(
"Key/value pairs for backend configuration.ServiceInfo shall return a"
" list of keys that a backend supports. Keys are case insensitive.It is"
" expected that clients pass all runtime or hardware requirement"
" key/values that are not mapped to existing tesResources properties to"
" backend_parameters. Backends shall log system warnings if a key is"
" passed that is unsupported. Backends shall not store or return"
" unsupported keys if included in a task. If backend_parameters_strict"
" equals true, backends should fail the task if any key/values are"
" unsupported, otherwise, backends should attempt to run the"
" task Intended uses include VM size selection, coprocessor configuration,"
' etc. \nExample: ```\n{\n "backend_parameters" : {\n "VmSize" :'
' "Standard_D64_v3"\n }\n}\n```'
),
example={"VmSize": "Standard_D64_v3"},
)
backend_parameters_strict: Optional[bool] = Field(
default=False,
description=(
"If set to true, backends should fail the task if any"
" backend_parameters key/values are unsupported, otherwise, backends"
" should attempt to run the task"
),
example=False,
)


class Artifact(Enum):
Expand Down Expand Up @@ -434,6 +482,8 @@ class TesState(Enum):
EXECUTOR_ERROR = "EXECUTOR_ERROR"
SYSTEM_ERROR = "SYSTEM_ERROR"
CANCELED = "CANCELED"
PREEMPTED = "PREEMPTED"
CANCELING = "CANCELING"


class TesNextTes(CustomBaseModel):
Expand Down
Loading