Esempio n. 1
0
class Job(DataBaseModel):
    # multi-party common configuration
    f_user_id = CharField(max_length=25, index=True, null=True)
    f_job_id = CharField(max_length=25, index=True)
    f_name = CharField(max_length=500, null=True, default='')
    f_description = TextField(null=True, default='')
    f_tag = CharField(max_length=50, null=True, index=True, default='')
    f_dsl = JSONField()
    f_runtime_conf = JSONField()
    f_runtime_conf_on_party = JSONField()
    f_train_runtime_conf = JSONField(null=True)
    f_roles = JSONField()
    f_work_mode = IntegerField()
    f_initiator_role = CharField(max_length=50, index=True)
    f_initiator_party_id = CharField(max_length=50, index=True)
    f_status = CharField(max_length=50, index=True)
    f_status_code = IntegerField(null=True, index=True)
    # this party configuration
    f_role = CharField(max_length=50, index=True)
    f_party_id = CharField(max_length=10, index=True)
    f_is_initiator = BooleanField(null=True, index=True, default=False)
    f_progress = IntegerField(null=True, default=0)
    f_ready_signal = BooleanField(index=True, default=False)
    f_ready_time = BigIntegerField(null=True)
    f_cancel_signal = BooleanField(index=True, default=False)
    f_cancel_time = BigIntegerField(null=True)
    f_rerun_signal = BooleanField(index=True, default=False)
    f_end_scheduling_updates = IntegerField(null=True, default=0)

    f_engine_name = CharField(max_length=50, null=True, index=True)
    f_engine_type = CharField(max_length=10, null=True, index=True)
    f_cores = IntegerField(index=True, default=0)
    f_memory = IntegerField(index=True, default=0)  # MB
    f_remaining_cores = IntegerField(index=True, default=0)
    f_remaining_memory = IntegerField(index=True, default=0)  # MB
    f_resource_in_use = BooleanField(index=True, default=False)
    f_apply_resource_time = BigIntegerField(null=True)
    f_return_resource_time = BigIntegerField(null=True)

    f_start_time = BigIntegerField(null=True)
    f_start_date = DateTimeField(null=True)
    f_end_time = BigIntegerField(null=True)
    f_end_date = DateTimeField(null=True)
    f_elapsed = BigIntegerField(null=True)

    class Meta:
        db_table = "t_job"
        primary_key = CompositeKey('f_job_id', 'f_role', 'f_party_id')
Esempio n. 2
0
class Task(DataBaseModel):
    # multi-party common configuration
    f_job_id = CharField(max_length=25, index=True)
    f_component_name = TextField()
    f_task_id = CharField(max_length=100, index=True)
    f_task_version = BigIntegerField(index=True)
    f_initiator_role = CharField(max_length=50, index=True)
    f_initiator_party_id = CharField(max_length=50, index=True, default=-1)
    f_federated_mode = CharField(max_length=10, index=True)
    f_federated_status_collect_type = CharField(max_length=10, index=True)
    f_status = CharField(max_length=50, index=True)
    f_status_code = IntegerField(null=True, index=True)
    # this party configuration
    f_role = CharField(max_length=50, index=True)
    f_party_id = CharField(max_length=10, index=True)
    f_run_on_this_party = BooleanField(null=True, index=True, default=False)
    f_run_ip = CharField(max_length=100, null=True)
    f_run_pid = IntegerField(null=True)
    f_party_status = CharField(max_length=50, index=True)
    f_engine_conf = JSONField(null=True)

    f_start_time = BigIntegerField(null=True)
    f_start_date = DateTimeField(null=True)
    f_end_time = BigIntegerField(null=True)
    f_end_date = DateTimeField(null=True)
    f_elapsed = BigIntegerField(null=True)

    class Meta:
        db_table = "t_task"
        primary_key = CompositeKey('f_job_id', 'f_task_id', 'f_task_version',
                                   'f_role', 'f_party_id')
