2025-10-12 21:23:12 -07:00
|
|
|
import enum
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ExitCode(enum.Enum):
|
|
|
|
|
SUCCESS = 0 # Do not set/return this manually
|
|
|
|
|
UNCAUGHT = 1 # Do not set/return this manually
|
|
|
|
|
|
|
|
|
|
UNSPECIFIED = 2
|
|
|
|
|
UNKNOWN = 3
|
|
|
|
|
|
|
|
|
|
# Hard infra errors (non-retryable)
|
|
|
|
|
CLI_ERROR = 10
|
|
|
|
|
CONFIG_ERROR = 11
|
|
|
|
|
SETUP_ERROR = 12
|
|
|
|
|
CLUSTER_RESOURCE_ERROR = 13
|
|
|
|
|
CLUSTER_ENV_BUILD_ERROR = 14
|
|
|
|
|
CLUSTER_STARTUP_ERROR = 15
|
2025-12-30 08:54:16 -08:00
|
|
|
# LOCAL_ENV_SETUP_ERROR = 16 # not used anymore
|
|
|
|
|
# REMOTE_ENV_SETUP_ERROR = 17 # not used anymore
|
2025-10-12 21:23:12 -07:00
|
|
|
FETCH_RESULT_ERROR = 18
|
|
|
|
|
ANYSCALE_ERROR = 19
|
|
|
|
|
|
|
|
|
|
# Infra timeouts (retryable)
|
|
|
|
|
RAY_WHEELS_TIMEOUT = 30
|
|
|
|
|
CLUSTER_ENV_BUILD_TIMEOUT = 31
|
|
|
|
|
CLUSTER_STARTUP_TIMEOUT = 32
|
|
|
|
|
CLUSTER_WAIT_TIMEOUT = 33
|
|
|
|
|
|
|
|
|
|
# Command errors - these are considered application errors
|
|
|
|
|
COMMAND_ERROR = 40
|
|
|
|
|
COMMAND_ALERT = 41
|
|
|
|
|
COMMAND_TIMEOUT = 42
|
|
|
|
|
PREPARE_ERROR = 43
|
2022-02-16 17:35:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class ReleaseTestError(RuntimeError):
|
|
|
|
|
exit_code = ExitCode.UNSPECIFIED
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ReleaseTestPackageError(ReleaseTestError):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ReleaseTestConfigError(ReleaseTestPackageError):
|
|
|
|
|
exit_code = ExitCode.CONFIG_ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ReleaseTestCLIError(ReleaseTestPackageError):
|
|
|
|
|
exit_code = ExitCode.CLI_ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ReleaseTestSetupError(ReleaseTestPackageError):
|
|
|
|
|
exit_code = ExitCode.SETUP_ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ClusterManagerError(ReleaseTestError):
|
|
|
|
|
exit_code = ExitCode.CLUSTER_RESOURCE_ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ClusterEnvCreateError(ClusterManagerError):
|
|
|
|
|
exit_code = ExitCode.CLUSTER_RESOURCE_ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ClusterEnvBuildError(ClusterManagerError):
|
|
|
|
|
exit_code = ExitCode.CLUSTER_ENV_BUILD_ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ClusterEnvBuildTimeout(ClusterManagerError):
|
|
|
|
|
exit_code = ExitCode.CLUSTER_ENV_BUILD_TIMEOUT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ClusterComputeCreateError(ClusterManagerError):
|
|
|
|
|
exit_code = ExitCode.CLUSTER_RESOURCE_ERROR
|
|
|
|
|
|
|
|
|
|
|
2022-12-22 07:00:29 +01:00
|
|
|
class CloudInfoError(ClusterManagerError):
|
|
|
|
|
exit_code = ExitCode.CLUSTER_RESOURCE_ERROR
|
|
|
|
|
|
|
|
|
|
|
2022-02-16 17:35:02 +00:00
|
|
|
class ClusterStartupTimeout(ClusterManagerError):
|
|
|
|
|
exit_code = ExitCode.CLUSTER_STARTUP_TIMEOUT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ClusterStartupFailed(ClusterManagerError):
|
|
|
|
|
exit_code = ExitCode.CLUSTER_STARTUP_ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FileManagerError(ReleaseTestError):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FileUploadError(FileManagerError):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CommandTimeout(ReleaseTestError):
|
|
|
|
|
exit_code = ExitCode.COMMAND_TIMEOUT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PrepareCommandTimeout(CommandTimeout):
|
|
|
|
|
exit_code = ExitCode.CLUSTER_WAIT_TIMEOUT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestCommandTimeout(CommandTimeout):
|
|
|
|
|
exit_code = ExitCode.COMMAND_TIMEOUT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CommandError(ReleaseTestError):
|
|
|
|
|
exit_code = ExitCode.COMMAND_ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PrepareCommandError(CommandError):
|
|
|
|
|
exit_code = ExitCode.PREPARE_ERROR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestCommandError(CommandError):
|
|
|
|
|
exit_code = ExitCode.COMMAND_ERROR
|
|
|
|
|
|
|
|
|
|
|
2023-02-07 22:44:17 -08:00
|
|
|
class FetchResultError(FileManagerError):
|
|
|
|
|
exit_code = ExitCode.FETCH_RESULT_ERROR
|
2022-02-16 17:35:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class LogsError(CommandError):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ResultsAlert(CommandError):
|
|
|
|
|
exit_code = ExitCode.COMMAND_ALERT
|
2023-02-15 16:57:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class JobBrokenError(ReleaseTestError):
|
|
|
|
|
exit_code = ExitCode.ANYSCALE_ERROR
|
|
|
|
|
|
|
|
|
|
|
2023-02-16 13:01:39 -08:00
|
|
|
class JobTerminatedBeforeStartError(ReleaseTestError):
|
2023-02-17 18:32:36 -08:00
|
|
|
exit_code = ExitCode.CLUSTER_STARTUP_TIMEOUT
|
2023-02-15 16:57:50 -08:00
|
|
|
|
|
|
|
|
|
2023-02-16 13:01:39 -08:00
|
|
|
class JobTerminatedError(ReleaseTestError):
|
|
|
|
|
exit_code = ExitCode.ANYSCALE_ERROR
|
|
|
|
|
|
|
|
|
|
|
2023-02-17 18:32:36 -08:00
|
|
|
class JobOutOfRetriesError(ReleaseTestError):
|
|
|
|
|
exit_code = ExitCode.ANYSCALE_ERROR
|
|
|
|
|
|
|
|
|
|
|
2023-02-15 16:57:50 -08:00
|
|
|
class JobStartupFailed(ClusterStartupFailed):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class JobStartupTimeout(ClusterStartupTimeout):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class JobNoLogsError(ReleaseTestError):
|
|
|
|
|
exit_code = ExitCode.ANYSCALE_ERROR
|