mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-04-02 18:10:30 -04:00
wizard for deploying bdc (#7183)
* wip * wip2 * wip eod 820 * wip 822 * text component improvements and misc changes * aria-label * targetClusterPage wip * target cluster page * target cluster page * wip 827 * wip deployment profile page * profile page * service settings page * wip 0903 * 0909 wip * 0910 * 0911 * sql instance and working directory * notebooks * docker version on windows * EULA env var * 917 updates * address comments * use async file access * fix the summary page display issue for ad auth * add save json file buttons * use promise for private methds * review feedbacks * refactor * pass json to notebooks * fix no tool scenario * bypass tool check if installed * update hint text * update notebooks * workaround azdata first time use * comments * accept eula and some text update * fix the error in package.json * promise instead of thenable * comments * fix typo
This commit is contained in:
@@ -25,20 +25,18 @@
|
||||
"source": [
|
||||
"\n",
|
||||
" \n",
|
||||
"## Deploy SQL Server 2019 big data cluster on an existing Azure Kubernetes Service (AKS) cluster\n",
|
||||
"## Deploy SQL Server 2019 Big Data Cluster on an existing Azure Kubernetes Service (AKS) cluster\n",
|
||||
" \n",
|
||||
"This notebook walks through the process of deploying a <a href=\"https://docs.microsoft.com/sql/big-data-cluster/big-data-cluster-overview?view=sqlallproducts-allversions\">SQL Server 2019 big data cluster</a> on an existing AKS cluster.\n",
|
||||
"This notebook walks through the process of deploying a <a href=\"https://docs.microsoft.com/sql/big-data-cluster/big-data-cluster-overview?view=sqlallproducts-allversions\">SQL Server 2019 Big Data Cluster</a> on an existing AKS cluster.\n",
|
||||
" \n",
|
||||
"* Follow the instructions in the **Prerequisites** cell to install the tools if not already installed.\n",
|
||||
"* Make sure you have the target cluster set as the current context in your kubectl config file.\n",
|
||||
" The config file would typically be under C:\\Users\\(userid)\\.kube on Windows, and under ~/.kube/ for macOS and Linux for a default installation.\n",
|
||||
" In the kubectl config file, look for \"current-context\" and ensure it is set to the AKS cluster that the SQL Server 2019 big data cluster will be deployed to.\n",
|
||||
"* The **Required information** cell will prompt you for password that will be used to access the cluster controller, SQL Server, and Knox.\n",
|
||||
"* The values in the **Default settings** cell can be changed as appropriate.\n",
|
||||
"* The **Required information** will check and prompt you for password if it is not set in the environment variable. The password can be used to access the cluster controller, SQL Server, and Knox.\n",
|
||||
"\n",
|
||||
"<span style=\"color:red\"><font size=\"3\">Please press the \"Run Cells\" button to run the notebook</font></span>"
|
||||
],
|
||||
"metadata": {}
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "82e60c1a-7acf-47ee-877f-9e85e92e11da"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
@@ -49,14 +47,20 @@
|
||||
"|Tools|Description|Installation|\n",
|
||||
"|---|---|---|\n",
|
||||
"|kubectl | Command-line tool for monitoring the underlying Kuberentes cluster | [Installation](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-native-package-management) |\n",
|
||||
"|azdata | Command-line tool for installing and managing a big data cluster |[Installation](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) |"
|
||||
"|azdata | Command-line tool for installing and managing a Big Data Cluster |[Installation](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) |"
|
||||
],
|
||||
"metadata": {}
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "714582b9-10ee-409e-ab12-15a4825c9471"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": "### **Check dependencies**",
|
||||
"metadata": {}
|
||||
"source": [
|
||||
"### **Check dependencies**"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "e3dd8e75-e15f-44b4-81fc-1f54d6f0b1e2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
@@ -68,143 +72,168 @@
|
||||
"pandas_patch = int(pandas_version[2])\r\n",
|
||||
"if not (pandas_major > 0 or (pandas_major == 0 and pandas_minor > 24) or (pandas_major == 0 and pandas_minor == 24 and pandas_patch >= 2)):\r\n",
|
||||
" sys.exit('Please upgrade the Notebook dependency before you can proceed, you can do it by running the \"Reinstall Notebook dependencies\" command in command palette (View menu -> Command Palette…).')\r\n",
|
||||
"def run_command():\r\n",
|
||||
" print(\"Executing: \" + cmd)\r\n",
|
||||
" !{cmd}\r\n",
|
||||
"def run_command(command):\r\n",
|
||||
" print(\"Executing: \" + command)\r\n",
|
||||
" !{command}\r\n",
|
||||
" if _exit_code != 0:\r\n",
|
||||
" sys.exit(f'Command execution failed with exit code: {str(_exit_code)}.\\n\\t{cmd}\\n')\r\n",
|
||||
" print(f'Successfully executed: {cmd}')\r\n",
|
||||
" sys.exit(f'Command execution failed with exit code: {str(_exit_code)}.\\n\\t{command}\\n')\r\n",
|
||||
" print(f'Successfully executed: {command}')\r\n",
|
||||
"\r\n",
|
||||
"cmd = 'kubectl version --client=true'\r\n",
|
||||
"run_command()\r\n",
|
||||
"cmd = 'azdata --version'\r\n",
|
||||
"run_command()"
|
||||
"run_command('kubectl version --client=true')\r\n",
|
||||
"run_command('azdata --version')"
|
||||
],
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "d973d5b4-7f0a-4a9d-b204-a16480f3940d"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": 1
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": "### **Show current context**",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"cmd = ' kubectl config current-context'\r\n",
|
||||
"run_command()"
|
||||
"### **Required information**"
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"execution_count": 2
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": "### **Required information**",
|
||||
"metadata": {}
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "0bb02e76-fee8-4dbc-a75b-d5b9d1b187d0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"env_var_flag = \"AZDATA_NB_VAR_BDC_CONTROLLER_PASSWORD\" in os.environ\n",
|
||||
"if env_var_flag:\n",
|
||||
" mssql_password = os.environ[\"AZDATA_NB_VAR_BDC_CONTROLLER_PASSWORD\"]\n",
|
||||
"else: \n",
|
||||
" mssql_password = getpass.getpass(prompt = 'SQL Server 2019 big data cluster controller password')\n",
|
||||
"invoked_by_wizard = \"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\" in os.environ\n",
|
||||
"if invoked_by_wizard:\n",
|
||||
" mssql_password = os.environ[\"AZDATA_NB_VAR_BDC_ADMIN_PASSWORD\"]\n",
|
||||
"else:\n",
|
||||
" mssql_password = getpass.getpass(prompt = 'SQL Server 2019 Big Data Cluster controller password')\n",
|
||||
" if mssql_password == \"\":\n",
|
||||
" sys.exit(f'Password is required.')\n",
|
||||
" confirm_password = getpass.getpass(prompt = 'Confirm password')\n",
|
||||
" if mssql_password != confirm_password:\n",
|
||||
" sys.exit(f'Passwords do not match.')\n",
|
||||
"print('You can also use the same password to access Knox and SQL Server.')"
|
||||
"print('You can also use the controller password to access Knox and SQL Server.')"
|
||||
],
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "e7e10828-6cae-45af-8c2f-1484b6d4f9ac"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": 3
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": "### **Default settings**",
|
||||
"metadata": {}
|
||||
"source": [
|
||||
"### **Set variables**\n",
|
||||
"Generated by Azure Data Studio using the values collected in the Deploy Big Data Cluster wizard"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "c009edfe-b964-4b28-beeb-02a2c65f9918"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### **Set and show current context**"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "127c8042-181f-4862-a390-96e59c181d09"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"if env_var_flag:\n",
|
||||
" mssql_cluster_name = os.environ[\"AZDATA_NB_VAR_BDC_NAME\"]\n",
|
||||
" mssql_controller_username = os.environ[\"AZDATA_NB_VAR_BDC_CONTROLLER_USERNAME\"]\n",
|
||||
"else:\n",
|
||||
" mssql_cluster_name = 'mssql-cluster'\n",
|
||||
" mssql_controller_username = 'admin'\n",
|
||||
"configuration_profile = 'aks-dev-test'\n",
|
||||
"configuration_folder = 'mssql-bdc-configuration'\n",
|
||||
"print(f'SQL Server big data cluster name: {mssql_cluster_name}')\n",
|
||||
"print(f'SQL Server big data cluster controller user name: {mssql_controller_username}')\n",
|
||||
"print(f'Deployment configuration profile: {configuration_profile}')\n",
|
||||
"print(f'Deployment configuration: {configuration_folder}')"
|
||||
"run_command(f'kubectl config use-context {mssql_cluster_context}')\n",
|
||||
"run_command('kubectl config current-context')"
|
||||
],
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "7d1a03d4-1df8-48eb-bff0-0042603b95b1"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": 4
|
||||
"execution_count": 0
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": "### **Create a deployment configuration file**",
|
||||
"metadata": {}
|
||||
"source": [
|
||||
"### **Create deployment configuration files**"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "138536c3-1db6-428f-9e5c-8269a02fb52e"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"os.environ[\"ACCEPT_EULA\"] = 'yes'\n",
|
||||
"cmd = f'azdata bdc config init --source {configuration_profile} --target {configuration_folder} --force'\n",
|
||||
"run_command()\n",
|
||||
"cmd = f'azdata bdc config replace -c {configuration_folder}/bdc.json -j metadata.name={mssql_cluster_name}'\n",
|
||||
"run_command()"
|
||||
"mssql_target_profile = 'ads-bdc-custom-profile'\n",
|
||||
"if not os.path.exists(mssql_target_profile):\n",
|
||||
" os.mkdir(mssql_target_profile)\n",
|
||||
"bdcJsonObj = json.loads(bdc_json)\n",
|
||||
"controlJsonObj = json.loads(control_json)\n",
|
||||
"bdcJsonFile = open(f'{mssql_target_profile}/bdc.json', 'w')\n",
|
||||
"bdcJsonFile.write(json.dumps(bdcJsonObj, indent = 4))\n",
|
||||
"bdcJsonFile.close()\n",
|
||||
"controlJsonFile = open(f'{mssql_target_profile}/control.json', 'w')\n",
|
||||
"controlJsonFile.write(json.dumps(controlJsonObj, indent = 4))\n",
|
||||
"controlJsonFile.close()\n",
|
||||
"print(f'Created deployment configuration folder: {mssql_target_profile}')"
|
||||
],
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "2ff82c8a-4bce-449c-9d91-3ac7dd272021"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": 6
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": "### **Create SQL Server 2019 big data cluster**",
|
||||
"metadata": {}
|
||||
"source": [
|
||||
"### **Create SQL Server 2019 Big Data Cluster**"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "efe78cd3-ed73-4c9b-b586-fdd6c07dd37f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"print (f'Creating SQL Server 2019 big data cluster: {mssql_cluster_name} using configuration {configuration_folder}')\n",
|
||||
"print (f'Creating SQL Server 2019 Big Data Cluster: {mssql_cluster_name} using configuration {mssql_target_profile}')\n",
|
||||
"os.environ[\"CONTROLLER_USERNAME\"] = mssql_controller_username\n",
|
||||
"os.environ[\"CONTROLLER_PASSWORD\"] = mssql_password\n",
|
||||
"os.environ[\"MSSQL_SA_PASSWORD\"] = mssql_password\n",
|
||||
"os.environ[\"KNOX_PASSWORD\"] = mssql_password\n",
|
||||
"cmd = f'azdata bdc create -c {configuration_folder}'\n",
|
||||
"run_command()"
|
||||
"run_command(f'azdata bdc create -c {mssql_target_profile}')"
|
||||
],
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "373947a1-90b9-49ee-86f4-17a4c7d4ca76"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": 7
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": "### **Login to SQL Server 2019 big data cluster**",
|
||||
"metadata": {}
|
||||
"source": [
|
||||
"### **Login to SQL Server 2019 Big Data Cluster**"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "4e026d39-12d4-4c80-8e30-de2b782f2110"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"cmd = f'azdata login --cluster-name {mssql_cluster_name}'\n",
|
||||
"run_command()"
|
||||
"run_command(f'azdata login --cluster-name {mssql_cluster_name}')"
|
||||
],
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "79adda27-371d-4dcb-b867-db025f8162a5"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": 8
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": "### **Show SQL Server 2019 big data cluster endpoints**",
|
||||
"metadata": {}
|
||||
"source": [
|
||||
"### **Show SQL Server 2019 Big Data Cluster endpoints**"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "c1921288-ad11-40d8-9aea-127a722b3df8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
@@ -218,17 +247,21 @@
|
||||
"endpointsDataFrame.columns = [' '.join(word[0].upper() + word[1:] for word in columnName.split()) for columnName in endpoints[0].keys()]\n",
|
||||
"display(HTML(endpointsDataFrame.to_html(index=False, render_links=True)))"
|
||||
],
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "a2202494-fd6c-4534-987d-15c403a5096f"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": 9
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"### **Connect to master SQL Server instance in Azure Data Studio**\r\n",
|
||||
"Click the link below to connect to the master SQL Server instance of the SQL Server 2019 big data cluster."
|
||||
"### **Connect to SQL Server Master instance in Azure Data Studio**\r\n",
|
||||
"Click the link below to connect to the SQL Server Master instance of the SQL Server 2019 Big Data Cluster."
|
||||
],
|
||||
"metadata": {}
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "621863a2-aa61-46f4-a9d0-717f41c009ee"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
@@ -236,11 +269,13 @@
|
||||
"sqlEndpoints = [x for x in endpoints if x['name'] == 'sql-server-master']\r\n",
|
||||
"if sqlEndpoints and len(sqlEndpoints) == 1:\r\n",
|
||||
" connectionParameter = '{\"serverName\":\"' + sqlEndpoints[0]['endpoint'] + '\",\"providerName\":\"MSSQL\",\"authenticationType\":\"SqlLogin\",\"userName\":\"sa\",\"password\":' + json.dumps(mssql_password) + '}'\r\n",
|
||||
" display(HTML('<br/><a href=\"command:azdata.connect?' + html.escape(connectionParameter)+'\"><font size=\"3\">Click here to connect to master SQL Server instance</font></a><br/>'))\r\n",
|
||||
" display(HTML('<br/><a href=\"command:azdata.connect?' + html.escape(connectionParameter)+'\"><font size=\"3\">Click here to connect to SQL Server Master instance</font></a><br/>'))\r\n",
|
||||
"else:\r\n",
|
||||
" sys.exit('Could not find the master SQL Server instance endpoint')"
|
||||
" sys.exit('Could not find the SQL Server Master instance endpoint')"
|
||||
],
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "48342355-9d2b-4fa6-b1aa-3bc77d434dfa"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": 10
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user