环境变量和配置选项

Driverless AI 提供了一系列环境变量,在启动 Driverless AI 时或在 config.toml 文件中指定时,可以传递这些变量。 使用 config.toml 文件 一节提供了完整的变量列表。视您安装的是 Driverless AI RPM、DEB 还是 TAR SH 或者视您是否运行 Docker 映像,用于指定变量的步骤也会有不同。

设置环境变量和配置选项

每个属性必须以 DRIVERLESS_AI_ 开头。以下示例通过启用了 S3 和 HDFS 访问的环境变量启动 Driverless AI(无身份验证)。

nvidia-docker run \
  --pid=host \
  --init \
  --rm \
  -u `id -u`:`id -g` \
  -e DRIVERLESS_AI_ENABLED_FILE_SYSTEMS="file,s3,hdfs" \
  -e DRIVERLESS_AI_AUTHENTICATION_METHOD="local" \
  -e DRIVERLESS_AI_LOCAL_HTPASSWD_FILE="<htpasswd_file_location>" \
  -v /etc/passwd:/etc/passwd:ro \
  -v /etc/group:/etc/group:ro \
  -v `pwd`/data:/data \
  -v `pwd`/log:/log \
  -v `pwd`/license:/license \
  -v `pwd`/tmp:/tmp \
  h2oai/dai-centos7-x86_64:1.9.2.1-cuda10.0.xx

在安装 RPM、DEB 或 TAR SH 后,可在 etc/dai 文件夹中找到 config.toml 文件。在此文件中编辑相应的变量,然后重启 Driverless AI。

以下实例展示了 config.toml 文件中的配置选项,当启用 S3 和 HDFS 访问时需设置这些选项(无身份验证)。

  1. 导出 Driverless AI config.toml 文件或将其添加至 ~/.bashrc。例如:

# DEB and RPM
export DRIVERLESS_AI_CONFIG_FILE="/etc/dai/config.toml"

# TAR SH
export DRIVERLESS_AI_CONFIG_FILE="/path/to/your/unpacked/dai/directory/config.toml"
  1. 指定所需的配置选项,以启用(无身份验证的)S3 和 HDFS 访问。

# File System Support
# upload : standard upload feature
# file : local file system/server file system
# hdfs : Hadoop file system, remember to configure the HDFS config folder path and keytab below
# dtap : Blue Data Tap file system, remember to configure the DTap section below
# s3 : Amazon S3, optionally configure secret and access key below
# gcs : Google Cloud Storage, remember to configure gcs_path_to_service_account_json below
# gbq : Google BigQuery, remember to configure gcs_path_to_service_account_json below
# minio : Minio Cloud Storage, remember to configure secret and access key below
# snow : Snowflake Data Warehouse, remember to configure Snowflake credentials below (account name, username, password)
# kdb : KDB+ Time Series Database, remember to configure KDB credentials below (hostname and port, optionally: username, password, classpath, and jvm_args)
# azrbs : Azure Blob Storage, remember to configure Azure credentials below (account name, account key)
# jdbc: JDBC Connector, remember to configure JDBC below. (jdbc_app_configs)
enabled_file_systems = "file,s3,hdfs"

# authentication_method
# unvalidated : Accepts user id and password, does not validate password
# none : Does not ask for user id or password, authenticated as admin
# pam :  Accepts user id and password, Validates user with operating system
# ldap : Accepts user id and password, Validates against an ldap server, look
# local: Accepts a user id and password, Validated against a htpasswd file provided in local_htpasswd_file
# for additional settings under LDAP settings
authentication_method = "local"

# Local password file
# Generating a htpasswd file: see syntax below
# htpasswd -B "<location_to_place_htpasswd_file>" "<username>"
# note: -B forces use of brcypt, a secure encryption method
local_htpasswd_file = "<htpasswd_file_location>"
  1. 启动 Driverless AI。请注意,用于启动 Driverless AI 的命令将因安装类型而异。

# Linux RPM or DEB with systemd
sudo systemctl start dai

# Linux RPM or DEB without systemd
sudo -H -u dai /opt/h2oai/dai/run-dai.sh

# Linux TAR SH
./run-dai.sh