Skip to content
This repository was archived by the owner on Aug 17, 2023. It is now read-only.
This repository was archived by the owner on Aug 17, 2023. It is now read-only.

Issue in kubeflow fairing library while using in vscode #558

@Roma110

Description

@Roma110

/kind bug

Hi All,
Getting issue while using fairing library from VSCode GUI.
Has fairing library been tested in VSCode notebook ?
Because when i checked the code, i got the below error:

kernel_id = re.search('kernel-(.*).json', ipykernel.connect.get_connection_file()).group(1)

**Output:
/opt/conda/lib/python3.8/site-packages/kubeflow/fairing/notebook/notebook_util.py in get_notebook_name()
10 def get_notebook_name(): #pylint:disable=inconsistent-return-statements
11 """Return the full path of the jupyter notebook. """
---> 12 kernel_id = re.search('kernel-(.*).json',
13 ipykernel.connect.get_connection_file()).group(1)
14 servers = list_running_servers()

AttributeError: 'NoneType' object has no attribute 'group'

After modifying the code as below, this is the output:

import ipykernel
import re
kernel_id = re.search('(.*.json)',  ipykernel.connect.get_connection_file()).group(1)
print(kernel_id)

Output:
/tmp/tmp-3030pDALWEp8bRZ.json

The kernel name starts with "tmp- " in VSCode
But in jupyterlab , kernel name starts with "kernel-"
For example: kernel-5c890661-1206-4d97-abb7-b69c9d4610ed.json

How kubeflow-fairing can be used for vscode ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions