Install on Google Compute

Driverless AI can be installed on Google Compute using one of two methods:

  • Install via the available Cloud Launcher offering (recommended)
  • Running Driverless AI in a Docker container on Google Compute Engine

Install the Google Cloud Platform Offering

This section describes how to install and start Driverless AI in a Google Compute environment using the available Cloud Launcher offering. This assumes that you already have a Google Cloud Platform account. If you don’t have an account, go to https://console.cloud.google.com/getting-started to create one.

Before You Begin

If you are trying GCP for the first time and have just created an account, please check your Google Compute Engine (GCE) resource quota limits. By default, GCP allocates a maximum of 8 CPUs and no GPUs. Our default recommendation for launching Driverless AI is 32 CPUs, 120 GB RAM, and 2 P100 NVIDIA GPUs. You can change these settings to match your quota limit, or you can request more resources from GCP. Refer to https://cloud.google.com/compute/quotas for more information, including information on how to check your quota and request additional quota.

Installation Procedure

  1. In your browser, log in to the Google Compute Engine Console at https://console.cloud.google.com/.
  2. In the left navigation panel, select Cloud Launcher.
../_images/google_cloud_launcher.png
  1. On the Cloud Launcher page, search for Driverless and select the H2O.ai Driverless AI offering. The following page will display.
../_images/google_driverlessai_offering.png
  1. Click Launch on Compute Engine. (If necessary, refer to Google Compute Instance Types for information about machine and GPU types.)
  • Select a zone that has p100s or k80s (such as us-east1-)
  • Optionally change the number of cores and amount of memory. (This defaults to 32 CPUs and 120 GB RAM.)
  • Specify a GPU type. (This defaults to a p100 GPU.)
  • Optionally change the number of GPUs. (Default is 2.)
  • Specify the boot disk type and size.
  • Optionally change the network name and subnetwork names. Be sure that whichever network you specify has port 12345 exposed.
  • Click Deploy when you are done. Driverless AI will begin deploying. Note that this can take several minutes.
../_images/google_deploy_compute_engine.png
  1. A summary page displays when the compute engine is successfully deployed. This page includes the instance ID and the username (always h2oai) and password that will be required when starting Driverless AI. Click on the Instance link to retrieve the external IP address for starting Driverless AI.
../_images/google_deploy_summary.png
  1. In your browser, go to https://[External_IP]:12345 to start Driverless AI.
  2. Agree to the Terms and Conditions.
  3. Log in to Driverless AI using your user name and password.
  4. Optionally enable GCS and Big Query access.
  1. In order to enable GCS and Google BigQuery access, you must pass the running instance a service account json file configured with GCS and GBQ access. The Driverless AI image comes with a blank file called service_account.json. Obtain a functioning service account json file from GCP, rename it to “service_account.json”, and copy it to the Ubuntu user on the running instance.
gcloud compute scp /path/to/service_account.json ubuntu@<running_instance_name>:service_account.json
  1. SSH into the machine running Driverless AI, and verify that the service_account.json file is in the /home/ubuntu/ folder.
  2. Stop (if running) and then restart Driverless AI for the services_account.json changes to take effect.
# Check to see if Driverless AI is running
h2oai status

# Stop Driverless AI if it is running
h2oai stop

# Start Driverless AI
h2oai start

Running in a Docker Container on Google Compute Engine

This section describes how to install and start Driverless AI from a Docker container on Google Compute environment. This assumes that you already have a Google Cloud Platform account. If you don’t have an account, go to https://console.cloud.google.com/getting-started to create one. In addition, refer to Google’s Machine Types documentation for information on Google Compute machine types.

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.

Before You Begin

If you are trying GCP for the first time and have just created an account, please check your Google Compute Engine (GCE) resource quota limits. By default, GCP allocates a maximum of 8 CPUs and no GPUs. You can change these settings to match your quota limit, or you can request more resources from GCP. Refer to https://cloud.google.com/compute/quotas for more information, including information on how to check your quota and request additional quota.

Installation Procedure

  1. In your browser, log in to the Google Compute Engine Console at https://console.cloud.google.com/.
  2. In the left navigation panel, select Compute Engine > VM Instances.
../_images/gce_newvm_instance.png
  1. Click Create Instance.
../_images/gce_create_instance.png
  1. Specify the following at a minimum:
  • A unique name for this instance.
  • The desired zone. Note that not all zones and user accounts can select zones with GPU instances. Refer to the following for information on how to add GPUs: https://cloud.google.com/compute/docs/gpus/.
  • A supported OS, for example Ubuntu 16.04. Be sure to also increase the disk size of the OS image to be 64 GB.

Click Create at the bottom of the form when you are done. This creates the new VM instance.

../_images/gce_instance_settings.png
  1. Create a Firewall rule for Driverless AI. On the Google Cloud Platform left navigation panel, select VPC network > Firewall rules. Specify the following settings:
  • Specify a unique name and Description for this instance.
  • Change the Targets dropdown to All instances in the network.
  • Specify the Source IP ranges to be 0.0.0.0/0.
  • Under Protocols and Ports, select Specified protocols and ports and enter the following: tcp:12345.

Click Create at the bottom of the form when you are done.

../_images/gce_create_firewall_rule.png
  1. On the VM Instances page, SSH to the new VM Instance by selecting Open in Browser Window from the SSH dropdown.
../_images/gce_ssh_in_browser.png
  1. H2O provides a script for you to run in your VM instance. Open an editor in the VM instance (for example, vi). Copy one of the scripts below (depending on whether you are running GPUs or CPUs). Save the script as install.sh.
