Artificial Intelligence on IaaS++

From the Microsoft Cloud and AI Team

This workshop leads you through a series of Jupyter Notebooks that explain how to use the Microsoft Azure Data Science Virtual Machine (DSVM) and the Team Data Science Process (TDSP) to create Data Science and AI solutions. These solutions can be deployed in a variety of ways, leveraging Infrastructure-as-a-Service (IaaS) through Platform-as-a-Service (PaaS) environments, and a mixture of both based on requirements.

The material for this workshop is intended for a Data Scientist familiar with Machine Learning, Python programming, Artificial Intelligence application development, and a professional backgound in team software development with methodologies such as Agile. If any of these topics are new to you, we have a learning path here that you can follow to bring you up to speed before you start this workshop.

This material draws from a previous example, which draws from yet another example.

Prepare The Project - System Setup and Configuration

The following labs will guide you through setting up an account, a DSVM, and the Azure Machine Learning workspaces and other elements needed to create your solution. You’ll also download the Project Plan for your solution for your team.

In Phase One of this Workshop, you’ll learn more about how to discover the questions that need an answer, information about the data sources you require, a determination of the algorithms and other parts of an experiment, creating a trained model, operationalizing the solution so that a customer can access it, and how to close out the project with the customer along with any model retraining that is needed. Before you begin these phases, you’ll need to set up your environment to perform each of these steps.

Lab 0.0 - Set up an Microsoft Azure Account

For experimentation and model management, we’ll use the Microsoft Azure platform. There are four choices for setting up a Microsoft Azure account:

  1. You can use a Free Subscription - The process for setting that up is here
  2. You can use a Microsoft Developer Network (MSDN) account - The process for setting that up is here
  3. You can use a Corporate account - See your corporate person in charge of Azure accounts to see if you are able to create a Virtual Machine and other assets on your company subscription
  4. If you are taking this workshop in an on-premises training class, your trainer may provide an Azure Account login for you - Ask your training instructor for instructions for a login

Once you have an Azure account login, open the Microsoft Azure Portal and continue to the next lab.

Lab 0.1 - Set up the Azure Deep Learning Virtual Machine

Instructions:

  1. Open this page and perform the steps to set up a Linux Deep Learning DSVM, with a Password.
  2. Follow the instructions for that section, choosing NC6 Standard as the size of the DSVM
  3. Complete the creation of the DSVM, and note the name, connection information and password for your system.

(Note: You do not need to configure an X2Go client unless you want to - it is not required for the course)

Lab 0.2 - Log in to the DSVM, Explore and Update the System

Whenever you install a new system, it’s a good idea to check the environment to ascertain it’s configuration. In Linux, the following commands are useful:

Instructions:

  1. On your local system, open CMD on Windows or a Terminal Window on Linux.
  2. Type the following commands:

ssh <Login Name You Created>@<IP Address of your DSVM>

First, start with the release information of the Operating System:

lsb_release -a

And let’s check the drive space:

df -H

We notice that the home mount point (/data) doesn’t have a lot of room. We’ll fix that in a bit.

Finally, let’s update the system:

sudo apt-get update

(You may be prompted for the password you set in the Portal when you created the VM)

sudo apt-get upgrade

Next, you’ll want to enable Docker to be configured for use by non-root users. You can learn more about that process here: https://docs.microsoft.com/en-us/azure/machine-learning/desktop-workbench/deployment-setup-configuration

Run the following commands to set that up: sudo -i

pip install -r https://aka.ms/az-ml-o16n-cli-requirements-file

exit

sudo /opt/microsoft/azureml/initial_setup.sh

Now log out of the DSVM and login via SSH again.

Lab verification

Commands complete successfully.

Lab 0.3 - Clone the Workshop’s Jupyter Notebooks

Instructions:

  1. We’ll need more space for the labs, since /data doesn’t have enough to do what we need to do. Log in to the DSVM, and clone the course with the following command:

sudo mkdir /gpuclass

  1. Then grant access to it for everyone (Security Note: in production, you would limit the access to only certain groups, and determine for each file whether they need read/write/execute):

sudo chmod -R 0777 /gpuclass

  1. Now clone the course with the following command:

git clone https://github.com/Azure/LearnAI-AIonIaaS /gpuclass

  1. And link to it with the following command:

ln -s /gpuclass ~/notebooks/gpuclass

We should now be able to see the course materials when we access the notebook server.

Lab verification

Enter the following commands to ensure you have several Notebook files:

cd ~/notebooks/gpuclass/notebooks

ls *.ipynb

Lab 0.4 - Start the Jupyter Notebook Server and Open the Workshop Notebooks

  1. You’re now ready to continue on to the introduction Jupyter Notebook. Connect to it on your local brwoser using the following URL, replacing the IP Address with the IP Address (or DNS name) of your Linux DSVM, which you can find in the Azure Portal:

https://<IP Address of your DSVM>:8000

You may get a security warning, since your DSVM is not set up with a signed certificate, but as long as you verify you are connecting to your DSVM’s address, you may continue to your site.

NOTE: Continuing to a system that is not yours by bypassing the browser’s security warning is highly dangerous, and you should exit that screen immediately if the IP address is not correct. Carefully verify that you are accessing the correct site!

  1. If prompted, log in with the name and password you set for your Linux DSVM
  2. If prompted, click the Start My Server button.
  3. Navigate to the ~/notebooks/gpuclass/notebooks folder and open the 0 - Introduction.ipynb Jupyter Notebook. Continue the workshop from there.