BlueData DataTap 设置

本节介绍如何配置 Driverless AI 与 BlueData DataTap 配合使用。

请注意:根据您所安装的 Docker 版本,在启动 Driverless AI Docker 映像时,使用``docker run –runtime=nvidia`` (>= Docker 19.03) 或 nvidia-docker (< Docker 19.03) 命令。使用 docker version 检查所使用的 Docker 版本。

配置属性说明

  • dtap_auth_type: 选择 DTAP 身份验证。可用值为:

    • noauth: 无需身份验证

    • principal: 通过 DataTap 对主体用户进行身份验证

    • keytab: 使用密钥表进行身份验证(建议)。如果将 Driverless AI 作为一项服务运行,则 Kerberos 密钥表的所有者需为 Driverless AI 用户。

    • keytabimpersonation: 使用密钥表进行模拟登录

  • dtap_config_path: DTAP (HDFS) 配置文件夹路径位置。此文件夹可包含多个配置文件。请注意:DTAP 配置文件 core-site.xml 需要包含 DTap FS 配置,例如:

    <configuration>
      <property>
        <name>fs.dtap.impl</name>
        <value>com.bluedata.hadoop.bdfs.Bdfs</value>
        <description>The FileSystem for BlueData dtap: URIs.</description>
      </property>
    </configuration>
    
  • dtap_key_tab_path: 主体密钥表文件路径。当 dtap_auth_type=principal 时可使用。

  • dtap_app_principal_user: Kerberos 应用程序主体用户(建议)。

  • dtap_app_login_user: 当前用户的用户 ID(例如:user@realm)。

  • dtap_app_jvm_args: 用于 DTap 分发的 JVM 参数。用空格分隔每个参数。

  • dtap_app_classpath: DTap classpath

  • dtap_init_path: 指定 DTAP 浏览器 UI 中显示的 DTAP 启动路径。

  • enabled_file_systems: 您要启用的文件系统。为使数据连接器正常运行,必须进行此项配置。

示例 1:启用无身份验证的 DataTap

此示例启用了 DataTap 数据连接器并禁用了身份验证。此连接器不传递任何配置文件;但是,可通过传递 DTap 名称节点的名称和 IP 来配置 Docker DNS。这允许用户直接使用名称节点地址引用 DTap 中储存的数据,例如 dtap://name.node/datasets/iris.csvdtap://name.node/datasets/. (请注意:当前目录需要以斜杠结尾。)

nvidia-docker run \
  --pid=host \
  --init \
  --rm \
  --shm-size=256m \
  --add-host name.node:172.16.2.186 \
  -e DRIVERLESS_AI_ENABLED_FILE_SYSTEMS="file,dtap" \
  -e DRIVERLESS_AI_DTAP_AUTH_TYPE='noauth'  \
  -p 12345:12345 \
  -v /etc/passwd:/etc/passwd \
  -v /tmp/dtmp/:/tmp \
  -v /tmp/dlog/:/log \
  -v /tmp/dlicense/:/license \
  -v /tmp/ddata/:/data \
  -u $(id -u):$(id -g) \
  h2oai/dai-centos7-x86_64:1.9.2.1-cuda10.0.xx

此示例展示了如何在 config.toml 文件中配置 DataTap 选项,然后当在 Docker 中启动 Driverless AI 时指定此文件。请注意,本示例启用了无身份验证的 DataTap。

  1. 配置 Driverless AI config.toml 文件。设置以下配置选项:

  • enabled_file_systems = "file, upload, dtap"

  1. 将 config.toml 文件挂载至 Docker 容器。

nvidia-docker run \
  --pid=host \
  --init \
  --rm \
  --shm-size=256m \
  --add-host name.node:172.16.2.186 \
  -e DRIVERLESS_AI_CONFIG_FILE=/path/in/docker/config.toml \
  -p 12345:12345 \
  -v /local/path/to/config.toml:/path/in/docker/config.toml \
  -v /etc/passwd:/etc/passwd:ro \
  -v /etc/group:/etc/group:ro \
  -v /tmp/dtmp/:/tmp \
  -v /tmp/dlog/:/log \
  -v /tmp/dlicense/:/license \
  -v /tmp/ddata/:/data \
  -u $(id -u):$(id -g) \
  h2oai/dai-centos7-x86_64:1.9.2.1-cuda10.0.xx

此示例在 config.toml 文件中启用了 DataTap 数据连接器并禁用了身份验证。这允许用户直接使用名称节点地址引用 DataTap 中储存的数据,例如 dtap://name.node/datasets/iris.csvdtap://name.node/datasets/. (请注意:当前目录需要以斜杠结尾。)

  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. 在 config.toml 文件中指定以下配置选项。

