MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / startJupyterServer

Function startJupyterServer

src/test/common.node.ts:221–257  ·  view source on GitHub ↗
(
            options: {
                token?: string;
                port?: number;
                useCert?: boolean;
                jupyterLab?: boolean;
                password?: string;
                detached?: boolean;
                standalone?: boolean;
            } = {}
        )

Source from the content-addressed store, hash-verified

219 return { file: Uri.file(tempFile), dispose: () => swallowExceptions(() => fs.unlinkSync(tempFile)) };
220 },
221 async startJupyterServer(
222 options: {
223 token?: string;
224 port?: number;
225 useCert?: boolean;
226 jupyterLab?: boolean;
227 password?: string;
228 detached?: boolean;
229 standalone?: boolean;
230 } = {}
231 ): Promise<{ url: string } & IDisposable> {
232 if (IS_REMOTE_NATIVE_TEST()) {
233 if (options.standalone) {
234 return JupyterServer.instance.startJupyter(options);
235 }
236 if (!remoteUrisCleared) {
237 await commands.executeCommand('deepnote.clearSavedJupyterUris');
238 remoteUrisCleared = true;
239 }
240 const url = options.useCert
241 ? await JupyterServer.instance.startJupyterWithCert()
242 : await JupyterServer.instance.startJupyterWithToken();
243 console.info(`Jupyter started and listening at ${url}`);
244 try {
245 await commands.executeCommand('deepnote.selectjupyteruri', Uri.parse(url));
246 } catch (ex) {
247 console.error('Failed to select jupyter server, retry in 1s', ex);
248 }
249 // Todo: Fix in debt week, we need to retry, some changes have caused the first connection attempt to fail on CI.
250 // Possible we're trying to connect before the server is ready.
251 await sleep(5_000);
252 await commands.executeCommand('deepnote.selectjupyteruri', Uri.parse(url));
253 return { url, dispose: noop };
254 } else {
255 return { url: '', dispose: noop };
256 }
257 },
258 async stopJupyterServer() {
259 if (IS_REMOTE_NATIVE_TEST()) {
260 return;

Calls 9

sleepFunction · 0.90
IS_REMOTE_NATIVE_TESTFunction · 0.85
startJupyterMethod · 0.80
startJupyterWithCertMethod · 0.80
startJupyterWithTokenMethod · 0.80
executeCommandMethod · 0.65
infoMethod · 0.65
parseMethod · 0.65
errorMethod · 0.65

Tested by 1

initSuiteFunction · 0.72