Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
b0b1752
New aws jobstore.
DailyDreaming Oct 14, 2024
7dc1a7c
Update.
DailyDreaming Jan 24, 2025
06b7a40
Updates.
DailyDreaming Feb 3, 2025
4c12449
Linting.
DailyDreaming Mar 3, 2025
2900c99
Update.
DailyDreaming Mar 25, 2025
3a345dd
Update from master.
DailyDreaming Mar 25, 2025
9322285
Update.
DailyDreaming Mar 25, 2025
031bab4
Update and rebase.
DailyDreaming Mar 25, 2025
c58e025
Update and rebase.
DailyDreaming Mar 25, 2025
698b450
Assuage make docs's anger.
DailyDreaming Mar 25, 2025
b9f3cc8
Rebase.
DailyDreaming Mar 25, 2025
321a2c6
Some compat, some review comments.
DailyDreaming Mar 26, 2025
faf0581
Move boto imports.
DailyDreaming Mar 26, 2025
a9a8880
Update.
DailyDreaming Mar 27, 2025
082311d
Update comments, move imports, and update docstrings.
DailyDreaming Mar 31, 2025
0608622
Update imports.
DailyDreaming Apr 1, 2025
687b9b7
Merge branch 'master' into issues/964-aws-remove-sdb
DailyDreaming Apr 1, 2025
133fc26
Merge remote-tracking branch 'upstream/master' into issues/964-aws-re…
adamnovak Jul 24, 2025
0b2316b
Fix typing
adamnovak Jul 24, 2025
d778e1e
Enable type checking and fix utils typing
adamnovak Jul 24, 2025
aaf6085
Address code review comments, drop comments in docstrings, drop dupli…
adamnovak Jul 24, 2025
b99e462
Reformat and revise docs so docs build works
adamnovak Jul 24, 2025
56faabd
Merge remote-tracking branch 'upstream/master' into issues/964-aws-re…
adamnovak Jul 24, 2025
859dd2d
Quote possibly-unavailable types
adamnovak Jul 24, 2025
4631950
Make missing AWS modules produce ImportError and not NotImplementedError
adamnovak Jul 25, 2025
1f75eac
Stop trying to import the boto 2 error types
adamnovak Jul 25, 2025
3a643b7
Use the key function everywhere and deal with not having a log place …
adamnovak Jul 25, 2025
9e912b2
Add missing pre_update_hook call
adamnovak Jul 25, 2025
654d8e7
Stop logging every write
adamnovak Jul 25, 2025
cc0f8c4
Only write the marker when it moves
adamnovak Jul 25, 2025
7f3c3d2
Use the content key prefix when uploading files
adamnovak Jul 25, 2025
adef28a
Get executable bit from the end of the key fields
adamnovak Jul 25, 2025
1122742
Add --toil suffix to test bucket cleanup script
adamnovak Jul 25, 2025
14d1338
Make FileJobStore _write_to_url a classmethod again
adamnovak Jul 25, 2025
2126540
Stop tracking executability in key because it is tracked in the typed…
adamnovak Jul 25, 2025
3503b01
Merge remote-tracking branch 'upstream/master' into issues/964-aws-re…
adamnovak Jul 25, 2025
5fc4c39
Fix self reference in classmethod
adamnovak Jul 25, 2025
4a1de2e
Add pytest-randomly to report and set seeds only
adamnovak Jul 28, 2025
05c04fc
Fix removed method and enable AWS util test type checking
adamnovak Aug 5, 2025
7a3df6d
Move single-test teardown into test and fix argument type
adamnovak Aug 5, 2025
80aabc9
Fix typing by moving import
adamnovak Aug 5, 2025
47d2518
Merge remote-tracking branch 'upstream/master' into issues/964-aws-re…
adamnovak Aug 6, 2025
7822305
Satisfy MyPy on the pipes
adamnovak Aug 6, 2025
2d6d7ad
Respect turning off encryption for stream uploads so config.pickle ca…
adamnovak Aug 6, 2025
c369df4
Get the config from self
adamnovak Aug 6, 2025
bfc6616
Make AWS encryption settings update live from the config to satisfy test
adamnovak Aug 6, 2025
df02144
Handle error from trying to read without encryption, and default encr…
adamnovak Aug 6, 2025
86a8fe6
Make Bucket from the resource and not free-floating
adamnovak Aug 6, 2025
59b2eec
Satisfy MyPy
adamnovak Aug 6, 2025
278fb2f
Avoid depending on strongly-consistent clean in subTest tests
adamnovak Aug 7, 2025
4f55510
Raise correct nonexistent job store exception
adamnovak Aug 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions contrib/admin/mypy-with-ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def main():

