Skip to content

Commit 1331fea

Browse files
athith-guniqueg
andauthored
feat: update TES models to v1.1 (#179)
* 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]>
1 parent 0920812 commit 1331fea

File tree

1 file changed

+55
-2
lines changed

1 file changed

+55
-2
lines changed

pro_tes/ga4gh/tes/models.py

+55-2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ class TesExecutor(CustomBaseModel):
111111
),
112112
examples=[{"BLASTDB": "/data/GRC38", "HMMERDB": "/data/hmmer"}],
113113
)
114+
ignore_error: Optional[bool] = Field(
115+
default=None,
116+
description=(
117+
"Default behavior of running an array of executors is that "
118+
"execution stopson the first error. If `ignore_error` is `True`, "
119+
"then the runner will record error exit codes, but will continue "
120+
"on to the next tesExecutor."
121+
),
122+
)
114123

115124

116125
class TesExecutorLog(CustomBaseModel):
@@ -181,7 +190,7 @@ class TesInput(CustomBaseModel):
181190
),
182191
examples=["/data/file1"],
183192
)
184-
type: TesFileType
193+
type: Optional[TesFileType] = TesFileType.FILE
185194
content: Optional[str] = Field(
186195
default=None,
187196
description=(
@@ -191,6 +200,20 @@ class TesInput(CustomBaseModel):
191200
' "url" must be ignored.'
192201
),
193202
)
203+
streamable: Optional[bool] = Field(
204+
default=None,
205+
description=(
206+
"Indicate that a file resource could be accessed using a"
207+
" streaming interface, ie a FUSE mounted s3 object. This flag"
208+
" indicates that using a streaming mount, as opposed to "
209+
"downloading the whole file to the local scratch space, may be "
210+
"faster despite the latency and overhead. This does not mean that"
211+
" the backend will use a streaming interface, as it may not be "
212+
"provided by the vendor, but if the capacity is avalible it can "
213+
" be used without degrading the performance of the underlying"
214+
" program."
215+
),
216+
)
194217

195218

196219
class TesOutput(CustomBaseModel):
@@ -220,7 +243,7 @@ class TesOutput(CustomBaseModel):
220243
" absolute path."
221244
),
222245
)
223-
type: TesFileType
246+
type: Optional[TesFileType] = TesFileType.FILE
224247

225248

226249
class TesOutputFileLog(CustomBaseModel):
@@ -284,6 +307,34 @@ class TesResources(CustomBaseModel):
284307
),
285308
examples=["us-west-1"],
286309
)
310+
backend_parameters: Optional[dict[str, str]] = Field(
311+
default=None,
312+
description=(
313+
"Key/value pairs for backend configuration.ServiceInfo shall "
314+
"return a list of keys that a backend supports. Keys are case "
315+
"insensitive. It is expected that clients pass all runtime or "
316+
"hardware requirement key/values that are not mapped to existing"
317+
" tesResources properties to backend_parameters. Backends shall"
318+
" log system warnings if a key is passed that is unsupported. "
319+
"Backends shall not store or return unsupported keys if included "
320+
"in a task. If backend_parameters_strict equals true, backends "
321+
"should fail the task if any key/values are unsupported, "
322+
" otherwise, backends should attempt to run the task Intended "
323+
"uses include VM size selection, coprocessor configuration,"
324+
' etc. \nExample: ```\n{\n "backend_parameters" : {\n '
325+
'"VmSize" :"Standard_D64_v3"\n }\n}\n```'
326+
),
327+
examples=[{"VmSize": "Standard_D64_v3"}],
328+
)
329+
backend_parameters_strict: Optional[bool] = Field(
330+
default=False,
331+
description=(
332+
"If set to true, backends should fail the task if any"
333+
" backend_parameters key/values are unsupported, otherwise, "
334+
"backends should attempt to run the task"
335+
),
336+
examples=[False],
337+
)
287338

288339

289340
class Artifact(Enum):
@@ -434,6 +485,8 @@ class TesState(Enum):
434485
EXECUTOR_ERROR = "EXECUTOR_ERROR"
435486
SYSTEM_ERROR = "SYSTEM_ERROR"
436487
CANCELED = "CANCELED"
488+
PREEMPTED = "PREEMPTED"
489+
CANCELING = "CANCELING"
437490

438491

439492
class TesNextTes(CustomBaseModel):

0 commit comments

Comments
 (0)