Minio 设置

本节介绍如何配置 Driverless AI 与 Minio 配合使用。请注意,与 S3 不同,在指定 Minio 数据连接器时还必须配置身份验证方式。

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

配置属性说明

  • minio_endpoint_url: 用于访问 Minio 的端点 URL。

  • minio_access_key_id: Minio 访问密钥。

  • minio_secret_access_key: Minio 密码访问密钥。

  • minio_skip_cert_verification: 如果将其设置为 true,则 Minio 连接器将跳过证书验证部分。此项设置默认为 false。

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

启用有身份验证的 Minio

此示例通过传递端点 URL、访问密钥 ID 和访问密钥来启用 Minio 数据连接器。其通过传递名称节点的名称和 IP 来配置 Docker DNS。这允许用户直接使用端点 URL(如 http://<endpoint_url>/<bucket>/datasets/iris.csv)引用 Minio 中储存的数据。

nvidia-docker run \
  --shm-size=256m \
  --add-host name.node:172.16.2.186 \
  -e DRIVERLESS_AI_ENABLED_FILE_SYSTEMS="file,minio" \
  -e DRIVERLESS_AI_MINIO_ENDPOINT_URL="<endpoint_url>"
  -e DRIVERLESS_AI_MINIO_ACCESS_KEY_ID="<access_key_id>" \
  -e DRIVERLESS_AI_MINIO_SECRET_ACCESS_KEY="<access_key>" \
  -e DRIVERLESS_AI_MINIO_SKIP_CERT_VERIFICATION="false" \
  -p 12345:12345 \
  --init -it --rm \
  -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 文件中配置 Minio 选项并在于 Docker 中启动 Driverless AI 时指定此文件。

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

  • enabled_file_systems = "file, upload, minio"

  • minio_endpoint_url = "<endpoint_url>"

  • minio_access_key_id = "<access_key_id>"

  • minio_secret_access_key = "<access_key>"

  • minio_skip_cert_verification = "false"

  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

此示例通过传递端点 URL、访问密钥 ID 和访问密钥来启用 Minio 数据连接器。其通过传递 Minio 端点的名称和 IP 来配置 Docker DNS。这允许用户直接使用端点 URL(如 http://<endpoint_url>/<bucket>/datasets/iris.csv)引用 Minio 中储存的数据。

  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, minio"

# Minio Connector credentials
minio_endpoint_url = "<endpoint_url>"
minio_access_key_id = "<access_key_id>"
minio_secret_access_key = "<access_key>"
minio_skip_cert_verification = "false"
  1. 完成后,保存更改,然后停止/重启 Driverless AI。