-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial skeleton of the local task runtime, with proofs of concept for docker container management, file path mapping, and I/O stdlib functions like `stdout()` and `write_lines()`.
- Loading branch information
Showing
11 changed files
with
926 additions
and
30 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# pyre-strict | ||
# misc utility functions... | ||
|
||
from typing import Tuple | ||
|
||
|
||
def strip_leading_whitespace(txt: str) -> Tuple[int, str]: | ||
# Given a multi-line string, determine the largest w such that each line | ||
# begins with at least w whitespace characters. Return w and the string | ||
# with w characters removed from the beginning of each line. | ||
lines = txt.split("\n") | ||
|
||
to_strip = None | ||
for line in lines: | ||
lsl = len(line.lstrip()) | ||
if lsl: | ||
c = len(line) - lsl | ||
assert c >= 0 | ||
if to_strip is None or to_strip > c: | ||
to_strip = c | ||
# TODO: do something about mixed tabs & spaces | ||
|
||
if not to_strip: | ||
return (0, txt) | ||
|
||
for i, line_i in enumerate(lines): | ||
if line_i.lstrip(): | ||
lines[i] = line_i[to_strip:] | ||
|
||
return (to_strip, "\n".join(lines)) |
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,3 @@ | ||
# pyre-strict | ||
import WDL.runtime.task | ||
from WDL.runtime.task import run_local_task |
Oops, something went wrong.