# File System Support
# upload : standard upload feature
# dtap : Blue Data Tap file system, remember to configure the DTap section below
enabled_file_systems = "file, dtap"
  1. 完成后,保存更改,然后停止/重启 Driverless AI。

示例 2:启用带基于密钥表的身份验证的 DataTap

请注意

  • 如果使用 Kerberos 身份验证,则 Driverless AI 服务器上的时间必须与 Kerberos 服务器上的时间一致。如果客户端和 DC 之间的时间差异为 5 分钟或以上,则 Kerberos 会出现故障。

  • 如果将 Driverless AI 作为一项服务运行,则 Kerberos 密钥表的所有者需为 Driverless AI 用户。否则, Driverless AI 将无法读取/访问密钥表,并将导致回退至简单身份验证,从而失败。

在此示例中:

  • 将密钥表放置于计算机的 /tmp/dtmp 文件夹中,并提供如下所述的文件路径。

  • 配置 DRIVERLESS_AI_DTAP_APP_PRINCIPAL_USER 环境变量,以引用为其创建了密钥表的用户(通常以 user@realm 的形式引用)。

nvidia-docker run \
    --pid=host \
    --init \
    --rm \
    --shm-size=256m \
    -e DRIVERLESS_AI_ENABLED_FILE_SYSTEMS="file,dtap" \
    -e DRIVERLESS_AI_DTAP_AUTH_TYPE='keytab'  \
    -e DRIVERLESS_AI_DTAP_KEY_TAB_PATH='tmp/<<keytabname>>' \
    -e DRIVERLESS_AI_DTAP_APP_PRINCIPAL_USER='<<user@kerberosrealm>>' \
    -p 12345:12345 \
    -v /etc/passwd:/etc/passwd \
    -v /tmp/dtmp/:/tmp \
    -v /tmp/dlog/:/log \
    -v /tmp/dlicense/:/license \
    -v /tmp/ddata/:/data \
    -u $(id -u):$(id -g) \
    h2oai/dai-centos7-x86_64:1.9.2.1-cuda10.0.xx

在此示例中:

  • 将密钥表放置于计算机的 /tmp/dtmp 文件夹中,并提供如下所述的文件路径。

  • 配置 dtap_app_prinicpal_user 选项,以引用为其创建了密钥表的用户(通常以 user@realm 的形式引用)。

  1. 配置 Driverless AI config.toml 文件。设置以下配置选项:

  • enabled_file_systems = "file, upload, dtap"

  • dtap_auth_type = "keytab"

  • dtap_key_tab_path = "/tmp/<keytabname>"

  • dtap_app_principal_user = "<user@kerberosrealm>"

  1. 将 config.toml 文件挂载至 Docker 容器。

nvidia-docker run \
  --pid=host \
  --init \
  --rm \
  --shm-size=256m \
  --add-host name.node:172.16.2.186 \
  -e DRIVERLESS_AI_CONFIG_FILE=/path/in/docker/config.toml \
  -p 12345:12345 \
  -v /local/path/to/config.toml:/path/in/docker/config.toml \
  -v /etc/passwd:/etc/passwd:ro \
  -v /etc/group:/etc/group:ro \
  -v /tmp/dtmp/:/tmp \
  -v /tmp/dlog/:/log \
  -v /tmp/dlicense/:/license \
  -v /tmp/ddata/:/data \
  -u $(id -u):$(id -g) \
  h2oai/dai-centos7-x86_64:1.9.2.1-cuda10.0.xx

在此示例中:

  • 将密钥表放置于计算机的 /tmp/dtmp 文件夹中,并提供如下所述的文件路径。

  • 配置 dtap_app_prinicpal_user 选项,以引用为其创建了密钥表的用户(通常以 user@realm 的形式引用)。

  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. 在 config.toml 文件中指定以下配置选项。

# File System Support
# file : local file system/server file system
# dtap : Blue Data Tap file system, remember to configure the DTap section below
enabled_file_systems = "file, dtap"

# Blue Data DTap connector settings are similar to HDFS connector settings.
#
# Specify DTap Auth Type, allowed options are:
#   noauth : No authentication needed
#   principal : Authenticate with DTab with a principal user
#   keytab : Authenticate with a Key tab (recommended). If running
#             DAI as a service, then the Kerberos keytab needs to
#             be owned by the DAI user.
#   keytabimpersonation : Login with impersonation using a keytab
dtap_auth_type = "keytab"

# Path of the principal key tab file
dtap_key_tab_path = "/tmp/<keytabname>"

# Kerberos app principal user (recommended)
dtap_app_principal_user = "<user@kerberosrealm>"
  1. 完成后,保存更改,然后停止/重启 Driverless AI。

示例 3:启用带基于密钥表的模拟的 DataTap

请注意

  • 如果使用 Kerberos,请确保 Driverless AI 的时间与 Kerberos 服务器上的时间一致。

  • 如果将 Driverless AI 作为一项服务运行,则 Kerberos 密钥表的所有者需为 Driverless AI。

