notebook background execution (#8079)

* notebook background execution

* code review comments

* comments 2

* more logging
This commit is contained in:
Alan Ren
2019-10-29 11:53:50 -07:00
committed by GitHub
parent 6e7311ca87
commit 5629356c66
7 changed files with 83 additions and 20 deletions

View File

@@ -35,7 +35,7 @@ export interface INotebookService {
launchNotebook(notebook: string | NotebookInfo): Thenable<azdata.nb.NotebookEditor>;
launchNotebookWithContent(title: string, content: string): Thenable<azdata.nb.NotebookEditor>;
getNotebook(notebook: string | NotebookInfo): Promise<Notebook>;
executeNotebook(notebook: any, env: NodeJS.ProcessEnv): Promise<NotebookExecutionResult>;
executeNotebook(notebook: any, env?: NodeJS.ProcessEnv): Promise<NotebookExecutionResult>;
}
export class NotebookService implements INotebookService {
@@ -73,7 +73,7 @@ export class NotebookService implements INotebookService {
return <Notebook>JSON.parse(await this.platformService.readTextFile(notebookPath));
}
async executeNotebook(notebook: Notebook, env: NodeJS.ProcessEnv): Promise<NotebookExecutionResult> {
async executeNotebook(notebook: Notebook, env?: NodeJS.ProcessEnv): Promise<NotebookExecutionResult> {
const content = JSON.stringify(notebook, undefined, 4);
const fileName = `nb-${getDateTimeString()}.ipynb`;
const workingDirectory = this.platformService.storagePath();