Skip to content

Commit 77218b7

Browse files
authored
Merge pull request #10 from LJ-Hao/main
add: all vlm & all llm
2 parents c33d2cc + 0bb1e58 commit 77218b7

23 files changed

Lines changed: 491 additions & 84 deletions

.github/workflows/deploy.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build and Push Deploy Images
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths:
7+
- 'src/**'
8+
- 'docker/RK3576/VLM/deploy_llm.dockerfile'
9+
- 'docker/RK3576/LLM/deploy_llm.dockerfile'
10+
- 'docker/RK3588/VLM/deploy_vlm.dockerfile'
11+
- 'docker/RK3588/LLM/deploy_llm.dockerfile'
12+
- '.github/workflows/deploy.yml'
13+
- 'lib/**'
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
18+
packages: write
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
include:
26+
- platform: rk3576
27+
type: llm
28+
dockerfile: docker/RK3576/LLM/deploy_llm.dockerfile
29+
- platform: rk3576
30+
type: vlm
31+
dockerfile: docker/RK3576/VLM/deploy_vlm.dockerfile
32+
- platform: rk3588
33+
type: llm
34+
dockerfile: docker/RK3588/LLM/deploy_llm.dockerfile
35+
- platform: rk3588
36+
type: vlm
37+
dockerfile: docker/RK3588/VLM/deploy_vlm.dockerfile
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
- name: Set up QEMU (for ARM64 emulation)
44+
uses: docker/setup-qemu-action@v3
45+
46+
- name: Set up Docker Buildx
47+
uses: docker/setup-buildx-action@v3
48+
49+
- name: Log in to GHCR
50+
uses: docker/login-action@v3
51+
with:
52+
registry: ghcr.io
53+
username: ${{ github.actor }}
54+
password: ${{ secrets.GITHUB_TOKEN }}
55+
56+
# Generate image tags:
57+
# Image name: ghcr.io/<owner>/deploy_<type>
58+
# Tags: <platform>-latest, <platform>-<short-sha>
59+
- name: Generate image tags
60+
id: meta
61+
run: |
62+
OWNER_LOWER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
63+
IMAGE_NAME="ghcr.io/${OWNER_LOWER}/deploy_${{ matrix.type }}"
64+
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
65+
TAGS="${IMAGE_NAME}:${{ matrix.platform }}-latest"
66+
TAGS="${TAGS},${IMAGE_NAME}:${{ matrix.platform }}-${SHORT_SHA}"
67+
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
68+
69+
- name: Build and push Docker image
70+
uses: docker/build-push-action@v5
71+
with:
72+
context: .
73+
file: ${{ matrix.dockerfile }}
74+
platforms: linux/arm64
75+
push: ${{ github.event_name != 'pull_request' }}
76+
tags: ${{ steps.meta.outputs.tags }}
77+
labels: |
78+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
79+
org.opencontainers.image.revision=${{ github.sha }}
80+
org.opencontainers.image.version=${{ github.ref_name }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Thumbs.db
2828
*.db
2929

3030
# Environment variables
31-
.env
31+
.env/
3232
.env.local
3333

3434
# Jupyter

VLM.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# LLM Fast start
1+
# VLM Fast start
22

33
## Step 1: Install Docker
44

docker/RK3576/LLM/DeepSeek-R1-Distill-Qwen.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ ENV RKLLM_MODEL_PATH=/app/models/${MODEL_FILE}
3434

3535
EXPOSE 8001
3636

37-
CMD ["sh", "-c", "python3 /app/fastapi_server_llm.py --rkllm_model_path ${RKLLM_MODEL_PATH} --target_platform rk3576"]
37+
CMD ["sh", "-c", "bash /app/fix_freq_rk3576.sh && python3 /app/fastapi_server_llm.py --rkllm_model_path ${RKLLM_MODEL_PATH} --target_platform rk3576"]

docker/RK3576/LLM/Qwen3.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ ENV RKLLM_MODEL_PATH=/app/models/${MODEL_FILE}
3434

3535
EXPOSE 8001
3636

37-
CMD ["sh", "-c", "python3 /app/fastapi_server_llm.py --rkllm_model_path ${RKLLM_MODEL_PATH} --target_platform rk3576"]
37+
CMD ["sh", "-c", "bash /app/fix_freq_rk3576.sh && python3 /app/fastapi_server_llm.py --rkllm_model_path ${RKLLM_MODEL_PATH} --target_platform rk3576"]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# 第一阶段:环境准备
2+
FROM python:3.10-slim AS base
3+
4+
RUN apt-get update && \
5+
apt-get install -y wget curl git sudo libgomp1 && \
6+
rm -rf /var/lib/apt/lists/*
7+
8+
WORKDIR /app
9+
10+
# 安装依赖
11+
COPY ./src/llm/requirements.txt /app/requirements.txt
12+
RUN pip install --no-cache-dir -r /app/requirements.txt
13+
14+
# 拷贝运行时库和工具
15+
COPY ./lib/librkllmrt.so /usr/lib/librkllmrt.so
16+
COPY ./src/fix_freq_rk3576.sh /app/fix_freq_rk3576.sh
17+
RUN chmod +x /app/fix_freq_rk3576.sh
18+
19+
# --- 最终阶段 ---
20+
FROM base AS final
21+
22+
COPY ./src/llm/fastapi_server_llm.py /app/
23+
24+
EXPOSE 8001
25+

docker/RK3576/VLM/DeepseekOCR.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ ENV VISION_MODEL_PATH=/app/models/${VISION_FILE}
4848

4949
EXPOSE 8002
5050

51-
CMD ["sh", "-c", "python3 /app/fastapi_server_vlm.py --llm_model ${LLM_MODEL_PATH} --encoder_model ${VISION_MODEL_PATH}"]
51+
CMD ["sh", "-c", "bash /app/fix_freq_rk3576.sh && python3 /app/fastapi_server_vlm.py --llm_model ${LLM_MODEL_PATH} --encoder_model ${VISION_MODEL_PATH}"]

docker/RK3576/VLM/InternVL3.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ COPY ./lib/librknnrt.so /usr/lib/librknnrt.so
2222
COPY ./src/fix_freq_rk3576.sh /app/fix_freq_rk3576.sh
2323
RUN chmod +x /app/fix_freq_rk3576.sh
2424

25+
2526
# --- 最终阶段 ---
2627
FROM base AS final
2728
ARG LLM_URL
@@ -48,4 +49,4 @@ ENV VISION_MODEL_PATH=/app/models/${VISION_FILE}
4849

4950
EXPOSE 8002
5051

51-
CMD ["sh", "-c", "python3 /app/fastapi_server_vlm.py --llm_model ${LLM_MODEL_PATH} --encoder_model ${VISION_MODEL_PATH}"]
52+
CMD ["sh", "-c", "bash /app/fix_freq_rk3576.sh && python3 /app/fastapi_server_vlm.py --llm_model ${LLM_MODEL_PATH} --encoder_model ${VISION_MODEL_PATH}"]

docker/RK3576/VLM/Qwen2.5-VL.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ COPY ./lib/librknnrt.so /usr/lib/librknnrt.so
2222
COPY ./src/fix_freq_rk3576.sh /app/fix_freq_rk3576.sh
2323
RUN chmod +x /app/fix_freq_rk3576.sh
2424

25+
2526
# --- 最终阶段 ---
2627
FROM base AS final
2728
ARG LLM_URL
@@ -48,4 +49,4 @@ ENV VISION_MODEL_PATH=/app/models/${VISION_FILE}
4849

4950
EXPOSE 8002
5051

51-
CMD ["sh", "-c", "python3 /app/fastapi_server_vlm.py --llm_model ${LLM_MODEL_PATH} --encoder_model ${VISION_MODEL_PATH}"]
52+
CMD ["sh", "-c", "bash /app/fix_freq_rk3576.sh && python3 /app/fastapi_server_vlm.py --llm_model ${LLM_MODEL_PATH} --encoder_model ${VISION_MODEL_PATH}"]

docker/RK3576/VLM/Qwen3-VL.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ ENV VISION_MODEL_PATH=/app/models/${VISION_FILE}
4848

4949
EXPOSE 8002
5050

51-
CMD ["sh", "-c", "python3 /app/fastapi_server_vlm.py --llm_model ${LLM_MODEL_PATH} --encoder_model ${VISION_MODEL_PATH}"]
51+
CMD ["sh", "-c", "bash /app/fix_freq_rk3576.sh && python3 /app/fastapi_server_vlm.py --llm_model ${LLM_MODEL_PATH} --encoder_model ${VISION_MODEL_PATH}"]

0 commit comments

Comments
 (0)