Skip to content

Commit

Permalink
feat: update TES models to v1.1 (#179)
Browse files Browse the repository at this point in the history
* feat: add ignore_error to TesExecutor

* feat: add backend_parameters and backend_parameters_strict to TesResources

* feat: add new tesStates

* refactor: make TesFileType optional

* feat: add streamable to TesInput

* refactor: avoid string literal

* fix: shorten doc line lengths

* fix: change example to examples

---------

Co-authored-by: Alex Kanitz <[email protected]>
  • Loading branch information
athith-g and uniqueg authored Jul 22, 2024
1 parent 0920812 commit 1331fea
Showing 1 changed file with 55 additions and 2 deletions.
57 changes: 55 additions & 2 deletions pro_tes/ga4gh/tes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ 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 stopson the first error. If `ignore_error` is `True`, "
"then the runner will record error exit codes, but will continue "
"on to the next tesExecutor."
),
)


class TesExecutorLog(CustomBaseModel):
Expand Down Expand Up @@ -181,7 +190,7 @@ class TesInput(CustomBaseModel):
),
examples=["/data/file1"],
)
type: TesFileType
type: Optional[TesFileType] = TesFileType.FILE
content: Optional[str] = Field(
default=None,
description=(
Expand All @@ -191,6 +200,20 @@ 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 +243,7 @@ class TesOutput(CustomBaseModel):
" absolute path."
),
)
type: TesFileType
type: Optional[TesFileType] = TesFileType.FILE


class TesOutputFileLog(CustomBaseModel):
Expand Down Expand Up @@ -284,6 +307,34 @@ 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```'
),
examples=[{"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"
),
examples=[False],
)


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


class TesNextTes(CustomBaseModel):
Expand Down

0 comments on commit 1331fea

Please sign in to comment.