def projects_tensorboard_start(project_id): project = get_valid_project(project_id=project_id) if not project or not project.tensorboard: _logger.warning('Project does not have a tensorboard.') return None if project.tensorboard.last_status == JobLifeCycle.RUNNING: _logger.warning('Tensorboard is already running.') return None tensorboard_scheduler.start_tensorboard(project.tensorboard)
def tensorboards_start(tensorboard_job_id): tensorboard = get_valid_tensorboard(tensorboard_job_id=tensorboard_job_id) if not tensorboard: return None if not JobLifeCycle.can_transition(status_from=tensorboard.last_status, status_to=JobLifeCycle.SCHEDULED): _logger.info('Tensorboard `%s` cannot transition from `%s` to `%s`.', tensorboard.unique_name, tensorboard.last_status, JobLifeCycle.SCHEDULED) tensorboard_scheduler.start_tensorboard(tensorboard)
def tensorboards_start(tensorboard_job_id): tensorboard = get_valid_tensorboard(tensorboard_job_id=tensorboard_job_id) if not tensorboard: _logger.warning('Tensorboard %s does not exist anymore.', tensorboard_job_id) return None if not JobLifeCycle.can_transition(status_from=tensorboard.last_status, status_to=JobLifeCycle.SCHEDULED): _logger.info('Tensorboard `%s` cannot transition from `%s` to `%s`.', tensorboard.unique_name, tensorboard.last_status, JobLifeCycle.SCHEDULED) tensorboard_scheduler.start_tensorboard(tensorboard)
def tensorboards_start(tensorboard_job_id): tensorboard = get_valid_tensorboard(tensorboard_job_id=tensorboard_job_id) if not tensorboard: return None if not JobLifeCycle.can_transition(status_from=tensorboard.last_status, status_to=JobLifeCycle.SCHEDULED): _logger.info('Tensorboard `%s` cannot transition from `%s` to `%s`.', tensorboard.unique_name, tensorboard.last_status, JobLifeCycle.SCHEDULED) try: tensorboard_scheduler.start_tensorboard(tensorboard) except StoreNotFoundError: tensorboard.set_status(status=JobLifeCycle.FAILED, message='Tensorboard failed to start, ' 'the outputs volume/storage was not found.')