forked from DataBiosphere/toil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TES batch system prototype (DataBiosphere#3821)
* Start on a stub TES batch system * Fill in TES stub with code that should mostly work * Get jobs issued but be unable to poll them because of ohsu-comp-bio/py-tes#31 * Turn on (bring back?) Python 3.8 appliance since that matches my Python * Update to unreleased pytes that can understand an empty log * Accept the py-tes issues we cannot change * Change to testing py-tes that might tolerate newer dateutil * Fix all the MyPy errors except for py-tes not having stubs * Add hacked-up autogenerated stubs for py-tes public API * Fix missing TypeVar * Accept falsey responses because they are errors * Actually import URLError * Call test teardown and setup to fix DataBiosphere#3815 * Go find base class setup and teardown methods * Stop showing canceled TES tasks as updated jobs * Allow waiting and synthesize exit codes to get job running test to pass * Add classifiers and point at py-tes 0.4.2 code * Handle not having a prepare argument * Don't del from a set * Redesign batch system option parsing * Add TES variables to docs * Set up Funnel for the test stage that will need it * Actually fill in base Config from the environment * Lower logging levels * Cache Docker images we know to exist * Break off the Kubernetes executor for re-use * Use released py-tes * Don't clobber Config defaults * Parse whatever object type is there * Correct docstring * Prevent batch system plugin test from permanently adding a batch system * Tolerate new default of linkImports true whether we used argparse or not * Limit pool size to effective CPU count * Reorganize shared batch system options into one place * Fix other multiprocessing pools to not swamp the system * Clean up background server processes in a better way * Fix some pylint errors * Accept old names in both option setting functions * Emit a DeprecationWarning when using an old option field * Fix whitespace * Don't claim to work with Python 3.9 * Don't obey Funnel environment variables, only Toil ones * Rename batch system utility modules * Document when --statePollingWait ought to work * Explain why someone might --scale * Explain how someone might --scale * Drop toil- from job prefix * Don't require TES server to 404 * Type the environment * Only mount existing local paths * Stop early when looking for runtime when there's no start_time * Improve spelling * Actually save --statePollingWait docs * snake_case another batch system utility * Complete merge with 48db82e * Require pytz type hints which MyPy suddenly demands * Add back type: ignore somehow lost in f8d6778 * Don't add duplicate Python 3.8 tests * Revert "Add back type: ignore somehow lost in f8d6778" This reverts commit e5dc8b4. * Revert "Require pytz type hints which MyPy suddenly demands" This reverts commit 3baa621. * Add types-pytz again but as a dev dependency * Make sure to report tracebacks in the worker * Use more descriptive TypeVars * Stop making per-TES-workflow IDs and just use jobs' self-identified names
- Loading branch information
Showing
40 changed files
with
1,527 additions
and
451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from tes.models import CancelTaskRequest, CreateTaskResponse, GetTaskRequest, ListTasksRequest, ListTasksResponse, ServiceInfo, Task, strconv | ||
from tes.utils import TimeoutError, raise_for_status, unmarshal | ||
from typing import Any, Optional, Union | ||
|
||
def process_url(value: str) -> str: ... | ||
|
||
class HTTPClient: | ||
url: str = ... | ||
timeout: int = ... | ||
user: Optional[str] = ... | ||
password: Optional[str] = ... | ||
token: Optional[str] = ... | ||
def get_service_info(self) -> ServiceInfo: ... | ||
def create_task(self, task: Task) -> CreateTaskResponse: ... | ||
def get_task(self, task_id: str, view: str = ...) -> Task: ... | ||
def cancel_task(self, task_id: str) -> None: ... | ||
def list_tasks(self, view: str = ..., page_size: Optional[int] = ..., page_token: Optional[str] = ...) -> ListTasksResponse: ... | ||
def wait(self, task_id: str, timeout: Union[int, float, None] = ...) -> None: ... | ||
def __init__(self, url: str, timeout: Optional[int], user: Optional[str], password: Optional[str], token: Optional[str]) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
from typing import Any | ||
|
||
class Base: | ||
def as_dict(self, drop_empty: bool = ...) -> Dict[str, Any]: ... | ||
def as_json(self, drop_empty: bool = ...) -> str: ... | ||
def __init__(self) -> None: ... | ||
|
||
class Input(Base): | ||
url: Optional[str] = ... | ||
path: Optional[str] = ... | ||
type: str = ... | ||
name: Optional[str] = ... | ||
description: Optional[str] = ... | ||
content: Any = ... | ||
def __init__(self, url: Optional[str], path: Optional[str], type: Optional[str], name: Optional[str], description: Optional[str], content: Any) -> None: ... | ||
|
||
class Output(Base): | ||
url: Optional[str] = ... | ||
path: Optional[str] = ... | ||
type: str = ... | ||
name: Optional[str] = ... | ||
description: Optional[str] = ... | ||
def __init__(self, url: Optional[str], path: Optional[str], type: Optional[str], name: Optional[str], description: Optional[str]) -> None: ... | ||
|
||
class Resources(Base): | ||
cpu_cores: int = ... | ||
ram_gb: Union[float, int, None] = ... | ||
disk_gb: Union[float, int, None] = ... | ||
preemptible: Optional[bool] = ... | ||
zones: Optional[List[str]] = ... | ||
def __init__(self, cpu_cores: int, ram_gb: Union[float, int, None], disk_gb: Union[float, int, None], preemptible: Optional[bool], zones: Optional[List[str]]) -> None: ... | ||
|
||
class Executor(Base): | ||
image: str = ... | ||
command: str = ... | ||
workdir: Optional[str] = ... | ||
stdin: Optional[str] = ... | ||
stdout: Optional[str] = ... | ||
stderr: Optional[str] = ... | ||
env: Optional[Dict[str, str]] = ... | ||
def __init__(self, image: str, command: str, workdir: Optional[str], stdin: Optional[str], stdout: Optional[str], stderr: Optional[str], env: Optional[Dict[str, str]]) -> None: ... | ||
|
||
class ExecutorLog(Base): | ||
start_time: Optional[datetime] = ... | ||
end_time: Optional[datetime] = ... | ||
stdout: Optional[str] = ... | ||
stderr: Optional[str] = ... | ||
exit_code: Optional[int] = ... | ||
def __init__(self, start_time: Optional[datetime], end_time: Optional[datetime], stdout: Optional[str], stderr: Optional[str], exit_code: Optional[int]) -> None: ... | ||
|
||
class OutputFileLog(Base): | ||
url: Optional[str] = ... | ||
path: Optional[str] = ... | ||
size_bytes: Optional[int] = ... | ||
def __init__(self, url: Optional[str], path: Optional[str], size_bytes: Optional[int]) -> None: ... | ||
|
||
class TaskLog(Base): | ||
start_time: Optional[datetime] = ... | ||
end_time: Optional[datetime] = ... | ||
metadata: Optional[Dict[str, Any]] = ... | ||
logs: Optional[List[ExecutorLog]] = ... | ||
outputs: Optional[List[OutputFileLog]] = ... | ||
system_logs: Optional[List[str]] = ... | ||
def __init__(self, start_time: Optional[datetime], end_time: Optional[datetime], metadata: Optional[Dict[str, Any]], logs: Optional[List[ExecutorLog]], outputs: Optional[List[OutputFileLog]], system_logs: Optional[List[str]]) -> None: ... | ||
|
||
class Task(Base): | ||
id: Optional[str] = ... | ||
state: Optional[str] = ... | ||
name: Optional[str] = ... | ||
description: Optional[str] = ... | ||
inputs: Optional[List[Input]] = ... | ||
outputs: Optional[List[Output]] = ... | ||
resources: Optional[Resources] = ... | ||
executors: Optional[List[Executor]] = ... | ||
volumes: Optional[List[str]] = ... | ||
tags: Optional[List[str]] = ... | ||
logs: Optional[List[TaskLog]] = ... | ||
creation_time: Optional[datetime] = ... | ||
def is_valid(self) -> Tuple[bool, Optional[BaseException]]: ... | ||
def __init__(self, id: Optional[str], state: Optional[str], name: Optional[str], description: Optional[str], inputs: Optional[List[Input]], outputs: Optional[List[Output]], resources: Optional[Resources], executors: Optional[List[Executor]], volumes: Optional[List[str]], tags: Optional[List[str]], logs: Optional[List[TaskLog]], creation_time: Optional[datetime]) -> None: ... | ||
|
||
class GetTaskRequest(Base): | ||
id: Optional[str] = ... | ||
view: Optional[str] = ... | ||
def __init__(self, id: Optional[str], view: Optional[str]) -> None: ... | ||
|
||
class CreateTaskResponse(Base): | ||
id: Optional[str] = ... | ||
def __init__(self, id: Optional[str]) -> None: ... | ||
|
||
class ServiceInfoRequest(Base): | ||
def __init__(self) -> None: ... | ||
|
||
class ServiceInfo(Base): | ||
name: Optional[str] = ... | ||
doc: Optional[str] = ... | ||
storage: Optional[List[str]] = ... | ||
def __init__(self, name: Optional[str], doc: Optional[str], storage: Optional[List[str]]) -> None: ... | ||
|
||
class CancelTaskRequest(Base): | ||
id: Optional[str] = ... | ||
def __init__(self, id: Optional[str]) -> None: ... | ||
|
||
class CancelTaskResponse(Base): | ||
def __init__(self) -> None: ... | ||
|
||
class ListTasksRequest(Base): | ||
project: Optional[str] = ... | ||
name_prefix: Optional[str] = ... | ||
page_size: Optional[int] = ... | ||
page_token: Optional[str] = ... | ||
view: Optional[str] = ... | ||
def __init__(self, project: Optional[str], name_prefix: Optional[str], page_size: Optional[int], page_token: Optional[str], view: Optional[str]) -> None: ... | ||
|
||
class ListTasksResponse(Base): | ||
tasks: Optional[List[Task]] = ... | ||
next_page_token: Optional[str] = ... | ||
def __init__(self, tasks: Optional[List[Task]], next_page_token: Optional[str]) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.