Education*
Devops
Architecture
F/B End
B.Chain
Basic
Others
CLOSE
Search For:
Search
BY TAGS
linux
HTTP
golang
flutter
java
fintech
๊ฐ๋ฐํ๊ฒฝ
kubernetes
network
Docker
devops
database
tutorial
cli
๋ถ์ฐ์์คํ
www
๋ธ๋ก์ฒด์ธ
AWS
system admin
bigdata
๋ณด์
๊ธ์ต
msa
mysql
redis
Linux command
dns
javascript
CICD
VPC
FILESYSTEM
S3
NGINX
TCP/IP
ZOOKEEPER
NOSQL
IAC
CLOUD
TERRAFORM
logging
IT์ฉ์ด
Kafka
docker-compose
Dart
MLOps with Joinc - Kubeflow ์ค์น
Recommanded
Free
YOUTUBE Lecture:
<% selectedImage[1] %>
yundream
2025-03-09
2025-03-09
16
 ## MLOps MLOps(Machine Learning Operations)๋ ๋จธ์ ๋ฌ๋ ๋ชจ๋ธ์ ํจ์จ์ ์ผ๋ก ๊ฐ๋ฐ, ๋ฐฐํฌ, ์ด์, ๊ด๋ฆฌํ๊ธฐ ์ํ ๋ฐฉ๋ฒ๋ก , ํ๋ก์ธ์ค, ๊ดํ์ ์๋ฏธํ๋ค. DevOps, Data Engineering, ML Engineering ์ ๊ฐ๋ ์ ๊ฒฐํฉํ์ฌ **์๋ํ**, **์ฌํ์ฑ**, **๊ด์ธก๊ฐ๋ฅ์ฑ(๋ชจ๋ํฐ๋ง)** ์ ๊ฐํํ๋ ๊ฒ์ด ํต์ฌ ๋ชฉํ๋ค. ## MLOps ์ ์ฃผ์ ๊ฐ๋ ๋จธ์ ๋ฌ๋์ ๋๋์ ๋ฐ์ดํฐ๋ฅผ ์ด์ฉํด์ ์ฅ์๊ฐ์ ์์ ์ ๋ฐ๋ณต์ ์ผ๋ก ํด์ผ ํ๋ค. MLOps๋ฅผ ํตํด์ ๋ฐ๋ณต์ ์ธ ์์์ ์ ์ค์ฌ์ ๋ชจ๋ธ ๋ฐฐํฌ ์๋๋ฅผ ๋์ฌ์ ๋ณํํ๋ ํ๊ฒฝ์ ์ ์ํ๊ฒ ๋์ ํ ์ ์๋ค. ์ฌ๊ธฐ์๋ ๋ฐ์ดํฐ ์ค๋น, ์ ์ฒ๋ฆฌ, ๋ชจ๋ธ ํ์ต, ๊ฒ์ฆ, ์๋น(๋ฐฐํฌ)์ ๋ชจ๋ ๊ณผ์ ์ ์๋ํ๋ฅผ ํฌํจํ์ฌ **ํจ๊ณผ์ ์ด๊ณ ์ง์์ ์ธ ๋ชจ๋ธ ๊ฐ์ **์ด ๊ฐ๋ฅํ ํ๊ฒฝ์ ๋ง๋ ๋ค. ๋ง์ ๊ฐ๋ ๋ค์ด ๋์ฌ ๊ฑด๋ฐ, ์ด๋ฐ๊ฒ ์๊ตฌ๋ ํ๊ณ ๊ฐ๋ณ๊ฒ ํ๊ณ ์ง๋๊ฐ๋ฉด ๋๋ค. ##### ์๋ํ(Automation) * ๋ฐ์ดํฐ ์ค๋น, ๋ชจ๋ธ ํ์ต, ๊ฒ์ฆ, ๋ฐฐํฌ, ๋ชจ๋ํฐ๋ง์ ์ ์ฒด ๊ณผ์ ์ ์๋ํํ์ฌ ์ผ๊ด๋ ์ํฌํ๋ก์ฐ๋ฅผ ๊ตฌ์ถํ๋ค. * CICD ํ์ดํ๋ผ์ธ๊ณผ ํตํฉํ์ฌ ๋ชจ๋ธ์ ์ ์ํ๊ฒ ํ๋ก๋์ ์ ๋ฐ์ ํ ์ ์๋ค. ##### ์ฌํ์ฑ(Reproductibility) * DVC(๋ฐ์ดํฐ ๋ฒ์ ๊ด๋ฆฌ) , ๋ชจ๋ธ ๋ฐ ์คํ์ ์ถ์ ๋ฑ์ ํตํด ์ฌํ ๊ฐ๋ฅํ ์คํ ํ๊ฒฝ์ ์ ์งํ๋ค. * ์ปจํ ์ด๋(Docker, Kubernetes)๋ฑ์ ํ๊ฒฝ์ ํ์ฉํ์ฌ ๋ชจ๋ธ์ ์ผ๊ด๋๊ฒ ๊ฐ๋ฐํ๊ณ ๋ฐฐํฌ ํ ์ ์๋ค. ##### ๊ด์ธก๊ฐ๋ฅ์ฑ * ๋ชจ๋ธ์ ์ฑ๋ฅ์ ํ(Drift Detection) , ๋ฐ์ดํฐ ํ์ง ๊ฒ์ฆ(Data Validation), ์ด์ ๊ฐ์ง(Anomaly Detection) ๋ฑ์ ๋ชจ๋ํฐ๋งํ์ฌ ์ง์์ ์ผ๋ก ๋ชจ๋ธ์ ๊ด๋ฆฌ ํ๋ค. * ํ๋ก๋์ ์ ๋ฐฐํฌ๋ ๋ชจ๋ธ์ ๋ชจ๋ํฐ๋งํ๊ณ , ํ์ํ๋ฉด ์ฌํ์ต ๋ฐ ์ฌ๋ฐฐํฌ๋ฅผ ์๋ํ ํ๋ค. #### MLOps ํ์ดํ๋ผ์ธ์ ๋ชจ์ต  MLOps ํ์ดํ๋ผ์ธ์ ์ ์ฒด ๋ชจ์ต์ ์กฐ๋งํด๋ณด์. #### Orchestrated experiment ๊ฐ๋ฐ์ ๋ฐ ๋ฐ์ดํฐ ์ฌ์ด์ธํฐ์ค๊ฐ ML ๋ชจ๋ธ ๊ฐ๋ฐ ๋ฐ ์คํ์ ํ๋ ์์ญ์ด๋ค. * Data Validation: ๋ฐ์ดํฐ์ ์ ํฉ์ฑ์ ํ์ธํ์ฌ ๋ชจ๋ธ ํ์ต์ ์ ์ ํ์ง ๊ฒ์ฆํ๋ค. * Data Preparation: ๋ฐ์ดํฐ ์ ์ , ์ ๊ทํ, ํผ์ฒ ์์ง๋์ด๋ง ๋ฑ์ ์ํํ๋ค. * Model Training: ML/DL ๋ชจ๋ธ์ ํ์ตํ๋ค * Model Evaluation: ํ์ตํ ๋ชจ๋ธ์ ์ฑ๋ฅ์ ํ๊ฐํ๊ณ ์งํ๋ฅผ ๋ ํฌํ (์ ํ๋, F1-Score) ํ๋ค. * Model Validation: ๋ชจ๋ธ์ด ๋ฐฐํฌ ๊ฐ๋ฅํ ํ์ง์ ๊ฐ์ถ์๋์ง๋ฅผ ๊ฒ์ฆํ๋ค. * Model Analysis: ๋ชจ๋ธ์ ๋์์ ๋ถ์ํ๊ณ ๊ฐ์ ์ ์ ์ฐพ๋๋ค. #### ์์ค์ฝ๋ ๊ด๋ฆฌ ๋ฐ ๋ฐฐํฌ ๋ฐ์ดํฐ ์ค์ฌ์ด๋ผ๋ ๊ฒ์ ์ ์ธํ๋ฉด ์ ํ๋ฆฌ์ผ์ด์ ๊ฐ๋ฐ ํ๋ก์ธ์ค์ ํฐ ์ฐจ์ด๋ ์๋ค. ์ด๋ฅผ ์ํ ์ฝ๋ ๊ด๋ฆฌ ๋ฐ ๋ฐฐํฌ ๊ณผ์ ์ด ํ์ํ๋ค. * Source Code & Source Repository: ๋ชจ๋ธ ํ์ต ์ฝ๋ ๋ฐ MLOps ๊ด๋ จ ์ฝ๋๋ฅผ ์ ์ฅํ๊ณ ๋ฒ์ ์ ๊ด๋ฆฌํ๋ค. * Pipeline deployment: ๋ชจ๋ธ์ ์๋ํ๋ ML ํ์ดํ๋ผ์ธ์ ๋ฐฐํฌํ์ฌ, ์ด์ ํ๊ฒฝ์์ ์๋์๋๋ก ํ๋ค. #### Automated Pipeline(์๋ํ๋ ํ์ดํ๋ผ์ธ) * Data Extraction: Feature Store์์ Feature์ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์จ๋ค * Data Validation: ๋ฐ์ดํฐ์ ํ์ง ๊ฒ์ฌ๋ฅผ ์ํํ๋ค. * Data Preparation: ๋ฐ์ดํฐ๋ฅผ ์ ๋ฆฌํ๊ณ ๋ณํํ๋ค. * Model Training: ML ๋ชจ๋ธ ํ์ต์ ์ํํ๋ค. * Model Evaluation & Validation: ๋ชจ๋ธ์ ์ฑ๋ฅ์ ํ๊ฐํ๊ณ ๊ธฐ์ค์ ๋ง์กฑํ๋ฉด ๋ฐฐํฌํ ์ค๋น๋ฅผ ํ๋ค. #### Model Registry & Continuous Deployment ๋ฐ์ดํฐ๋ก ๋ถํฐ ๋ชจ๋ธ์ ๋ง๋ค์๋ค๋ฉด, ์ด์ ์ด ๋ชจ๋ธ์ ๋ฐฐํฌํด์ผ ํ ๊ฒ์ด๋ค. CICD์์ **CD(Continues Delivery)** ๋ถ๋ถ์ด๋ค. * Model Registry: ๊ฒ์ฆ๋ ๋ชจ๋ธ์ ์ ์ฅํ๊ณ ๋ฒ์ ๊ด๋ฆฌ๋ฅผ ์ํํ๋ค. * Model Serving: ๋ชจ๋ธ์ ํ๋ก๋์ ํ๊ฒฝ์ ๋ฐฐํฌํ์ฌ ์ฌ์ฉ์์๊ฒ ์๋น์ค ํ๋ค. #### Prediction Service & Performance Monitoring * Prediction Service: ๋ฐฐํฌ๋ ๋ชจ๋ธ์ด ์ค์๊ฐ ๋๋ ๋ฐฐ์น ๋ฐฉ์์ผ๋ก ์์ ์ ์ํํ๋ค. * Performance Monitoring: ๋ชจ๋ธ์ ์ฑ๋ฅ์ ์ง์์ ์ผ๋ก ๋ชจ๋ํฐ๋งํ์ฌ ๋ฐ์ดํฐ ๋๋ฆฌํํธ, ์ฑ๋ฅ ์ ํ ๋ฑ์ ๊ฐ์งํ๊ณ ๋์ํ๋ค. ## MLOps ๊ธฐ์ ์คํ DevOps๊ฐ ML ์์ญ์ผ๋ก ํ์ฅ๋ ๊ฐ๋ ์ด๊ธฐ ๋๋ฌธ์ ๊ธฐ์ ์คํ์ ๋ง์ ๋ถ๋ถ๋ค์ด DevOps์ ๊ฒน์น๋ค. DevOps ๊ฒฝํ์ด ์๋ค๋ฉด ์ฝ๊ฒ ๊ฐ๋ ์ ์ดํดํ๊ณ ๊ธฐ์ ์คํ์ ์์ ์ ๊ฒ์ผ๋ก ๋ง๋ค ์ ์์ ๊ฒ์ด๋ค.  MLOps์ ์ฃผ์ ๊ธฐ์ ์คํ์ ๋ํด์ ์์๋ณด์. 1. ๋ฒ์ ๊ด๋ฆฌ: Git, DVC, MLFlow, **KubeFlow** 2. ๋ชจ๋ธ ๊ด๋ฆฌ: MLflow, Weights & Biases, KubeFlow 3. CI/CD: GitHub Action, GitLab CI/CD, Jenkins 4. ๋ฐฐํฌ ๋ฐ ์๋น: Docker, Kubernetes, FastAPI, TensorFlow Serving 5. ๋ชจ๋ํฐ๋ง: Prometheus, Grafana, Evidently AI ๋ฐ์ดํฐ ์์ง์์, ์๋น/๋ชจ๋ํฐ๋ง๊น์ง๋ฅผ ๋ค๋ฃจ๊ธฐ ๋๋ฌธ์ ๋ค์ํ ๊ธฐ์ ๋ค์ด ์ฌ์ฉ๋๋ ๊ฒ์ ์ ์ ์๋ค. MLOps๋ ๋จธ์ ๋ฌ๋๊ณผ ์๋น์ ํ์ํ GPU ์ธํ๋ผ, ์น ์ ํ๋ฆฌ์ผ์ด์ ์๋น์ค์ ํ์ํ CPU ์ธํ๋ผ, ์ ํ๋ฆฌ์ผ์ด์ ๊ฐ๋ฐ/๋ฐฐํฌ/๋ชจ๋ํฐ๋ง ๊ด๋ฒ์ํ ์์ญ์ ๋ํ ์ ๋ณด๊ฐ ํ์ํ๋ค. ํ๋ง๋๋ก DevOps + ๋จธ์ ๋ฌ๋ ์ด๋ผ๊ณ ๋ณผ ์ ์๋ค. ๋ฐ๋ผ์ ํด ํ ๋๊ฐ ๋ฐฐ์ ๋ค๊ณ ํ ์ ์๋ ๊ฒ์ด ์๋๋ค. "ํ๋์ ์ฌ์ "์ด๋ผ๊ณ ์๊ฐํ๋ฉด ๋๋ค. ์ฌ๊ธฐ์์๋ **Kubeflow** ๋ฅผ ๊ธฐ์ค์ผ๋ก MLOps๋ฅผ ์ดํด๋ณผ ์๊ฐ์ด๋ค. ## Kubeflow Kubeflow๋ **์ฟ ๋ฒ๋คํฐ์ค(Kubernetes)** ๊ธฐ๋ฐ์ **MLOps ํ๋ซํผ** ์ผ๋ก ๋จธ์ ๋ฌ๋ ๋ชจ๋ธ์ ๊ฐ๋ฐ, ํ์ต, ๋ฐฐํฌ, ๋ชจ๋ํฐ๋ง์ ์๋ํํ ์ ์๋๋ก ์ง์ํ๋ ์คํ ์์ค ํ๋ก์ ํธ์ด๋ค. ์๋๋ Google์ด TensorFlow ๋ชจ๋ธ์ ์ฟ ๋ฒ๋คํฐ์ค์์ ์ฝ๊ฒ ์คํํ๊ธฐ ์ํด์ ๊ฐ๋ฐํ์ง๋ง, ํ์ฌ๋ **PyThorch, XGBoost** ๋ฑ ๋ค์ํ ํ๋ ์์ํฌ๋ฅผ ์ง์ํ๋ ๋ฒ์ฉ MLOps ํ๋ซํผ์ผ๋ก ๋ฐ์ ํ๋ค.  Kubeflow๋ Kubernetes๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ์ฌ, GPU, TPU, CPU์ ๋ํ ๊ด๋ฆฌ, ๊ฒฉ๋ฆฌ, ๋ชจ๋ํฐ๋ง, ํ ๋น์ Kubernetes์ ์์ํ๊ณ ๋ชจ๋ธ์ ๊ด๋ฆฌ/๊ฐ๋ฐ/๋ฐฐํฌ์ ์ง์คํ๊ฒ ๋๋ค. ##### Kubeflow ํ์ดํ๋ผ์ธ  Kubeflow๋ ๋ฐ์ดํฐ ์ค๋น์์ ํ๋ จ, ํจํค์ง์ ์ ๊ณผ์ ์ ์ง์ํ๋ค. ์ด ์ค ๋ชจ๋ธ ํ๋ จ๊ณผ ํ ์คํธ์๋ GPU๊ฐ ํ์ํ๋ฏ๋ก NVIDIA GPU๋ฅผ ์ง์ํ๋ ๋์ปค ๋ฐํ์์ด ์ค์น๋์ด ์์ด์ผ ํ๋ค. ##### Kubeflow ํต์ฌ ๊ธฐ๋ฅ ์ฌ๊ธฐ์์๋ ์ฃผ์ ๊ธฐ๋ฅ์ ๊ฐ๋จํ ๋์ด ํ ๊ฒ์ด๋ค. ์์ธํ ๋ด์ฉ์ ์ค์ ์ค์นํ๊ณ ๋ชจ๋ธ์ ๋๋ฆฌ๋ฉด์ ์ดํด๋ณผ ๊ฒ์ด๋ค. **ํ์ดํ๋ผ์ธ(Kubeflow Pipelines, KFP) * ๋จธ์ ๋ฌ๋ ์ํฌํ๋ฌ์ฐ๋ฅผ ์ปจํ ์ด๋ ๊ธฐ๋ฐ์ผ๋ก ์๋ํ * ๋จ๊ณ๋ณ ์คํ, ์คํจ์ ์ฌ์๋, ํ๋ผ๋ฏธํฐ ํ๋ ๋ฑ ์ง์ * GUI ๋์๋ณด๋๋ฅผ ํตํด ์ํฌํ๋ก์ฐ ๊ด๋ฆฌ **Jupyter Notebook ๊ด๋ฆฌ** * ์ฟ ๋ฒ๋คํฐ์ค์์ Jupyter Notebook์ ์์ฝ๊ฒ ์์ฑ ๋ฐ ๊ด๋ฆฌ * ๊ฐ๋ฐ์ ๋ฐ ๋ฐ์ดํฐ ์ฌ์ด์ธํฐ์คํธ๊ฐ ํ๋ ฅ ์ด์ง **๋ถ์ฐ ํ์ต(Kubeflow training Operators** * TensorFlow, PyTorch, XGBoost ๋ฑ์ ๋ถ์ฐํ์ต์ ์ง์ * Horovod ๋ฑ์ ํ์ฉํ ๋ฉํฐ GPU ํ์ต **๋ชจ๋ธ ์๋น(Kuberflow Serving)** * KServe(KFServing) ๋ฅผ ํตํด ๋ชจ๋ธ์ ์ค์๊ฐ ์๋น * TensorFlow Serving, TorchServe, Triton Inference Server ๋ฑ์ ์๋น ์์ง ์ง์ * ์คํ ์ค์ผ์ผ๋ง, A/B ํ ์คํธ, Canary ๋ฐฐํฌ ์ง์ **์คํ ๋ฐ ๋ชจ๋ธ ๊ด๋ฆฌ(ML Metadata, Katib)** * ์คํ ๊ฒฐ๊ณผ๋ฅผ ์ถ์ ๋ฐ ์ ์ฅ * Katib๋ฅผ ํ์ฉํ์ฌ ์๋ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์ง์ ##### Kubeflow๋ฅผ ์ฌ์ฉํ๋ ์ด์ ์ฟ ๋ฒ๋คํฐ์ค ํ๊ฒฝ์ ์ต์ ํ๋์ด ์์ด์ ํด๋ผ์ฐ๋/์จ-ํ๋ ๋ฏธ์ค์ ์๊ด์์ด ์ฌ์ฉ ํ ์ ์๋ค. ์ด๊ธฐ ์ค์ ์ด ๋ค์ ๋ณต์กํ๋ค๋ ๋จ์ ์ด ์๊ธฐ๋ ํ์ง๋ง, ๊ธฐ๋ฅ ์ธก๋ฉด์์๋ ๋ถ์กฑํจ์ด ์๋ ํด์ด๋ค. | ๊ธฐ๋ฅ | Kubeflow | MLflow | SageMaker | Vertex AI | | ---------- | -------- | ------ | --------- | --------- | | ์ฟ ๋ฒ๋คํฐ์ค ๊ธฐ๋ฐ | โ | โ | โ | โ | | ML ํ์ดํ๋ผ์ธ | โ | โ | โ | โ | | ํ์ดํผํ๋ผ๋ฏธํฐ ํ๋ | โ | โ | โ | โ | | ๋ชจ๋ธ ์๋น | โ | ์ผ๋ถ ์ง์ | โ | โ | | ๋ชจ๋ํฐ๋ง | โ | โ | โ | โ | ## Kubeflow ํ ์คํธ ํ๊ฒฝ ์๋์ ๊ฐ์ ์ฌ์์ ๋ก์ปฌ PC์์ Kubeflow๋ฅผ ์ค์นํ๊ณ ํ ์คํธํ ๊ฒ์ด๋ค. * ์ด์์ฒด์ : Ubuntu 24.10 * Docker Engine: 27.4.0 * CPU: AMD Ryzen 5 5600X 6-Core Processor * RAM: 32G * GPU: NVIDIA GeForce RTX 4060 VRAM 16G * Kubernetes: Minikube๋ฅผ ์ด์ฉํด์ ๋ก์ปฌ PC์ ์ฟ ๋ฒ๋คํฐ์ค ํ๊ฒฝ์ ๊ตฌ์ฑํ๋ค ## NVIDIA GPU ๋๋ผ์ด๋ฒ ์ค์นํ๊ธฐ ๐ง ํฌ์ง ์์ ๋ฐ์ดํฐ๋ฅผ ์ด์ฉํด์ ํ์ต๋ชฉ์ ์ผ๋ก MLOps๋ฅผ ํ ์คํธ ํ ๊ฒฝ์ฐ GPU๋ ํ์๊ฐ ์๋๋ค. GPU๊ฐ ์๊ฑฐ๋ ์ค์ ํ๊ธฐ ๊ท์ฐฎ๋ค๋ฉด ์ด ๋ถ๋ถ์ ๋์ด๊ฐ๋ ๋๋ค. ์ฐ๋ถํฌ ๋ฆฌ๋ ์ค์์๋ *ubuntu-drivers* ๋ฅผ ์ด์ฉํด์ ์ต์ ์ ๋๋ผ์ด๋ฒ๋ฅผ ์๋์ผ๋ก ์ถ์ฒํ๊ณ ์ค์น ํ ์ ์๋ค. ``` sudo ubuntu-drivers autoinstall ``` ์ด ๋ช ๋ น์ ๋ด๋ฆฌ๋ฉด ์์คํ ์ ๋ง๋ ์ต์ ์ NVDIA ๋๋ผ์ด๋ฒ๋ฅผ ์๋์ผ๋ก ์ค์นํ๋ค. ์ค์น ํ์๋ ์์คํ ์ ์ฌ๋ถํ ํ๋ค. ์ค์น๊ฐ ์๋ฃ๋๋ฉด *nvidia-smi* ๋ช ๋ น์ ์ด์ฉํด์ GPU๊ฐ ์ ๋๋ก ์ธ์๋๋์ง ํ์ธ ํ ์ ์๋ค. ``` $ nvidia-smi Sun Mar 9 14:27:58 2025 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 550.135 Driver Version: 550.135 CUDA Version: 12.4 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA GeForce RTX 4060 Ti Off | 00000000:0B:00.0 On | N/A | | 0% 43C P8 20W / 165W | 464MiB / 16380MiB | 12% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ ``` ## NVIDIA Container Toolkit ์ค์น ๐ง ํฌ์ง ์์ ๋ฐ์ดํฐ๋ฅผ ์ด์ฉํด์ ํ์ต๋ชฉ์ ์ผ๋ก MLOps๋ฅผ ํ ์คํธ ํ ๊ฒฝ์ฐ GPU๋ ํ์๊ฐ ์๋๋ค. GPU๊ฐ ์๊ฑฐ๋ ์ค์ ํ๊ธฐ ๊ท์ฐฎ๋ค๋ฉด ์ด ๋ถ๋ถ์ ๋์ด๊ฐ๋ ๋๋ค. [Installing the NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) ```shell curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list ``` ์ ์ฅ์๋ฅผ ์ ๋ฐ์ดํธ ํ๋ค. ``` sudo apt-get update ``` NVIDIA Container Toolkit ํจํค์ง๋ฅผ ์ธ์คํจ ํ๋ค. ``` sudo apt-get install -y nvidia-container-toolkit ``` ๋์ปค๋ฅผ ๋ฆฌ์คํํธ ํ๋ค. ``` sudo systemctl restart docker ``` ๋์ปค ์ปจํ ์ด๋๊ฐ GPU๋ฅผ ์ธ์ํ๋์ง ํ ์คํธํ๋ค. ์๋์ ๊ฐ์ด GPU ์ ๋ณด๊ฐ ์ถ๋ ฅ๋๋ฉด ์ฑ๊ณต์ด๋ค. ``` $ docker run --gpus all ubuntu nvidia-smi Sat Mar 8 01:23:34 2025 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 550.135 Driver Version: 550.135 CUDA Version: 12.4 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA GeForce RTX 4060 Ti Off | 00000000:0B:00.0 On | N/A | | 0% 45C P8 19W / 165W | 531MiB / 16380MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| +-----------------------------------------------------------------------------------------+ ``` ## Minikube Kubeflow๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด์๋ ์ฟ ๋ฒ๋คํฐ์ค ํด๋ฌ์คํฐ๊ฐ ์์ด์ผ ํ๋๋ฐ, **minikube**๋ฅผ ์ด์ฉํ๋ฉด ๊ฐ์ธ PC์๋ ๊ฐ๋จํ๊ฒ ์ฟ ๋ฒ๋คํฐ์ค ํ๊ฒฝ์ ๊ตฌ์ฑ ํ ์ ์๋ค. ์ฌ๊ธฐ์์๋ Minikube ์ค์น๋ฅผ ์ํ ์ต์ํ๋ง ์๊ฐํ๋ค. Minikube์ Kubernetes์ ๋ํด์ ์์ธํ ์๊ณ ์ถ๋ค๋ฉด [Minikube์ ํจ๊ปํ๋ Kubernetes Study ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํ์](https://www.joinc.co.kr/w/kubernetes_minikube_index) #### kubectl Minikube๋ฅผ ์ค์นํ๋ ค๋ฉด Kubernetes๋ฅผ ๊ด๋ฆฌํ๋ **kubectl** ์ ์ค์นํด์ผ ํ๋ค. ์ฐ๋ถํฌ ๋ฆฌ๋ ์ค์์๋ ์๋์ ๊ฐ์ด ๊ฐ๋จํ๊ฒ ์ค์น ํ ์ ์๋ค. ์ ์ฅ์๋ฅผ ๋ฑ๋กํ๊ณ ``` sudo apt update sudo apt install -y apt-transport-https ca-certificates curl curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo tee /etc/apt/trusted.gpg.d/kubernetes.asc ``` kubectl ํจํค์ง๋ฅผ ์ค์นํ๋ค. ``` sudo apt update sudo apt install -y kubectl ``` kubectl์ด ์ ์ค์น๋๋์ง ํ์ธํด๋ณด์. ์คํ๋๋ฉด ์ฑ๊ณต์ด๋ค. ``` $ kubectl version Client Version: v1.31.6-dispatcher Kustomize Version: v5.4.2 Unable to connect to the server: dial tcp 192.168.49.2:8443: connect: no route to host ``` ์์ง์ (minikube๋ฅผ ์ด์ฉํด์) ์ฟ ๋ฒ๋คํฐ์ค ํ๊ฒฝ์ด ๊ตฌ์ฑ๋์ง ์์๊ธฐ ๋๋ฌธ์ connect ์๋ฌ๊ฐ ๋จ์ด์ง ๊ฒ์ด๋ค. #### Minikube ์ค์น minikube๋ฅผ ๋ค์ด๋ก๋ ํ๊ณ ์ค์นํ๋ค. ``` curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube ``` ๋ฒ์ ์ ํ์ธํด๋ณด์. ``` $ minikube version minikube version: v1.35.0 commit: dd5d320e41b5451cdf3c01891bc4e13d189586ed-dirty ``` minikube๋ฅผ ์คํํ๋ค. ``` minikube start --cpus 4 --memory 8192 --disk-size=50g ``` minikube๋ฅผ ์ด์ฉํด์ ๋ง๋ค์ด์ง ๋คํธ์ํฌ๋ private ๋คํธ์ํฌ๋ก, ๋ก์ปฌ PC์์ ์ง์ ์ ๊ทผ ํ ์ ์๋ค. minikube tunnel ๋ช ๋ น์ ์ด์ฉํด์ ๋ก์ปฌ์์ ์ ๊ทผ ๊ฐ๋ฅํ๋๋ก ํ๋ค. ``` $ minikube tunnel Status: machine: minikube pid: 114312 route: 10.96.0.0/12 -> 192.168.39.132 minikube: Running services: [] errors: minikube: no errors router: no errors loadbalancer emulator: no errors ``` kubectl์ ์ด์ฉํด์ ์ฟ ๋ฒ๋คํฐ์ค ํ๊ฒฝ์ด ์ ๋ง๋ค์ด์ก๋์ง ํ์ธํ๋ค. ``` $ kubectl cluster-info Kubernetes control plane is running at https://192.168.49.2:8443 $ kubectl get nodes NAME STATUS ROLES AGE VERSION minikube Ready control-plane 21h v1.32.0 ``` ## Kubeflow #### Kubeflow ์ค์น Kubeflow๋ **kubeflow/manifests** ์ ์ฅ์๋ฅผ ์ฌ์ฉํ์ฌ ์ค์น ํ ์ ์๋ค. #### Kustomize ์ค์น Kubeflow๋ **Kustomize** ๋ฅผ ์ฌ์ฉํ์ฌ ๋ฐฐํฌํ๋ค. Kustomize๋ Kubernetes ๊ฐ์ฒด ๊ตฌ์ฑ์ ์ ์ํ๋ ๋๊ตฌ๋ค. Kustomize๋ฅผ ์ด์ฉํ๋ฉด ๊ธฐ์กด Kubernetes ๋งค๋ํ์คํธ ํ์ผ์ ๊ธฐ๋ฐ์ผ๋ก ์ ํ๋ฆฌ์ผ์ด์ ๋ฐฐํฌ๋ฅผ ๊ตฌ์ฑํ ์ ์๋ค. ``` curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash sudo mv kustomize /usr/local/bin/ ``` #### Kubeflow Manifest ๋ค์ด๋ก๋ ``` git clone https://github.com/kubeflow/manifests.git git checkout v1.8.0 cd manifests ``` #### ์ค์น ๋ฐ ์คํ kubeflow ๋ฐฐํฌ๋ฅผ ์ํด์ "kubeflow" ๋ค์์คํ์ด์ค๋ฅผ ๋ง๋ ๋ค. ``` kubectl create namespace kubeflow ``` kustomize๋ฅผ ์ด์ฉํด์ kubeflow๋ฅผ ์ค์นํ๋ค. ``` while ! kustomize build example | kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done ``` #### Kubeflow ์ํ ํ์ธ ``` $ kubectl get pods -n kubeflow NAME READY STATUS RESTARTS AGE admission-webhook-deployment-69976d468d-ldb8d 1/1 Running 1 (12h ago) 12h cache-server-54dd59f65c-bl4q7 2/2 Running 2 (12h ago) 12h centraldashboard-76965b8847-469ck 2/2 Running 2 (12h ago) 12h jupyter-web-app-deployment-69995b57db-6ft76 2/2 Running 2 (12h ago) 12h katib-controller-78f4cbc88f-lgwh7 1/1 Running 2 (2m36s ago) 12h katib-db-manager-5ddf8fd5f4-b6pfr 1/1 Running 10 (48s ago) 12h katib-mysql-5dfcbbc87f-qwknq 0/1 Running 2 (12h ago) 12h katib-ui-6887769bf8-d7zkm 2/2 Running 2 (12h ago) 12h kserve-controller-manager-9b9ff6875-dbbgl 2/2 Running 2 (12h ago) 12h kserve-models-web-app-965b75bdf-8dbbt 2/2 Running 2 (12h ago) 12h kubeflow-pipelines-profile-controller-68469d866f-x7n7f 1/1 Running 1 (3m15s ago) 12h metacontroller-0 1/1 Running 2 (2m32s ago) 12h metadata-envoy-deployment-5f5d6986b9-trpnj 1/1 Running 1 (12h ago) 12h metadata-grpc-deployment-76d6fb49f8-rmjkv 2/2 Running 11 (2m23s ago) 12h metadata-writer-765c7b9664-2v92p 2/2 Running 7 (12h ago) 12h minio-847b65dd88-4nw2k 2/2 Running 2 (12h ago) 12h ml-pipeline-64f8c78ddc-lz2cv 2/2 Running 5 (12h ago) 12h ml-pipeline-persistenceagent-744467d649-ggkz6 2/2 Running 2 (12h ago) 12h ml-pipeline-scheduledworkflow-5f55545d8c-vwd82 2/2 Running 2 (12h ago) 12h ml-pipeline-ui-776b8f4456-mfgnv 2/2 Running 2 (3m15s ago) 12h ml-pipeline-viewer-crd-644ddd8f94-jzcs6 2/2 Running 5 (2m41s ago) 12h ml-pipeline-visualizationserver-76495876dc-424sn 2/2 Running 2 (3m15s ago) 12h mysql-767f4d9f9b-fzthf 2/2 Running 2 (12h ago) 12h notebook-controller-deployment-76445ffdf9-jmt22 2/2 Running 5 (2m40s ago) 12h profiles-deployment-576bc6dc96-4njrj 3/3 Running 7 (2m20s ago) 12h pvcviewer-controller-manager-6fc5985fd9-mzmrs 3/3 Running 7 (2m24s ago) 12h tensorboard-controller-deployment-66f4ff67b9-vljbf 3/3 Running 6 (2m40s ago) 12h tensorboards-web-app-deployment-7b78c4d6c-4sc79 2/2 Running 2 (12h ago) 12h training-operator-549d6b4bfb-fcc8j 1/1 Running 1 (12h ago) 12h volumes-web-app-deployment-55cd5bbd4f-cgsdj 2/2 Running 2 (12h ago) 12h workflow-controller-7dd7dfd785-crmgv 2/2 Running 5 (2m37s ago) 12h ``` #### Kubeflow Dashboard ํฌํธํฌ์๋ฉ์ ํตํด์ kubeflow dashboard ์ ์ ๊ทผ ํ ์ ์๋ค. ``` kubectl port-forward -n istio-system svc/istio-ingressgateway 8080:80 ``` localhost:8080 ์ผ๋ก ์ ๊ทผํ๋ค. ๊ธฐ๋ณธ ์์ด๋ ํจ์ค์๋๋ ์๋์ ๊ฐ๋ค. * User name: user@example.com * ๋น๋ฐ๋ฒํธ: 12341234  ๊ฐ๋ฐ์ ๋ฐ ๋ฐ์ดํฐ ์ฌ์ด์ธํฐ์คํธ๋ kubeflow๋ฅผ ์ด์ฉํด์ ๋จธ์ ๋ฌ๋ ์ํฌํ๋ก์ฐ๋ฅผ ์๊ฐ์ ์ผ๋ก ๊ด๋ฆฌํ๊ณ ๋ชจ๋ํฐ๋ง ํ ์ ์๋ค. ์ฌ์ฉ์๋ ์๋์ ๊ฐ์ ์ผ๋ค์ ํ ์ ์๋ค. #### Kubeflow ๊ตฌ์ฑ์์ ๊ด๋ฆฌ 1. Notebooks: Jupyter ๋ ธํธ๋ถ ์๋ฒ๋ฅผ ๊ด๋ฆฌํ๊ณ ์์ฑํด์ ๋ฐ์ดํฐ ํ์, ๋ชจ๋ธ ๊ฐ๋ฐ ๋ฐ ์คํ์ ์ํ ํ ์ ์๋ค. 2. **Pipelines**: ๋จธ์ ๋ฌ๋ ์ํฌํ๋ก์ฐ๋ฅผ ํ์ดํ๋ผ์ธ ํํ๋ก ์๊ฐํํ๊ณ ์คํ, ๋ชจ๋ํฐ๋ง ํ ์ ์๋ค. 3. Katib: ํ์ดํผํ๋ผ๋ฏธํฐ ํ๋ ์์ ์ ๊ด๋ฆฌํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ์๊ฐ์ ์ผ๋ก ํ์ธํ ์ ์๋ค. 4. KFServing: ๋ชจ๋ธ ์๋น์ ๊ด๋ฆฌํ๊ณ ๋ฐฐํฌ๋ ๋ชจ๋ธ์ ์ํ๋ฅผ ๋ชจ๋ํฐ๋ง ํ ์ ์๋ค. 5. Volumes: Kubeflow์์ ์ฌ์ฉํ๋ persistant ๋ณผ๋ฅจ์ ๊ด๋ฆฌํ๋ค 6. TensorBoards: ํ ์๋ณด๋ ์ธ์คํด์ค๋ฅผ ๊ด๋ฆฌํ๊ณ ํ์ต ๊ณผ์ ์ ์๊ฐํ ํ ์ ์๋ค. 7. ํ์ดํ๋ผ์ธ ์คํ ์ํ, ๋ชจ๋ธ ๋ฐฐํฌ ์ํ, ๋ฆฌ์์ค ์ฌ์ฉ๋ ๋ฑ Kubeflow ์ํฌํ๋ก์ฐ์ ์ ๋ฐ์ ์ธ ์ํ๋ฅผ ์ค์๊ฐ์ผ๋ก ๋ชจ๋ํฐ๋ง ํ ์ ์๋ค. ## ์ ๋ฆฌ ์ค๋์ MLOps์ ๊ฐ๋ ์ ์ดํด๋ณด๊ณ ๋ํ์ ์ธ ์คํ์์ค MLOps ํ๋ซํผ์ธ Kubeflow๋ฅผ ์ค์นํ๋ค. ๋ค์ ํฌ์คํธ์์๋ Pipeline์ ๊ฐ๋ฐํ๊ณ ๊ฐ๋จํ ML ์ํฌ๋ก๋๋ฅผ ์คํํด๋ณด๊ฒ ๋ค.
