Exemplo n.º 1
0
def project_deleted(sender, **kwargs):
    instance = kwargs['instance']
    scheduler.stop_tensorboard(instance)

    # Delete outputs and logs
    delete_project_outputs(instance.unique_name)
    delete_project_logs(instance.unique_name)
Exemplo n.º 2
0
 def handle(self, *args, **options):
     for project in Project.objects.filter(
             Q(has_tensorboard=True) | Q(has_notebook=True)):
         if project.has_notebook:
             scheduler.stop_notebook(project)
         if project.has_tensorboard:
             scheduler.stop_tensorboard(project)
Exemplo n.º 3
0
def stop_tensorboard(project_id):
    try:
        project = Project.objects.get(id=project_id)
    except Project.DoesNotExist:
        logger.info('Project id `{}` does not exist'.format(project_id))
        return None

    scheduler.stop_tensorboard(project)
Exemplo n.º 4
0
def project_deleted(sender, **kwargs):
    instance = kwargs['instance']
    scheduler.stop_tensorboard(instance)
    scheduler.stop_notebook(instance)
    # 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.º 5
0
def stop_tensorboard(project_id):
    project = get_valid_project(project_id)
    if not project:
        return None
    scheduler.stop_tensorboard(project)