.. _install-on-macosx:

Mac OS X
--------

This section describes how to install, start, stop, and upgrade the Driverless AI Docker image on Mac OS X. Note that this uses regular Docker and not NVIDIA Docker. GPU support will not be available. 

The installation steps assume that you have a license key for Driverless AI. For information on how to obtain a license key for Driverless AI, visit https://www.h2o.ai/driverless-ai/. Once obtained, you will be promted to paste the license key into the Driverless AI UI when you first log in, or you can save it as a .sig file and place it in the \license folder that you will create during the installation process.

**Caution**:  

- This is an extremely memory-constrained environment for experimental purposes only. Stick to small datasets! For serious use, please use Linux.
- Be aware that there are known performace issues with Docker for Mac. More information is available here: https://docs.docker.com/docker-for-mac/osxfs/#technology.

Environment
~~~~~~~~~~~

+-----------------------+---------------+---------+-----------------+
| Operating System      | GPU Support?  | Min Mem | Suitable for    |
+=======================+===============+=========+=================+
| Mac OS X              | No            | 16 GB   | Experimentation |
+-----------------------+---------------+---------+-----------------+

Installing Driverless AI
~~~~~~~~~~~~~~~~~~~~~~~~

1. Retrieve the Driverless AI Docker image from https://www.h2o.ai/download/. 

2. Download and run Docker for Mac from https://docs.docker.com/docker-for-mac/install.

3. Adjust the amount of memory given to Docker to be at least 10 GB. Driverless AI won't run at all with less than 10 GB of memory. You can optionally adjust the number of CPUs given to Docker. You will find the controls by clicking on (Docker Whale)->Preferences->Advanced as shown in the following screenshots. (Don't forget to Apply the changes after setting the desired memory value.)

.. image:: ../images/macosx_docker_menu_bar.png
   :align: center

.. image:: ../images/macosx_docker_advanced_preferences.png
   :align: center
   :height: 507
   :width: 382

4. Set up a directory for the version of Driverless AI within the Terminal, replacing VERSION below with your Driverless AI Docker image version (for example, 1.4.0): 

 ::

    mkdir dai_rel_VERSION

5. With Docker running, open a Terminal and move the downloaded Driverless AI to your new directory.

6. Change directories to the new directory, then load the image using the following command. Note that this example shows how to load Driverless AI version 1.4.0 for Cuda 9. Replace this with your image.

 ::

    cd dai_rel_VERSION
    docker load < dai-docker-centos7-x86_64-1.4.0-9.0.tar.gz

7. Set up the data, log, license, and tmp directories (within the new Driverless AI directory):

 ::

    mkdir data
    mkdir log
    mkdir license
    mkdir tmp


8. Optionally copy data into the **data** directory on the host. The data will be visible inside the Docker container at **/data**. You can also upload data after starting Driverless AI. 

9. Start the Driverless AI Docker image (still within the new Driverless AI directory). GPU support will not be available.

 ::

    docker run \
      --pid=host \
      --init \
      --rm \
      --shm-size=256m \
      -u `id -u`:`id -g` \
      -p 12345:12345 \
      -v `pwd`/data:/data \
      -v `pwd`/log:/log \
      -v `pwd`/license:/license \
      -v `pwd`/tmp:/tmp \
      h2oai/dai-centos7-x86_64:1.4.0-9.0

10. Connect to Driverless AI with your browser at http://localhost:12345.

Stopping the Docker Image
~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: stop-docker.rst

Upgrading the Docker Image
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: upgrade-docker.rst
