Skip to content

Commit 228e453

Browse files
authored
doc: add doc ahout developent on cloud or runpod (#3194)
Signed-off-by: fredw <[email protected]>
1 parent 3cf7066 commit 228e453

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
(build-image-to-dockerhub)=
2+
3+
# Build the TensorRT-LLM Docker Image
4+
When you develop trt-llm on cloud platform such as runpod, you may need to provide a docker image for the platform. So you firstly need to upload the image to dockerhub.
5+
6+
## Build the TensorRT-LLM Docker Image and Upload to DockerHub
7+
8+
```bash
9+
make -C docker build
10+
```
11+
Then we can get the docker image named `tensorrt_llm/devel:latest`
12+
13+
### Enable ssh access to the container
14+
Since the default docker image doesn’t have ssh support, we can’t ssh into it. We need to add ssh support to the container.
15+
Let’s first create a new Dockerfile with below content:
16+
17+
```Dockerfile
18+
FROM tensorrt_llm/devel:latest
19+
20+
RUN apt update && apt install openssh-server -y
21+
RUN mkdir -p /run/sshd && chmod 755 /run/sshd
22+
RUN mkdir -p /root/.ssh && chmod 700 /root/.ssh && touch /root/.ssh/authorized_keys && chmod 600 /root/.ssh/authorized_keys
23+
# add sshd to entrypoint script
24+
RUN echo "sshd -E /opt/sshd.log" >> /opt/nvidia/entrypoint.d/99-start-sshd.sh
25+
```
26+
27+
If we save this Dockerfile as `Dockerfile.ssh`. Then we can build the docker image with below command:
28+
29+
```bash
30+
docker build -t tensorrt_llm/devel:with_ssh -f Dockerfile.ssh .
31+
```
32+
33+
Then we can get the docker image named `tensorrt_llm/devel:with_ssh`
34+
35+
## Upload the Docker Image to DockerHub
36+
37+
You need to register a [dockerhub](https://hub.docker.com) account first if you don't have one.
38+
39+
Then you can click 'Personal Access Tokens' in the user menu and create a new token.
40+
41+
With the token, you can login to dockerhub with below command:
42+
43+
```bash
44+
docker login -u <your_dockerhub_username>
45+
```
46+
47+
Enter the token to the console.
48+
49+
After login, you can tag and push the docker image to dockerhub with below command:
50+
51+
```bash
52+
docker tag tensorrt_llm/devel:with_ssh <your_dockerhub_username>/tensorrt_llm:devel
53+
docker push <your_dockerhub_username>/tensorrt_llm:devel
54+
```
55+
56+
Finally, you can see the docker image in your dockerhub repository and can use it with the link such as `docker.io/<your_dockerhub_username>/tensorrt_llm:devel`.
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
(dev-on-runpod)=
2+
3+
# Develop TensorRT-LLM on Runpod
4+
[Runpod](https://runpod.io) is a popular cloud platform among many researchers. This doc describes how to develop TensorRT-LLM on Runpod.
5+
6+
## Prepare
7+
8+
### Create a Runpod account
9+
Please refer to the [Runpod Getting Started](https://docs.runpod.io/get-started/).
10+
11+
### Configure SSH Key
12+
Please refer to the [Configure SSH Key](https://docs.runpod.io/pods/configuration/use-ssh).
13+
14+
Note that we can skip the step of "Start your Pod. Make sure of the following things" here as we will introduce it below.
15+
16+
## Build the TensorRT-LLM Docker Image and Upload to DockerHub
17+
Please refer to the [Build Image to DockerHub](build-image-to-dockerhub.md).
18+
19+
Note that the docker image must enable ssh access. See on [Enable ssh access to the container](build-image-to-dockerhub.md#enable-ssh-access-to-the-container).
20+
21+
## Create a Pod Template
22+
Click "Template" bottom on the menus and click "Create Template" bottom.
23+
24+
Fill the docker image link of DockerHub such as `docker.io/<your_dockerhub_username>/tensorrt_llm:devel` on "Docker Image" field.
25+
26+
Fill "22" into "Expose TCP Ports" field.
27+
28+
Fill
29+
```bash
30+
sleep infinity
31+
```
32+
into 'Container Start Command' field.
33+
34+
## Connect to the Pod
35+
Please refer to the [Connect to the Pod](https://docs.runpod.io/pods/connect-to-a-pod).
36+
37+
You can connect the pod with SSH or Web Terminal.
38+
39+
If you want to connect the pod with SSH, you can copy the command from "SSH over exposed TCP" field and run it on your host.
40+
41+
In some scenarios such as using a team account, your public key has not been added to the pod successfully. You can directly add this command to the 'Container Start Command' field as:
42+
43+
```bash
44+
bash -c 'echo "<your_public_key>" >> ~/.ssh/authorized_keys;sleep infinity'
45+
```
46+
47+
Enjoy your development!

0 commit comments

Comments
 (0)