Recent Posts
MLOps with Joinc - Kubeflow ์ค์น
Vertex Gemini ๊ธฐ๋ฐ AI ์์ด์ ํธ ๊ฐ๋ฐ 05. ์ฒซ ๋ฒ์งธ LLM ์ ํ๋ฆฌ์ผ์ด์ ๊ฐ๋ฐ
LLama-3.2-Vision ํ ์คํธ
Vertex Gemini ๊ธฐ๋ฐ AI ์์ด์ ํธ ๊ฐ๋ฐ 04. ํ๋กฌํํธ ์์ง๋์ด๋ง
Vertex Gemini ๊ธฐ๋ฐ AI ์์ด์ ํธ ๊ฐ๋ฐ 03. Vertex AI Gemini ๋๋ฌ๋ณด๊ธฐ
Vertex Gemini ๊ธฐ๋ฐ AI ์์ด์ ํธ ๊ฐ๋ฐ 02. ์์ฑ AI์ ๋ํด์
Vertex Gemini ๊ธฐ๋ฐ AI ์์ด์ ํธ ๊ฐ๋ฐ 01. ์๊ฐ
Vertex Gemini ๊ธฐ๋ฐ AI ์์ด์ ํธ ๊ฐ๋ฐ-์๊ฐ
์์ฑ AI ๋ชจ๋ธ Flux.1 ์ค์น ๋ฐ ์ฌ์ฉ
GPT๋ฅผ ์ด์ฉํ Reranker ํ ์คํธ
Archive Posts
Tags
AI
machine learning
Copyrights ยฉ -
Joinc
, All Rights Reserved.
Inherited From -
Yundream
Rebranded By -
Joonphil
Recent Posts
Archive Posts
Tags