Skip to content

Commit 2fb5d4b

Browse files
committed
move to new build system
1 parent 76977c5 commit 2fb5d4b

11 files changed

Lines changed: 41 additions & 146 deletions

.env

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# auto-download
2+
MODEL_PATH: lmsys/fastchat-t5-3b-v1.0
3+
4+
# or locally, inside the models folder e.g.
5+
# MODEL_PATH="/models/vicuna-7b-1.1"
6+
# MODEL_PATH="/models/llama-7b-hf"
7+
# MODEL_PATH="/models/fastchat-t5-3b-v1.0"
8+
9+
10+
# cpu, cuda, mps
11+
FASTCHAT_DEVICE="cpu"
12+
FASTCHAT_GPU_COUNT=0
13+
14+
FASTCHAT_CONTROLLER_HOST=0.0.0.0
15+
FASTCHAT_CONTROLLER_PORT=21001
16+
FASTCHAT_CONTROLLER_ADDRESS=http://fastchat-controller:21001
17+
18+
FASTCHAT_WORKER_HOST=127.0.0.1
19+
FASTCHAT_WORKER_PORT=21002
20+
FASTCHAT_WORKER_ADDRESS=http://fastchat-worker:21002
21+
22+
FASTCHAT_API_HOST=127.0.0.1
23+
FASTCHAT_API_PORT=7500
24+
25+
FASTCHAT_GRADIO_HOST=0.0.0.0
26+
FASTCHAT_GRADIO_PORT=3000
27+
FASTCHAT_GRADIO_MODEL_LIST_MODE="reload"
Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Publish Docker images
22

33
on:
4-
push:
5-
branches: [main]
64
release:
75
types: [published]
86
workflow_dispatch:
@@ -14,7 +12,7 @@ permissions:
1412
jobs:
1513

1614
call-docker-build-fastchat:
17-
uses: localagi/ai-dedicated-workflows/.github/workflows/operation-docker-build-publish.yml@v1
15+
uses: localagi/ai-dedicated-workflows/.github/workflows/operation-docker-build-publish.yml@v3
1816
with:
1917
registry-github-enable: false
2018
registry-repo-name: fastchat
@@ -24,74 +22,5 @@ jobs:
2422
type=semver,pattern={{version}}
2523
build-args: |
2624
FASTCHAT_VERSION=${{ github.ref_name }}
27-
registry-readme: README-docker.md
2825
platforms: linux/amd64,linux/arm64/v8
2926
secrets: inherit
30-
31-
call-docker-build-fastchat-controller:
32-
uses: localagi/ai-dedicated-workflows/.github/workflows/operation-docker-build-publish.yml@v1
33-
with:
34-
registry-github-enable: false
35-
registry-repo-name: fastchat-controller
36-
tags: |
37-
type=schedule
38-
type=ref,event=branch
39-
type=semver,pattern={{version}}
40-
dockerfile: Dockerfile.controller
41-
build-args: |
42-
FROM_IMAGE=${{ needs.call-docker-build-fastchat.outputs.primary-image }}
43-
registry-readme: README-docker.md
44-
platforms: linux/amd64,linux/arm64/v8
45-
secrets: inherit
46-
needs: call-docker-build-fastchat
47-
48-
call-docker-build-fastchat-worker:
49-
uses: localagi/ai-dedicated-workflows/.github/workflows/operation-docker-build-publish.yml@v1
50-
with:
51-
registry-github-enable: false
52-
registry-repo-name: fastchat-worker
53-
tags: |
54-
type=schedule
55-
type=ref,event=branch
56-
type=semver,pattern={{version}}
57-
dockerfile: Dockerfile.worker
58-
build-args: |
59-
FROM_IMAGE=${{ needs.call-docker-build-fastchat.outputs.primary-image }}
60-
registry-readme: README-docker.md
61-
platforms: linux/amd64,linux/arm64/v8
62-
secrets: inherit
63-
needs: call-docker-build-fastchat
64-
65-
call-docker-build-fastchat-api:
66-
uses: localagi/ai-dedicated-workflows/.github/workflows/operation-docker-build-publish.yml@v1
67-
with:
68-
registry-github-enable: false
69-
registry-repo-name: fastchat-api
70-
tags: |
71-
type=schedule
72-
type=ref,event=branch
73-
type=semver,pattern={{version}}
74-
dockerfile: Dockerfile.api
75-
build-args: |
76-
FROM_IMAGE=${{ needs.call-docker-build-fastchat.outputs.primary-image }}
77-
registry-readme: README-docker.md
78-
platforms: linux/amd64,linux/arm64/v8
79-
secrets: inherit
80-
needs: call-docker-build-fastchat
81-
82-
call-docker-build-fastchat-gradio:
83-
uses: localagi/ai-dedicated-workflows/.github/workflows/operation-docker-build-publish.yml@v1
84-
with:
85-
registry-github-enable: false
86-
registry-repo-name: fastchat-gradio
87-
tags: |
88-
type=schedule
89-
type=ref,event=branch
90-
type=semver,pattern={{version}}
91-
dockerfile: Dockerfile.gradio
92-
build-args: |
93-
FROM_IMAGE=${{ needs.call-docker-build-fastchat.outputs.primary-image }}
94-
registry-readme: README-docker.md
95-
platforms: linux/amd64,linux/arm64/v8
96-
secrets: inherit
97-
needs: call-docker-build-fastchat

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

Dockerfile

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,5 @@ RUN git clone -b "$FASTCHAT_VERSION" --depth 1 https://github.com/lm-sys/FastCha
1515
WORKDIR /fastchat
1616
RUN pip3 install .
1717

