Install on AWS

This section describes how to install the Driverless AI AMI from AWS.

Watch the installation video here. Note that some of the images in this video may change between releases, but the installation steps remain the same.

Environment

Provider Instance Type Num GPUs Suitable for
AWS p2.xlarge 1 Experimentation
p2.8xlarge 8 Serious use
p2.16xlarge 16 Serious use
p3.2xlarge 1 Experimentation
p3.8xlarge 4 Serious use
p3.16xlarge 8 Serious use
g3.4xlarge 1 Experimentation
g3.8xlarge 2 Experimentation
g3.16xlarge 4 Serious use

Installing the EC2 Instance

  1. Log in to your AWS account at https://aws.amazon.com.
  2. In the upper right corner of the Amazon Web Services page, make sure that the location drop-down is US East (N Virginia).
../_images/ami_location_dropdown.png
  1. Select the EC2 option under the Compute section to open the EC2 Dashboard.
../_images/ami_select_ec2.png
  1. Click the Launch Instance button under the Create Instance section.
../_images/ami_launch_instance_button.png
  1. Under Community AMIs, search for h2oai, and then select the version that you want to launch.
../_images/ami_select_h2oai_ami.png
  1. On the Choose an Instance Type page, select GPU compute in the Filter by dropdown. This will ensure that your Driverless AI instance will run on GPUs. Select a GPU compute instance from the available options. (We recommend at least 32 vCPUs.) Click the Next: Configure Instance Details button.
../_images/ami_choose_instance_type.png
  1. Specify the Instance Details that you want to configure. Create a VPC or use an existing one, and ensure that “Auto-Assign Public IP” is enabled and associated to your subnet. Click Next: Add Storage.
../_images/ami_configure_instance_details.png
  1. Specify the Storage Device settings. Note again that Driverless AI requires 10 GB to run and will stop working of less than 10 GB is available. The machine should have a minimum of 30 GB of disk space. Click Next: Add Tags.
../_images/ami_add_storage.png
  1. If desired, add unique Tag name to identify your instance. Click Next: Configure Security Group.
  2. Add the following security rules to enable SSH access to Driverless AI, then click Review and Launch.
Type Protocol Port Range Source Description
SSH TCP 22 Anywhere 0.0.0.0/0  
Custom TCP Rule TCP 12345 Anywhere 0.0.0.0/0 Launch DAI
../_images/ami_add_security_rules.png
  1. Review the configuration, and then click Launch.
  2. A popup will appear prompting you to select a key pair. This is required in order to SSH into the instance. You can select your existing key pair or create a new one. Be sure to accept the acknowledgement, then click Launch Instances to start the new instance.
../_images/ami_select_key_pair.png
  1. Upon successful completion, a message will display informing you that your instance is launching. Click the View Instances button to see information about the instance including the IP address. The Connect button on this page provides information on how to SSH into your instance.
  2. Open a Terminal window and SSH into the IP address of the AWS instance. Replace the DNS name below with your instance DNS.
ssh -i "mykeypair.pem" ubuntu@ec2-34-230-6-230.compute-1.amazonaws.com
  1. If you selected a GPU-compute instance, then you must enable persistence and optimizations of the GPU. The commands vary depending on the instance type. Note also that these commands need to be run once every reboot. Refer to the following for more information:
# g3:
sudo nvidia-smi -pm 1
sudo nvidia-smi -acp 0
sudo nvidia-smi --auto-boost-permission=0
sudo nvidia-smi --auto-boost-default=0
sudo nvidia-smi -ac "2505,1177"

# p2:
sudo nvidia-smi -pm 1
sudo nvidia-smi -acp 0
sudo nvidia-smi --auto-boost-permission=0
sudo nvidia-smi --auto-boost-default=0
sudo nvidia-smi -ac "2505,875"

# p3:
sudo nvidia-smi -pm 1
sudo nvidia-smi -acp 0
sudo nvidia-smi -ac "877,1530"
  1. At this point, you can copy data into the data directory on the host machine using scp. (Note that the data folder already exists.) For example:
scp <data_file>.csv ubuntu@ec2-34-230-6-230.compute-1.amazonaws.com:/home//data

The data will be visible inside the Docker container.

  1. Connect to Driverless AI with your browser:
http://Your-Driverless-AI-Host-Machine:12345

Stopping the EC2 Instance

