diff --git a/README.md b/README.md index c2a7dfb..ca68345 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,40 @@ -# DECS -Dongguk Education(Elastic이 되게끔 k8s 도입 예정) Containter Service 입니다.. +## 🗒️ 이미지 버전 요약 +각 이미지 태그는 생성된 날짜(YYMMDD)를 따르며, latest 태그는 항상 최신 버전의 이미지를 가리킵니다. +| 이미지 태그 (Image Tag) | TensorFlow 버전 | CUDA / cuDNN | 베이스 OS (Base OS) | 주요 변경사항 및 설명 | +| :--- | :--- | :--- | :--- | :--- | +| `dguailab/decs:latest`
`dguailab/decs:251002` | **2.18.0** | CUDA 12.5
cuDNN 8.9 | Ubuntu 22.04 | **(최신)** TensorFlow 2.18.0 업그레이드, 최신 GPU 환경 지원 | +| `dguailab/decs:250926` | **2.13.0** | CUDA 11.8
cuDNN 8.6 | Ubuntu 20.04 | **(이전 안정 버전)** TensorFlow 2.13.0 기반의 안정화 버전 | +## ⚙️ 사용 방법 +필요한 버전의 이미지를 Docker Hub에서 pull 받아 사용합니다. + +### 최신 버전 사용하기 +latest 태그를 사용하여 항상 최신 버전의 이미지를 받을 수 있습니다. +``` +docker pull dguailab/decs:latest +``` + +### 날짜 태그를 직접 명시하여 받기 +``` +docker pull dguailab/decs:251002 +``` + +### 특정 구버전 사용하기 +이전 버전의 TensorFlow 환경이 필요한 경우, 해당 날짜 태그를 명시하여 이미지를 받습니다. +``` +docker pull dguailab/decs:250926 +``` + + +# ⚒️ 빌드 자동화 +이 Docker 이미지는 GitHub Actions를 통해 자동으로 빌드 및 배포됩니다. +- 실행 조건: decsYYMMDD 형식의 브랜치가 develop 브랜치로 병합(merge)될 때 +- 자동 생성 태그: +- 브랜치 이름에서 추출한 날짜 태그 (예: `dguailab/decs:251002`) +- 최신 버전을 가리키는 latest 태그 (`dguailab/decs:latest`) + + +


+### 🔗 관리자용 노션 문서 링크 +https://www.notion.so/DECS-280c7692a263802ca40ff68b38f58dd1?source=copy_link diff --git a/entrypoint.sh b/entrypoint.sh index 8f95799..cb2113d 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -80,16 +80,33 @@ service ssh restart # jupyter lab 에서 생성한 ipynb 파일을 저장할 디렉토리 생성 (없는경우만 신규 생성) if [ ! -d "/home/$USER_ID/decs_jupyter_lab" ]; then - mkdir /home/$USER_ID/decs_jupyter_lab - echo "Created /home/$USER_ID/decs_jupyter_lab dir...." + mkdir /home/$USER_ID/decs_jupyter_lab + echo "Created /home/$USER_ID/decs_jupyter_lab dir...." +fi + +# jupyter lab config 파일이 없으면 생성 +mkdir -p /home/$USER_ID/.jupyter/ + +if [ ! -f /home/$USER_ID/.jupyter/jupyter_notebook_config.py ]; then + echo "jupyter_notebook_config.py not found, generating..." + /opt/anaconda3/bin/jupyter notebook --generate-config + cp /root/.jupyter/jupyter_notebook_config.py /home/$USER_ID/.jupyter/ +else + echo "jupyter_notebook_config.py already exists." fi # jupyter lab 접속 설정 -sed -i "1i c.JupyterApp.config_file_name = 'jupyter_notebook_config.py'\nc.NotebookApp.allow_origin = '*'\nc.NotebookApp.ip = '0.0.0.0'\nc.NotebookApp.open_browser = False\nc.NotebookApp.allow_remote_access = True\nc.NotebookApp.allow_root = True\nc.NotebookApp.notebook_dir='/home/$USER_ID/decs_jupyter_lab'" /jupyter_config/jupyter_notebook_config.py +sed -i "1i c.JupyterApp.config_file_name = 'jupyter_notebook_config.py'\nc.NotebookApp.allow_origin = '*'\nc.NotebookApp.ip = '0.0.0.0'\nc.NotebookApp.open_browser = False\nc.NotebookApp.allow_remote_access = True\nc.NotebookApp.allow_root = True\nc.NotebookApp.notebook_dir='/home/$USER_ID/decs_jupyter_lab'" /home/$USER_ID/.jupyter/jupyter_notebook_config.py + +# Jupyter Lab 토큰을 랜덤 문자열로 생성하고 저장 +TOKEN=$(tr -dc A-Za-z0-9 /home/$USER_ID/decs_jupyter_lab/jupyter_token.txt +chmod 600 /home/$USER_ID/decs_jupyter_lab/jupyter_token.txt +chown $USER_ID:$USER_ID /home/$USER_ID/decs_jupyter_lab/jupyter_token.txt # jupyter_lab 기동 echo "trying jupyter lab..." -nohup /opt/anaconda3/bin/jupyter lab --NotebookApp.token=decs --config=/jupyter_config/jupyter_notebook_config.py >/dev/null 2>&1 & +nohup /opt/anaconda3/bin/jupyter lab --NotebookApp.token=$TOKEN --config=/home/$USER_ID/.jupyter/jupyter_notebook_config.py >/dev/null 2>&1 & echo "jupyter lab listening!" # ldconfig permission 오류 방지