Exemplo n.º 1
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)
Exemplo n.º 2
0
 def test_project_logs_path_creation_deletion(self):
     with patch('experiments.tasks.build_experiment.apply_async') as _:
         experiment = ExperimentFactory(user=self.project.user, project=self.project)
     experiment_logs_path = get_experiment_logs_path(experiment.unique_name)
     open(experiment_logs_path, '+w')
     project_logs_path = get_project_logs_path(self.project.unique_name)
     project_repos_path = get_project_logs_path(self.project.unique_name)
     # Should be true, created by the signal
     assert os.path.exists(experiment_logs_path) is True
     assert os.path.exists(project_logs_path) is True
     assert os.path.exists(project_repos_path) is True
     delete_project_logs(self.project.unique_name)
     assert os.path.exists(experiment_logs_path) is False
     assert os.path.exists(project_logs_path) is False
     assert os.path.exists(project_repos_path) is False
Exemplo n.º 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)
Exemplo n.º 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)