From 420ef5d980b7918d5c2c14c4f06e74488a2f5ff7 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Thu, 31 Oct 2019 12:23:21 -0700 Subject: [PATCH 1/6] Parallelize --- .../datascience/jupyter/notebookStarter.ts | 152 ++++++++++++------ 1 file changed, 102 insertions(+), 50 deletions(-) diff --git a/src/client/datascience/jupyter/notebookStarter.ts b/src/client/datascience/jupyter/notebookStarter.ts index 2e0256825cb5..e144fc4240d0 100644 --- a/src/client/datascience/jupyter/notebookStarter.ts +++ b/src/client/datascience/jupyter/notebookStarter.ts @@ -3,7 +3,7 @@ 'use strict'; -import { execSync } from 'child_process'; +import * as cp from 'child_process'; import * as os from 'os'; import * as path from 'path'; import * as uuid from 'uuid/v4'; @@ -62,57 +62,11 @@ export class NotebookStarter implements Disposable { let exitCode: number | null = 0; try { // Generate a temp dir with a unique GUID, both to match up our started server and to easily clean up after - const tempDir = await this.generateTempDir(); - this.disposables.push(tempDir); - - // In the temp dir, create an empty config python file. This is the same - // as starting jupyter with all of the defaults. - const configFile = useDefaultConfig ? path.join(tempDir.path, 'jupyter_notebook_config.py') : undefined; - if (configFile) { - await this.fileSystem.writeFile(configFile, ''); - traceInfo(`Generating custom default config at ${configFile}`); - } - - // Create extra args based on if we have a config or not - const extraArgs: string[] = []; - if (useDefaultConfig) { - extraArgs.push(`--config=${configFile}`); - } - // Check for the debug environment variable being set. Setting this - // causes Jupyter to output a lot more information about what it's doing - // under the covers and can be used to investigate problems with Jupyter. - if (process.env && process.env.VSCODE_PYTHON_DEBUG_JUPYTER) { - extraArgs.push('--debug'); - } - - // Modify the data rate limit if starting locally. The default prevents large dataframes from being returned. - extraArgs.push('--NotebookApp.iopub_data_rate_limit=10000000000.0'); - - // Check for a docker situation. - try { - if (await this.fileSystem.fileExists('/proc/self/cgroup')) { - const cgroup = await this.fileSystem.readFile('/proc/self/cgroup'); - if (cgroup.includes('docker')) { - // We definitely need an ip address. - extraArgs.push('--ip'); - extraArgs.push('127.0.0.1'); - - // Now see if we need --allow-root. - const idResults = execSync('id', { encoding: 'utf-8' }); - if (idResults.includes('(root)')) { - extraArgs.push('--allow-root'); - } - } - } - } catch { - noop(); - } - - // Use this temp file and config file to generate a list of args for our command - const args: string[] = [...['--no-browser', `--notebook-dir=${tempDir.path}`], ...extraArgs]; + const tempDirPromise = this.generateTempDir(); + tempDirPromise.then(dir => this.disposables.push(dir)).ignoreErrors(); // Before starting the notebook process, make sure we generate a kernel spec - const kernelSpec = await this.kernelService.getMatchingKernelSpec(undefined, cancelToken); + const [args, kernelSpec] = await Promise.all([this.generateArguments(useDefaultConfig, tempDirPromise), this.kernelService.getMatchingKernelSpec(undefined, cancelToken)]); // Make sure we haven't canceled already. if (cancelToken && cancelToken.isCancellationRequested) { @@ -136,6 +90,7 @@ export class NotebookStarter implements Disposable { } // Wait for the connection information on this result + const tempDir = await tempDirPromise; const connection = await JupyterConnection.waitForConnection(tempDir.path, this.getJupyterServerInfo, launchResult, this.serviceContainer, cancelToken); // Fire off telemetry for the process being talkable @@ -158,6 +113,103 @@ export class NotebookStarter implements Disposable { } } } + + private async generateArguments(useDefaultConfig: boolean, tempDirPromise: Promise): Promise{ + const mainArgs: string [] = ['--no-browser']; + + // Create extra args based on if we have a config or not + const extraArgs: string[] = []; + + // Check for the debug environment variable being set. Setting this + // causes Jupyter to output a lot more information about what it's doing + // under the covers and can be used to investigate problems with Jupyter. + if (process.env && process.env.VSCODE_PYTHON_DEBUG_JUPYTER) { + extraArgs.push('--debug'); + } + + // Modify the data rate limit if starting locally. The default prevents large dataframes from being returned. + extraArgs.push('--NotebookApp.iopub_data_rate_limit=10000000000.0'); + + // Parallelize as much as possible. + const promises = [this.addNotebookDirArgument(mainArgs, tempDirPromise), this.addDockerArguments(extraArgs)]; + if (useDefaultConfig) { + promises.push(this.addConfigArgument(extraArgs, tempDirPromise)); + } + + await Promise.all(promises); + + // Use this temp file and config file to generate a list of args for our command + return [...mainArgs, ...extraArgs]; + } + + /** + * Adds the `--notebook-dir` argument. + * + * @private + * @param {string[]} args + * @param {Promise} tempDirectory + * @returns {Promise} + * @memberof NotebookStarter + */ + private async addNotebookDirArgument(args: string[], tempDirectory: Promise): Promise { + const tempDir = await tempDirectory; + args.push(`--notebook-dir=${tempDir.path}`); + } + + /** + * Adds the `--config` argument. + * + * @private + * @param {string[]} args + * @param {Promise} tempDirectory + * @returns {Promise} + * @memberof NotebookStarter + */ + private async addConfigArgument(args: string[], tempDirectory: Promise): Promise { + const tempDir = await tempDirectory; + // In the temp dir, create an empty config python file. This is the same + // as starting jupyter with all of the defaults. + const configFile = path.join(tempDir.path, 'jupyter_notebook_config.py'); + await this.fileSystem.writeFile(configFile, ''); + traceInfo(`Generating custom default config at ${configFile}`); + + // Create extra args based on if we have a config or not + args.push(`--config=${configFile}`); + } + + /** + * Adds the `--ip` and `--alow-root` arguments when in docker. + * + * @private + * @param {string[]} args + * @param {Promise} tempDirectory + * @returns {Promise} + * @memberof NotebookStarter + */ + private async addDockerArguments(args: string[]): Promise { + // Check for a docker situation. + try { + const cgroup = await this.fileSystem.readFile('/proc/self/cgroup').catch(() => ''); + if (!cgroup.includes('docker')) { + return; + } + // We definitely need an ip address. + args.push('--ip'); + args.push('127.0.0.1'); + + // Now see if we need --allow-root. + await new Promise(resolve => { + cp.exec('id', { encoding: 'utf-8' }, (_, stdout: string | Buffer) => { + if (stdout && stdout.toString().includes('(root)')) { + args.push('--allow-root'); + } + resolve(); + }); + }); + } catch { + noop(); + } + } private async generateTempDir(): Promise { const resultDir = path.join(os.tmpdir(), uuid()); await this.fileSystem.createDirectory(resultDir); From 3cc6d45622b2da2c7b782e21a2d76807f72a78e9 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Mon, 4 Nov 2019 12:32:21 -0800 Subject: [PATCH 2/6] Fix tests --- src/test/datascience/execution.unit.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/datascience/execution.unit.test.ts b/src/test/datascience/execution.unit.test.ts index 65e7fe4497c7..83fe0734c961 100644 --- a/src/test/datascience/execution.unit.test.ts +++ b/src/test/datascience/execution.unit.test.ts @@ -455,7 +455,7 @@ suite('Jupyter Execution', async () => { const getServerInfoPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'datascience', 'getServerInfo.py'); setupPythonService(service, undefined, [getServerInfoPath], Promise.resolve({ stdout: 'failure to get server infos' })); setupPythonServiceExecObservable(service, 'jupyter', ['kernelspec', 'list'], [], []); - setupPythonServiceExecObservable(service, 'jupyter', ['notebook', '--no-browser', /--notebook-dir=.*/, /.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0'], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); + setupPythonServiceExecObservable(service, 'jupyter', ['notebook', '--no-browser', /--notebook-dir=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0', /--config=.*/], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); } @@ -467,7 +467,7 @@ suite('Jupyter Execution', async () => { const getServerInfoPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'datascience', 'getServerInfo.py'); setupPythonService(service, undefined, [getServerInfoPath], Promise.resolve({ stdout: 'failure to get server infos' })); setupPythonServiceExecObservable(service, 'jupyter', ['kernelspec', 'list'], [], []); - setupPythonServiceExecObservable(service, 'jupyter', ['notebook', '--no-browser', /--notebook-dir=.*/, /.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0'], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); + setupPythonServiceExecObservable(service, 'jupyter', ['notebook', '--no-browser', /--notebook-dir=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0', /--config=.*/], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); } function setupMissingNotebookPythonService(service: TypeMoq.IMock) { @@ -495,7 +495,7 @@ suite('Jupyter Execution', async () => { const getServerInfoPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'datascience', 'getServerInfo.py'); setupProcessServiceExec(service, workingPython.path, [getServerInfoPath], Promise.resolve({ stdout: 'failure to get server infos' })); setupProcessServiceExecObservable(service, workingPython.path, ['-m', 'jupyter', 'kernelspec', 'list'], [], []); - setupProcessServiceExecObservable(service, workingPython.path, ['-m', 'jupyter', 'notebook', '--no-browser', /--notebook-dir=.*/, /.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0'], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); + setupProcessServiceExecObservable(service, workingPython.path, ['-m', 'jupyter', 'notebook', '--no-browser', /--notebook-dir=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0', /--config=.*/], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); } function setupMissingKernelProcessService(service: TypeMoq.IMock, notebookStdErr?: string[]) { @@ -503,7 +503,7 @@ suite('Jupyter Execution', async () => { const getServerInfoPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'datascience', 'getServerInfo.py'); setupProcessServiceExec(service, missingKernelPython.path, [getServerInfoPath], Promise.resolve({ stdout: 'failure to get server infos' })); setupProcessServiceExecObservable(service, missingKernelPython.path, ['-m', 'jupyter', 'kernelspec', 'list'], [], []); - setupProcessServiceExecObservable(service, missingKernelPython.path, ['-m', 'jupyter', 'notebook', '--no-browser', /--notebook-dir=.*/, /.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0'], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); + setupProcessServiceExecObservable(service, missingKernelPython.path, ['-m', 'jupyter', 'notebook', '--no-browser', /--notebook-dir=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0', /--config=.*/], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); } function setupPathProcessService(jupyterPath: string, service: TypeMoq.IMock, notebookStdErr?: string[]) { @@ -512,7 +512,7 @@ suite('Jupyter Execution', async () => { setupProcessServiceExec(service, jupyterPath, ['--version'], Promise.resolve({ stdout: '1.1.1.1' })); setupProcessServiceExec(service, jupyterPath, ['notebook', '--version'], Promise.resolve({ stdout: '1.1.1.1' })); setupProcessServiceExec(service, jupyterPath, ['kernelspec', '--version'], Promise.resolve({ stdout: '1.1.1.1' })); - setupProcessServiceExecObservable(service, jupyterPath, ['notebook', '--no-browser', /--notebook-dir=.*/, /.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0'], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); + setupProcessServiceExecObservable(service, jupyterPath, ['notebook', '--no-browser', /--notebook-dir=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0', /--config=.*/], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); // WE also check for existence with just the key jupyter setupProcessServiceExec(service, 'jupyter', ['--version'], Promise.resolve({ stdout: '1.1.1.1' })); From 6e43179ab04f87e69b32705bb77bf6cb13048e84 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Mon, 4 Nov 2019 12:41:18 -0800 Subject: [PATCH 3/6] Fix typo --- src/client/datascience/jupyter/notebookStarter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/datascience/jupyter/notebookStarter.ts b/src/client/datascience/jupyter/notebookStarter.ts index e144fc4240d0..dc2f45c80d4c 100644 --- a/src/client/datascience/jupyter/notebookStarter.ts +++ b/src/client/datascience/jupyter/notebookStarter.ts @@ -178,7 +178,7 @@ export class NotebookStarter implements Disposable { } /** - * Adds the `--ip` and `--alow-root` arguments when in docker. + * Adds the `--ip` and `--allow-root` arguments when in docker. * * @private * @param {string[]} args From 0844a44d94067bda3f093fb9d0c8cc067396ff57 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Mon, 4 Nov 2019 14:37:48 -0800 Subject: [PATCH 4/6] Fixed order of arguments to ensure tests pass --- .../datascience/jupyter/notebookStarter.ts | 58 +++++++++---------- src/test/datascience/execution.unit.test.ts | 10 ++-- 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/src/client/datascience/jupyter/notebookStarter.ts b/src/client/datascience/jupyter/notebookStarter.ts index dc2f45c80d4c..b80a45ca633c 100644 --- a/src/client/datascience/jupyter/notebookStarter.ts +++ b/src/client/datascience/jupyter/notebookStarter.ts @@ -115,57 +115,51 @@ export class NotebookStarter implements Disposable { } private async generateArguments(useDefaultConfig: boolean, tempDirPromise: Promise): Promise{ - const mainArgs: string [] = ['--no-browser']; - // Create extra args based on if we have a config or not - const extraArgs: string[] = []; - - // Check for the debug environment variable being set. Setting this - // causes Jupyter to output a lot more information about what it's doing - // under the covers and can be used to investigate problems with Jupyter. - if (process.env && process.env.VSCODE_PYTHON_DEBUG_JUPYTER) { - extraArgs.push('--debug'); - } - - // Modify the data rate limit if starting locally. The default prevents large dataframes from being returned. - extraArgs.push('--NotebookApp.iopub_data_rate_limit=10000000000.0'); // Parallelize as much as possible. - const promises = [this.addNotebookDirArgument(mainArgs, tempDirPromise), this.addDockerArguments(extraArgs)]; + const promisedArgs: Promise[] = []; + promisedArgs.push(Promise.resolve('--no-browser')); + promisedArgs.push(this.getNotebookDirArgument(tempDirPromise)); if (useDefaultConfig) { - promises.push(this.addConfigArgument(extraArgs, tempDirPromise)); + promisedArgs.push(this.getConfigArgument(tempDirPromise)); } + // Modify the data rate limit if starting locally. The default prevents large dataframes from being returned. + promisedArgs.push(Promise.resolve('--NotebookApp.iopub_data_rate_limit=10000000000.0')); - await Promise.all(promises); + const [args, dockerArgs] = await Promise.all([Promise.all(promisedArgs), this.getDockerArguments()]); + + // Check for the debug environment variable being set. Setting this + // causes Jupyter to output a lot more information about what it's doing + // under the covers and can be used to investigate problems with Jupyter. + const debugArgs = (process.env && process.env.VSCODE_PYTHON_DEBUG_JUPYTER) ? ['--debug'] : []; // Use this temp file and config file to generate a list of args for our command - return [...mainArgs, ...extraArgs]; + return [...args, ...dockerArgs, ...debugArgs]; } /** - * Adds the `--notebook-dir` argument. + * Gets the `--notebook-dir` argument. * * @private - * @param {string[]} args * @param {Promise} tempDirectory * @returns {Promise} * @memberof NotebookStarter */ - private async addNotebookDirArgument(args: string[], tempDirectory: Promise): Promise { + private async getNotebookDirArgument(tempDirectory: Promise): Promise { const tempDir = await tempDirectory; - args.push(`--notebook-dir=${tempDir.path}`); + return `--notebook-dir=${tempDir.path}`; } /** - * Adds the `--config` argument. + * Gets the `--config` argument. * * @private - * @param {string[]} args * @param {Promise} tempDirectory * @returns {Promise} * @memberof NotebookStarter */ - private async addConfigArgument(args: string[], tempDirectory: Promise): Promise { + private async getConfigArgument(tempDirectory: Promise): Promise { const tempDir = await tempDirectory; // In the temp dir, create an empty config python file. This is the same // as starting jupyter with all of the defaults. @@ -174,40 +168,40 @@ export class NotebookStarter implements Disposable { traceInfo(`Generating custom default config at ${configFile}`); // Create extra args based on if we have a config or not - args.push(`--config=${configFile}`); + return `--config=${configFile}`; } /** * Adds the `--ip` and `--allow-root` arguments when in docker. * * @private - * @param {string[]} args * @param {Promise} tempDirectory - * @returns {Promise} + * @returns {Promise} * @memberof NotebookStarter */ - private async addDockerArguments(args: string[]): Promise { + private async getDockerArguments(): Promise { + const args: string[] = []; // Check for a docker situation. try { const cgroup = await this.fileSystem.readFile('/proc/self/cgroup').catch(() => ''); if (!cgroup.includes('docker')) { - return; + return args; } // We definitely need an ip address. args.push('--ip'); args.push('127.0.0.1'); // Now see if we need --allow-root. - await new Promise(resolve => { + return new Promise(resolve => { cp.exec('id', { encoding: 'utf-8' }, (_, stdout: string | Buffer) => { if (stdout && stdout.toString().includes('(root)')) { args.push('--allow-root'); } - resolve(); + resolve([]); }); }); } catch { - noop(); + return args; } } private async generateTempDir(): Promise { diff --git a/src/test/datascience/execution.unit.test.ts b/src/test/datascience/execution.unit.test.ts index 83fe0734c961..20267fd9e474 100644 --- a/src/test/datascience/execution.unit.test.ts +++ b/src/test/datascience/execution.unit.test.ts @@ -455,7 +455,7 @@ suite('Jupyter Execution', async () => { const getServerInfoPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'datascience', 'getServerInfo.py'); setupPythonService(service, undefined, [getServerInfoPath], Promise.resolve({ stdout: 'failure to get server infos' })); setupPythonServiceExecObservable(service, 'jupyter', ['kernelspec', 'list'], [], []); - setupPythonServiceExecObservable(service, 'jupyter', ['notebook', '--no-browser', /--notebook-dir=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0', /--config=.*/], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); + setupPythonServiceExecObservable(service, 'jupyter', ['notebook', '--no-browser', /--notebook-dir=.*/, /--config=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0'], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); } @@ -467,7 +467,7 @@ suite('Jupyter Execution', async () => { const getServerInfoPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'datascience', 'getServerInfo.py'); setupPythonService(service, undefined, [getServerInfoPath], Promise.resolve({ stdout: 'failure to get server infos' })); setupPythonServiceExecObservable(service, 'jupyter', ['kernelspec', 'list'], [], []); - setupPythonServiceExecObservable(service, 'jupyter', ['notebook', '--no-browser', /--notebook-dir=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0', /--config=.*/], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); + setupPythonServiceExecObservable(service, 'jupyter', ['notebook', '--no-browser', /--notebook-dir=.*/, /--config=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0'], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); } function setupMissingNotebookPythonService(service: TypeMoq.IMock) { @@ -495,7 +495,7 @@ suite('Jupyter Execution', async () => { const getServerInfoPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'datascience', 'getServerInfo.py'); setupProcessServiceExec(service, workingPython.path, [getServerInfoPath], Promise.resolve({ stdout: 'failure to get server infos' })); setupProcessServiceExecObservable(service, workingPython.path, ['-m', 'jupyter', 'kernelspec', 'list'], [], []); - setupProcessServiceExecObservable(service, workingPython.path, ['-m', 'jupyter', 'notebook', '--no-browser', /--notebook-dir=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0', /--config=.*/], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); + setupProcessServiceExecObservable(service, workingPython.path, ['-m', 'jupyter', 'notebook', '--no-browser', /--notebook-dir=.*/, /--config=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0'], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); } function setupMissingKernelProcessService(service: TypeMoq.IMock, notebookStdErr?: string[]) { @@ -503,7 +503,7 @@ suite('Jupyter Execution', async () => { const getServerInfoPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'datascience', 'getServerInfo.py'); setupProcessServiceExec(service, missingKernelPython.path, [getServerInfoPath], Promise.resolve({ stdout: 'failure to get server infos' })); setupProcessServiceExecObservable(service, missingKernelPython.path, ['-m', 'jupyter', 'kernelspec', 'list'], [], []); - setupProcessServiceExecObservable(service, missingKernelPython.path, ['-m', 'jupyter', 'notebook', '--no-browser', /--notebook-dir=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0', /--config=.*/], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); + setupProcessServiceExecObservable(service, missingKernelPython.path, ['-m', 'jupyter', 'notebook', '--no-browser', /--notebook-dir=.*/, /--config=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0'], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); } function setupPathProcessService(jupyterPath: string, service: TypeMoq.IMock, notebookStdErr?: string[]) { @@ -512,7 +512,7 @@ suite('Jupyter Execution', async () => { setupProcessServiceExec(service, jupyterPath, ['--version'], Promise.resolve({ stdout: '1.1.1.1' })); setupProcessServiceExec(service, jupyterPath, ['notebook', '--version'], Promise.resolve({ stdout: '1.1.1.1' })); setupProcessServiceExec(service, jupyterPath, ['kernelspec', '--version'], Promise.resolve({ stdout: '1.1.1.1' })); - setupProcessServiceExecObservable(service, jupyterPath, ['notebook', '--no-browser', /--notebook-dir=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0', /--config=.*/], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); + setupProcessServiceExecObservable(service, jupyterPath, ['notebook', '--no-browser', /--notebook-dir=.*/, /--config=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0'], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); // WE also check for existence with just the key jupyter setupProcessServiceExec(service, 'jupyter', ['--version'], Promise.resolve({ stdout: '1.1.1.1' })); From b61dde78ac2722dacfbac9c7cbb54f51298d19d3 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Mon, 4 Nov 2019 15:09:38 -0800 Subject: [PATCH 5/6] Linter issues --- src/client/datascience/jupyter/notebookStarter.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/datascience/jupyter/notebookStarter.ts b/src/client/datascience/jupyter/notebookStarter.ts index b80a45ca633c..1a6414653235 100644 --- a/src/client/datascience/jupyter/notebookStarter.ts +++ b/src/client/datascience/jupyter/notebookStarter.ts @@ -14,7 +14,6 @@ import { IFileSystem, TemporaryDirectory } from '../../common/platform/types'; import { IPythonExecutionFactory, SpawnOptions } from '../../common/process/types'; import { IDisposable } from '../../common/types'; import * as localize from '../../common/utils/localize'; -import { noop } from '../../common/utils/misc'; import { StopWatch } from '../../common/utils/stopWatch'; import { EXTENSION_ROOT_DIR } from '../../constants'; import { IServiceContainer } from '../../ioc/types'; From 52a1c045c3f2829d2929b93d04c802ce659cb541 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Mon, 4 Nov 2019 15:49:25 -0800 Subject: [PATCH 6/6] Fix linter --- src/client/datascience/jupyter/notebookStarter.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/client/datascience/jupyter/notebookStarter.ts b/src/client/datascience/jupyter/notebookStarter.ts index 1a6414653235..8133f1ef6f0e 100644 --- a/src/client/datascience/jupyter/notebookStarter.ts +++ b/src/client/datascience/jupyter/notebookStarter.ts @@ -114,8 +114,6 @@ export class NotebookStarter implements Disposable { } private async generateArguments(useDefaultConfig: boolean, tempDirPromise: Promise): Promise{ - - // Parallelize as much as possible. const promisedArgs: Promise[] = []; promisedArgs.push(Promise.resolve('--no-browser'));