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();

View File

@@ -234,7 +234,7 @@ export class ResourceTypeService implements IResourceTypeService {
const wizard = new DeployClusterWizard(provider.wizard, new KubeService(), new AzdataService(this.platformService), this.notebookService);
wizard.open();
} else if (instanceOfDialogDeploymentProvider(provider)) {
const dialog = new DeploymentInputDialog(this.notebookService, provider.dialog);
const dialog = new DeploymentInputDialog(this.notebookService, this.platformService, provider.dialog);
dialog.open();
} else if (instanceOfNotebookDeploymentProvider(provider)) {
this.notebookService.launchNotebook(provider.notebook);

View File

@@ -263,8 +263,10 @@ export abstract class ToolBase implements ITool {
);
this.version = this.getVersionFromOutput(commandOutput);
if (this.version) {
// discover and set the installationPath
await this.setInstallationPath();
if (this.autoInstallSupported) {
// discover and set the installationPath
await this.setInstallationPath();
}
return ToolStatus.Installed;
}
else {