본문으로 건너뛰기
버전: docs v25.02

Quick Run

Updated 2024.05.05

ALO의 최신 버전을 설치하고, 샘플 AI Solution(Titanic)을 설치하여 코드 수정 없이 AI Solution을 등록하는 과정을 빠르게 가이드 하는 페이지입니다. Linux 명령어를 실행할 수 있고, Jupyter notebook 가 설치된 환경인 경우 아래 사항을 진행 할 수 있습니다. (참고: jupyter notebook 이 docker container 내부에서 실행 될 경우 일부 명령어가 다를 수 있습니다.)

Topics



step1: Start ALO

자세한 사항은 설치하기 페이지 ALO 설치하기 를 참조 하시기 바랍니다.

step1-1: ALO를 설치 합니다.

{project_name}에는 원하는 작업 폴더 명을 작성합니다.

git clone https://github.com/mellerikat/alo.git {project_name}
cd {project_name}

step1-2: ALO 실행 환경을 설정 합니다.

아래는 Anaconda 가상환경의 예이며, pyenv 등 python 3.10 버전을 실행 가능한 가상 환경을 구축하면 됩니다.

conda init bash ## conda 환경 초기화
exec bash ## bash를 재시작
# conda create --prefix /home/jovyan/testenv python=3.10 ## docker 에서의 jupyter 실행 시, 삭제되지 않는 가상환경 설치 방법
conda create -n {가상환경이름} python=3.10 ## 3.10 필수

conda activate {가상환경이름} ## conda activate 가 실행되지 않은 경우, exec bash 를 실행하기
pip install -r requirements.txt

## [솔루션 등록 Jupter Notebook 실행을 위한 추가 작업]
pip install ipykernel
## 가상환경 이름이 /home/jovyan/testenv 일 경우, testenv 만 작성합니다.
python -m ipykernel install --user --name {가상환경이름} --display-name {jupyter-가상환경-표시이름}

Note : pyenv + pipenv를 통한 가상환경 구축은 ALO 설치하기 - 개발환경 구축 페이지를 참고해주세요.



step2: Develop Solution

ALO 에서 실행되는 AI Solution 에 대한 이해가 필요한 경우 샘플 Solution 인 'titanic' 예제를 설치하여 확인 가능합니다.

step2-1: Titanic 설치 및 실행하기

#  ALO main.py 가 존재하는 {project_home} 위치 에서 solution 폴더 설치
git clone https://github.com/mellerikat/titanic.git solution
python main.py # ALO 실행

step2-2: AI Contents 설치 및 실행하기

AI Contents 는 AI를 활용하여 다양한 산업 분야의 과제들을 해결하기 위해 재사용 가능한 AI Solution을 지칭하며, 추가 개발 없이 간단히 YAML 파일 설정에서 데이터를 변경하는 정도로도 과제에 바로 적용하여 사용해 볼 수 있습니다. 자세한 사항은 AI Contents 페이지 (AI Contents) 를 참조하시기 바랍니다.

Note: AI Contents에 대한 Git 코드 접근은 (AI Contents Access)를 참고하시기 바랍니다.

AI ContentsDescription
TCRTabular 데이터에 대한 분류/회귀 AI Contents로, 전처리 / 샘플링 / HPO / 최적 모델 선정을 자동으로 수행합니다.
https://github.com/mellerikat-aicontents/Tabular-Classification-Regression.git
GCRGCR은 TCR과 입출력은 동일하나, Graph ML 기술로 데이터의 숨은 정보를 추출 및 활용해 모델 정확도를 높이며, 결측치가 있는 데이터도 처리 가능한 분류/회귀 AI Contents입니다.
https://github.com/mellerikat-aicontents/Graph-powered-Classification-Regression.git
FCST데이터의 시계열을 분석하고 미래 값을 예측하는 AI Contents 입니다.
https://github.com/mellerikat-aicontents/Forecasting.git.git
CVImage classification 모델을 통해 여러 종류의 클래스 분류를 자동화하기 위한 AI Contents 입니다.
https://github.com/mellerikat-aicontents/Vision-Classification.git
PADPAD는 Point Anomaly Detection의 약자이며 point 형태의 시계열 데이터가 정상인지 이상인지 탐지하는 AI Contents입니다.
https://github.com/mellerikat-aicontents/Anomaly-Detection.git
TADTAD는 Tabular Anomaly Detection의 약자이며, Tabular 형태의 단일 혹은 다양한 변수를 통해 정상과 이상을 탐지하는 AI Contents입니다.
https://github.com/mellerikat-aicontents/Tabular-Anomaly-Detection.git
MAD여러 개의 다양한 변수를 모니터링하면서 이상 또는 불량을 조기 검출(Early sensing)하여 이상탐지하고 싶은 경우 사용할 수 있는 AI Contents입니다.
http://mod.lge.com/hub/dxadvtech/aicontents/mad.git
VADVisual Anomaly Detection(VAD)은 정상 이미지를 학습하여 비정상 이미지를 감지하는 AI 컨텐츠입니다.
https://github.com/mellerikat-aicontents/Vision-Anomaly-Detection.git