The EC2 instance will continue to run even when you close the aws.amazon.com portal. To stop the instance:

  1. On the EC2 Dashboard, click the Running Instances link under the Resources section.
  2. Select the instance that you want to stop.
  3. In the Actions drop down menu, select Instance State > Stop.
  4. A confirmation page will display. Click Yes, Stop to stop the instance.

Upgrading the Driverless AI Image

WARNING: Experiments, MLIs, and MOJOs reside in the Driverless AI tmp directory and are not automatically upgraded when Driverless AI is upgraded.

  • Build MLI models before upgrading.
  • Build MOJO pipelines before upgrading.
  • Back up your Driverless AI tmp directory before upgrading.

If you did not build MLI on a model before upgrading Driverless AI, then you will not be able to view MLI on that model after upgrading. Before upgrading, be sure to run MLI jobs on models that you want to continue to interpret in future releases. If that MLI job appears in the list of Interpreted Models in your current version, then it will be retained after upgrading.

If you did not build a MOJO pipeline on a model before upgrading Driverless AI, then you will not be able to build a MOJO pipeline on that model after upgrading. Before upgrading, be sure to build MOJO pipelines on all desired models and then back up your Driverless AI tmp directory.

Upgrading from Version 1.2.2 or Earlier

The following example shows how to upgrade from 1.2.2 or earlier to the current version. Upgrading from these earlier versions requires an edit to the start and h2oai scripts.

  1. SSH into the IP address of the image instance and copy the existing experiments to a backup location:
# Set up a directory of the previous version name
mkdir dai_rel_1.2.2

# Copy the data, log, license, and tmp directories as backup
cp -r ./data dai_rel_1.2.2/data
cp -r ./log dai_rel_1.2.2/log
cp -r ./license dai_rel_1.2.2/license
cp -r ./tmp dai_rel_1.2.2/tmp
  1. wget the newer image. For example:
wget ami-0c50db5e1999408a7
  1. In the /home/ubuntu/scripts/ folder, edit both the start.sh and h2oai.sh scripts to use the newer image.
  2. Use the docker load command to load the image:
docker load < ami-0c50db5e1999408a7
  1. Optionally run docker images to ensure that the new image is in the registry.
  2. Connect to Driverless AI with your browser at http://Your-Driverless-AI-Host-Machine:12345.

Upgrading from Version 1.3.0 or Later

The following example shows how to upgrade from version 1.3.0 or later.

  1. SSH into the IP address of the image instance and copy the existing experiments to a backup location:
# Set up a directory of the previous version name
mkdir dai_rel_1.3.0

# Copy the data, log, license, and tmp directories as backup
cp -r ./data dai_rel_1.3.0/data
cp -r ./log dai_rel_1.3.0/log
cp -r ./license dai_rel_1.3.0/license
cp -r ./tmp dai_rel_1.3.0/tmp
  1. wget the newer image. For example:
wget https://s3.amazonaws.com/artifacts.h2o.ai/releases/ai/h2o/dai/rel-1.4.2-9/x86_64-centos7/dai-docker-centos7-x86_64-1.5.0-9.0.tar.gz
  1. Use the docker load command to load the image:
docker load < dai-docker-centos7-x86_64-1.5.0-9.0.tar.gz
  1. In the new AMI, locate the DAI_RELEASE file, and edit that file to match the new image tag.
  2. Stop and then start Driverless AI.
h2oai stop
h2oai start

AWS Role-Based Authentication

In Driverless AI, it is possible to enable role-based authentication via the IAM role. This is a two-step process that involves setting up AWS IAM and then starting Driverless AI by specifying the role in the config.toml file or with the AWS_ROLE_ARN environment variable.

AWS IAM Setup

  1. Create an IAM role. This IAM role should have a Trust Relationship with Principal Trust Entity set to your Account ID. For example: trust relationship for Account ID 524466471676 would look like:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": {
            "AWS": "arn:aws:iam::524466471676:root"
          },
          "Action": "sts:AssumeRole"
        }
      ]
    }
    
../_images/aws_iam_role_create.png
  1. Create a new policy that allows users to assume the role:
../_images/aws_iam_policy_create.png
  1. Assign the policy to the user.
../_images/aws_iam_policy_assign.png
  1. Test role switching here: https://signin.aws.amazon.com/switchrole. (Refer to https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_roles.html#troubleshoot_roles_cant-assume-role.)

Driverless AI Setup

  • Update the config.aws_role_arn config varriable in the config.toml file or start Driverless AI using the AWS_ROLE_ARN environment variable.