From ffb6fccd8479cdd5965bd51de116e06ccb631709 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Mon, 29 Apr 2019 22:09:58 -0700 Subject: [PATCH 1/6] Azure ML tweaks and fixes --- .../.devcontainer/Dockerfile | 37 ++++++++++++++----- .../.devcontainer/settings.vscode.json | 8 ++++ 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 containers/azure-machine-learning-python-3/.devcontainer/settings.vscode.json diff --git a/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile b/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile index dbcc825d54..455d14d9ed 100644 --- a/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile +++ b/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile @@ -3,22 +3,41 @@ # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- -FROM python:3 +# Update this to FROM python:3 if you'd prefer +# to use standard python instead +FROM continuumio/anaconda3 -# Install git, process tools -RUN apt-get update && apt-get -y install git procps +# Configure apt +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 -# Install Docker CE - ** COMMENT OUT IF YOU WILL ONLY RUN LOCAL OR IN AZURE ** -RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \ - && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - 2>/dev/null \ - && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \ +# Copy default endpoint specific user settings overrides into container to +# to specify Python path and that Docker should run as a workspace extension +COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json + +# Install git, required tools +RUN apt-get install -y \ + git \ + curl \ + procps \ + apt-transport-https \ + ca-certificates \ + gnupg-agent \ + software-properties-common \ + lsb-release 2>&1 + +# Install Docker CLI +RUN curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ + && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \ && apt-get update \ && apt-get install -y docker-ce-cli -# Install pylint -RUN pip install pylint +# Install pylint and Azure ML SDK +RUN pip install pylint azureml-sdk 2>&1 # Clean up RUN apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* +ENV DEBIAN_FRONTEND=dialog diff --git a/containers/azure-machine-learning-python-3/.devcontainer/settings.vscode.json b/containers/azure-machine-learning-python-3/.devcontainer/settings.vscode.json new file mode 100644 index 0000000000..34f8822518 --- /dev/null +++ b/containers/azure-machine-learning-python-3/.devcontainer/settings.vscode.json @@ -0,0 +1,8 @@ +{ + "remote.extensionKind": { + "peterjausovec.vscode-docker": "workspace", + "python.pythonPath": "/opt/conda/bin/python", + "python.linting.pylintEnabled": true, + "python.linting.enabled": true + } +} \ No newline at end of file From 2878f2218f341cf0c719edcdd4bf472a40e8e32e Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Mon, 29 Apr 2019 22:25:33 -0700 Subject: [PATCH 2/6] Update installed extras --- .../azure-machine-learning-python-3/.devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile b/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile index 455d14d9ed..e3bd99e6e4 100644 --- a/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile +++ b/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile @@ -34,7 +34,7 @@ RUN curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper && apt-get install -y docker-ce-cli # Install pylint and Azure ML SDK -RUN pip install pylint azureml-sdk 2>&1 +RUN pip install pylint azureml-sdk[notebooks,automl] 2>&1 # Clean up RUN apt-get autoremove -y \ From 1cebaa1a4d9059f8a0a9bd2491841911a53a1fa0 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Tue, 30 Apr 2019 07:00:24 -0700 Subject: [PATCH 3/6] Fixed settings file --- .../.devcontainer/settings.vscode.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/containers/azure-machine-learning-python-3/.devcontainer/settings.vscode.json b/containers/azure-machine-learning-python-3/.devcontainer/settings.vscode.json index 34f8822518..adaeba5945 100644 --- a/containers/azure-machine-learning-python-3/.devcontainer/settings.vscode.json +++ b/containers/azure-machine-learning-python-3/.devcontainer/settings.vscode.json @@ -1,8 +1,8 @@ { "remote.extensionKind": { - "peterjausovec.vscode-docker": "workspace", - "python.pythonPath": "/opt/conda/bin/python", - "python.linting.pylintEnabled": true, - "python.linting.enabled": true - } + "peterjausovec.vscode-docker": "workspace" + }, + "python.pythonPath": "/opt/conda/bin/python", + "python.linting.pylintEnabled": true, + "python.linting.enabled": true } \ No newline at end of file From 60be7a7bd76ba99cb55590b3b5901b4b88d19195 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Tue, 30 Apr 2019 10:51:20 -0700 Subject: [PATCH 4/6] Specify Anaconda in README, warn about image size --- containers/azure-machine-learning-python-3/README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/containers/azure-machine-learning-python-3/README.md b/containers/azure-machine-learning-python-3/README.md index af7ed7ee52..2ff32d6ed4 100644 --- a/containers/azure-machine-learning-python-3/README.md +++ b/containers/azure-machine-learning-python-3/README.md @@ -1,18 +1,22 @@ -# Azure Machine Learning & Python 3 +# Azure Machine Learning & Python 3 - Anaconda ## Summary -*Use Azure Machine Learning with Python 3. Includes Python, the Docker CLI (for local testing), and related extensions and dependencies.* +*Use Azure Machine Learning with Python 3 - Anaconda. Includes Anaconda, the Docker CLI (for local testing), and related extensions and dependencies.* | Metadata | Value | |----------|-------| | *Contributors* | The VS Code Team | | *Definition type* | Dockerfile | -| *Languages, platforms* | Azure Machine Learning, Python | +| *Languages, platforms* | Azure Machine Learning, Python, Anaconda | ## Using this definition with an existing folder -This definition requires an Azure subscription to use. You can create a [free account here](https://account.azure.com/signup?offer=ms-azr-0044p&appId=102&ref=azureplat-generic&redirectURL=https%3a%2f%2fazure.microsoft.com%2fen-us%2fget-started%2fwelcome-to-azure%2f&l=en-us&correlationId=15FE63BE1C4960F42D1B6EFB18496296) and learn more about using [Azure Machine Learning with VS Code here](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-vscode-tools#get-started-with-azure-machine-learning). Once you have an Azure account, follow these steps: +This definition requires an Azure subscription to use. You can create a [free account here](https://account.azure.com/signup?offer=ms-azr-0044p&appId=102&ref=azureplat-generic&redirectURL=https%3a%2f%2fazure.microsoft.com%2fen-us%2fget-started%2fwelcome-to-azure%2f&l=en-us&correlationId=15FE63BE1C4960F42D1B6EFB18496296) and learn more about using [Azure Machine Learning with VS Code here](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-vscode-tools#get-started-with-azure-machine-learning). + +The definition also uses an Anaconda base image which can take some time to download the first time given its size. + +Once you have an Azure account, follow these steps: 1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine. From 37d7ee16a1a0f244fcd31317cbed287d3efbcdd4 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Tue, 30 Apr 2019 11:17:33 -0700 Subject: [PATCH 5/6] Add sudo for docker runs --- .../azure-machine-learning-python-3/.devcontainer/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile b/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile index e3bd99e6e4..5effa0beb1 100644 --- a/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile +++ b/containers/azure-machine-learning-python-3/.devcontainer/Dockerfile @@ -25,6 +25,7 @@ RUN apt-get install -y \ ca-certificates \ gnupg-agent \ software-properties-common \ + sudo \ lsb-release 2>&1 # Install Docker CLI From 186a5b9925d87a00cb657b99a3cecde01190c97a Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Tue, 30 Apr 2019 11:54:10 -0700 Subject: [PATCH 6/6] Add note about sharedVolumes=false for Docker scenario --- containers/azure-machine-learning-python-3/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/containers/azure-machine-learning-python-3/README.md b/containers/azure-machine-learning-python-3/README.md index 2ff32d6ed4..1688b7816a 100644 --- a/containers/azure-machine-learning-python-3/README.md +++ b/containers/azure-machine-learning-python-3/README.md @@ -12,9 +12,13 @@ ## Using this definition with an existing folder -This definition requires an Azure subscription to use. You can create a [free account here](https://account.azure.com/signup?offer=ms-azr-0044p&appId=102&ref=azureplat-generic&redirectURL=https%3a%2f%2fazure.microsoft.com%2fen-us%2fget-started%2fwelcome-to-azure%2f&l=en-us&correlationId=15FE63BE1C4960F42D1B6EFB18496296) and learn more about using [Azure Machine Learning with VS Code here](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-vscode-tools#get-started-with-azure-machine-learning). +There are a few notes for using this definition: -The definition also uses an Anaconda base image which can take some time to download the first time given its size. +1. This definition requires an Azure subscription to use. You can create a [free account here](https://account.azure.com/signup?offer=ms-azr-0044p&appId=102&ref=azureplat-generic&redirectURL=https%3a%2f%2fazure.microsoft.com%2fen-us%2fget-started%2fwelcome-to-azure%2f&l=en-us&correlationId=15FE63BE1C4960F42D1B6EFB18496296) and learn more about using [Azure Machine Learning with VS Code here](https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-vscode-tools#get-started-with-azure-machine-learning). + +2. The definition also uses an Anaconda base image which can take some time to download the first time given its size. + +3. If you are using Docker locally in your `runconfig`, you will need to set `sharedVolumes` to `false` since these will not work from inside a dev container. Once you have an Azure account, follow these steps: