This commit is contained in:
yueguoguo 2017-06-21 11:29:17 +08:00
Родитель 3a3c2b4687
Коммит 5873e1968b
3 изменённых файлов: 25 добавлений и 53 удалений

Просмотреть файл

@ -1,45 +1,17 @@
# One-box configuration for MRS based virtual machine.
# deploy an MRS VM.
library(AzureSMR)
library(AzureDSVM)
settingsfile <- getOption("AzureSMR.config")
config <- read.AzureSMR.config()
timestamp <- format(Sys.time(), format="%y%m%d%H%M")
context("DSVM deployment (this test may last 10 to 15 minutes)")
asc <- createAzureContext()
with(config,
setAzureContext(asc, tenantID=tenantID, clientID=clientID, authKey=authKey)
)
azureAuthenticate(asc)
azureCreateResourceGroup(asc,
resourceGroup = "mrstest",
location = "southeastasia")
deployDSVM(context = asc,
resource.group = "mrstest",
location = "southeastasia",
hostname = "mrsle",
username = "zhle",
size = "Standard_D4_v2",
os = "RServer",
authen = "Key",
pubkey = config$PUBKEY)
mrsOneBoxConfiguration <- function(azureActiveContext,
vmName) {
mrsOneBoxConfiguration <- function(context,
hostname) {
assert_that(AzureSMR:::is_vm_name(vmName))
status <- operateDSVM(context=azureActiveContext,
names =
status <- operateDSVM(context=context,
hostname=hostname,
operation="Check")
if (status != )
if (status != "Provisioning succeeded, VM running") {
operateDSVM(context=context,
hostname=hostname,
operation="Start")
} else {
# do the one-box configuration.
# TODO: check the OS to be Microsoft R Server.
}
}

Просмотреть файл

@ -28,7 +28,7 @@ operateDSVM <- function(context,
assert_that(AzureSMR:::is_vm_name(hostname))
if (missing(operation)) stop("Please specify an operation on the DSVM")
operation <- match.arg(c("Check", "Start", "Stop", "Delete"))
operation <- match.arg(operation, c("Check", "Start", "Stop", "Delete"))
# check if vm exists.

Просмотреть файл

@ -36,19 +36,19 @@ dsvm_username <- "dsvmuser"
context("Operate a DSVM")
res <- deployDSVM(asc,
resource.group=resourceGroup_name,
location=location,
hostname=dsvm_name,
username=dsvm_username,
size=dsvm_size,
os=dsvm_os,
authen="Password",
pubkey="",
password=dsvm_password,
mode="Sync")
test_that("- check status of a DSVM", {
deployDSVM(asc,
resource.group=resourceGroup_name,
location=location,
hostname=dsvm_name,
username=dsvm_username,
size=dsvm_size,
os=dsvm_os,
authen="Password",
pubkey="",
password=dsvm_password,
mode="Sync")
res <- operateDSVM(asc,
resource.group=resourceGroup_name,
hostname=dsvm_name,