AI Contents 로 실행은 titanic 샘플 solution 실행과 동일 합니다. Git 주소만 위 테이블을 참조하여 변경하면 됩니다.

# 로그인 캐싱
git config --global credential.helper 'cache --timeout=864000'

# ALO main.py 가 존재하는 {project_home} 위치 에서 solution 폴더 설치
git clone {AI Contents git 주소} solution
python main.py # ALO 실행


step3: Register Solution

AI Solution 을 등록하기 위해선 register-ai-solution.ipynb 의 가이드에 따라 아래 절차들을 진행합니다.

  1. 솔루션을 등록할 Infra 설정 AI Solution 정보 작성
  2. AI Solution 정보 작성
  3. 솔루션 등록 실행
  4. AI 학습 테스트

step3-1: Infra 설정

./{project_home}/setting/infra_setup.yaml 에 AI Solution을 등록할 환경의 정보를 작성합니다. 자세한 사항은 Infra 설정 (Infra 설정) 을 참고 하시기 바랍니다.

"VERSION": 1.0  ## solution_metadata version
"AIC_URI": "https://aicond.meerkat-ai.com/"
"REGION": "ap-northeast-2"
"WORKSPACE_NAME": "meerkat-ws"
"BUILD_METHOD": "codebuild" ## codebuild, docker, buildah
"LOGIN_MODE": "static" ## ldap, static
"REPOSITORY_TAGS":
- "Key=Owner,Value=Meerkat"
"AWS_KEY_PROFILE": "alo-aws-profile"
### aws codebuild (cloud build)
## 'type': 'WINDOWS_CONTAINER'|'LINUX_CONTAINER'|'LINUX_GPU_CONTAINER'|'ARM_CONTAINER'|'WINDOWS_SERVER_2019_CONTAINER'|'LINUX_LAMBDA_CONTAINER'|'ARM_LAMBDA_CONTAINER',
"CODEBUILD_ENV_TYPE": "LINUX_CONTAINER"
## 'computeType': 'BUILD_GENERAL1_SMALL'|'BUILD_GENERAL1_MEDIUM'|'BUILD_GENERAL1_LARGE'|'BUILD_GENERAL1_XLARGE'|'BUILD_GENERAL1_2XLARGE'|'BUILD_LAMBDA_1GB'|'BUILD_LAMBDA_2GB'|'BUILD_LAMBDA_4GB'|'BUILD_LAMBDA_8GB'|'BUILD_LAMBDA_10GB',
"CODEBUILD_ENV_COMPUTE_TYPE": "BUILD_GENERAL1_SMALL"

step3-2: AI Solution 정보 작성

register-ai-solution.ipynb Jupyter Notebook에서 부여받은 계정으로 로그인 셀을 실행하고, 아래 셀의 내용을 작성하여 실행합니다. 핵심 key는 'solution_name' 이며, 등록할 AI Solution의 명칭을 영소문자와 '-'의 조합으로 기입해줍니다. 자세한 사항은 AI Solution 등록 (AI Solution 등록) 을 참조 하시기 바랍니다.

#----------------------------------------#
# AI Solution Spec 작성 #
#----------------------------------------#
solution_info ={
'solution_name': 'my-solution',
'inference_only': False,
'solution_update': False,
'overview': "Write an overall description of the AI ​​Solution.",
'detail': [
{'title': 'title001', 'content': 'content001'},
{'title': 'title002', 'content': 'content002'},
],
'contents_type': {
'support_labeling': False,
'inference_result_datatype': 'table', # image
'train_datatype': 'table', # image
'labeling_column_name': ''
},
'train_gpu': False,
'inference_gpu': False,
"inference_arm": False
}

step3-3: AI Solution 등록 실행

register-ai-solution.ipynb 에서 아래 사항을 실행합니다.

import sys
try:
del sys.modules['src.solution_register'], sys.modules['src.constants']
except:
pass
from src.solution_register import SolutionRegister
## set register instance
infra = "./setting/infra_config.yaml"
register = SolutionRegister(infra_setup=infra, solution_info=solution_info)

## login AI Conductor
register.login(username, password)

## register AI solution
register.run()