Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 patch for v3.24.0 latest for python 2.7 #1

Open
wants to merge 18 commits into
base: releases/3.24.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def runSetup():
addict = 'addict<=2.2.0'
sphinx = 'sphinx==1.7.5'
pathlib2 = 'pathlib2==2.3.2'
enum34 = 'enum34==1.1.10'

core_reqs = [
dill,
Expand All @@ -71,7 +72,8 @@ def runSetup():
subprocess32,
addict,
sphinx,
pathlib2]
pathlib2,
enum34]

aws_reqs = [
boto,
Expand Down
39 changes: 39 additions & 0 deletions src/toil/batchSystems/abstractBatchSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
standard_library.install_aliases()
from future.utils import with_metaclass
from builtins import object
import enum
import os
import shutil
import logging
Expand All @@ -37,6 +38,44 @@

logger = logging.getLogger(__name__)

# Value to use as exitStatus in UpdatedBatchJobInfo.exitStatus when status is not available.
EXIT_STATUS_UNAVAILABLE_VALUE = 255

class BatchJobExitReason(enum.IntEnum):
FINISHED = 1
"""Successfully finished."""
FAILED = 2
"""Job finished, but failed."""
LOST = 3
"""Preemptable failure (job's executing host went away)."""
KILLED = 4
"""Job killed before finishing."""
ERROR = 5
"""Internal error."""
MEMLIMIT = 6
"""Job hit batch system imposed memory limit."""
MISSING = 7
"""Job disappeared from the scheduler without actually stopping, so Toil killed it."""
MAXJOBDURATION = 8
"""Job ran longer than --maxJobDuration, so Toil killed it."""
PARTITION = 9
"""Job was not able to talk to the leader via the job store, so Toil declared it failed."""


@classmethod
def to_string(cls, value):
"""
Convert to human-readable string.

Given an int that may be or may be equal to a value from the enum,
produce the string value of its matching enum entry, or a stringified
int.
"""
try:
return cls(value).name
except ValueError:
return str(value)


# A class containing the information required for worker cleanup on shutdown of the batch system.
WorkerCleanupInfo = namedtuple('WorkerCleanupInfo', (
Expand Down
Loading