18-
# e.g. "/model/vicuna-7b-1.1"
19-
ENV MODEL_PATH="/model/llama-7b-hf"
20-
21-
# cpu, cuda, mps
22-
ENV FASTCHAT_DEVICE="cpu"
23-
ENV FASTCHAT_GPU_COUNT=0
24-
25-
ENV FASTCHAT_CONTROLLER_HOST=127.0.0.1
26-
ENV FASTCHAT_CONTROLLER_PORT=21001
27-
ENV FASTCHAT_CONTROLLER_ADDRESS=http://$FASTCHAT_CONTROLLER_HOST:$FASTCHAT_CONTROLLER_PORT
28-
29-
ENV FASTCHAT_WORKER_HOST=127.0.0.1
30-
ENV FASTCHAT_WORKER_PORT=21002
31-
ENV FASTCHAT_WORKER_ADDRESS=http://$FASTCHAT_WORKER_HOST:$FASTCHAT_WORKER_PORT
32-
33-
ENV FASTCHAT_API_HOST=127.0.0.1
34-
ENV FASTCHAT_API_PORT=7500
35-
36-
ENV FASTCHAT_GRADIO_HOST=127.0.0.1
37-
ENV FASTCHAT_GRADIO_PORT=3000
38-
ENV FASTCHAT_GRADIO_MODEL_LIST_MODE="once"
39-
4018
COPY entrypoint.sh .
4119
RUN chmod +x entrypoint.sh

Dockerfile.api

Lines changed: 0 additions & 7 deletions
This file was deleted.

Dockerfile.controller

Lines changed: 0 additions & 7 deletions
This file was deleted.

Dockerfile.gradio

Lines changed: 0 additions & 7 deletions
This file was deleted.

Dockerfile.worker

Lines changed: 0 additions & 7 deletions
This file was deleted.

README-docker.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docker-compose.yaml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,14 @@ version: "3.8"
22
services:
33

44
fastchat-controller:
5-
image: localagi/fastchat-controller:${FASTCHAT_VERSION:-main}
6-
environment:
7-
FASTCHAT_CONTROLLER_HOST: "0.0.0.0"
5+
image: localagi/fastchat:${FASTCHAT_VERSION:-main}
6+
command: "/fastchat/entrypoint.sh fastchat.serve.controller --host ${FASTCHAT_CONTROLLER_HOST} --port ${FASTCHAT_CONTROLLER_PORT}"
87

98
fastchat-worker:
10-
image: localagi/fastchat-worker:${FASTCHAT_VERSION:-main}
11-
environment:
12-
FASTCHAT_WORKER_HOST: "0.0.0.0"
13-
FASTCHAT_WORKER_ADDRESS: http://fastchat-worker:21002
14-
FASTCHAT_CONTROLLER_ADDRESS: http://fastchat-controller:21001
15-
FASTCHAT_DEVICE: "cpu"
16-
MODEL_PATH: lmsys/fastchat-t5-3b-v1.0
17-
# or to use a local model:
18-
# MODEL_PATH: "/models/fastchat-t5-3b-v1.0"
19-
## use volumes to mount local models and use MODEL_PATH to provide an absolute path from internal /models
20-
# volumes:
21-
# - /path/to/local/models:/models
9+
image: localagi/fastchat:${FASTCHAT_VERSION:-main}
10+
command: /fastchat/entrypoint.sh fastchat.serve.model_worker --host ${FASTCHAT_WORKER_HOST} --port ${FASTCHAT_WORKER_PORT} --controller-address ${FASTCHAT_CONTROLLER_ADDRESS} --worker-address ${FASTCHAT_WORKER_ADDRESS} --model-path ${MODEL_PATH} --num-gpus ${FASTCHAT_GPU_COUNT} --device ${FASTCHAT_DEVICE}
11+
volumes:
12+
- ${LOCAL_MODEL_DIR:-./models}:/models
2213
deploy:
2314
resources:
2415
reservations:
@@ -31,21 +22,19 @@ services:
3122
- fastchat-controller
3223

3324
fastchat-api:
34-
image: localagi/fastchat-api:${FASTCHAT_VERSION:-main}
25+
image: localagi/fastchat:${FASTCHAT_VERSION:-main}
26+
command: /fastchat/entrypoint.sh fastchat.serve.openai_api_server --host ${FASTCHAT_API_HOST} --port ${FASTCHAT_API_PORT} --controller-address ${FASTCHAT_CONTROLLER_ADDRESS}
3527
environment:
3628
FASTCHAT_CONTROLLER_ADDRESS: http://fastchat-controller:21001
3729
ports:
38-
- "7500:7500"
30+
- "${FASTCHAT_API_PORT}:${FASTCHAT_API_PORT}"
3931
depends_on:
4032
- fastchat-controller
4133

4234
fastchat-gradio:
43-
image: localagi/fastchat-gradio:${FASTCHAT_VERSION:-main}
44-
environment:
45-
FASTCHAT_GRADIO_HOST: 0.0.0.0
46-
FASTCHAT_CONTROLLER_ADDRESS: http://fastchat-controller:21001
47-
FASTCHAT_GRADIO_MODEL_LIST_MODE: reload
35+
image: localagi/fastchat:${FASTCHAT_VERSION:-main}
36+
command: /fastchat/entrypoint.sh fastchat.serve.gradio_web_server --host ${FASTCHAT_GRADIO_HOST} --port ${FASTCHAT_GRADIO_PORT} --controller-url ${FASTCHAT_CONTROLLER_ADDRESS} --model-list-mode ${FASTCHAT_GRADIO_MODEL_LIST_MODE}
4837
ports:
49-
- "3000:3000"
38+
- "${FASTCHAT_GRADIO_PORT}:${FASTCHAT_GRADIO_PORT}"
5039
depends_on:
5140
- fastchat-controller

0 commit comments

Comments
 (0)