From 86df1605a4dc0fb928a825b6aa6334bae84cf6cd Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Mon, 8 Jul 2019 16:41:31 -0700 Subject: [PATCH] update bdc notebook (#6286) * update bdc notebook and remove sql-image for now * update test --- .../bdc/2019/CTP3-1/deploy-bdc-aks.ipynb | 187 +++++++++++++++++- .../CTP3-1/deploy-bdc-existing-cluster.ipynb | 127 +++++++++++- .../docker/2017/deploy-sql2017-image.ipynb | 72 ------- .../docker/2019/deploy-sql2019-image.ipynb | 72 ------- extensions/resource-deployment/package.json | 59 ------ .../src/test/resourceTypeService.test.ts | 8 +- 6 files changed, 316 insertions(+), 209 deletions(-) delete mode 100644 extensions/resource-deployment/notebooks/docker/2017/deploy-sql2017-image.ipynb delete mode 100644 extensions/resource-deployment/notebooks/docker/2019/deploy-sql2019-image.ipynb diff --git a/extensions/resource-deployment/notebooks/bdc/2019/CTP3-1/deploy-bdc-aks.ipynb b/extensions/resource-deployment/notebooks/bdc/2019/CTP3-1/deploy-bdc-aks.ipynb index 5ae0b48f5c..cc716c27b0 100644 --- a/extensions/resource-deployment/notebooks/bdc/2019/CTP3-1/deploy-bdc-aks.ipynb +++ b/extensions/resource-deployment/notebooks/bdc/2019/CTP3-1/deploy-bdc-aks.ipynb @@ -22,8 +22,193 @@ "cells": [ { "cell_type": "markdown", - "source": "TODO", + "source": "![11811317_10153406249401648_2787740058697948111_n](https://raw.githubusercontent.com/Microsoft/sqlworkshops/master/graphics/solutions-microsoft-logo-small.png)\n\n## Create Azure Kubernetes Service cluster and deploy SQL Server 2019 big data cluster\n\nThis notebook walks through the process of deploying a SQL Server 2019 big data cluster on Azure Kubernetes Service.\n\n* Please follow the instructions in the **Dependencies** cell to install the dependencies.\n* The **Required information** cell will prompt you for the required information to create a SQL Server 2019 big data cluster.\n* We have included some default settings in the **Azure settings** cell of this Notebook, Please review the default values and make changes accordingly.\n* If you are experiencing issue in the *Create AKS cluster* step you might need to re-run the cell, more information: https://docs.microsoft.com/en-us/azure/aks/kubernetes-service-principal#specify-a-service-principal-for-an-aks-cluster. \n\n", "metadata": {} + }, + { + "cell_type": "markdown", + "source": "### **Dependencies**\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ToolDescriptionInstallation
Azure CLICommand-line interface for managing Azure services. Used with AKS big data cluster deployments (More info).Install
kubectlCommand-line tool for monitoring the underlying Kuberentes cluster (More info).Install
mssqlctlCommand-line tool for installing and managing a big data cluster.Install
\n

", + "metadata": {} + }, + { + "cell_type": "markdown", + "source": "### **Check dependencies**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "#Run command helper function\r\ndef run_command():\r\n print(\"Executing: \" + cmd)\r\n !{cmd}\r\n if _exit_code != 0:\r\n raise SystemExit(f'Shell command:\\n\\n\\t{cmd}\\n\\nreturned non-zero exit code: ' + str(_exit_code) + '.\\n')\r\n print(f'Successfully executed: {cmd}')\r\n\r\ncmd = 'az --version'\r\nrun_command()\r\ncmd = 'kubectl version --client=true'\r\nrun_command()\r\ncmd = 'mssqlctl --version'\r\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 1 + }, + { + "cell_type": "markdown", + "source": "### **Required information**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "import getpass\ndef get_user_input(input_name, is_password = False):\n if is_password:\n user_input = getpass.getpass(prompt = input_name)\n print(input_name + ': ***********')\n else:\n user_input = input(input_name)\n print(input_name + ': ' + user_input)\n if user_input == \"\":\n raise SystemExit(f'{input_name} is required')\n return user_input;\n\nmssql_cluster_name = get_user_input('Cluster name')\nbdc_controller_username = get_user_input('Controller username')\nbdc_controller_password = get_user_input('Controller password', True)\nbdc_mssql_sa_password = get_user_input('SQL Server password', True)\ndocker_username = get_user_input('Docker username')\ndocker_password = get_user_input('Docker password', True)", + "metadata": {}, + "outputs": [], + "execution_count": 2 + }, + { + "cell_type": "markdown", + "source": "### **Azure settings**\n*Subscription ID*: visit here to find out the subscriptions you can use, if you leave it unspecified, the default subscription will be used.\n\n*VM Size*: visit here to find out the available VM sizes you could use. \n \n*Region*: visit here to find out the Azure regions where the Azure Kubernettes Service is available.", + "metadata": {} + }, + { + "cell_type": "code", + "source": "azure_subscription_id = \"\"\nazure_vm_size = \"Standard_E4s_v3\"\nazure_region = \"eastus\"\nazure_vm_count = int(5)", + "metadata": {}, + "outputs": [], + "execution_count": 3 + }, + { + "cell_type": "markdown", + "source": "### **Default settings**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "azure_resource_group = mssql_cluster_name\nbdc_knox_password = bdc_mssql_sa_password\naks_kubernetes_version = ''\naks_cluster_name = mssql_cluster_name\nmssqlctl_configuration_profile = 'aks-dev-test'\nmssqlctl_configuration_file = 'mssql-bdc-configuration'\n\n# Show parameter values\nprint('')\nprint(f'mssql_cluster_name = {mssql_cluster_name}')\nprint(f'azure_subscription_id = {azure_subscription_id}')\nprint(f'azure_vm_size = {azure_vm_size}')\nprint(f'azure_vm_count = {str(azure_vm_count)}')\nprint(f'azure_region = {azure_region}')\nprint(f'azure_resource_group = {azure_resource_group}')\nprint(f'aks_kubernetes_version = {aks_kubernetes_version}')\nprint(f'aks_cluster_name = {aks_cluster_name}')\nprint(f'docker_username = {docker_username}')\nprint(f'mssqlctl_configuration_profile = {mssqlctl_configuration_profile}')\nprint(f'mssqlctl_configuration_file = {mssqlctl_configuration_file}')\nprint(f'bdc_controller_username = {bdc_controller_username}')\nprint('')", + "metadata": {}, + "outputs": [], + "execution_count": 4 + }, + { + "cell_type": "markdown", + "source": "### **Login to Azure**\n\nThis will open a web browser window to enable credentials to be entered. If this cells is hanging forever, it might be because your Web browser windows is waiting for you to enter your Azure credentials!\n", + "metadata": {} + }, + { + "cell_type": "code", + "source": "cmd = f'az login'\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 5 + }, + { + "cell_type": "markdown", + "source": "\n### **Set active Azure subscription**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "if azure_subscription_id != \"\":\n cmd = f'az account set --subscription {azure_subscription_id}'\n run_command()\nelse:\n print('Using the default Azure subscription', {azure_subscription_id})\ncmd = f'az account show'\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 6 + }, + { + "cell_type": "markdown", + "source": "### **Create Azure resource group**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "cmd = f'az group create --name {azure_resource_group} --location {azure_region}'\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 7 + }, + { + "cell_type": "markdown", + "source": "### **Create AKS cluster**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "if aks_kubernetes_version != \"\":\n kubernetes_version_option=\"--kubernetes-version {aks_kubernetes_version}\"\nelse:\n kubernetes_version_option = \"\"\ncmd = f'az aks create --name {aks_cluster_name} --resource-group {azure_resource_group} --generate-ssh-keys --node-vm-size {azure_vm_size} --node-count {azure_vm_count} {kubernetes_version_option}' \nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 8 + }, + { + "cell_type": "markdown", + "source": "### **Set the new AKS cluster as current context**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "cmd = f'az aks get-credentials --resource-group {azure_resource_group} --name {aks_cluster_name} --admin --overwrite-existing'\r\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 9 + }, + { + "cell_type": "markdown", + "source": "### **List the MSSQLCTL configuration profiles**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "import os\nos.environ[\"ACCEPT_EULA\"] = 'yes'\ncmd = f'mssqlctl bdc config list'\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 10 + }, + { + "cell_type": "markdown", + "source": "### **Create a MSSQLCTL configuration file**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "# Create a configuration file\ncmd = f'mssqlctl bdc config init --source {mssqlctl_configuration_profile} --target {mssqlctl_configuration_file} --force'\nrun_command()\n\n# Set the 'big data cluster' name\njsonPath = '\"metadata.name=''{0}''\"'.format(mssql_cluster_name)\ncmd = f'mssqlctl bdc config section set -c {mssqlctl_configuration_file} -j {jsonPath}'\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 11 + }, + { + "cell_type": "markdown", + "source": "### **Create SQL Server 2019 big data cluster**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "import os\nprint (f'Creating SQL Server 2019 big data cluster: {mssql_cluster_name} using configuration file {mssqlctl_configuration_file}')\nos.environ[\"CONTROLLER_USERNAME\"] = bdc_controller_username\nos.environ[\"CONTROLLER_PASSWORD\"] = bdc_controller_password\nos.environ[\"MSSQL_SA_PASSWORD\"] = bdc_mssql_sa_password\nos.environ[\"KNOX_PASSWORD\"] = bdc_knox_password\nos.environ[\"DOCKER_USERNAME\"] = docker_username\nos.environ[\"DOCKER_PASSWORD\"] = docker_password\n\ncmd = f'mssqlctl bdc create -c {mssqlctl_configuration_file} --accept-eula yes'\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 12 + }, + { + "cell_type": "markdown", + "source": "### **Login to SQL Server 2019 big data cluster**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "cmd = f'mssqlctl login --cluster-name {mssql_cluster_name}'\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 13 + }, + { + "cell_type": "markdown", + "source": "### **Show SQL Server 2019 big data cluster endpoints**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "import json\nimport pandas as pd\nfrom IPython.display import *\npd.set_option('display.max_colwidth', -1)\n\ndef formatColumnNames(column):\n return ' '.join(word[0].upper() + word[1:] for word in column.split())\n\ndef show_results(results):\n df = pd.DataFrame(results)\n df.columns = [formatColumnNames(n) for n in results[0].keys()]\n mydata = HTML(df.to_html(render_links=True))\n display(mydata)\n\ncmd = f'mssqlctl bdc endpoint list'\nendpointsResults = !{cmd}\nendpointsInJson = json.loads(''.join(endpointsResults))\nshow_results(endpointsInJson)", + "metadata": {}, + "outputs": [], + "execution_count": 14 + }, + { + "cell_type": "markdown", + "source": "### **Connect to master SQL Server instance in Azure Data Studio**\r\nClick the link below to connect to the master SQL Server instance of the SQL Server 2019 big data cluster.", + "metadata": {} + }, + { + "cell_type": "code", + "source": "filteredEndpoints = [x for x in endpointsInJson if x['name'] == 'sql-server-master']\r\nif filteredEndpoints and len(filteredEndpoints) == 1:\r\n display(HTML(\"

Click here to connect to SQL Server

\"))", + "metadata": {}, + "outputs": [], + "execution_count": 15 } ] } \ No newline at end of file diff --git a/extensions/resource-deployment/notebooks/bdc/2019/CTP3-1/deploy-bdc-existing-cluster.ipynb b/extensions/resource-deployment/notebooks/bdc/2019/CTP3-1/deploy-bdc-existing-cluster.ipynb index 5ae0b48f5c..d77a682481 100644 --- a/extensions/resource-deployment/notebooks/bdc/2019/CTP3-1/deploy-bdc-existing-cluster.ipynb +++ b/extensions/resource-deployment/notebooks/bdc/2019/CTP3-1/deploy-bdc-existing-cluster.ipynb @@ -22,8 +22,133 @@ "cells": [ { "cell_type": "markdown", - "source": "TODO", + "source": "![11811317_10153406249401648_2787740058697948111_n](https://raw.githubusercontent.com/Microsoft/sqlworkshops/master/graphics/solutions-microsoft-logo-small.png)\n\n## Deploy SQL Server 2019 big data cluster on an existing Kubernetes cluster\n\nThis notebook walks through the process of deploying a SQL Server 2019 big data cluster on an existing Kubernetes cluster\n\n* Follow the instructions in the **Dependencies** cell to install the dependencies.\n* Make sure you have the target cluster set as the current context in your kubectl config file.\n* The **Required information** cell will prompt you for the required information to create a SQL Server 2019 big data cluster.\n\n", "metadata": {} + }, + { + "cell_type": "markdown", + "source": "### **Dependencies**\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ToolDescriptionInstallation
kubectlCommand-line tool for monitoring the underlying Kuberentes cluster (More info)Install
mssqlctlCommand-line tool for installing and managing a big data clusterInstall
\n

", + "metadata": {} + }, + { + "cell_type": "markdown", + "source": "### **Check dependencies**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "#Run command helper function\r\ndef run_command():\r\n print(\"Executing: \" + cmd)\r\n !{cmd}\r\n if _exit_code != 0:\r\n raise SystemExit(f'Shell command:\\n\\n\\t{cmd}\\n\\nreturned non-zero exit code: ' + str(_exit_code) + '.\\n')\r\n print(f'Successfully executed: {cmd}')\r\n\r\ncmd = 'kubectl version --client=true'\r\nrun_command()\r\ncmd = 'mssqlctl --version'\r\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 1 + }, + { + "cell_type": "markdown", + "source": "### **Show current context**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "cmd = ' kubectl config current-context'\r\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 2 + }, + { + "cell_type": "markdown", + "source": "### **Required information**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "import getpass\ndef get_user_input(input_name, is_password = False):\n if is_password:\n user_input = getpass.getpass(prompt = input_name)\n print(input_name + ': ***********')\n else:\n user_input = input(input_name)\n print(input_name + ': ' + user_input)\n if user_input == \"\":\n raise SystemExit(f'{input_name} is required')\n return user_input;\n\nmssql_cluster_name = get_user_input('Cluster name')\nbdc_controller_username = get_user_input('Controller username')\nbdc_controller_password = get_user_input('Controller password', True)\nbdc_mssql_sa_password = get_user_input('SQL Server password', True)\ndocker_username = get_user_input('Docker username')\ndocker_password = get_user_input('Docker password', True)", + "metadata": {}, + "outputs": [], + "execution_count": 3 + }, + { + "cell_type": "markdown", + "source": "### **Default settings**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "bdc_knox_password = bdc_mssql_sa_password\nmssqlctl_configuration_profile = 'aks-dev-test'\nmssqlctl_configuration_file = 'mssql-bdc-configuration'\n\n# Show parameter values\nprint('')\nprint(f'mssql_cluster_name = {mssql_cluster_name}')\nprint(f'docker_username = {docker_username}')\nprint(f'mssqlctl_configuration_profile = {mssqlctl_configuration_profile}')\nprint(f'mssqlctl_configuration_file = {mssqlctl_configuration_file}')\nprint(f'bdc_controller_username = {bdc_controller_username}')\nprint('')", + "metadata": {}, + "outputs": [], + "execution_count": 4 + }, + { + "cell_type": "markdown", + "source": "### **List the MSSQLCTL configuration profiles**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "import os\nos.environ[\"ACCEPT_EULA\"] = 'yes'\ncmd = f'mssqlctl bdc config list'\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 5 + }, + { + "cell_type": "markdown", + "source": "### **Create a MSSQLCTL configuration file**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "# Create a configuration file\ncmd = f'mssqlctl bdc config init --source {mssqlctl_configuration_profile} --target {mssqlctl_configuration_file} --force'\nrun_command()\n\n# Set the 'big data cluster' name\njsonPath = '\"metadata.name=''{0}''\"'.format(mssql_cluster_name)\ncmd = f'mssqlctl bdc config section set -c {mssqlctl_configuration_file} -j {jsonPath}'\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 7 + }, + { + "cell_type": "markdown", + "source": "### **Create SQL Server 2019 big data cluster**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "import os\nprint (f'Creating SQL Server 2019 big data cluster: {mssql_cluster_name} using configuration file {mssqlctl_configuration_file}')\nos.environ[\"CONTROLLER_USERNAME\"] = bdc_controller_username\nos.environ[\"CONTROLLER_PASSWORD\"] = bdc_controller_password\nos.environ[\"MSSQL_SA_PASSWORD\"] = bdc_mssql_sa_password\nos.environ[\"KNOX_PASSWORD\"] = bdc_knox_password\nos.environ[\"DOCKER_USERNAME\"] = docker_username\nos.environ[\"DOCKER_PASSWORD\"] = docker_password\n\ncmd = f'mssqlctl bdc create -c {mssqlctl_configuration_file} --accept-eula yes'\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 12 + }, + { + "cell_type": "markdown", + "source": "### **Login to SQL Server 2019 big data cluster**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "cmd = f'mssqlctl login --cluster-name {mssql_cluster_name}'\nrun_command()", + "metadata": {}, + "outputs": [], + "execution_count": 13 + }, + { + "cell_type": "markdown", + "source": "### **Show SQL Server 2019 big data cluster endpoints**", + "metadata": {} + }, + { + "cell_type": "code", + "source": "import json\nimport pandas as pd\nfrom IPython.display import *\npd.set_option('display.max_colwidth', -1)\n\ndef formatColumnNames(column):\n return ' '.join(word[0].upper() + word[1:] for word in column.split())\n\ndef show_results(results):\n df = pd.DataFrame(results)\n df.columns = [formatColumnNames(n) for n in results[0].keys()]\n mydata = HTML(df.to_html(render_links=True))\n display(mydata)\n\ncmd = f'mssqlctl bdc endpoint list'\nendpointsResults = !{cmd}\nendpointsInJson = json.loads(''.join(endpointsResults))\nshow_results(endpointsInJson)", + "metadata": {}, + "outputs": [], + "execution_count": 14 + }, + { + "cell_type": "markdown", + "source": "### **Connect to master SQL Server instance in Azure Data Studio**\r\nClick the link below to connect to the master SQL Server instance of the SQL Server 2019 big data cluster.", + "metadata": {} + }, + { + "cell_type": "code", + "source": "filteredEndpoints = [x for x in endpointsInJson if x['name'] == 'sql-server-master']\r\nif filteredEndpoints and len(filteredEndpoints) == 1:\r\n display(HTML(\"

Click here to connect to SQL Server

\"))", + "metadata": {}, + "outputs": [], + "execution_count": 15 } ] } \ No newline at end of file diff --git a/extensions/resource-deployment/notebooks/docker/2017/deploy-sql2017-image.ipynb b/extensions/resource-deployment/notebooks/docker/2017/deploy-sql2017-image.ipynb deleted file mode 100644 index 6a915e14ef..0000000000 --- a/extensions/resource-deployment/notebooks/docker/2017/deploy-sql2017-image.ipynb +++ /dev/null @@ -1,72 +0,0 @@ -{ - "metadata": { - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python", - "version": "3.6.6", - "mimetype": "text/x-python", - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "pygments_lexer": "ipython3", - "nbconvert_exporter": "python", - "file_extension": ".py" - } - }, - "nbformat_minor": 2, - "nbformat": 4, - "cells": [ - { - "cell_type": "markdown", - "source": "First, pull the Microsoft SQL Server 2017 Image", - "metadata": {} - }, - { - "cell_type": "code", - "source": "cmd = f'docker pull mcr.microsoft.com/mssql/server:2017-latest'\r\n!{cmd}", - "metadata": {}, - "outputs": [], - "execution_count": 49 - }, - { - "cell_type": "markdown", - "source": "List all the containers", - "metadata": {} - }, - { - "cell_type": "code", - "source": "cmd = f'docker ps -a'\r\n!{cmd}", - "metadata": {}, - "outputs": [], - "execution_count": 50 - }, - { - "cell_type": "markdown", - "source": "Start a new container with SQL Server 2017", - "metadata": {} - }, - { - "cell_type": "code", - "source": "import time\r\n\r\ncontainer_name = 'sql2017-' + time.strftime(\"%Y%m%d%H%M%S\", time.localtime())\r\nprint('New container name: ' + container_name)\r\n\r\nsql_port = 1433\r\nsa_password = \"\"\r\n\r\ncmd = f'docker run -e ACCEPT_EULA=Y -e \"SA_PASSWORD={sa_password}\" -p {sql_port}:{sql_port} --name {container_name} -d mcr.microsoft.com/mssql/server:2017-latest'\r\nprint(cmd)\r\n!{cmd}", - "metadata": {}, - "outputs": [], - "execution_count": 51 - }, - { - "cell_type": "markdown", - "source": "List all the containers", - "metadata": {} - }, - { - "cell_type": "code", - "source": "cmd = f'docker ps -a'\r\n!{cmd}", - "metadata": {}, - "outputs": [], - "execution_count": 48 - } - ] -} \ No newline at end of file diff --git a/extensions/resource-deployment/notebooks/docker/2019/deploy-sql2019-image.ipynb b/extensions/resource-deployment/notebooks/docker/2019/deploy-sql2019-image.ipynb deleted file mode 100644 index b7cbf977e6..0000000000 --- a/extensions/resource-deployment/notebooks/docker/2019/deploy-sql2019-image.ipynb +++ /dev/null @@ -1,72 +0,0 @@ -{ - "metadata": { - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python", - "version": "3.6.6", - "mimetype": "text/x-python", - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "pygments_lexer": "ipython3", - "nbconvert_exporter": "python", - "file_extension": ".py" - } - }, - "nbformat_minor": 2, - "nbformat": 4, - "cells": [ - { - "cell_type": "markdown", - "source": "First, pull the Microsoft SQL Server 2019 Image", - "metadata": {} - }, - { - "cell_type": "code", - "source": "cmd = f'docker pull mcr.microsoft.com/mssql/server:2019-latest'\r\n!{cmd}", - "metadata": {}, - "outputs": [], - "execution_count": 49 - }, - { - "cell_type": "markdown", - "source": "List all the containers", - "metadata": {} - }, - { - "cell_type": "code", - "source": "cmd = f'docker ps -a'\r\n!{cmd}", - "metadata": {}, - "outputs": [], - "execution_count": 50 - }, - { - "cell_type": "markdown", - "source": "Start a new container with SQL Server 2019", - "metadata": {} - }, - { - "cell_type": "code", - "source": "import time\r\n\r\ncontainer_name = 'sql2019-' + time.strftime(\"%Y%m%d%H%M%S\", time.localtime())\r\nprint('New container name: ' + container_name)\r\n\r\nsql_port = 1433\r\nsa_password = \"\"\r\n\r\ncmd = f'docker run -e ACCEPT_EULA=Y -e \"SA_PASSWORD={sa_password}\" -p {sql_port}:{sql_port} --name {container_name} -d mcr.microsoft.com/mssql/server:2019-latest'\r\nprint(cmd)\r\n!{cmd}", - "metadata": {}, - "outputs": [], - "execution_count": 51 - }, - { - "cell_type": "markdown", - "source": "List all the containers", - "metadata": {} - }, - { - "cell_type": "code", - "source": "cmd = f'docker ps -a'\r\n!{cmd}", - "metadata": {}, - "outputs": [], - "execution_count": 48 - } - ] -} \ No newline at end of file diff --git a/extensions/resource-deployment/package.json b/extensions/resource-deployment/package.json index 87de13b9c5..e3854cb9fe 100644 --- a/extensions/resource-deployment/package.json +++ b/extensions/resource-deployment/package.json @@ -26,11 +26,6 @@ ], "contributes": { "commands": [ - { - "command": "azdata.resource.sql-image.deploy", - "title": "%deploy-sql-image-command-name%", - "category": "%deploy-resource-command-category%" - }, { "command": "azdata.resource.sql-bdc.deploy", "title": "%deploy-sql-bdc-command-name%", @@ -50,10 +45,6 @@ } ], "dataExplorer/action": [ - { - "command": "azdata.resource.sql-image.deploy", - "group": "secondary" - }, { "command": "azdata.resource.sql-bdc.deploy", "group": "secondary" @@ -62,56 +53,6 @@ } }, "resourceTypes": [ - { - "name": "sql-image", - "displayName": "%resource-type-sql-image-display-name%", - "description": "%resource-type-sql-image-description%", - "platforms": [ - "darwin", - "win32", - "linux" - ], - "icon": { - "light": "./images/sql_server.svg", - "dark": "./images/sql_server_inverse.svg" - }, - "options": [ - { - "name": "version", - "displayName": "%version-display-name%", - "values": [ - { - "name": "sql2017", - "displayName": "%sql-2017-display-name%" - }, - { - "name": "sql2019", - "displayName": "%sql-2019-display-name%" - } - ] - } - ], - "providers": [ - { - "notebook": "%sql-2017-docker-notebook%", - "requiredTools": [ - { - "name": "docker" - } - ], - "when": "version=sql2017" - }, - { - "notebook": "%sql-2019-docker-notebook%", - "requiredTools": [ - { - "name": "docker" - } - ], - "when": "version=sql2019" - } - ] - }, { "name": "sql-bdc", "displayName": "%resource-type-sql-bdc-display-name%", diff --git a/extensions/resource-deployment/src/test/resourceTypeService.test.ts b/extensions/resource-deployment/src/test/resourceTypeService.test.ts index 787a32a855..dba2cd3265 100644 --- a/extensions/resource-deployment/src/test/resourceTypeService.test.ts +++ b/extensions/resource-deployment/src/test/resourceTypeService.test.ts @@ -21,10 +21,10 @@ suite('Resource Type Service Tests', function (): void { const resourceTypeService = new ResourceTypeService(mockPlatformService.object, toolsService); // index 0: platform name, index 1: number of expected resource types const platforms: { platform: string; resourceTypeCount: number }[] = [ - { platform: 'win32', resourceTypeCount: 2 }, - { platform: 'darwin', resourceTypeCount: 2 }, - { platform: 'linux', resourceTypeCount: 2 }]; - const totalResourceTypeCount = 2; + { platform: 'win32', resourceTypeCount: 1 }, + { platform: 'darwin', resourceTypeCount: 1 }, + { platform: 'linux', resourceTypeCount: 1 }]; + const totalResourceTypeCount = 1; platforms.forEach(platformInfo => { mockPlatformService.reset(); mockPlatformService.setup(service => service.platform()).returns(() => platformInfo.platform);