Пример #1
0
def notebook_job_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    set_tags(instance=instance)
    set_persistence(instance=instance)
    set_outputs(instance=instance)
    set_outputs_refs(instance=instance)
    assign_code_reference(instance)
Пример #2
0
def experiment_group_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    # Add code reference
    assign_code_reference(instance)
    # Check if params need to be set
    if not instance.hptuning and instance.specification:
        instance.hptuning = instance.specification.hptuning.to_dict()
Пример #3
0
def experiment_group_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    # Add code reference
    assign_code_reference(instance)
    # Check if params need to be set
    if not instance.hptuning and instance.specification:
        instance.hptuning = instance.specification.hptuning.to_dict()
Пример #4
0
def experiment_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    # Check if declarations need to be set
    if not instance.declarations and instance.specification:
        instance.declarations = instance.specification.declarations
    set_tags(instance=instance)
    set_persistence(instance=instance)
    set_outputs(instance=instance)
    set_outputs_refs(instance=instance)

    # Add code reference
    # Check if :
    # the experiment is new
    # that it has an exec section
    # that it's not cloned
    # that is not an external repo (because we did not clone it yet)
    # if the instance has a primary key then is getting updated
    condition = (
        not instance.specification or
        not instance.specification.build or
        instance.specification.build.git or
        instance.code_reference or
        not instance.project.has_code)
    if condition:
        return

    assign_code_reference(instance)
Пример #5
0
def job_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    set_tags(instance=instance)
    set_persistence(instance=instance)
    set_outputs(instance=instance)
    set_outputs_refs(instance=instance)
    set_name(instance=instance, query=Job.all)
    set_backend(instance=instance, default_backend=NATIVE_BACKEND)
    assign_code_reference(instance)
Пример #6
0
def notebook_job_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    set_tags(instance=instance)
    set_persistence(instance=instance)
    set_outputs(instance=instance)
    set_outputs_refs(instance=instance)
    assign_code_reference(instance)
    set_backend(instance=instance, default_backend=conf.get(NOTEBOOKS_BACKEND))
    set_name(instance=instance, query=NotebookJob.all)
Пример #7
0
def experiment_group_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    # Add code reference
    assign_code_reference(instance)
    # Check if params need to be set
    if not instance.hptuning and instance.specification:
        hptuning_config = instance.specification.hptuning
        hptuning = hptuning_config.to_dict()
        if hptuning_config.search_algorithm == SearchAlgorithms.GRID:
            hptuning['grid_search'] = hptuning.get('grid_search', {})
        instance.hptuning = hptuning
Пример #8
0
def tensorboard_job_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    set_tags(instance=instance)
    default_persistence_outputs = None
    if instance.experiment:
        default_persistence_outputs = instance.experiment.persistence_outputs
    if instance.experiment_group:
        default_persistence_outputs = instance.experiment_group.persistence_outputs
    set_persistence(instance=instance, default_persistence_outputs=default_persistence_outputs)
    set_outputs(instance=instance)
    set_outputs_refs(instance=instance)
    assign_code_reference(instance)
Пример #9
0
def experiment_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    # Check if declarations need to be set
    if not instance.declarations and instance.specification:
        instance.declarations = instance.specification.declarations
    set_tags(instance=instance)
    set_persistence(instance=instance)
    set_outputs(instance=instance)
    set_outputs_refs(instance=instance)
    if not instance.specification or not instance.specification.build:
        return

    assign_code_reference(instance)
Пример #10
0
def job_pre_save(sender, **kwargs):
    instance = kwargs['instance']

    # Add code reference
    # Check if :
    # the job is new
    # that it has an build section
    # that is not an external repo (because we did not clone it yet)
    # if the instance has a primary key then is getting updated
    condition = (instance.specification.build.git or instance.code_reference
                 or not instance.project.has_code)
    if condition:
        return

    assign_code_reference(instance)
Пример #11
0
def experiment_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    # Check if declarations need to be set
    if not instance.declarations and instance.specification:
        instance.declarations = instance.specification.declarations
    set_tags(instance=instance)
    set_persistence(instance=instance)
    set_outputs(instance=instance)
    set_outputs_refs(instance=instance)
    set_name(instance=instance, query=Experiment.all)
    if not instance.specification or not instance.specification.build:
        return

    if instance.is_independent:
        assign_code_reference(instance)
    else:
        instance.code_reference = instance.experiment_group.code_reference
Пример #12
0
def job_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    set_tags(instance=instance)
    set_persistence(instance=instance)
    set_outputs(instance=instance)
    set_outputs_refs(instance=instance)

    # Add code reference
    # Check if :
    # the job is new
    # that it has an build section
    # that is not an external repo (because we did not clone it yet)
    # if the instance has a primary key then is getting updated
    condition = (instance.code_reference or not instance.project.has_code)
    if condition:
        return

    assign_code_reference(instance)
Пример #13
0
def experiment_group_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    # Add code reference
    assign_code_reference(instance)
    # Check if params need to be set
    if not instance.hptuning and instance.specification:
        hptuning_config = instance.specification.hptuning
        hptuning = hptuning_config.to_dict()
        if hptuning_config.search_algorithm == SearchAlgorithms.GRID:
            hptuning['grid_search'] = hptuning.get('grid_search', {})
        instance.hptuning = hptuning
    set_tags(instance=instance)
    set_persistence(instance=instance)
    # Set type
    if not instance.hptuning:
        instance.group_type = GroupTypes.SELECTION
    else:
        instance.group_type = GroupTypes.STUDY
Пример #14
0
def add_experiment_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    # Check if declarations need to be set
    if not instance.declarations and instance.specification:
        instance.declarations = instance.specification.declarations

    # Add code reference
    # Check if :
    # the experiment is new
    # that it has an exec section
    # that it's not cloned
    # that is not an external repo (because we did not clone it yet)
    # if the instance has a primary key then is getting updated
    condition = (
        not instance.specification or
        not instance.specification.build or
        instance.specification.build.git or
        instance.code_reference or
        not instance.project.has_code)
    if condition:
        return

    assign_code_reference(instance)
Пример #15
0
def job_pre_save(sender, **kwargs):
    assign_code_reference(kwargs['instance'])
Пример #16
0
def notebook_job_pre_save(sender, **kwargs):
    assign_code_reference(kwargs['instance'])
Пример #17
0
def build_job_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    set_tags(instance=instance)
    set_backend(instance=instance)
    assign_code_reference(instance)
    set_name(instance=instance, query=BuildJob.all)
Пример #18
0
def add_notebook_code_reference(sender, **kwargs):
    assign_code_reference(kwargs['instance'])
Пример #19
0
def build_job_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    set_tags(instance=instance)
    assign_code_reference(instance)
Пример #20
0
def tensorboard_job_pre_save(sender, **kwargs):
    assign_code_reference(kwargs['instance'])
Пример #21
0
def add_tensorboard_code_reference(sender, **kwargs):
    assign_code_reference(kwargs['instance'])