- DVC 테스트 구성
DVC 설치 및 명령어 사용
DVC 설치
OS : centos-7.3-64
Python 3.8 이상 지원
- Python 3.9 설치
yum install gcc openssl-devel bzip2-devel libffi-devel -y
wget https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tgz
tar -xvf Python-3.9.15.tgz
cd Python-3.9.15/
./configure --enable-optimizations
make altinstall
- pip 설치
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
- DVC 설치
pip install dvc[all]==2.6.4
- DVC 설치 확인
dvc --version
DVC 구성
- DVC 저장소 셋팅
mkdir dvc-sample
git init
dvc init
mkdir data
cd data
- dvc 로 버전 tracking 할 data 를 생성
vi demo.csv
cd ..
dvc add data/demo.csv
git add data/.gitignore data/demo.csv.dvc
# demo.csv.dvc 파일은 메타정보를 가진 파일
# git 에서는 demo.txt 파일이 아닌, demo.txt.dvc 파일만 관리
cat demo.csv.dvc
git commit -m "Add demo.csv.dvc"
- ObjectStorage 연동
dvc remote add -d myremote s3://dvc-sample4
dvc remote modify myremote endpointurl https://kr.object.ncloudstorage.com
dvc remote modify myremote access_key_id 'xxxxxxxxxxxxxxxxxxx'
dvc remote modify myremote secret_access_key 'xxxxxxxxxxxxxxxxx'
- dvc config을 git commit
git add .dvc/config
git commit -m "add remote storage"
- dvc push
dvc push
- 특정 버전으로 rollback
git log --oneline
git checkout e6c1942 data/demo.csv.dvc
vi data/demo.csv.dvc
dvc checkout
cat data/demo.csv
- 데이터 삭제되었거나 새로 받아야 하는 경우
DVC Pull
'IT' 카테고리의 다른 글
플레이스토어에 앱을 올릴 때 유용한 사이트 3가지 (34) | 2024.11.21 |
---|---|
Feature Store - Feast (33) | 2024.07.03 |
Forward Proxy(squid) 사용하여 도메인 기반의 접근 제어 구성 (0) | 2024.06.27 |
깔끔한 PPT 만드는 팁 (2) | 2024.06.07 |
MS Ignite 2023 : Common Generative AI Use Cases with Azure and Snowflake (0) | 2024.04.16 |