From 3395997b7002d83fe45275603f00b6fad792bbac Mon Sep 17 00:00:00 2001 From: Bharath Sankaranarayan Date: Thu, 28 Feb 2019 11:07:18 -0800 Subject: [PATCH 1/4] updated the code to handle error --- .../app-deploy/RollDice/roll-dice.R | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/samples/features/sql-big-data-cluster/app-deploy/RollDice/roll-dice.R b/samples/features/sql-big-data-cluster/app-deploy/RollDice/roll-dice.R index f0e2002c..7d87ec8a 100644 --- a/samples/features/sql-big-data-cluster/app-deploy/RollDice/roll-dice.R +++ b/samples/features/sql-big-data-cluster/app-deploy/RollDice/roll-dice.R @@ -9,15 +9,20 @@ #install.packages("TeachingDemos") rollEm <- function(numDice = 2) + { -list.of.packages <- c("TeachingDemos") -new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] -if(length(new.packages)) install.packages(new.packages) + if (numDice < 11) + { + list.of.packages <- c("TeachingDemos") + new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] + if(length(new.packages)) install.packages(new.packages) library(TeachingDemos) - - r<-dice(ndice = numDice) - return(as.data.frame(r)) + r<-dice(ndice = numDice) + return(as.data.frame(r)) + } + else {"Oops we have not quite figued this out... number of dice need to be less than or equal to 10!"} } + result<-rollEm(x) From 3ec5929705a348f8c329c3b6da3cb694958291a9 Mon Sep 17 00:00:00 2001 From: Bharath Sankaranarayan Date: Thu, 28 Feb 2019 15:06:50 -0800 Subject: [PATCH 2/4] Update roll-dice.R --- .../sql-big-data-cluster/app-deploy/RollDice/roll-dice.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/features/sql-big-data-cluster/app-deploy/RollDice/roll-dice.R b/samples/features/sql-big-data-cluster/app-deploy/RollDice/roll-dice.R index 7d87ec8a..3c7dc182 100644 --- a/samples/features/sql-big-data-cluster/app-deploy/RollDice/roll-dice.R +++ b/samples/features/sql-big-data-cluster/app-deploy/RollDice/roll-dice.R @@ -7,7 +7,7 @@ ##################################################### ##################################################### #install.packages("TeachingDemos") - +# Note if you choose > 10 as the number of dice the app fails as it is not able to handle Null or N/A which are the default lables for the colors rollEm <- function(numDice = 2) { From 01d079957cdc260daf2f3eec9debb1a6262890ad Mon Sep 17 00:00:00 2001 From: Mihaela Blendea Date: Fri, 1 Mar 2019 07:48:08 -0800 Subject: [PATCH 3/4] Updates for CTP2.3 --- .../deployment/aks/deploy-sql-big-data-aks.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/features/sql-big-data-cluster/deployment/aks/deploy-sql-big-data-aks.py b/samples/features/sql-big-data-cluster/deployment/aks/deploy-sql-big-data-aks.py index 3f9ab628..5fdbc201 100644 --- a/samples/features/sql-big-data-cluster/deployment/aks/deploy-sql-big-data-aks.py +++ b/samples/features/sql-big-data-cluster/deployment/aks/deploy-sql-big-data-aks.py @@ -1,7 +1,7 @@ # # Prerequisites: # -# Azure CLI (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli), python3 (https://www.python.org/downloads), mssqlctl CLI (pip3 install --index-url https://private-repo.microsoft.com/python/ctp-2.0 mssqlctl ) +# Azure CLI (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli), python3 (https://www.python.org/downloads), mssqlctl CLI (pip3 install -r https://private-repo.microsoft.com/python/ctp-2.3/mssqlctl/requirements.txt ) # # Run `az login` at least once BEFORE running this script # @@ -58,7 +58,7 @@ os.environ['DOCKER_IMAGE_TAG']=DOCKER_IMAGE_TAG os.environ['DOCKER_IMAGE_POLICY']="IfNotPresent" os.environ['DOCKER_PRIVATE_REGISTRY']="1" os.environ['CLUSTER_PLATFORM']="aks" -os.environ['ACCEPT_EULA']="Y" +os.environ['ACCEPT_EULA']="yes" print ("Set azure context to subcription: "+SUBSCRIPTION_ID) command = "az account set -s "+ SUBSCRIPTION_ID @@ -72,11 +72,11 @@ print("Creating AKS cluster: "+CLUSTER_NAME) command = "az aks create --name "+CLUSTER_NAME+" --resource-group "+GROUP_NAME+" --generate-ssh-keys --node-vm-size "+VM_SIZE+" --node-count "+AKS_NODE_COUNT+" --kubernetes-version 1.10.9" executeCmd (command) -command = "az aks get-credentials --name "+CLUSTER_NAME+" --resource-group "+GROUP_NAME+" --admin" +command = "az aks get-credentials --overwrite-existing --name "+CLUSTER_NAME+" --resource-group "+GROUP_NAME+" --admin" executeCmd (command) print("Creating SQL Big Data cluster:" +CLUSTER_NAME) -command="mssqlctl create cluster "+CLUSTER_NAME +command="mssqlctl cluster create --name "+CLUSTER_NAME executeCmd (command) print("") @@ -86,10 +86,10 @@ command="kubectl get service endpoint-master-pool -o=custom-columns=""IP:.status executeCmd(command) print("") print("HDFS/KNOX:") -command="kubectl get service service-security-lb -o=custom-columns=""IP:status.loadBalancer.ingress[0].ip,PORT:.spec.ports[0].port"" -n "+CLUSTER_NAME +command="kubectl get service endpoint-security -o=custom-columns=""IP:status.loadBalancer.ingress[0].ip,PORT:.spec.ports[0].port"" -n "+CLUSTER_NAME executeCmd(command) print("") print("Cluster administration portal (https://:):") -command="kubectl get service service-proxy-lb -o=custom-columns=""IP:status.loadBalancer.ingress[0].ip,PORT:.spec.ports[0].port"" -n "+CLUSTER_NAME +command="kubectl get service endpoint-service-proxy -o=custom-columns=""IP:status.loadBalancer.ingress[0].ip,PORT:.spec.ports[0].port"" -n "+CLUSTER_NAME executeCmd(command) print("") From df1e328198e638fab1ebcab0d5d1e54d2bc4c5fd Mon Sep 17 00:00:00 2001 From: Mihaela Blendea Date: Fri, 1 Mar 2019 07:49:59 -0800 Subject: [PATCH 4/4] Updates for CTP2.3 --- samples/features/sql-big-data-cluster/deployment/aks/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/features/sql-big-data-cluster/deployment/aks/README.md b/samples/features/sql-big-data-cluster/deployment/aks/README.md index dbb6578d..a07d5c41 100644 --- a/samples/features/sql-big-data-cluster/deployment/aks/README.md +++ b/samples/features/sql-big-data-cluster/deployment/aks/README.md @@ -18,7 +18,7 @@ Using this sample Python script, you will deploy a Kubernetes cluster in Azure u ``` - Install mssqlctl CLI latest version using . Run the command below using elevated priviledges (sudo or admin cmd window): ``` - pip3 install --extra-index-url https://private-repo.microsoft.com/python/ctp-2.2 mssqlctl + pip3 install -r https://private-repo.microsoft.com/python/ctp-2.3/mssqlctl/requirements.txt ``` 1. Login into your Azure account. Run this command: ```