# TODO: Remove these paths as typing is added and mypy conflicts are addressed.
# These are handled as path prefixes.
ignore_paths = [os.path.abspath(f) for f in [

ignore_paths = [os.path.join(pkg_root, f) for f in [
'docs/_build',
'docker/Dockerfile.py',
'docs/conf.py',
Expand Down Expand Up @@ -82,9 +83,7 @@ def main():
'src/toil/lib/aws/__init__.py',
'src/toil/server/utils.py',
'src/toil/test',
'src/toil/utils/toilStats.py',
'src/toil/server/utils.py',
'src/toil/jobStores/aws/jobStore.py'
'src/toil/utils/toilStats.py'
]]

def ignore(file_path):
Expand All @@ -100,19 +99,9 @@ def ignore(file_path):
for file_path in all_files_to_check:
if not ignore(file_path):
filtered_files_to_check.append(file_path)
# print(f'Checking: {filtered_files_to_check}')
# args = ['mypy', '--color-output', '--show-traceback'] + filtered_files_to_check
# p = subprocess.run(args=args)
# exit(p.returncode)
filtered_files_to_check = [
'src/toil/jobStores/aws/jobStore.py'
]
for file in filtered_files_to_check:
print(f'Checking: {file}')
args = ['mypy', '--color-output', '--show-traceback', file]
p = subprocess.run(args=args)
if p.returncode != 0:
raise RuntimeError(f'BROKEN: {file}')
args = ['mypy', '--color-output', '--show-traceback'] + filtered_files_to_check
p = subprocess.run(args=args)
exit(p.returncode)


if __name__ == '__main__':
Expand Down
1 change: 0 additions & 1 deletion src/toil/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,6 @@ class JobDescription(Requirer):
Subclassed into variants for checkpoint jobs and service jobs that have
their specific parameters.
"""

def __init__(
self,
requirements: Mapping[str, Union[int, str, bool]],
Expand Down
35 changes: 18 additions & 17 deletions src/toil/jobStores/abstractJobStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Optional,
Union,
cast,
overload,
overload
)
from urllib.error import HTTPError
from urllib.parse import ParseResult, urlparse
Expand Down Expand Up @@ -88,7 +88,7 @@ def __init__(self, url: ParseResult) -> None:
class NoSuchJobException(Exception):
"""Indicates that the specified job does not exist."""

def __init__(self, jobStoreID: FileID):
def __init__(self, jobStoreID: Union[FileID, str]):
"""
:param str jobStoreID: the jobStoreID that was mistakenly assumed to exist
"""
Expand All @@ -98,7 +98,7 @@ def __init__(self, jobStoreID: FileID):
class ConcurrentFileModificationException(Exception):
"""Indicates that the file was attempted to be modified by multiple processes at once."""

def __init__(self, jobStoreFileID: FileID):
def __init__(self, jobStoreFileID: Union[FileID, str]):
"""
:param jobStoreFileID: the ID of the file that was modified by multiple workers
or processes concurrently
Expand All @@ -110,7 +110,7 @@ class NoSuchFileException(Exception):
"""Indicates that the specified file does not exist."""

def __init__(
self, jobStoreFileID: FileID, customName: Optional[str] = None, *extra: Any
self, jobStoreFileID: Union[FileID, str], customName: Optional[str] = None, *extra: Any
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good reason to say this can be a string now? Is it too hard to drag the typed file ID object through in the new implementation for some good reason?

When this is a string, is this meant to be the string-packed version of the file ID? Or just the ID part without e.g. the size packed in?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess some of the user-facing file ID API still accepts file IDs typed as strings, so maybe we do still need to be able to take them here.

):
"""
:param jobStoreFileID: the ID of the file that was mistakenly assumed to exist
Expand Down Expand Up @@ -138,11 +138,12 @@ class NoSuchJobStoreException(LocatorException):
def __init__(self, locator: str, prefix: str):
"""
:param str locator: The location of the job store
:param str prefix: The type of job store
"""
super().__init__(
"The job store '%s' does not exist, so there is nothing to restart.",
locator,
prefix,
prefix
)


Expand All @@ -157,7 +158,7 @@ def __init__(self, locator: str, prefix: str):
"The job store '%s' already exists. Use --restart to resume the workflow, or remove "
"the job store with 'toil clean' to start the workflow from scratch.",
locator,
prefix,
prefix
)


Expand Down Expand Up @@ -224,7 +225,7 @@ def write_config(self) -> None:
) as fileHandle:
pickle.dump(self.__config, fileHandle, pickle.HIGHEST_PROTOCOL)

def resume(self) -> None:
def resume(self, sse_key_path: Optional[str] = None) -> None:
"""
Connect this instance to the physical storage it represents and load the Toil configuration
into the :attr:`AbstractJobStore.config` attribute.
Expand Down Expand Up @@ -748,7 +749,6 @@ def _open_url(cls, url: ParseResult) -> IO[bytes]:
"""
raise NotImplementedError(f"No implementation for {url}")

@classmethod
@abstractmethod
def _write_to_url(
cls,
Expand Down Expand Up @@ -1155,15 +1155,6 @@ def assign_job_id(self, job_description: JobDescription) -> None:
"""
raise NotImplementedError()

@contextmanager
def batch(self) -> Iterator[None]:
"""
If supported by the batch system, calls to create() with this context
manager active will be performed in a batch after the context manager
is released.
"""
yield

@deprecated(new_function_name="create_job")
def create(self, jobDescription: JobDescription) -> JobDescription:
return self.create_job(jobDescription)
Expand Down Expand Up @@ -1261,6 +1252,15 @@ def load_job(self, job_id: str) -> JobDescription:
def update(self, jobDescription: JobDescription) -> None:
return self.update_job(jobDescription)

@contextmanager
def batch(self) -> Iterator[None]:
"""
If supported by the batch system, calls to create() with this context
manager active will be performed in a batch after the context manager
is released.
"""
yield

@abstractmethod
def update_job(self, job_description: JobDescription) -> None:
"""
Expand Down Expand Up @@ -1502,6 +1502,7 @@ def read_file_stream(
) -> ContextManager[IO[str]]: ...

@abstractmethod
@contextmanager # type: ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we really only need/want @contextmanager on the implementation? It doesn't really help on the unimplemented stub, and it apparently means we have to break out of typing.

def read_file_stream(
self,
file_id: Union[FileID, str],
Expand Down
Loading
Loading