在此示例中:

  • 将密钥表放置于计算机的 /tmp/dtmp 文件夹中,并提供如下所述的文件路径。

  • 配置 DRIVERLESS_AI_DTAP_APP_PRINCIPAL_USER 变量,以引用为其创建了密钥表的用户(通常以 user@realm 的形式引用)。

  • 配置 DRIVERLESS_AI_DTAP_APP_LOGIN_USER 变量,以引用被模拟的用户(通常以 user@realm 的形式引用)。

# Docker instructions
nvidia-docker run \
    --pid=host \
    --init \
    --rm \
    --shm-size=256m \
    -e DRIVERLESS_AI_ENABLED_FILE_SYSTEMS="file,dtap" \
    -e DRIVERLESS_AI_DTAP_AUTH_TYPE='keytabimpersonation'  \
    -e DRIVERLESS_AI_DTAP_KEY_TAB_PATH='tmp/<<keytabname>>' \
    -e DRIVERLESS_AI_DTAP_APP_PRINCIPAL_USER='<<appuser@kerberosrealm>>' \
    -e DRIVERLESS_AI_DTAP_APP_LOGIN_USER='<<thisuser@kerberosrealm>>' \
    -p 12345:12345 \
    -v /etc/passwd:/etc/passwd \
    -v /tmp/dtmp/:/tmp \
    -v /tmp/dlog/:/log \
    -v /tmp/dlicense/:/license \
    -v /tmp/ddata/:/data \
    -u $(id -u):$(id -g) \
    h2oai/dai-centos7-x86_64:1.9.2.1-cuda10.0.xx

在此示例中:

  • 将密钥表放置于计算机的 /tmp/dtmp 文件夹中,并提供如下所述的文件路径。

  • 配置 dtap_app_principal_user 变量,以引用为其创建了密钥表的用户(通常以 user@realm 的形式引用)。

  • 配置 dtap_app_login_user 变量,以引用被模拟的用户(通常以 user@realm 的形式引用)。

  1. 配置 Driverless AI config.toml 文件。设置以下配置选项:

  • enabled_file_systems = "file, upload, dtap"

  • dtap_auth_type = "keytabimpersonation"

  • dtap_key_tab_path = "/tmp/<keytabname>"

  • dtap_app_principal_user = "<user@kerberosrealm>"

  • dtap_app_login_user = "<user@realm>"

  1. 将 config.toml 文件挂载至 Docker 容器。

nvidia-docker run \
  --pid=host \
  --init \
  --rm \
  --shm-size=256m \
  --add-host name.node:172.16.2.186 \
  -e DRIVERLESS_AI_CONFIG_FILE=/path/in/docker/config.toml \
  -p 12345:12345 \
  -v /local/path/to/config.toml:/path/in/docker/config.toml \
  -v /etc/passwd:/etc/passwd:ro \
  -v /etc/group:/etc/group:ro \
  -v /tmp/dtmp/:/tmp \
  -v /tmp/dlog/:/log \
  -v /tmp/dlicense/:/license \
  -v /tmp/ddata/:/data \
  -u $(id -u):$(id -g) \
  h2oai/dai-centos7-x86_64:1.9.2.1-cuda10.0.xx

在此示例中:

  • 将密钥表放置于计算机的 /tmp/dtmp 文件夹中,并提供如下所述的文件路径。

  • 配置 dtap_app_principal_user 变量,以引用为其创建了密钥表的用户(通常以 user@realm 的形式引用)。

  • 配置 dtap_app_login_user 变量,以引用被模拟的用户(通常以 user@realm 的形式引用)。

  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. 在 config.toml 文件中指定以下配置选项。

# 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 Big Query, 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)
# hive: Hive Connector, remember to configure Hive below. (hive_app_configs)
# recipe_url: load custom recipe from URL
# recipe_file: load custom recipe from local file system
enabled_file_systems = "file, dtap"

# Blue Data DTap connector settings are similar to HDFS connector settings.
#
# Specify DTap Auth Type, allowed options are:
#   noauth : No authentication needed
#   principal : Authenticate with DTab with a principal user
#   keytab : Authenticate with a Key tab (recommended). If running
#             DAI as a service, then the Kerberos keytab needs to
#             be owned by the DAI user.
#   keytabimpersonation : Login with impersonation using a keytab
dtap_auth_type = "keytabimpersonation"

# Path of the principal key tab file
dtap_key_tab_path = "/tmp/<keytabname>"

# Kerberos app principal user (recommended)
dtap_app_principal_user = "<user@kerberosrealm>"

# Specify the user id of the current user here as user@realm
dtap_app_login_user = "<user@realm>"
  1. 完成后,保存更改,然后停止/重启 Driverless AI。