Example #1
0
 def test_project_outputs_path_creation_deletion(self):
     with patch('experiments.tasks.build_experiment.apply_async') as _:
         experiment = ExperimentFactory(user=self.project.user, project=self.project)
     create_experiment_outputs_path(experiment.unique_name)
     experiment_outputs_path = get_experiment_outputs_path(experiment.unique_name)
     project_outputs_path = get_project_outputs_path(self.project.unique_name)
     assert os.path.exists(experiment_outputs_path) is True
     assert os.path.exists(project_outputs_path) is True
     delete_project_outputs(self.project.unique_name)
     assert os.path.exists(experiment_outputs_path) is False
     assert os.path.exists(project_outputs_path) is False
Example #2
0
def new_project(sender, **kwargs):
    instance = kwargs['instance']
    created = kwargs.get('created', False)

    if not created:
        return

    # Clean outputs, logs, and repos
    delete_project_outputs(instance.unique_name)
    delete_project_logs(instance.unique_name)
    delete_project_repos(instance.unique_name)
Example #3
0
def project_deleted(sender, **kwargs):
    instance = kwargs['instance']
    tensorboard_scheduler.stop_tensorboard(instance, update_status=False)
    notebook_scheduler.stop_notebook(instance, update_status=False)
    # Delete tensorboard job
    if instance.tensorboard:
        instance.tensorboard.delete()

    # Delete notebook job
    if instance.notebook:
        instance.notebook.delete()

    # Clean outputs, logs, and repos
    delete_project_outputs(instance.unique_name)
    delete_project_logs(instance.unique_name)
    delete_project_repos(instance.unique_name)
Example #4
0
def project_deleted(sender, **kwargs):
    instance = kwargs['instance']
    # Clean outputs, logs, and repos
    delete_project_outputs(instance.unique_name)
    delete_project_logs(instance.unique_name)
    delete_project_repos(instance.unique_name)