diff --git a/samples/features/Azure Data Studio/Notebooks/Install cluster dependencies.ipynb b/samples/features/Azure Data Studio/Notebooks/Install cluster dependencies.ipynb new file mode 100644 index 00000000..7a137897 --- /dev/null +++ b/samples/features/Azure Data Studio/Notebooks/Install cluster dependencies.ipynb @@ -0,0 +1,316 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Install Dependencies to deploy SQL Server 2019 Big Data Clusters\n", + "----------------------------------------------------------------\n", + "\n", + "The following tools are most important for managing, connecting to, and\n", + "querying the cluster:\n", + "\n", + "- **Azure CLI**\n", + "- **kubectl**\n", + "- **mssqlctl**\n", + "\n", + "**The cell below tries to install these dependencies for you. If you\n", + "still experience any issues in executing this cell then please install\n", + "from the following Installation links below.**\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", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
ToolRequiredDescriptionInstallation
mssqlctlYesCommand-line tool for installing and managing a big data cluster.Install
kubectlYesCommand-line tool for monitoring the underlying Kuberentes cluster (More info).Windows | Linux
Azure CLIFor AKSModern command-line interface for managing Azure services. Used with AKS big data cluster deployments (More info).Install
\n", + "\n", + "Steps\n", + "-----\n", + "\n", + "### Provide overrides for any default installation parameters\n", + "\n", + "You don’t need to provide any installation parameters, we’ll provide a\n", + "set of default which will provide a good experience.\n", + "\n", + "However, feel free to override any of the defaults provided below here:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "mssql_version=\"\"\n", + "docker_registry=\"\"\n", + "\n", + "windows_azcli_url=\"\"\n", + "windows_kubectl_url=\"\"\n", + "\n", + "azure_cli_use_force_install_option = None\n", + "azure_cli_use_user_install_option = None\n", + "\n", + "mssqlctl_url=\"\" # url to download mssqlctl from (without ending filename)\n", + "mssqlctl_use_force_install_option = None\n", + "mssqlctl_use_user_install_option = None\n", + "\n", + "skip_mssqlctl_uninstall = None\n", + "skip_mssqlctl_install = None" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Provide default installation parameters\n", + "\n", + "A default set of parameters to provide a good initial experience of SQL\n", + "Server 2019 big data clusters." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "if mssql_version==\"\":\n", + " mssql_version=\"ctp-2.5\"\n", + "\n", + "if windows_azcli_url==\"\":\n", + " windows_azcli_url=\"https://aka.ms/installazurecliwindows\"\n", + "\n", + "if windows_kubectl_url==\"\":\n", + " windows_kubectl_url=\"https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/windows/amd64/kubectl.exe\"\n", + "\n", + "if docker_repository==\"\":\n", + " docker_repository=\"aris-p-release-candidate-gb\"\n", + "\n", + "if mssqlctl_url==\"\":\n", + " mssqlctl_url=\"\"http://helsinki/browse/packages/python/{0}/mssqlctl/{1}\".format(docker_repository, 'requirements.txt')\n", + "\n", + "if azure_cli_use_force_install_option is None:\n", + " azure_cli_use_force_install_option = False\n", + "\n", + "if azure_cli_use_user_install_option is None:\n", + " azure_cli_use_user_install_option = True\n", + "\n", + "if mssqlctl_use_force_install_option is None:\n", + " mssqlctl_use_force_install_option = False\n", + "\n", + "if mssqlctl_use_user_install_option is None:\n", + " mssqlctl_use_user_install_option = True\n", + "\n", + "if skip_mssqlctl_uninstall is None:\n", + " skip_mssqlctl_uninstall = True\n", + "\n", + "if skip_mssqlctl_install is None:\n", + " skip_mssqlctl_install = False\n", + "\n", + "print('mssql_version = ' + mssql_version)\n", + "print('docker_registry = ' + docker_registry)\n", + "print('azure_cli_use_force_install_option = ' + str(azure_cli_use_force_install_option))\n", + "print('azure_cli_use_user_install_option = ' + str(azure_cli_use_user_install_option))\n", + "print('mssqlctl_url = ' + mssqlctl_url)\n", + "print('mssqlctl_use_force_install_option = ' + str(mssqlctl_use_force_install_option))\n", + "print('mssqlctl_use_user_install_option = ' + str(mssqlctl_use_user_install_option))\n", + "print('skip_mssqlctl_uninstall = ' + str(skip_mssqlctl_uninstall))\n", + "print('skip_mssqlctl_install = ' + str(skip_mssqlctl_install))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Install Azure CLI" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import sys\n", + "\n", + "force_install_option='--force-install' if azure_cli_use_force_install_option else ''\n", + "user_install_option='--user' if azure_cli_use_user_install_option else ''\n", + "\n", + "print(f'START: !{sys.executable} -m pip install azure-cli {force_install_option} {user_install_option}\\n')\n", + "\n", + "!{sys.executable} -m pip install azure-cli {force_install_option} {user_install_option}\n", + "if _exit_code != 0:\n", + " raise SystemExit('Shell command:\\n\\n\\t!{sys.executable} -m pip install azure-cli {force_install_option} {user_install_option}\\n\\nreturned non-zero exit code: ' + str(_exit_code) + '.\\n')\n", + "\n", + "print(f'\\nSUCCESS: !{sys.executable} -m pip install azure-cli {force_install_option} {user_install_option}')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Install Kubernetes CLI" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import platform\n", + "import requests\n", + "import sys\n", + "\n", + "if platform.system()==\"Darwin\":\n", + " print(f'START: !brew update\\n')\n", + "\n", + " !brew update\n", + " if _exit_code != 0:\n", + " raise SystemExit('Shell command:\\n\\n\\t !brew update\\n\\nreturned non-zero exit code: ' + str(_exit_code) + '.\\n')\n", + "\n", + " print(f'\\nSUCCESS: !brew update')\n", + " print(f'START: !brew install kubernetes-cli\\n')\n", + "\n", + " !brew install kubernetes-cli\n", + " if _exit_code != 0:\n", + " raise SystemExit('Shell command:\\n\\n\\t !brew install kubernetes-cli\\n\\nreturned non-zero exit code: ' + str(_exit_code) + '.\\n')\n", + "\n", + " print(f'\\nSUCCESS: !brew install kubernetes-cli')\n", + "elif platform.system()==\"Windows\":\n", + " print(f'START: !curl -LO {windows_kubectl_url}\\n')\n", + "\n", + " !curl -LO {windows_kubectl_url}\n", + " if _exit_code != 0:\n", + " raise SystemExit('Shell command:\\n\\n\\t !curl -LO {windows_kubectl_url}\\n\\nreturned non-zero exit code: ' + str(_exit_code) + '.\\n')\n", + "\n", + " print(f'\\nSUCCESS: !curl -LO {windows_kubectl_url}')\n", + "elif platform.system()==\"Linux\":\n", + " print(f'START: !sudo apt-get update\\n')\n", + "\n", + " !sudo apt-get update\n", + " if _exit_code != 0:\n", + " raise SystemExit('Shell command:\\n\\n\\t !sudo apt-get update\\n\\nreturned non-zero exit code: ' + str(_exit_code) + '.\\n')\n", + "\n", + " print(f'\\nSUCCESS: !sudo apt-get update')\n", + " print(f'START: !sudo apt-get install -y kubectl\\n')\n", + "\n", + " !sudo apt-get install -y kubectl\n", + " if _exit_code != 0:\n", + " raise SystemExit('Shell command:\\n\\n\\t !sudo apt-get install -y kubectl\\n\\nreturned non-zero exit code: ' + str(_exit_code) + '.\\n')\n", + "\n", + " print(f'\\nSUCCESS: !sudo apt-get install -y kubectl')\n", + "else:\n", + " raise SystemExit(\"Platform '{0}' is not recognized, must be 'Darwin', 'Windows' or 'Linux'\".format(platform.system()))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Uninstall MSSQLCTL CLI" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import sys\n", + "\n", + "if not skip_mssqlctl_uninstall:\n", + " print(f'START: !{sys.executable} -m pip uninstall -r {mssqlctl_url} --yes --trusted-host helsinki\\n')\n", + "\n", + " !{sys.executable} -m pip uninstall -r {mssqlctl_url} --yes --trusted-host helsinki\n", + " if _exit_code != 0:\n", + " raise SystemExit('Shell command:\\n\\n\\t !{sys.executable} -m pip uninstall -r {mssqlctl_url} --yes --trusted-host helsinki\\n\\nreturned non-zero exit code: ' + str(_exit_code) + '.\\n')\n", + "\n", + " print(f'\\nSUCCESS: !{sys.executable} -m pip uninstall -r {mssqlctl_url} --yes --trusted-host helsinki')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Install MSSQLCTL CLI" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import sys\n", + "\n", + "force_install_option='--force-install' if mssqlctl_use_force_install_option else ''\n", + "user_install_option='--user' if mssqlctl_use_user_install_option else ''\n", + "\n", + "if not skip_mssqlctl_install:\n", + " print(f'START: !{sys.executable} -m pip install -r {mssqlctl_url} {force_install_option} {user_install_option} --trusted-host helsinki\\n')\n", + "\n", + " !{sys.executable} -m pip install -r {mssqlctl_url} {force_install_option} {user_install_option} --trusted-host helsinki\n", + " if _exit_code != 0:\n", + " raise SystemExit('Shell command:\\n\\n\\t !{sys.executable} -m pip install -r {mssqlctl_url} {force_install_option} {user_install_option} --trusted-host helsinki\\n\\nreturned non-zero exit code: ' + str(_exit_code) + '.\\n')\n", + "\n", + " print(f'\\nSUCCESS: !{sys.executable} -m pip install -r {mssqlctl_url} {force_install_option} {user_install_option} --trusted-host helsinki')" + ] + } + ], + "nbformat": 4, + "nbformat_minor": 5, + "metadata": { + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "azdata": { + "test": { + "strategy": "Sequential", + "dri": false, + "ci": false, + "gci": false + }, + "publish": { + "access": { + "current": "Internal", + "goal": "Public" + }, + "state": "Draft" + } + } + } +} +