Default is "Ubuntu" instead of "Linux"!

Added CentOS and made Ubuntu as default
This commit is contained in:
yueguoguo 2017-05-12 11:35:30 +08:00
Родитель 831e0a13e8
Коммит 8f22d9ec3e
3 изменённых файлов: 40 добавлений и 23 удалений

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

@ -17,8 +17,7 @@
#' @param size Size of the DSVM. The default is "Standard_D1_v2". All
#' available sizes can be obtained by function `getVMSizes`.
#'
#' @param os Operating system of DSVM. Permitted values are "Linux"
#' ,"Windows", and "DeepLearning". The default is to deploy a Linux Data Science
#' @param os Operating system of DSVM. Permitted values are "Ubuntu", "CentOS", "Windows", and "DeepLearning". The default is to deploy a Ubuntu Linux Data Science
#' Virtual Machine. NOTE Deep learning DSVM is still Windows based but there is an extension which preinstalls GPU related drivers and libraries.
#'
#' @param authen Either "Key" for public-key based authentication
@ -49,8 +48,8 @@
#'
#' @examples
#' \dontrun{
#' # The following deploys a Linux DSVM with public key based authentication
#' deployDSVM(context, resource.group="<resource_group>", location="<location>", hostname="<machine_name>", username="<user_name>", os="Linux", pubkey="<a_valid_public_key_string_in_SSH_format>")
#' # The following deploys a Ubuntu DSVM with public key based authentication
#' deployDSVM(context, resource.group="<resource_group>", location="<location>", hostname="<machine_name>", username="<user_name>", os="Ubuntu", pubkey="<a_valid_public_key_string_in_SSH_format>")
#'
#' # The following deploys a Windows DSVM with password based authentication. The VM size is selected from all the available A-series machines that have the maximum number of computing cores.
#'
@ -68,8 +67,8 @@ deployDSVM <- function(context,
hostname,
username,
size="Standard_D1_v2",
os="Linux",
authen=ifelse(os=="Linux", "Key", "Password"),
os="Ubuntu",
authen=ifelse(os=="Ubuntu", "Key", "Password"),
pubkey="",
password="",
dns.label=hostname,
@ -148,7 +147,7 @@ deployDSVM <- function(context,
} else if(os == "DeepLearning") {
temp_path <- system.file("etc", "template_deeplearning.json", package="AzureDSVM")
para_path <- system.file("etc", "parameter_deeplearning.json", package="AzureDSVM")
} else if(os == "Linux")
} else if(os == "Ubuntu")
{
if(authen == "Key")
{
@ -162,9 +161,23 @@ deployDSVM <- function(context,
{
stop("Please specific a valid authentication method, i.e., either 'Key' for public key based or 'Password' for password based, for Linux OS based DSVM")
}
} else if(os == "CentOS")
{
if(authen == "Key")
{
temp_path <- system.file("etc", "template_linux_key.json", package="AzureDSVM")
para_path <- system.file("etc", "parameter_linux_key.json", package="AzureDSVM")
} else if(authen == "Password")
{
temp_path <- system.file("etc", "template_linux.json", package="AzureDSVM")
para_path <- system.file("etc", "parameter_linux.json", package="AzureDSVM")
} else
{
stop("Please specific a valid authentication method, i.e., either 'Key' for public key based or 'Password' for password based, for Linux OS based DSVM")
}
} else
{
stop("Please specify a valid OS type, i.e., either 'Windows', 'DeepLearning', or 'Linux'.")
stop("Please specify a valid OS type, i.e., either 'Windows', 'DeepLearning', 'CentOS', or 'Ubuntu'.")
}
# Update the parameter JSON with the virtual machine hostname.

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

@ -151,7 +151,7 @@ deployDSVMCluster <- function(context,
hostname=hostnames[i],
username=usernames[i],
size=size,
os="Linux",
os="Ubuntu",
authen="Key",
pubkey=pubkeys[i],
dns.label=hostnames[i],

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

@ -47,7 +47,7 @@ library(rattle)
USER <- Sys.info()[['user']]
source(paste0(USER, "_credentials.R"))
source(file.path("..", paste0(USER, "_credentials.R")))
```
```{r}
@ -98,42 +98,42 @@ if (! rg_pre_exists) azureCreateResourceGroup(context, RG, LOC)
existsRG(context, RG, LOC)
```
## Deploy a Linux Data Science Virtual Machine
## Deploy a Ubuntu Data Science Virtual Machine
Create the actual Linux DSVM with public-key based authentication
Create the actual Ubuntu DSVM with public-key based authentication
method. Name, username, and size can also be configured.
```{r deploy}
# Create the required Linux DSVM - generally 4 minutes.
# Create the required Ubuntu DSVM - generally 4 minutes.
ldsvm <- deployDSVM(context,
resource.group=RG,
location=LOC,
name=LDSVM,
hostname=HOST,
username=USER,
size="Standard_DS1_v2",
os="Linux",
size="Standard_D12_v2",
os="Ubuntu",
authen="Key",
pubkey=PUBKEY)
ldsvm
operateDSVM(context, RG, LDSVM, operation="Check")
operateDSVM(context, RG, HOST, operation="Check")
azureListVM(context, RG)
```
## Deploy a cluster of Linux Data Science Virtual Machines.
## Deploy a cluster of Ubuntu Data Science Virtual Machines.
```{r}
# Create a set of Linux DSVMs and they will be formed as a cluster.
# Create a set of Ubuntu DSVMs and they will be formed as a cluster.
ldsvm_set <- deployDSVMCluster(context,
resource.group=RG,
location=LOC,
count=COUNT,
name=LDSVM,
name=HOST,
username=LUSER,
pubkey=rep(PUBKEY, COUNT),
cluster=FALSE)
@ -248,10 +248,14 @@ mlProcess <- function(formula, data, modelName, modelPara) {
```
The worker script can be executed on a remote Linux DSVM or DSVM cluster with AzureDSVM function `executeScript` like what has been done in the previous tutorials.
The worker script can be executed on a remote Ubuntu DSVM or DSVM cluster with AzureDSVM function `executeScript` like what has been done in the previous tutorials.
The worker script for binary classification is located in "/test" directory, with name "worker_classficiation.R".
```{r}
VM_URL <- paste(HOST, LOC, "cloudapp.azure.com", sep=".")
```
```{r execution}
# remote execution on a single DSVM.
@ -260,10 +264,10 @@ time1 <- Sys.time()
executeScript(context,
resource.group=RG,
machines=LDSVM,
machines=HOST,
remote=VM_URL,
user=USER,
script="./workerClassification.R",
script="../test/workerClassification.R",
master=VM_URL,
slaves=VM_URL,
compute.context="localParallel")