Google Cloud Storage 설정

Driverless AI를 사용하면 Driverless AI 애플리케이션 내에서 Google Cloud Storage 데이터 소스의 탐색이 가능합니다. 해당 섹션에서는 Google Cloud Storage에서 작동할 수 있도록 Driverless AI의 구성 방법에 관해 설명합니다. 본 설정을 사용하려면 인증을 활성화해야 합니다. GCS 또는 GBP 커넥터의 활성화를 통해 해당 파일 시스템을 UI에서 사용할 수 있지만 인증 없이는 해당 커넥터를 사용할 수 없습니다.

인증해서 GCS 데이터 커넥터를 사용하려면 다음을 수행하십시오.

  1. GCP 에서 JSON 인증 파일을 획득하십시오.

  2. Docker 인스턴스에 JSON 파일을 마운트하십시오.

  3. gcs_path_to_service_account_json config 옵션에서 /json_auth_file.json의 경로를 지정하십시오.

Notes:

  • 계정 JSON은 시스템 관리자가 제공한 인증을 포함합니다. Google Cloud Storage와 Google BigQuery 인증을 모두 포함하는 JSON 파일을 제공받을 수 있고, 둘 중 하나만 포함하거나 아무것도 포함하지 않을 수 있습니다.

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

구성 속성에 관한 설명

  • gcs_path_to_service_account_json: /json_auth_file.json 파일의 경로를 지정합니다.

  • gcs_init_path: GCS 브라우저 UI에 표시되는 시작 GCS 경로를 지정합니다.

인증을 통해 GCS 시작

본 예제에서는 JSON 인증 파일을 패스하여 인증을 통해 GCS 데이터 커넥터를 활성화합니다. 여기서는 JSON 파일에 Google Cloud Storage 인증이 포함되어 있다고 가정합니다.

nvidia-docker run \
    --pid=host \
    --init \
    --rm \
    --shm-size=256m \
    -e DRIVERLESS_AI_ENABLED_FILE_SYSTEMS="file,gcs" \
    -e DRIVERLESS_AI_GCS_PATH_TO_SERVICE_ACCOUNT_JSON="/service_account_json.json" \
    -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 `pwd`/service_account_json.json:/service_account_json.json \
    h2oai/dai-centos7-x86_64:1.9.2.1-cuda10.0.xx

이 예제에서는 config.toml 파일에서 GCS 데이터 커넥터 옵션을 구성하는 방법과 Docker에서 Driverless AI의 시작 시 해당 파일을 지정하는 방법을 보여줍니다.

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

  • enabled_file_systems = "file, upload, gcs"

  • gcs_path_to_service_account_json = "/service_account_json.json"

  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

본 예제에서는 JSON 인증 파일을 패스하여 인증을 통해 GCS 데이터 커넥터를 활성화합니다. 여기서는 JSON 파일에 Google Cloud Storage 인증이 포함되어 있다고 가정합니다.

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

# GCS Connector credentials
# example (suggested) -- "/licenses/my_service_account_json.json"
gcs_path_to_service_account_json = "/service_account_json.json"
  1. 완료되면 변경 사항을 저장하고 Driverless AI를 중지/재시작하십시오.