Infra 정보 및 AI Solution 정보 기입
AI Solution을 구축하고 운영하는 과정에서는 해당 Solution을 호스팅 및 실행할 infra 환경에 대한 설정이 필수적입니다. 작성한 모델링 코드와 같은 경로에 있는 setting 폴더 내의 infra_config.yaml 파일은 그러한 infra 설정 목적으로 사용되며, 이 파일을 통해 AI Solution 손쉽게 등록하고 관리할 수 있도록 필요한 infra 정보를 정의할 수 있습니다.
infra_config.yaml 파일에 설정하는 정보들은 솔루션을 AI Conductor 플랫폼에 등록할 때 활용되며, AI 솔루션 개발자 또는 사용자는 해당 파일에 AI Conductor의 웹 서버 주소, AWS 클라우드 지역 (Region), 작업 공간 (Workspace) 이름, Docker 이미지 빌드 방법 등 중요한 인프라 관련 정보를 명시함으로써, 개발 혹은 운영 중인 AI Solution을 효과적으로 배포하고 실행할 수 있습니다.
Topics
인프라 설정 파일 구성
infra_config.yaml 파일 작성
setting/infra_config.yaml 에 AI Solution을 등록할 infra의 정보를 작성합니다.주요 정보들의 설명은 아래와 같습니다.
- AIC_URL: AI Conductor의 web server 주소
- AWS_KEY_PROFILE: S3, ECR 에 접근할 때, access & secret key 를 지정한 aws configure profile 의 명칭 입니다.
- BUILD_METHOD: 개발 환경에 따라 docker, buildah, codebuild 중 하나를 선택합니다.(AWS codebuild는 cloud infra를 통해 docker build를 수행합니다.)
- REPOSITORY_TAGS: ECR repository 를 생성 시, 입력 할 Tags 값. 과금를 위한 표시 정보
- CODEBUILD_ENV_COMPUTE_TYPE: BUILD_METHOD=codebuild 일 시 AWS Codebuild에서 컨테이너가 빌드되는 환경의 compute 타입
- CODEBUILD_ENV_TYPE: BUILD_METHOD=codebuild 일 시 AWS Codebuild에서 사용할 빌드 환경 타입
- VERSION: Meerkat 시스템 연동 포맷인 Solution Metadata의 버전
- WORKSPACE_NAME: AI Conductor로부터 할당 받은 Workspace
SA(Service Account) 방식이 아닌, aws key를 발급 받아서 사용하는 사용자는 aws key를 터미널에서 아래와 같은 형태로 aws configure 설정을 하고, 해당 profile name인 alo-aws-profile을 infra_config.yaml의 AWS_KEY_PROFILE에 작성합니다.
aws configure --profile alo-aws-profile
AWS Access Key ID : {access key 작성}
AWS Secret Access Key : {secret key 작성}
Default region name : ap-northeast-2
Default output format :
Note: {solution_name}/setting/example_infra_config 에 샘플이 있으므로 참고할 수 있습니다. 아래는 setting/infra_config.yaml 예시 입니다.
AIC_URI: https://aicond.try-mellerikat.com/
#CLOUD_SERVICE_ACCOUNT:
# TYPE: GCP # AWS
# CREDENTIALS: # for GCP
# KEY_FILE: *.json
# CREDENTIALS: # for AWS
# PROFILE: profile-name
AWS_KEY_PROFILE: aws-key-profile
GCP_CRENDENTIALS: key.json
BUILD_METHOD: docker # docker / buildah / codebuild
CODEBUILD_ENV_COMPUTE_TYPE: BUILD_GENERAL1_SMALL
CODEBUILD_ENV_TYPE: LINUX_CONTAINER
LOGIN_MODE: static
REGION: ap-northeast-2
REPOSITORY_TAGS: # ECR repository tags 설정: {Key:Value} 리스트
- Key: Owner
Value: Mellerikat
- Key: Phase
Value: DEV
VERSION: 1.1
WORKSPACE_NAME: poc-ws
solution_info.yaml 파일 작성
solution_info.yaml 파일에 등록할 AI Solution의 정보를 작성합니다.
수정해야 할 인자는 아래와 같습니다.
- name: 솔루션 이름
- update: 기존 솔루션 업데이트 유무
- overview: 제작한 AI Solution에 대한 설명
- support_labeling: 운영 후 재학습 기능 사용 유무
- detail: overview 인자 외에 추가적으로 필요한 설명에 대한 내용
- inference: 추론 환경에 대한 설정
- train: 학습 환경에 대한 설정
- ui_args: ui_args의 type으로 float, integer, string (혹은 string 형태의 list), single_selection, multi_selection 타입 중 선택이 가능하며 ui_args_detail에는 각 type에서 요구하는 내용을 작성합니다.
name: my-solution-name # 솔루션 이름
type: private
update: false # true # 기존 솔루션 업데이트 유무
overview: "" # 솔루션 설명
contents_type:
labeling_column_name: null
support_labeling: false
detail:
- content: "sample content001"
title: "sample title001"
- content: "sample content002"
title: "sample title002"
inference: # 추론 spec
cpu: amd64 # cpu 유형 amd64/arm64
gpu: false # GPU 적용 유무
only: false # 추론 전용 유무
datatype: table # table or image
# datatype:
# result: table # table or image
train: # 학습 spec
gpu: false # GPU 적용 유무
datatype: table # table or image
### ui_args 선언 부 ###
ui_args:
function:
readiness:
default: ''
description: Dataframe에 있는 학습 대상 x 컬럼 명을 ','로 구분하여 입력합니다.
name: x_columns
range:
- 1
- 100000
type: string
train:
default: auto
description: HPO시 모델을 선택하기 위한 평가 metric을 선택합니다.
name: auto
selectable:
- auto
- accuracy
- f1
- recall
- precision
- mse
- r2
- mae
- rmse
type: single_selection
update: false