IBM Docker 映像¶
为简化本地安装,Driverless AI 将作为 Docker 映像提供给以下系统组合:
主机操作系统 |
Docker 版本 |
主机架构 |
最小内存 |
---|---|---|---|
RHEL 或 CentOS 7.4 或更高版本 |
Docker CE |
ppc64le |
64 GB |
请注意:
CUDA 10 或更高版本,并安装有 440.82 版及更高版本的 NVIDIA 驱动程序(仅 GPU)
若需在 Power 上使用 GPU 版本的 LightGBM,则启用 enable_lightgbm_cuda_support 专家设置。目前尚不支持在 Power 上使用 LightGBM OpenCL 。
若需获得 GPU 支持等最佳性能,请使用 nvidia-docker2。若仅需在不使用 GPU 的情况下获得较低性能的体验,则使用普通版本的 docker(具有相同的 docker 映像)即可。
这些安装步骤假设您已有 Driverless AI 许可证密钥。请访问 https://www.h2o.ai/products/h2o-driverless-ai/,了解如何获取 Driverless AI 许可证密钥。获取密钥后,首次登录时系统将提示您将许可证密钥粘贴至 Driverless AI UI 中,或者您可以将其保存为 .sig 文件并放置于您将在安装过程中创建的 license 文件夹中。
在使用 GPU 的 IBM 系统上安装¶
本节介绍如何在 RHEL 上安装并启动 Driverless AI Docker 映像以用于使用 GPU 的 IBM Power LE 系统。请注意 nvidia-docker 对 ppc64le 计算机的支持有限。更多关于 ppc64le 计算机的 nvidia-docker 支持信息,请点击`此处 <https://github.com/nvidia/nvidia-docker/wiki/Frequently-Asked-Questions#do-you-support-powerpc64-ppc64le>。
打开终端和并使用 SSH 登录将运行 Driverless AI 的主机。登录之后,执行以下步骤:
从 https://www.h2o.ai/download/ 检索 Driverless AI Docker 映像。
将以下内容添加至
/etc/yum.repos.d/
中的cuda-rhel7.repo
:
[cuda] name=cuda baseurl=http://developer.download.nvidia.com/compute/cuda/repos/rhel7/ppc64le enabled=1 gpgcheck=1 gpgkey=http://developer.download.nvidia.com/compute/cuda/repos/rhel7/ppc64le/7fa2af80.pub
将以下内容添加至
/etc/yum.repos.d/
中的nvidia-container-runtime.repo
:
[libnvidia-container] name=libnvidia-container baseurl=https://nvidia.github.io/libnvidia-container/centos7/$basearch repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://nvidia.github.io/libnvidia-container/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt [nvidia-container-runtime] name=nvidia-container-runtime baseurl=https://nvidia.github.io/nvidia-container-runtime/centos7/$basearch repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://nvidia.github.io/nvidia-container-runtime/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt
安装最新版本的驱动程序和最新版本的 CUDA:
yum -y install nvidia-driver-latest-dkms cuda --nogpgcheck
在 RedHat 上安装 Docker:
yum -y install docker
安装 NVIDIA hook。(请参阅 https://github.com/NVIDIA/nvidia-docker#rhel-docker,了解更多信息。)这会自动将 Docker 的运行时切换为``nvidia-runtime``.
yum -y install nvidia-container-runtime-hook
在主机上设置相应 Driverless AI 版本的目录
# Set up directory with the version name mkdir dai-1.9.2.1
将目录更改为新文件夹,然后将 Driverless AI Docker 映像加载到新目录中:
# cd into the new directory cd dai-1.9.2.1 # Load the Driverless AI docker image docker load < dai-docker-centos7-ppc64le-1.9.2-10.0.tar.gz
启用 GPU 的持久模式。注意每次重启时都需要运行此功能。更多信息,请查阅以下网页:http://docs.nvidia.com/deploy/driver-persistence/index.html。
sudo nvidia-smi -pm 1
在主机上(新目录内)设置数据、日志和许可证目录:
# Set up the data, log, license, and tmp directories on the host machine mkdir data mkdir log mkdir license mkdir tmp
此时,您可以将数据复制到主机上的 data 目录中。数据将在 Docker 容器内可见。
运行
docker images
,找到映像标签。启动 Driverless AI Docker 映像,并将下方标签替换为映像标签。根据您所安装的版本,使用
docker run --runtime=nvidia
(>= Docker 19.03) 或nvidia-docker
(< Docker 19.03) 命令。
请注意:可使用
docker version
来检查您使用的 Docker 版本。# Start the Driverless AI Docker image docker run --runtime=nvidia \ --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:TAG# Start the Driverless AI Docker image nvidia-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:TAGDriverless AI 将开始运行:
-------------------------------- Welcome to H2O.ai's Driverless AI --------------------------------- - 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
通过浏览器访问 http://Your-Driverless-AI-Host-Machine:12345,连接至 Driverless AI。
在使用 CPU 的 IBM 系统上安装¶
本节介绍如何在 RHEL 上安装并启动 Driverless AI Docker 映像以用于使用 CPU 的 IBM Power LE 系统。请注意,此处使用的是 docker
而非 nvidia-docker
. 此时,GPU 支持将不可用。
点击 此处 观看安装视频 。请注意,此视频中的某些图像可能因版本而异,但安装步骤仍相同。
请注意:截至本文件编写之时,只在 RHEL 7.4 版上测试了 Driverless AI。
打开终端和并使用 SSH 登录将运行 Driverless AI 的主机。登录之后,执行以下步骤:
安装并启动 Docker CE。
sudo yum install -y yum-utils sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo yum makecache fast sudo yum -y install docker-ce sudo systemctl start docker
在运行 Docker CE 的计算机上,从 https://www.h2o.ai/driverless-ai-download/ 检索 Driverless AI Docker 映像。
在主机上设置相应 Driverless AI 版本的目录
# Set up directory with the version name mkdir dai-1.9.2.1
在新目录内加载 Driverless AI Docker 映像:
# Load the Driverless AI Docker image docker load < dai-docker-centos7-ppc64le-1.9.2-10.0.tar.gz
(在新目录内)设置数据、日志、许可证和临时目录:
# cd into the directory associated with your version of Driverless AI cd dai-1.9.2.1 # Set up the data, log, license, and tmp directories on the host machine mkdir data mkdir log mkdir license mkdir tmp
将数据复制到主机上的 data 目录中。数据将在 Docker 容器内的 /<user-home>/data 目录下可见。
运行
docker images
,找到映像标签。启动 Driverless AI Docker 映像。注意 GPU 支持将不可用。
$ docker run \ --pid=host \ --init \ --rm \ -u `id -u`:`id -g` \ -p 12345:12345 \ -v `pwd`/data:/data \ -v `pwd`/log:/log \ -v `pwd`/license:/license \ -v `pwd`/tmp:/tmp \ -v /etc/passwd:/etc/passwd:ro \ -v /etc/group:/etc/group:ro \ h2oai/dai-centos7-x86_64:1.9.2.1-cuda10.0.xxDriverless AI 将开始运行:
-------------------------------- Welcome to H2O.ai's Driverless AI --------------------------------- - 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
通过浏览器访问 http://Your-Driverless-AI-Host-Machine:12345,连接至 Driverless AI。
停止 Docker 映像¶
若要停止 Driverless AI Docker 映像,在运行 Driverless AI Docker 映像的终端 (Mac OS X) 或 PowerShell (Windows 10) 窗口中按下 Ctrl + C 。
升级 Docker 映像¶
本节提供了用于升级 Docker 容器内已安装的各版本 Driverless AI 的说明。这些步骤将确保现有实验被保存。
警告:实验、MLI 和 MOJO 驻留在 Driverless AI 临时目录中,在升级 Driverless AI 时不会自动升级。
升级前构建 MLI 模型
升级前构建 MOJO 管道。
升级前停止 Driverless AI 并备份 Driverless AI tmp 目录。
如果在升级 Driverless AI 前未在务必模型上构建 MLI,则升级后将不能在该模型上查看 MLI。升级前,请务必在您想要在未来版本中继续进行解释的模型上运行 MLI 作业。如果当前版本的解释模型列表中含有此 MLI 作业,则在升级后将保留。
如果在升级 Driverless AI 前未在模型上构建 MOJO 管道,则升级后将不能在该模型上构建 MOJO 管道。升级前,请务必在所需的全部模型上构建 MOJO 管道,然后备份 Driverless AI tmp 目录。
请注意:如果 Driverless AI 仍在运行,需将其停止。
要求¶
从 1.7.0 版开始,不再支持 CUDA 9。您的主机环境必须有 CUDA 10.0 或更高版本,并安装有 NVIDIA 驱动程序 (>= 440.82)(仅 GPU)。Driverless AI 自带 CUDA 库,但是主机环境中必须有驱动程序。前往 https://www.nvidia.com/Download/index.aspx, 获取最新的 NVIDIA Tesla V/P/K 系列驱动程序。
升级步骤¶
使用 SSH 连接到运行 Driverless AI 的主机 IP 地址
在主机上设置相应 Driverless AI 版本的目录
# Set up directory with the version name mkdir dai-1.9.2.1 # cd into the new directory cd dai-1.9.2.1
从 https://www.h2o.ai/download/ 检索 Driverless AI 软件包,并将该软件包添加到新目录中。
在新目录内加载 Driverless AI Docker 映像:
# Load the Driverless AI docker image docker load < dai-docker-centos7-x86_64-1.9.2-10.0.tar.gz
将之前 Driverless AI 目录的数据、日志、许可证和临时目录复制到新的 Driverless AI 目录中:
# Copy the data, log, license, and tmp directories on the host machine cp -a dai_rel_1.4.2/data dai-1.9.2.1/data cp -a dai_rel_1.4.2/log dai-1.9.2.1/log cp -a dai_rel_1.4.2/license dai-1.9.2.1/license cp -a dai_rel_1.4.2/tmp dai-1.9.2.1/tmp
此时,您之前版本的实验将在 Docker 容器内可见。
使用
docker images
,找到新的映像标签。启动 Driverless AI Docker 映像。
通过浏览器访问 http://Your-Driverless-AI-Host-Machine:12345,连接至 Driverless AI。