Skip to content

Commit

Permalink
Merge pull request #356 from bjwswang/endpoint
Browse files Browse the repository at this point in the history
feat: able to view system pre-configured models
  • Loading branch information
bjwswang authored Dec 12, 2023
2 parents aa13ca2 + 295710b commit b70db9b
Show file tree
Hide file tree
Showing 16 changed files with 426 additions and 59 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go env -w GOPROXY=https://goproxy.cn,direct
RUN go mod download

# Copy the go source
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/arcadia/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: arcadia
description: A Helm chart(KubeBB Component) for KubeAGI Arcadia
type: application
version: 0.1.39
version: 0.1.40
appVersion: "0.0.1"

keywords:
Expand Down
7 changes: 6 additions & 1 deletion deploy/charts/arcadia/templates/post-models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Model
metadata:
name: baichuan2-7b-chat
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "1"
spec:
displayName: "baichuan2-7b"
displayName: "baichuan2-7b-chat"
description: |
Baichuan2 为百川智能推出的新一代开源大语言模型,采用 2.6 万亿 Tokens 的高质量语料训练。
模型在通用、法律、医疗、数学、代码和多语言翻译六个领域的中英文和多语言权威数据集上进行了广泛测试,取得同尺寸中显著的优秀效果。
Expand All @@ -29,6 +30,7 @@ apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Model
metadata:
name: chatglm2-6b
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "1"
Expand Down Expand Up @@ -59,6 +61,7 @@ apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Model
metadata:
name: qwen-7b-chat
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "1"
Expand Down Expand Up @@ -90,6 +93,7 @@ apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Model
metadata:
name: bge-large-zh-v1.5
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "1"
Expand Down Expand Up @@ -121,6 +125,7 @@ apiVersion: arcadia.kubeagi.k8s.com.cn/v1alpha1
kind: Model
metadata:
name: m3e-base
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "1"
Expand Down
38 changes: 38 additions & 0 deletions deploy/charts/arcadia/templates/resource_reader.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: kubeagi-reader
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- arcadia.kubeagi.k8s.com.cn
resources:
- models
verbs:
- get
- list
- apiGroups:
- arcadia.kubeagi.k8s.com.cn
resources:
- models/finalizers
verbs:
- update
- apiGroups:
- arcadia.kubeagi.k8s.com.cn
resources:
- models/status
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kubeagi-reader
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kubeagi-reader
subjects:
- kind: Group
name: resource-reader
13 changes: 11 additions & 2 deletions graphql-server/go-server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ package config

import (
"flag"
"os"

"k8s.io/klog/v2"

"github.com/kubeagi/arcadia/graphql-server/go-server/pkg/dataprocessing"
)

var s = &ServerConfig{}

type ServerConfig struct {
SystemNamespace string

Host string
Port int
EnablePlayground bool
Expand All @@ -36,7 +41,7 @@ type ServerConfig struct {
}

func NewServerFlags() ServerConfig {
s := ServerConfig{}
flag.StringVar(&s.SystemNamespace, "system-namespace", os.Getenv("POD_NAMESPACE"), "system namespace where kubeagi has been installed")
flag.StringVar(&s.Host, "host", "", "bind to the host, default is 0.0.0.0")
flag.IntVar(&s.Port, "port", 8081, "service listening port")
flag.BoolVar(&s.EnablePlayground, "enable-playground", false, "enable the graphql playground")
Expand All @@ -52,5 +57,9 @@ func NewServerFlags() ServerConfig {
flag.Parse()

dataprocessing.Init(s.DataProcessURL)
return s
return *s
}

func GetConfig() ServerConfig {
return *s
}
Loading

0 comments on commit b70db9b

Please sign in to comment.