Esempio n. 3
0
class MachineLearningModelInfo(DataBaseModel):
    f_role = CharField(max_length=50, index=True)
    f_party_id = CharField(max_length=10, index=True)
    f_roles = JSONField(default={})
    f_job_id = CharField(max_length=25, index=True)
    f_model_id = CharField(max_length=100, index=True)
    f_model_version = CharField(max_length=100, index=True)
    f_loaded_times = IntegerField(default=0)
    f_size = BigIntegerField(default=0)
    f_description = TextField(null=True, default='')
    f_initiator_role = CharField(max_length=50, index=True)
    f_initiator_party_id = CharField(max_length=50, index=True, default=-1)
    f_runtime_conf = JSONField(default={})
    f_work_mode = IntegerField()
    f_train_dsl = JSONField(default={})
    f_train_runtime_conf = JSONField(default={})
    f_imported = IntegerField(default=0)
    f_job_status = CharField(max_length=50, null=True)
    f_runtime_conf_on_party = JSONField(default={})
    f_fate_version = CharField(max_length=10, null=True, default='')
    f_parent = BooleanField(null=True, default=None)
    f_parent_info = JSONField(default={})
    f_inference_dsl = JSONField(default={})

    class Meta:
        db_table = "t_machine_learning_model_info"
        primary_key = CompositeKey('f_role', 'f_party_id', 'f_model_id',
                                   'f_model_version')
Esempio n. 4
0
class SessionRecord(DataBaseModel):
    f_session_id = CharField(max_length=150, null=False, primary_key=True)
    f_engine_name = CharField(max_length=50, index=True)
    f_engine_type = CharField(max_length=10, index=True)
    f_engine_address = JSONField()
    f_create_time = BigIntegerField(index=True)

    class Meta:
        db_table = "t_session_record"
Esempio n. 5
0
class EngineRegistry(DataBaseModel):
    f_engine_type = CharField(max_length=10, index=True)
    f_engine_name = CharField(max_length=50, index=True)
    f_engine_entrance = CharField(max_length=50, index=True)
    f_engine_config = JSONField()
    f_cores = IntegerField(index=True)
    f_memory = IntegerField(index=True)  # MB
    f_remaining_cores = IntegerField(index=True)
    f_remaining_memory = IntegerField(index=True)  # MB
    f_nodes = IntegerField(index=True)

    class Meta:
        db_table = "t_engine_registry"
        primary_key = CompositeKey('f_engine_name', 'f_engine_type')
Esempio n. 6
0
class MachineLearningModelInfo(DataBaseModel):
    f_id = BigAutoField(primary_key=True)
    f_role = CharField(max_length=50, index=True)
    f_party_id = CharField(max_length=10, index=True)
    f_roles = JSONField()
    f_job_id = CharField(max_length=25)
    f_model_id = CharField(max_length=100, index=True)
    f_model_version = CharField(max_length=100, index=True)
    f_loaded_times = IntegerField(default=0)
    f_size = BigIntegerField(default=0)
    f_create_time = BigIntegerField(default=0)
    f_update_time = BigIntegerField(default=0)
    f_description = TextField(null=True, default='')
    f_initiator_role = CharField(max_length=50, index=True)
    f_initiator_party_id = CharField(max_length=50, index=True, default=-1)
    f_runtime_conf = JSONField()
    f_work_mode = IntegerField()
    f_dsl = JSONField()
    f_train_runtime_conf = JSONField(default={})
    f_imported = IntegerField(default=0)
    f_job_status = CharField(max_length=50)

    class Meta:
        db_table = "t_machine_learning_model_info"
Esempio n. 7
0
class StorageTableMetaModel(DataBaseModel):
    f_name = CharField(max_length=100, index=True)
    f_namespace = CharField(max_length=100, index=True)
    f_address = JSONField()
    f_engine = CharField(max_length=100, index=True)  # 'EGGROLL', 'MYSQL'
    f_type = CharField(max_length=50, index=True)  # storage type
    f_options = JSONField()
    f_partitions = IntegerField(null=True)

    f_id_delimiter = CharField(null=True)
    f_in_serialized = BooleanField(default=True)
    f_have_head = BooleanField(default=True)

    f_schema = SerializedField()
    f_count = IntegerField(null=True)
    f_part_of_data = SerializedField()
    f_description = TextField(default='')

    f_create_time = BigIntegerField()
    f_update_time = BigIntegerField(null=True)

    class Meta:
        db_table = "t_storage_table_meta"
        primary_key = CompositeKey('f_name', 'f_namespace')