mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
MLS - Setting the right url to install sqlmlutils from for MAC and Linux (#9962)
* Setting the right url to install sqlmlutils from for MAC and Linux
This commit is contained in:
@@ -9,12 +9,25 @@
|
|||||||
"requiredRPackages": [
|
"requiredRPackages": [
|
||||||
{
|
{
|
||||||
"name": "RODBCext",
|
"name": "RODBCext",
|
||||||
"repository": "https://cran.microsoft.com"
|
"repository": "https://mran.microsoft.com/snapshot/2019-02-01/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sqlmlutils",
|
"name": "sqlmlutils",
|
||||||
"fileName": "sqlmlutils_0.7.1.zip",
|
"fileName": "sqlmlutils_0.7.1.zip",
|
||||||
"downloadUrl": "https://github.com/microsoft/sqlmlutils/blob/master/R/dist/sqlmlutils_0.7.1.zip?raw=true"
|
"downloadUrl": "https://github.com/microsoft/sqlmlutils/blob/master/R/dist/sqlmlutils_0.7.1.zip?raw=true",
|
||||||
|
"platform" : "win32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sqlmlutils",
|
||||||
|
"fileName": "sqlmlutils_0.7.1.tar.gz",
|
||||||
|
"downloadUrl": "https://github.com/microsoft/sqlmlutils/blob/master/R/dist/sqlmlutils_0.7.1.tar.gz?raw=true",
|
||||||
|
"platform" : "darwin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sqlmlutils",
|
||||||
|
"fileName": "sqlmlutils_0.7.1.tar.gz",
|
||||||
|
"downloadUrl": "https://github.com/microsoft/sqlmlutils/blob/master/R/dist/sqlmlutils_0.7.1.tar.gz?raw=true",
|
||||||
|
"platform" : "linux"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"rPackagesRepository": "https://cran.r-project.org"
|
"rPackagesRepository": "https://cran.r-project.org"
|
||||||
|
|||||||
@@ -32,4 +32,9 @@ export interface PackageConfigModel {
|
|||||||
* Package file name if package has download url
|
* Package file name if package has download url
|
||||||
*/
|
*/
|
||||||
fileName?: string;
|
fileName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Package platform (Windows, Mac, Linux)
|
||||||
|
*/
|
||||||
|
platform?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ export class PackageManager {
|
|||||||
*/
|
*/
|
||||||
public async managePackages(): Promise<void> {
|
public async managePackages(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
await this.enableExternalScript();
|
|
||||||
|
|
||||||
// Only execute the command if there's a valid connection with ml configuration enabled
|
// Only execute the command if there's a valid connection with ml configuration enabled
|
||||||
//
|
//
|
||||||
@@ -129,7 +128,8 @@ export class PackageManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await utils.createFolder(utils.getRPackagesFolderPath(this._rootFolder));
|
await utils.createFolder(utils.getRPackagesFolderPath(this._rootFolder));
|
||||||
await Promise.all(this._config.requiredSqlRPackages.map(x => this.installRPackage(x)));
|
const packages = this._config.requiredSqlRPackages.filter(p => !p.platform || p.platform === process.platform);
|
||||||
|
await Promise.all(packages.map(x => this.installRPackage(x)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export class SqlRPackageManageProvider extends SqlPackageManageProviderBase impl
|
|||||||
let scripts: string[] = [
|
let scripts: string[] = [
|
||||||
'formals(quit)$save <- formals(q)$save <- "no"',
|
'formals(quit)$save <- formals(q)$save <- "no"',
|
||||||
'library(sqlmlutils)',
|
'library(sqlmlutils)',
|
||||||
`connection <- connectionInfo(${connectionParts})`,
|
`connection <- connectionInfo(driver= "ODBC Driver 17 for SQL Server", ${connectionParts})`,
|
||||||
`r = getOption("repos")`,
|
`r = getOption("repos")`,
|
||||||
`r["CRAN"] = "${this._config.rPackagesRepository}"`,
|
`r["CRAN"] = "${this._config.rPackagesRepository}"`,
|
||||||
`options(repos = r)`,
|
`options(repos = r)`,
|
||||||
|
|||||||
Reference in New Issue
Block a user