mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 18:46:36 -05:00
Machine Learning Model Registry - Iteration1 (#9105)
* Machine learning services extension - model registration wizard
This commit is contained in:
@@ -82,7 +82,23 @@ export class ApiWrapper {
|
||||
return azdata.window.createModelViewDialog(title, dialogName, isWide);
|
||||
}
|
||||
|
||||
public createWizard(title: string): azdata.window.Wizard {
|
||||
return azdata.window.createWizard(title);
|
||||
}
|
||||
|
||||
public createWizardPage(title: string): azdata.window.WizardPage {
|
||||
return azdata.window.createWizardPage(title);
|
||||
}
|
||||
|
||||
public openDialog(dialog: azdata.window.Dialog): void {
|
||||
return azdata.window.openDialog(dialog);
|
||||
}
|
||||
|
||||
public getAllAccounts(): Thenable<azdata.Account[]> {
|
||||
return azdata.accounts.getAllAccounts();
|
||||
}
|
||||
|
||||
public getSecurityToken(account: azdata.Account, resource: azdata.AzureResource): Thenable<{ [key: string]: any }> {
|
||||
return azdata.accounts.getSecurityToken(account, resource);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,14 @@ export const mlEnableMlsCommand = 'mls.command.enableMls';
|
||||
export const mlDisableMlsCommand = 'mls.command.disableMls';
|
||||
export const extensionOutputChannel = 'Machine Learning Services';
|
||||
export const notebookExtensionName = 'Microsoft.notebook';
|
||||
export const azureSubscriptionsCommand = 'azure.accounts.getSubscriptions';
|
||||
export const azureResourceGroupsCommand = 'azure.accounts.getResourceGroups';
|
||||
|
||||
// Tasks, commands
|
||||
//
|
||||
export const mlManageLanguagesCommand = 'mls.command.manageLanguages';
|
||||
export const mlManageModelsCommand = 'mls.command.manageModels';
|
||||
export const mlRegisterModelCommand = 'mls.command.registerModel';
|
||||
export const mlManagePackagesCommand = 'mls.command.managePackages';
|
||||
export const mlOdbcDriverCommand = 'mls.command.odbcdriver';
|
||||
export const mlsDocumentsCommand = 'mls.command.mlsdocs';
|
||||
@@ -33,6 +37,7 @@ export const mlsConfigKey = 'machineLearningServices';
|
||||
export const pythonPathConfigKey = 'pythonPath';
|
||||
export const pythonEnabledConfigKey = 'enablePython';
|
||||
export const rEnabledConfigKey = 'enableR';
|
||||
export const registeredModelsTableName = 'registeredModelsTableName';
|
||||
export const rPathConfigKey = 'rPath';
|
||||
|
||||
// Localized texts
|
||||
@@ -70,7 +75,8 @@ export function httpGetRequestError(code: number, message: string): string {
|
||||
code,
|
||||
message);
|
||||
}
|
||||
export function getErrorMessage(error: Error): string { return localize('azure.resource.error', "Error: {0}", error?.message); }
|
||||
export function getErrorMessage(error: Error): string { return localize('azure.resource.error', "Error: {0}", error?.message || error?.toString()); }
|
||||
export const notSupportedEventArg = localize('notSupportedEventArg', "Not supported event args");
|
||||
export const extLangInstallTabTitle = localize('extLang.installTabTitle', "Installed");
|
||||
export const extLangLanguageCreatedDate = localize('extLang.languageCreatedDate', "Installed");
|
||||
export const extLangLanguagePlatform = localize('extLang.languagePlatform', "Platform");
|
||||
@@ -95,6 +101,33 @@ export const extLangSelectedPath = localize('extLang.selectedPath', "Selected Pa
|
||||
export const extLangInstallFailedError = localize('extLang.installFailedError', "Failed to install language");
|
||||
export const extLangUpdateFailedError = localize('extLang.updateFailedError', "Failed to update language");
|
||||
|
||||
export const modeIld = localize('models.id', "Id");
|
||||
export const modelName = localize('models.name', "Name");
|
||||
export const modelSize = localize('models.size', "Size");
|
||||
export const browseModels = localize('models.browseButton', "...");
|
||||
export const azureAccount = localize('models.azureAccount', "Account");
|
||||
export const azureSubscription = localize('models.azureSubscription', "Subscription");
|
||||
export const azureGroup = localize('models.azureGroup', "Resource Group");
|
||||
export const azureModelWorkspace = localize('models.azureModelWorkspace', "Workspace");
|
||||
export const azureModelFilter = localize('models.azureModelFilter', "Filter");
|
||||
export const azureModels = localize('models.azureModels', "Models");
|
||||
export const azureModelsTitle = localize('models.azureModelsTitle', "Azure models");
|
||||
export const localModelsTitle = localize('models.localModelsTitle', "Local models");
|
||||
export const modelSourcesTitle = localize('models.modelSourcesTitle', "Source location");
|
||||
export const currentModelsTitle = localize('models.currentModelsTitle', "Models");
|
||||
export const azureRegisterModel = localize('models.azureRegisterModel', "Register");
|
||||
export const registerModelWizardTitle = localize('models.RegisterWizard', "Register");
|
||||
export const registerModelButton = localize('models.RegisterModelButton', "Register model");
|
||||
export const modelRegisteredSuccessfully = localize('models.modelRegisteredSuccessfully', "Model registered successfully");
|
||||
export const modelFailedToRegister = localize('models.modelFailedToRegistered', "Model failed to register");
|
||||
export const localModelSource = localize('models.localModelSource', "Upload file");
|
||||
export const azureModelSource = localize('models.azureModelSource', "Import from AzureML registry");
|
||||
export const downloadModelMsgTaskName = localize('models.downloadModelMsgTaskName', "Downloading Model from Azure");
|
||||
export const invalidAzureResourceError = localize('models.invalidAzureResourceError', "Invalid Azure resource");
|
||||
export const invalidModelToRegisterError = localize('models.invalidModelToRegisterError', "Invalid model to register");
|
||||
|
||||
|
||||
|
||||
// Links
|
||||
//
|
||||
export const mlsDocuments = 'https://docs.microsoft.com/sql/advanced-analytics/?view=sql-server-ver15';
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
export class EventEmitterCollection extends vscode.Disposable {
|
||||
private _events: Map<string, vscode.EventEmitter<any>[]> = new Map<string, vscode.EventEmitter<any>[]>();
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
constructor() {
|
||||
super(() => this.dispose());
|
||||
|
||||
}
|
||||
|
||||
public on(evt: string, listener: (e: any) => any, thisArgs?: any) {
|
||||
if (!this._events.has(evt)) {
|
||||
this._events.set(evt, []);
|
||||
}
|
||||
let eventEmitter = new vscode.EventEmitter<any>();
|
||||
eventEmitter.event(listener, thisArgs);
|
||||
this._events.get(evt)?.push(eventEmitter);
|
||||
return this;
|
||||
}
|
||||
|
||||
public fire(evt: string, arg?: any) {
|
||||
if (!this._events.has(evt)) {
|
||||
this._events.set(evt, []);
|
||||
}
|
||||
this._events.get(evt)?.forEach(eventEmitter => {
|
||||
eventEmitter.fire(arg);
|
||||
});
|
||||
}
|
||||
|
||||
public dispose(): any {
|
||||
this._events.forEach(events => {
|
||||
events.forEach(event => {
|
||||
event.dispose();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ export class QueryRunner {
|
||||
return isEnabled;
|
||||
}
|
||||
|
||||
private async runQuery(connection: azdata.connection.ConnectionProfile, query: string): Promise<azdata.SimpleExecuteResult | undefined> {
|
||||
public async runQuery(connection: azdata.connection.ConnectionProfile, query: string): Promise<azdata.SimpleExecuteResult | undefined> {
|
||||
let result: azdata.SimpleExecuteResult | undefined = undefined;
|
||||
try {
|
||||
if (connection) {
|
||||
|
||||
Reference in New Issue
Block a user