# SCRIPT FOR GPUs ONLY
apt-get -y update
apt-get -y --no-install-recommends install \
  curl \
  apt-utils \
  python-software-properties \
  software-properties-common

add-apt-repository -y ppa:graphics-drivers/ppa
add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

apt-get update
apt-get install -y \
  nvidia-384 \
  nvidia-modprobe \
  docker-ce

wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb
dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb
# SCRIPT FOR CPUs ONLY
apt-get -y update
apt-get -y --no-install-recommends install \
  curl \
  apt-utils \
  python-software-properties \
  software-properties-common

add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

apt-get update
apt-get install -y docker-ce
  1. Type the following commands to run the install script.
chmod +x install.sh
sudo ./install.sh
  1. In your user folder, create the following directories as your user.
mkdir ~/tmp
mkdir ~/log
mkdir ~/data
mkdir ~/scripts
mkdir ~/license
mkdir ~/demo
mkdir -p ~/jupyter/notebooks
  1. Add your Google Compute user name to the Docker container.
sudo usermod -aG docker <username>
  1. Reboot the system to enable NVIDIA drivers.
sudo reboot
  1. If you are running CPUs, you can skip this step. Otherwise, enable persistence of the GPU. Note that this only needs to be run once. Refer to the following for more information: http://docs.nvidia.com/deploy/driver-persistence/index.html.
sudo nvidia-persistenced --user <USER>
sudo nvidia-smi -pm 1
  1. Retrieve the Driverless AI Docker image from https://www.h2o.ai/driverless-ai-download/.

Note: You can optionally run the following to retrieve the latest tagged version:

wget https://s3-us-west-2.amazonaws.com/h2o-internal-release/docker/driverless-ai-docker-runtime-latest-release.gz
  1. Load the Driverless AI Docker image.
sudo docker load < driverless-ai-docker-runtime-latest-release.gz
  1. Start the Driverless AI Docker image with nvidia-docker run (GPUs) or docker run (CPUs). Note that you must have write privileges for the folders that are created below. You can replace ‘pwd’ with the path to /home/<username> or start with sudo nvidia-docker run. Also, refer to Using Data Connectors with the Docker Image for information on how to add the GCS and GBQ data connectors to your Driverless AI instance.
# Start the Driverless AI Docker image
nvidia-docker run \
    --pid=host \
    --init \
    --rm \
    -u `id -u`:`id -g` \
    -p 12345:12345 \
    -p 54321:54321 \
    -p 9090:9090 \
    -v `pwd`/data:/data \
    -v `pwd`/log:/log \
    -v `pwd`/license:/license \
    -v `pwd`/tmp:/tmp \
    opsh2oai/h2oai-runtime

Driverless AI will begin running:

--------------------------------
Welcome to H2O.ai's Driverless AI
---------------------------------
     version: 1.2.2

- Put data in the volume mounted at /data
- Logs are written to the volume mounted at /log/20180606-044258
- Connect to Driverless AI on port 12345 inside the container
- Connect to Jupyter notebook on port 8888 inside the container
  1. Connect to Driverless AI with your browser:
http://Your-Driverless-AI-Host-Machine:12345

Stopping the GCE Instance

The Google Compute Engine instance will continue to run even when you close the portal. You can stop the instance using one of the following methods:

Stopping in the browser

  1. On the VM Instances page, click on the VM instance that you want to stop.
  2. Click Stop at the top of the page.
  3. A confirmation page will display. Click Stop to stop the instance.

Stopping in Terminal

SSH into the machine that is running Driverless AI, and then run the following:

h2oai stop

Upgrading Driverless AI

This section provides instructions for upgrading Driverless AI so that existing experiments are saved. The instructions show an example of upgrading Driverless AI from version 1.0.18 to version 1.2.2.

WARNING: Experiments, MLIs, and MOJOs are not automatically upgraded when Driverless AI is upgraded.

  • Build MLI models before upgrading.
  • Build MOJO pipelines 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.

Note: Stop Driverless AI if it is still running.

  1. SSH into the IP address of the machine that is running Driverless AI.
  2. Set up a directory for the version of Driverless AI on the host machine:
# Set up directory with the version name
mkdir dai_rel_1.2.2

# cd into the new directory
cd dai_rel_1.2.2
  1. Retrieve the Driverless AI package from https://www.h2o.ai/driverless-ai-download/ and add it to the new directory.

Note: You can optionally run the following to retrive the latest tagged version.

# Download latest release
wget https://s3-us-west-2.amazonaws.com/h2o-internal-release/docker/driverless-ai-docker-runtime-latest-release.gz
  1. Load the Driverless AI Docker image inside the new directory:
# Load the Driverless AI docker image
docker load < driverless-ai-docker-runtime-latest-release.gz
  1. Copy the data, log, license, and tmp directories from the previous Driverless AI directory to the new Driverless AI directory:
# Copy the data, log, license, and tmp directories on the host machine
cp -r dai_rel_1.0.18/data dai_rel_1.2.2/data
cp -r dai_rel_1.0.18/log dai_rel_1.2.2/log
cp -r dai_rel_1.0.18/license dai_rel_1.2.2/license
cp -r dai_rel_1.0.18/tmp dai_rel_1.2.2/tmp

At this point, your experiments from the previous versions will be visible inside the Docker container.

  1. Start the Driverless AI Docker image.
  2. Connect to Driverless AI with your browser at http://Your-Driverless-AI-Host-Machine:12345.