コード例 #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
ファイル: experiments.py プロジェクト: saiprashanths/polyaxon
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
ファイル: experiment_groups.py プロジェクト: sotte/polyaxon
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
ファイル: experiments.py プロジェクト: minc-yang/polyaxon
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
ファイル: experiments.py プロジェクト: ttsvetanov/polyaxon
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
ファイル: jobs.py プロジェクト: ttsvetanov/polyaxon
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
ファイル: build_jobs.py プロジェクト: nwittstruck/polyaxon
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'])