class GitTypeSchema(BaseCamelSchema): url = RefOrObject(fields.Str(allow_none=True)) revision = RefOrObject(fields.Str(allow_none=True)) @staticmethod def schema_config(): return V1GitType
class HyperoptSchema(BaseCamelSchema): kind = fields.Str(allow_none=True, validate=validate.Equal(V1MatrixKind.HYPEROPT)) max_iterations = RefOrObject(fields.Int(allow_none=True)) algorithm = fields.Str(allow_none=True, validate=validate.OneOf(["tpe", "rand", "anneal"])) params = fields.Dict(keys=fields.Str(), values=fields.Nested(HpParamSchema), required=True) num_runs = RefOrObject(fields.Int(required=True, validate=validate.Range(min=1)), required=True) seed = RefOrObject(fields.Int(allow_none=True)) concurrency = RefOrObject(fields.Int(allow_none=True)) container = SwaggerField( cls=k8s_schemas.V1Container, defaults={"name": MAIN_JOB_CONTAINER}, allow_none=True, ) early_stopping = fields.List(fields.Nested(EarlyStoppingSchema), allow_none=True) @staticmethod def schema_config(): return V1Hyperopt
class EventSchema(BaseCamelSchema): name = RefOrObject(fields.Str(allow_none=True)) kind = RefOrObject(fields.Str(allow_none=True)) @staticmethod def schema_config(): return V1EventType
class ImageSchema(BaseCamelSchema): name = RefOrObject(fields.Str(allow_none=True)) connection = RefOrObject(fields.Str(allow_none=True)) @staticmethod def schema_config(): return V1ImageType
class BayesSchema(BaseCamelSchema): kind = fields.Str(allow_none=True, validate=validate.Equal(V1MatrixKind.BAYES)) utility_function = fields.Nested(UtilityFunctionSchema, allow_none=True) num_initial_runs = RefOrObject(fields.Int(), required=True) max_iterations = RefOrObject(fields.Int(validate=validate.Range(min=1))) metric = fields.Nested(OptimizationMetricSchema, required=True) params = fields.Dict(keys=fields.Str(), values=fields.Nested(HpParamSchema), required=True) seed = RefOrObject(fields.Int(allow_none=True)) concurrency = fields.Int(allow_none=True) container = SwaggerField( cls=k8s_schemas.V1Container, defaults={"name": MAIN_JOB_CONTAINER}, allow_none=True, ) early_stopping = fields.Nested(EarlyStoppingSchema, many=True, allow_none=True) @staticmethod def schema_config(): return V1Bayes @validates_schema def validate_matrix(self, data, **kwargs): """Validates matrix data and creates the config objects""" validate_matrix(data.get("params"))
class GcsTypeSchema(BaseCamelSchema): bucket = RefOrObject(fields.Str(allow_none=True)) blob = RefOrObject(fields.Str(allow_none=True)) @staticmethod def schema_config(): return V1GcsType
class ContainerResourcesSchema(BaseSchema): limits = RefOrObject(fields.Dict(allow_none=True)) requests = RefOrObject(fields.Dict(allow_none=True)) @staticmethod def schema_config(): return ContainerResourcesConfig
class HyperbandSchema(BaseCamelSchema): kind = fields.Str(allow_none=True, validate=validate.Equal(V1MatrixKind.HYPERBAND)) params = fields.Dict(keys=fields.Str(), values=fields.Nested(HpParamSchema), allow_none=True) max_iterations = RefOrObject(fields.Int(validate=validate.Range(min=1))) eta = RefOrObject(fields.Float(validate=validate.Range(min=0))) resource = fields.Nested(OptimizationResourceSchema) metric = fields.Nested(OptimizationMetricSchema) resume = RefOrObject(fields.Boolean(allow_none=True)) seed = RefOrObject(fields.Int(allow_none=True)) concurrency = fields.Int(allow_none=True) container = SwaggerField( cls=k8s_schemas.V1Container, defaults={"name": MAIN_JOB_CONTAINER}, allow_none=True, ) early_stopping = fields.Nested(EarlyStoppingSchema, many=True, allow_none=True) @staticmethod def schema_config(): return V1Hyperband
class ResourceRequirementsSchema(BaseSchema): limits = RefOrObject(fields.Dict(allow_none=True)) requests = RefOrObject(fields.Dict(allow_none=True)) @staticmethod def schema_config(): return ResourceRequirementsConfig
class AuthTypeSchema(BaseCamelSchema): user = RefOrObject(fields.Str(), required=True) password = RefOrObject(fields.Str(), required=True) @staticmethod def schema_config(): return V1AuthType
class ArtifactsTypeSchema(BaseCamelSchema): files = RefOrObject(fields.List(StrOrList(), allow_none=True)) dirs = RefOrObject(fields.List(StrOrList(), allow_none=True)) workers = RefOrObject(fields.Int(allow_none=True)) @staticmethod def schema_config(): return V1ArtifactsType
class WasbTypeSchema(BaseCamelSchema): container = RefOrObject(fields.Str(allow_none=True)) storage_account = RefOrObject(fields.Str(allow_none=True)) path = RefOrObject(fields.Str(allow_none=True)) @staticmethod def schema_config(): return V1WasbType
class UriTypeSchema(BaseCamelSchema): user = RefOrObject(fields.Str(required=True)) password = RefOrObject(fields.Str(required=True)) host = RefOrObject(fields.Str(required=True)) @staticmethod def schema_config(): return V1UriType
class TruncationStoppingPolicySchema(BaseSchema): kind = fields.Str(allow_none=True, validate=validate.Equal("truncation")) percent = RefOrObject(fields.Float(), required=True) evaluation_interval = RefOrObject(fields.Int(), required=True) @staticmethod def schema_config(): return TruncationStoppingPolicyConfig
class MedianStoppingPolicySchema(BaseCamelSchema): kind = fields.Str(allow_none=True, validate=validate.Equal("median")) evaluation_interval = RefOrObject(fields.Int(), required=True) min_interval = RefOrObject(fields.Int(allow_none=True)) min_samples = RefOrObject(fields.Int(allow_none=True)) @staticmethod def schema_config(): return V1MedianStoppingPolicy
class FailureEarlyStoppingSchema(BaseCamelSchema): kind = fields.Str(allow_none=True, validate=validate.Equal("failure_early_stopping")) percent = RefOrObject(fields.Float(), required=True) evaluation_interval = RefOrObject(fields.Int(), required=True) @staticmethod def schema_config(): return V1FailureEarlyStopping
class ArtifactsTypeSchema(BaseCamelSchema): connection = RefOrObject(fields.Str(allow_none=True)) files = RefOrObject(fields.List(fields.Str(), allow_none=True)) dirs = RefOrObject(fields.List(fields.Str(), allow_none=True)) init = RefOrObject(fields.Bool(allow_none=True)) workers = RefOrObject(fields.Int(allow_none=True)) @staticmethod def schema_config(): return V1ArtifactsType
class CronScheduleSchema(BaseSchema): kind = fields.Str(allow_none=True, validate=validate.Equal("cron")) start_at = RefOrObject(fields.LocalDateTime(allow_none=True)) end_at = RefOrObject(fields.LocalDateTime(allow_none=True)) cron = RefOrObject(fields.String(required=True)) depends_on_past = RefOrObject(fields.Bool(allow_none=True)) @staticmethod def schema_config(): return CronScheduleConfig
class RepeatableScheduleSchema(BaseSchema): kind = fields.Str(allow_none=True, validate=validate.Equal("repeatable")) limit = RefOrObject(fields.Int(required=True, validate=validate.Range(min=1)), required=True) depends_on_past = RefOrObject(fields.Bool(allow_none=True), required=True) @staticmethod def schema_config(): return RepeatableScheduleConfig
class IntervalScheduleSchema(BaseSchema): kind = fields.Str(allow_none=True, validate=validate.Equal("interval")) start_at = RefOrObject(fields.LocalDateTime(required=True), required=True) end_at = RefOrObject(fields.LocalDateTime(allow_none=True)) frequency = RefOrObject(fields.TimeDelta(required=True), required=True) depends_on_past = RefOrObject(fields.Bool(allow_none=True)) @staticmethod def schema_config(): return IntervalScheduleConfig
class TunerSchema(BaseCamelSchema): hub_ref = fields.Str(required=True) queue = RefOrObject(fields.Str(allow_none=True)) presets = RefOrObject(fields.List(fields.Str(allow_none=True))) params = fields.Dict( keys=fields.Str(), values=fields.Nested(ParamSchema), allow_none=True ) @staticmethod def schema_config(): return V1Tuner
class FileTypeSchema(BaseCamelSchema): content = RefOrObject(fields.Str(), required=True) filename = RefOrObject(fields.Str(allow_none=True)) kind = RefOrObject( fields.Str(allow_none=True, validate=validate.OneOf(V1ArtifactKind.allowable_values))) chmod = RefOrObject(fields.Str(allow_none=True)) @staticmethod def schema_config(): return V1FileType
class JoinSchema(BaseCamelSchema): query = fields.Str(required=True) sort = fields.Str(allow_none=True) limit = RefOrObject(fields.Int(allow_none=True)) offset = RefOrObject(fields.Int(allow_none=True)) params = fields.Dict(keys=fields.Str(), values=fields.Nested(JoinParamSchema), allow_none=True) @staticmethod def schema_config(): return V1Join
class MetricEarlyStoppingSchema(BaseCamelSchema): kind = fields.Str(allow_none=True, validate=validate.Equal("metric_early_stopping")) metric = RefOrObject(fields.Str(), required=True) value = RefOrObject(fields.Float(), required=True) optimization = RefOrObject( fields.Str(validate=validate.OneOf(V1Optimization.VALUES)), required=True ) policy = fields.Nested(StoppingPolicySchema, allow_none=True) @staticmethod def schema_config(): return V1MetricEarlyStopping
class MappingSchema(BaseCamelSchema): kind = fields.Str(allow_none=True, validate=validate.Equal(V1MatrixKind.MAPPING)) values = RefOrObject(fields.List(fields.Dict(), required=True), required=True) concurrency = RefOrObject(fields.Int(allow_none=True)) early_stopping = fields.List(fields.Nested(EarlyStoppingSchema), allow_none=True) @staticmethod def schema_config(): return V1Mapping
class RandomSearchSchema(BaseSchema): kind = fields.Str(allow_none=True, validate=validate.Equal("random_search")) matrix = fields.Dict(keys=fields.Str(), values=fields.Nested(MatrixSchema), required=True) n_experiments = RefOrObject( fields.Int(allow_none=True, validate=validate.Range(min=1))) seed = RefOrObject(fields.Int(allow_none=True)) @staticmethod def schema_config(): return RandomSearchConfig
class HyperbandSchema(BaseSchema): kind = fields.Str(allow_none=True, validate=validate.Equal("hyperband")) matrix = fields.Dict(keys=fields.Str(), values=fields.Nested(MatrixSchema), allow_none=True) max_iter = RefOrObject(fields.Int(validate=validate.Range(min=1))) eta = RefOrObject(fields.Float(validate=validate.Range(min=0))) resource = fields.Nested(ResourceSchema) metric = fields.Nested(SearchMetricSchema) resume = RefOrObject(fields.Boolean(allow_none=True)) seed = RefOrObject(fields.Int(allow_none=True)) @staticmethod def schema_config(): return HyperbandConfig
class ExactTimeScheduleSchema(BaseSchema): kind = fields.Str(allow_none=True, validate=validate.Equal("exact_time")) start_at = RefOrObject(fields.LocalDateTime(required=True), required=True) @staticmethod def schema_config(): return ExactTimeScheduleConfig
class RaySchema(BaseCamelSchema): kind = fields.Str(allow_none=True, validate=validate.Equal(V1RunKind.RAY)) spec = RefOrObject(fields.Raw(required=True)) @staticmethod def schema_config(): return V1Ray
class SparkSchema(BaseSchema): kind = fields.Str(allow_none=True, validate=validate.Equal("spark")) spec = RefOrObject(fields.Raw(required=True)) @staticmethod def schema_config(): return SparkConfig