본문 바로가기
IT KNOWLEDGE

Kubeflow 설치하기

by BTC_Crong 2024. 5. 2.

베하~! 안녕하세요 1-Tier팀 입니다.

오늘은 Kubeflow를 설치하는 방법에 대해 알아보도록 하겠습니다.

혹시 kubeflow에 대해 궁금하신 분들은 제가 이전에 작성한 포스팅을 참고 부탁드립니다.

https://btcd.tistory.com/1169

 

Kubeflow 개요 및 특징

베하~! 1Tier 팀 입니다. Kubeflow~! 혹시 들어보셨나요? Kubeflow는 End-toEnd AI 플랫폼으로, MLOps를 위한 머신러닝 워크플로우로 점차 상용화 되어가고 있는데요, 이번에는 Kubeflow를 한번 알아보겠습니다

btcd.tistory.com

Kubeflow 설치하기

1. Git Repository 다운로드

export KUBEFLOW_RELEASE_VERSION=v1.7.0
export AWS_RELEASE_VERSION=v1.7.0-aws-b1.0.3
git clone https://github.com/awslabs/kubeflow-manifests.git && cd kubeflow-manifests
git checkout ${AWS_RELEASE_VERSION}
git clone --branch ${KUBEFLOW_RELEASE_VERSION} https://github.com/kubeflow/manifests.git upstrea

# 릴리즈 버전 확인 : https://awslabs.github.io/kubeflow-manifests/docs/about/releases/

2. Install necessary tools

sudo apt update
sudo apt upgrade
 
sudo apt-get install jq
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt install python3.8
 
python3.8 --version
alias python=python3.8
 
sudo apt install python3.8-dbg python3.8-dev python3.8-venv python3.8-distutils python3.8-lib2to3 python3.8-
gdbm python3.8-tk python3.8-full
 
make install-tools

3. AWS Credentials 설정 (필요 시)

aws configure --profile=kubeflow
# AWS Access Key ID [None]: <enter access key id>
# AWS Secret Access Key [None]: <enter secret access key>
# Default region name [None]: <AWS region>
# Default output format [None]: json
# Set the AWS_PROFILE variable with the profile above
export AWS_PROFILE=kubeflow

4. Terraform 배포

cd deployments/vanilla/terraform
 
# environment variables
# Region to create the cluster in
export CLUSTER_REGION=ap-northeast2
# Name of the cluster to create
export CLUSTER_NAME=kubeflow-eks
 
# Save the variables to a .tfvars file
cat <<EOF > sample.auto.tfvars
cluster_name="${CLUSTER_NAME}"
cluster_region="${CLUSTER_REGION}"
EOF
 
# View a preview
terraform init && terraform plan
 
# Apply
make deploy
 
# ----------------------------------------
# Clean
make delete

5. Coonect Kubeflow Dashboard

#kubeflow-manifests 위치에서 명령어 실행
make port-forward

#  http://localhost:8080/ Kubeflow Web 접근 가능

# 초기 접속 ID : user@example.com
# 초기 접속 PW : 12341234

6. PW 변경 방법

# PW 변경 방법
upstream/common/dex/base/config-map.yaml
#파일에서 staticPasswords 부분에 있는 hash값 변경
...
  staticPasswords:
  - email: user@example.com
    hash: <enter the generated hash here>

Troubleshooting

# kubeflow 대시보드 접속 시, 검은 바탕과 함께 다음과 같은 에러 발생
CSRF check failed. This may happen if you opened the login form in more than 1 tabs. Please try to login again.
 
# Kubeflow에서 사용하는 web은 Secure cookies를 사용하는데 HTTPS 통신을 하지 않으면 일부 기능을 사용하는데 있어 에러가 발생하기에 Secure cookies 기능을 해제함
# 프로덕션 레벨에서는 권장하지 않고 HTTPS 통신을 활성화 하는 것을 권장함
# HTTPS 활성화 방법 :https://junwork123.tistory.com/44
 
k edit deploy jupyter-web-app-deployment -n kubeflow
 
# APP_SECURE_COOKIES를 false로 수정
spec:
      containers:
      - env:
        - name: APP_SECURE_COOKIES
          values: "false"

 

'IT KNOWLEDGE' 카테고리의 다른 글

인터넷 상에 노출된 자격증명 탐지  (0) 2024.05.10
[Git] Cherry-pick 활용하기  (0) 2024.01.23
멀티 스레딩에 관하여  (0) 2024.01.19
연말 프로젝트 회고  (2) 2023.12.29
RAG에서의 Embedding과 Vector  (1) 2023.12.22

댓글