S3 설정

Driverless AI를 사용해 Driverless AI 애플리케이션 내에서 S3 데이터 소스를 탐색할 수 있습니다. 이 섹션에서는 Driverless AI가 S3와 함께 작동하도록 구성하는 내용을 설명합니다.

Note: Docker 설치 버전에 따라, Driverless AI Docker 이미지를 시작할 때는 docker run --runtime=nvidia (Docker 19.03 이후) 또는 nvidia-docker (Docker 19.03 이전) 명령을 사용하십시오. 사용 중인 Docker 버전을 확인하려면 docker version 을 사용하십시오.

구성 속성에 관한 설명

  • aws_access_key_id: S3 액세스 키 ID

  • aws_secret_access_key: S3 액세스 키

  • aws_role_arn: Amazon 리소스 이름

  • aws_default_region: aws_s3_endpoint_url 옵션이 설정되지 않은 경우 사용할 영역. aws_s3_endpoint_url을 설정한 경우 이것은 무시됩니다.

  • aws_s3_endpoint_url: S3에 액세스하기 위해 사용할 엔드포인트 URL.

  • aws_use_ec2_role_credentials: True로 설정하는 경우, S3 커넥터가 EC2 인스턴스에 접속한 역할과 관련된 자격 증명을 얻으려고 시도합니다.

  • s3_init_path: UI S3 브라우저에 표시할 시작 S3 경로.

  • enabled_file_systems: 활성화할 파일 시스템. 데이터 커넥터를 제대로 작동시키려면 이 시스템을 구성해야 합니다.

예 1: 인증 없는 S3 활성화

이 예에서는 S3 데이터 커넥터를 활성화하고 인증을 비활성화합니다. S3 액세스 키나 암호를 전달하지 않고, S3 이름 노드의 이름과 IP를 전달하여 Docker DNS를 구성합니다. 이를 통해 사용자는 이름 노드 주소(예: s3://name.node/datasets/iris.csv)를 사용하여 S3에 저장된 데이터를 직접 참조할 수 있습니다.

nvidia-docker run \
      --shm-size=256m \
      --add-host name.node:172.16.2.186 \
      -e DRIVERLESS_AI_ENABLED_FILE_SYSTEMS="file,s3" \
      -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 파일에서 S3 옵션을 구성한 다음 Docker에서 Driverless AI를 시작할 때 해당 파일을 지정하는 방법을 보여줍니다. 이 예에서는 인증 없이 S3를 활성화합니다.

  1. Driverless AI config.toml file 파일을 구성하십시오. 다음 구성 옵션을 설정하십시오.

  • enabled_file_systems = "file, upload, s3"

  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

이 예에서는 S3 데이터 커넥터를 활성화하고 인증을 비활성화합니다. S3 액세스 키 또는 암호를 전달하지 않습니다.

  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, s3"
  1. 완료되면 변경 사항을 저장하고 Driverless AI를 중지/재시작하십시오.

예 2: 인증을 통한 S3 활성화

이 예에서는 S3 액세스 키 ID와 액세스 키를 전달하여 인증을 통해 S3 데이터 커넥터를 활성화합니다. 또한, S3 이름 노드의 이름과 IP를 전달하여 Docker DNS를 구성합니다. 이를 통해 사용자는 이름 노드 주소(예: s3://name.node/datasets/iris.csv)를 사용하여 S3에 저장된 데이터를 직접 참조할 수 있습니다.

nvidia-docker run \
        --shm-size=256m \
        --add-host name.node:172.16.2.186 \
        -e DRIVERLESS_AI_ENABLED_FILE_SYSTEMS="file,s3" \
        -e DRIVERLESS_AI_AWS_ACCESS_KEY_ID="<access_key_id>" \
        -e DRIVERLESS_AI_AWS_SECRET_ACCESS_KEY="<access_key>" \
        -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 파일에서 인증을 통해 S3 옵션을 구성한 다음 Docker에서 Driverless AI를 시작할 때 해당 파일을 지정하는 방법을 보여줍니다.

  1. Driverless AI config.toml file 파일을 구성하십시오. 다음 구성 옵션을 설정하십시오.

  • enabled_file_systems = "file, upload, s3"

  • aws_access_key_id = "<access_key_id>"

  • aws_secret_access_key = "<access_key>"

  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

이 예에서는 S3 액세스 키 ID와 액세스 키를 전달하여 인증을 통해 S3 데이터 커넥터를 활성화합니다.

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

# S3 Connector credentials
aws_access_key_id = "<access_key_id>"
aws_secret_access_key = "<access_key>"
  1. 완료되면 변경 사항을 저장하고 Driverless AI를 중지/재시작하십시오.