로컬 인증 예제

본 섹션에서는 Driverless AI에서의 로컬 인증 활성화 방법에 관해 설명합니다.

Docker 이미지에서 인증을 사용하기 위해서는 사용하고자 하는 인증 환경 변수를 지정합니다. 각각의 변수는 DRIVERLESS_AI_로 시작해야 합니다. 아래 예제에서는 환경 변수를 통해 Driverless AI를 시작하여 다음을 활성화합니다.

  • Driverless AI 시작 시 로컬 인증

  • S3 및 HDFS 액세스(인증 없음)

nvidia-docker run \
  --pid=host \
  --init \
  --rm \
  --shm-size=256m \
  -p 12345:12345 \
  -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 `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

Native 설치에는 DEB, RPM 및 TAR SH 설치가 포함됩니다. 아래 예제에서는 다음 항목의 활성 시, 설정할 config.toml 파일의 구성 옵션을 보여줍니다.

  • Driverless AI 시작 시 로컬 인증

  • 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. config.toml 파일을 열고 인증 변수를 편집하십시오. config.toml 파일은 RPM 또는 DEB 설치 후, etc/dai 폴더에서 사용할 수 있습니다.

# File System Support
# file : local file system/server file system
# hdfs : Hadoop file system, remember to configure the hadoop coresite and keytab 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
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