Computer/Docker, Linux

[RunPod] 에서 원하는 이미지로 Pod 만들기 (Kor)

Braydon 2024. 5. 4. 04:01
반응형

Update : 2024.05.04

Content : RunPod에서 원하는 이미지로 GPU Pod 만들기

Reference : https://docs.runpod.io/pods/configuration/use-ssh

 

Use SSH | RunPod Documentation

The basic terminal SSH access that RunPod exposes is not a full SSH connection and, therefore, does not support commands like SCP. If you want to have full SSH capabilities, then you will need to rent an instance that has public IP support and run a full S

docs.runpod.io

 

1. 먼저 Deploy 페이지에 들어갑니다

https://www.runpod.io/console/deploy

 

https://www.runpod.io/console/deploy

 

www.runpod.io

 

2. GPU나 CPU를 선택해줍니다

 

3. Change Template을 눌러줍니다

- 만약 원하는 템플릿이 없을 경우, 원하는 이미지로 템플릿을 생성합니다.

- 생성하기 위해 아래의 페이지로 이동합니다.

https://www.runpod.io/console/user/templates

nvidia/cuda:12.1.0-devel-ubuntu22.04 example

 

4. 다시 1번부터 동일한 절차를 반복하고 Change Template에서 원하는 템플릿을 선택합니다.

 

5. Edit Template로 돌아와서 반드시 Container Start Command를 추가합니다. 

아래 보여지는 문구가 Container Start Command입니다.

해당 커맨드와 함께 실행하는 까닭은 해당되는 docker image에 ssh가 설치되어 있지 않아 바로 원격 접속하여 사용할 수 없기 때문입니다. 

bash -c 'apt update;DEBIAN_FRONTEND=noninteractive apt-get install openssh-server -y;mkdir -p ~/.ssh;cd $_;chmod 700 ~/.ssh;echo "$PUBLIC_KEY" >> authorized_keys;chmod 700 authorized_keys;service ssh start;sleep infinity'

 

 

6. Container Disk와 Volume Disk의 사이즈를 적절하게 조절합니다.

- Container disk는 매번 실행할 때마다, 다시 말해 중지하고 다시 실행할 때마다 초기화되는 일시적인 저장소의 크기를 의미합니다. 이는 파이선의 라이브러리와 캐시 등을 포함합니다.

- Volume disk는 at /workspace에 저장된 영구적인 저장소의 크기를 의미합니다.

 

7. Set Overrides하고 모든 것이 잘 설정되었다면, Deploy On-Demand하여 마칩니다.

반응형