-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: llm servise helm chart & dockerfile
- Loading branch information
1 parent
3fb0de7
commit 8f07b36
Showing
7 changed files
with
217 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: fschat | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: fschat | ||
template: | ||
metadata: | ||
labels: | ||
app: fschat | ||
spec: | ||
containers: | ||
- name: fschat-controller | ||
image: {{ .Values.image.repository }}:{{ .Values.image.tag }} | ||
command: ["python3", "-m", "fastchat.serve.controller", "--host", "0.0.0.0"] | ||
ports: | ||
- containerPort: 21001 | ||
|
||
- name: fschat-api | ||
image: {{ .Values.image.repository }}:{{ .Values.image.tag }} | ||
command: ["python3", "-m", "fastchat.serve.openai_api_server", "--host", "0.0.0.0", "--controller-address", "http://fastchat-controller:21001"] | ||
ports: | ||
- containerPort: 8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{{- if .Values.ingress.enabled -}} | ||
|
||
{{- if semverCompare "<1.19" .Capabilities.KubeVersion.GitVersion -}} | ||
apiVersion: extensions/v1beta1 | ||
{{- else if semverCompare "<1.22" .Capabilities.KubeVersion.GitVersion -}} | ||
apiVersion: networking.k8s.io/v1beta1 | ||
{{- else -}} | ||
apiVersion: networking.k8s.io/v1 | ||
{{- end }} | ||
kind: Ingress | ||
metadata: | ||
name: {{ .Release.Name }}-{{ .Chart.Name }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: | ||
app: {{ .Chart.Name }} | ||
release: {{ .Release.Name }} | ||
{{- with .Values.ingress.labels }} | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
|
||
{{- with .Values.ingress.annotations }} | ||
annotations: | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if .Values.ingress.ingressClassName }} | ||
ingressClassName: {{ .Values.ingress.ingressClassName }} | ||
{{- end }} | ||
|
||
{{- if .Values.ingress.tls }} | ||
tls: | ||
{{- range .Values.ingress.tls }} | ||
- hosts: | ||
{{- range .hosts }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
secretName: {{ .secretName }} | ||
{{- end }} | ||
{{- end }} | ||
rules: | ||
- host: {{ .Values.ingress.hosts }} | ||
http: | ||
paths: | ||
- path: {{ .Values.ingress.path.controllerPath }} | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ .Values.controllerService.name }} | ||
port: | ||
number: {{ .Values.controllerService.port }} | ||
- path: {{ .Values.ingress.path.apiServerPath }} | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ .Values.apiService.name }} | ||
port: | ||
number: {{ .Values.apiService.port }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: fschat-service | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: fschat | ||
ports: | ||
- name: {{ .Values.controllerService.name}} | ||
port: 21001 | ||
targetPort: 21001 | ||
- name: {{ .Values.apiService.name }} | ||
port: 8000 | ||
targetPort: 8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# FROM python:3.12.0b4-alpine3.18 | ||
# FROM ubuntu:22.04 | ||
FROM nvidia/cuda:11.7.1-runtime-ubuntu22.04 | ||
|
||
RUN sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list | ||
RUN sed -i 's/security.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list | ||
|
||
RUN apt update -y && apt upgrade -y && apt install -y python3 curl | ||
RUN apt install python3-pip -y | ||
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories | ||
# RUN apk add curl py3-pip py3-setuptools | ||
# RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | ||
# RUN python3 get-pip.py | ||
RUN pip3 install fschat -i https://pypi.mirrors.ustc.edu.cn/simple/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: "3.9" | ||
|
||
services: | ||
fastchat-controller: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
image: fschat:v1 | ||
ports: | ||
- "21001:21001" | ||
entrypoint: ["python3", "-m", "fastchat.serve.controller", "--host", "0.0.0.0", "--port", "21001"] | ||
fastchat-api-server: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
image: fschat:v1 | ||
ports: | ||
- "8000:8000" | ||
entrypoint: ["python3", "-m", "fastchat.serve.openai_api_server", "--controller-address", "http://fastchat-controller:21001", "--host", "0.0.0.0", "--port", "8000"] | ||
volumes: | ||
huggingface: # /root/.cache/huggingface 或未来构建的 git 服务 |