Exemplo n.º 1
0
def experiment_group_pre_deleted(sender, **kwargs):
    """Delete all group outputs."""
    instance = kwargs['instance']

    # Delete outputs and logs
    delete_experiment_group_outputs(instance.unique_name)
    delete_experiment_group_logs(instance.unique_name)
Exemplo n.º 2
0
def new_experiment_group(sender, **kwargs):
    instance = kwargs['instance']
    instance.set_status(ExperimentGroupLifeCycle.CREATED)
    # Clean outputs and logs
    delete_experiment_group_outputs(instance.unique_name)
    delete_experiment_group_logs(instance.unique_name)
    auditor.record(event_type=EXPERIMENT_GROUP_CREATED, instance=instance)
Exemplo n.º 3
0
def new_experiment_group(sender, **kwargs):
    instance = kwargs['instance']
    created = kwargs.get('created', False)

    if not created:
        return

    # Clean outputs and logs
    delete_experiment_group_outputs(instance.unique_name)
    delete_experiment_group_logs(instance.unique_name)

    create_group_experiments.apply_async((instance.id, ), countdown=1)
Exemplo n.º 4
0
def experiment_group_deleted(sender, **kwargs):
    """Stop all experiments before deleting the group."""

    instance = kwargs['instance']
    for experiment in instance.running_experiments:
        # Delete all jobs from DB before sending a signal to k8s,
        # this way no statuses will be updated in the meanwhile
        experiment.jobs.all().delete()
        experiment_scheduler.stop_experiment(experiment, update_status=False)

    # Delete outputs and logs
    delete_experiment_group_outputs(instance.unique_name)
    delete_experiment_group_logs(instance.unique_name)
Exemplo n.º 5
0
 def test_experiment_group_logs_path_creation_deletion(self):
     experiment = ExperimentFactory(user=self.project.user,
                                    project=self.project,
                                    experiment_group=self.experiment_group)
     experiment_logs_path = get_experiment_logs_path(experiment.unique_name)
     open(experiment_logs_path, '+w')
     experiment_group_logs_path = get_experiment_group_logs_path(
         self.experiment_group.unique_name)
     # Should be true, created by the signal
     assert os.path.exists(experiment_logs_path) is True
     assert os.path.exists(experiment_group_logs_path) is True
     delete_experiment_group_logs(self.experiment_group.unique_name)
     assert os.path.exists(experiment_logs_path) is False
     assert os.path.exists(experiment_group_logs_path) is False
Exemplo n.º 6
0
def new_experiment_group(sender, **kwargs):
    instance = kwargs['instance']
    # Clean outputs and logs
    delete_experiment_group_outputs(instance.unique_name)
    delete_experiment_group_logs(instance.unique_name)