mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
notebook background execution (#8079)
* notebook background execution * code review comments * comments 2 * more logging
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user