diff --git a/api/base/v1alpha1/application.go b/api/base/v1alpha1/application.go index d304d3e54..6304f6a03 100644 --- a/api/base/v1alpha1/application.go +++ b/api/base/v1alpha1/application.go @@ -28,6 +28,9 @@ const ( // AppPublicLabelKey will add to app which is public AppPublicLabelKey = Group + "/app-is-public" + // AppRecommendedLabelKey will add to app which is recommended + AppRecommendedLabelKey = Group + "/app-is-recommended" + DefaultChatTimeoutSeconds = 60 ) diff --git a/api/base/v1alpha1/application_types.go b/api/base/v1alpha1/application_types.go index 7ecd13ca2..d54938791 100644 --- a/api/base/v1alpha1/application_types.go +++ b/api/base/v1alpha1/application_types.go @@ -35,6 +35,8 @@ type ApplicationSpec struct { Icon string `json:"icon,omitempty"` // IsPublic Set whether the current application provides services to the public IsPublic bool `json:"isPublic,omitempty"` + // IsRecommended Set whether the current application is recognized as recommended to users + IsRecommended bool `json:"isRecommended,omitempty"` // WebConfig is the configuration for web interface WebConfig `json:",inline"` // prologue, show in the chat top diff --git a/apiserver/graph/generated/generated.go b/apiserver/graph/generated/generated.go index a827683b7..11cb5edb7 100644 --- a/apiserver/graph/generated/generated.go +++ b/apiserver/graph/generated/generated.go @@ -114,6 +114,7 @@ type ComplexityRoot struct { ID func(childComplexity int) int Icon func(childComplexity int) int IsPublic func(childComplexity int) int + IsRecommended func(childComplexity int) int Labels func(childComplexity int) int Name func(childComplexity int) int Namespace func(childComplexity int) int @@ -388,6 +389,7 @@ type ComplexityRoot struct { EnableUploadFile func(childComplexity int) int Hot func(childComplexity int) int Icon func(childComplexity int) int + IsRecommended func(childComplexity int) int Name func(childComplexity int) int NotReadyReasonCode func(childComplexity int) int Prologue func(childComplexity int) int @@ -1252,6 +1254,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ApplicationMetadata.IsPublic(childComplexity), true + case "ApplicationMetadata.isRecommended": + if e.complexity.ApplicationMetadata.IsRecommended == nil { + break + } + + return e.complexity.ApplicationMetadata.IsRecommended(childComplexity), true + case "ApplicationMetadata.labels": if e.complexity.ApplicationMetadata.Labels == nil { break @@ -2658,6 +2667,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.GPT.Icon(childComplexity), true + case "GPT.isRecommended": + if e.complexity.GPT.IsRecommended == nil { + break + } + + return e.complexity.GPT.IsRecommended(childComplexity), true + case "GPT.name": if e.complexity.GPT.Name == nil { break @@ -5239,6 +5255,11 @@ type ApplicationMetadata { """IsPublic, 是否发布,即是否公开提供服务""" isPublic: Boolean + """ + isRecommended, 是否推荐 + """ + isRecommended: Boolean + """ 应用状态 """ @@ -5293,6 +5314,11 @@ input CreateApplicationMetadataInput { """ isPublic: Boolean + """ + isRecommended, 是否推荐 + """ + isRecommended: Boolean + """ category:所属分类 """ @@ -5342,6 +5368,11 @@ input UpdateApplicationMetadataInput { """ isPublic: Boolean + """ + isRecommended, 是否推荐 + """ + isRecommended: Boolean + """ category:所属分类 """ @@ -6493,6 +6524,11 @@ type GPT { """ creator: String + """ + isRecommended, 是否推荐 + """ + isRecommended: Boolean + """ category:gpt所属分类 """ @@ -9572,6 +9608,8 @@ func (ec *executionContext) fieldContext_Application_metadata(ctx context.Contex return ec.fieldContext_ApplicationMetadata_updateTimestamp(ctx, field) case "isPublic": return ec.fieldContext_ApplicationMetadata_isPublic(ctx, field) + case "isRecommended": + return ec.fieldContext_ApplicationMetadata_isRecommended(ctx, field) case "status": return ec.fieldContext_ApplicationMetadata_status(ctx, field) case "category": @@ -11074,6 +11112,47 @@ func (ec *executionContext) fieldContext_ApplicationMetadata_isPublic(ctx contex return fc, nil } +func (ec *executionContext) _ApplicationMetadata_isRecommended(ctx context.Context, field graphql.CollectedField, obj *ApplicationMetadata) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ApplicationMetadata_isRecommended(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRecommended, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ApplicationMetadata_isRecommended(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ApplicationMetadata", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _ApplicationMetadata_status(ctx context.Context, field graphql.CollectedField, obj *ApplicationMetadata) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ApplicationMetadata_status(ctx, field) if err != nil { @@ -11219,6 +11298,8 @@ func (ec *executionContext) fieldContext_ApplicationMutation_createApplication(c return ec.fieldContext_ApplicationMetadata_updateTimestamp(ctx, field) case "isPublic": return ec.fieldContext_ApplicationMetadata_isPublic(ctx, field) + case "isRecommended": + return ec.fieldContext_ApplicationMetadata_isRecommended(ctx, field) case "status": return ec.fieldContext_ApplicationMetadata_status(ctx, field) case "category": @@ -11304,6 +11385,8 @@ func (ec *executionContext) fieldContext_ApplicationMutation_updateApplication(c return ec.fieldContext_ApplicationMetadata_updateTimestamp(ctx, field) case "isPublic": return ec.fieldContext_ApplicationMetadata_isPublic(ctx, field) + case "isRecommended": + return ec.fieldContext_ApplicationMetadata_isRecommended(ctx, field) case "status": return ec.fieldContext_ApplicationMetadata_status(ctx, field) case "category": @@ -19593,6 +19676,47 @@ func (ec *executionContext) fieldContext_GPT_creator(ctx context.Context, field return fc, nil } +func (ec *executionContext) _GPT_isRecommended(ctx context.Context, field graphql.CollectedField, obj *Gpt) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GPT_isRecommended(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRecommended, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GPT_isRecommended(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GPT", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _GPT_category(ctx context.Context, field graphql.CollectedField, obj *Gpt) (ret graphql.Marshaler) { fc, err := ec.fieldContext_GPT_category(ctx, field) if err != nil { @@ -20102,6 +20226,8 @@ func (ec *executionContext) fieldContext_GPTQuery_getGPT(ctx context.Context, fi return ec.fieldContext_GPT_hot(ctx, field) case "creator": return ec.fieldContext_GPT_creator(ctx, field) + case "isRecommended": + return ec.fieldContext_GPT_isRecommended(ctx, field) case "category": return ec.fieldContext_GPT_category(ctx, field) case "icon": @@ -35818,7 +35944,7 @@ func (ec *executionContext) unmarshalInputCreateApplicationMetadataInput(ctx con asMap[k] = v } - fieldsInOrder := [...]string{"name", "namespace", "labels", "annotations", "displayName", "description", "icon", "isPublic", "category"} + fieldsInOrder := [...]string{"name", "namespace", "labels", "annotations", "displayName", "description", "icon", "isPublic", "isRecommended", "category"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -35881,6 +36007,13 @@ func (ec *executionContext) unmarshalInputCreateApplicationMetadataInput(ctx con return it, err } it.IsPublic = data + case "isRecommended": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isRecommended")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsRecommended = data case "category": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("category")) data, err := ec.unmarshalOString2ᚕᚖstring(ctx, v) @@ -38875,7 +39008,7 @@ func (ec *executionContext) unmarshalInputUpdateApplicationMetadataInput(ctx con asMap[k] = v } - fieldsInOrder := [...]string{"name", "namespace", "labels", "annotations", "displayName", "description", "icon", "isPublic", "category"} + fieldsInOrder := [...]string{"name", "namespace", "labels", "annotations", "displayName", "description", "icon", "isPublic", "isRecommended", "category"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -38938,6 +39071,13 @@ func (ec *executionContext) unmarshalInputUpdateApplicationMetadataInput(ctx con return it, err } it.IsPublic = data + case "isRecommended": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isRecommended")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsRecommended = data case "category": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("category")) data, err := ec.unmarshalOString2ᚕᚖstring(ctx, v) @@ -40155,6 +40295,8 @@ func (ec *executionContext) _ApplicationMetadata(ctx context.Context, sel ast.Se out.Values[i] = ec._ApplicationMetadata_updateTimestamp(ctx, field, obj) case "isPublic": out.Values[i] = ec._ApplicationMetadata_isPublic(ctx, field, obj) + case "isRecommended": + out.Values[i] = ec._ApplicationMetadata_isRecommended(ctx, field, obj) case "status": out.Values[i] = ec._ApplicationMetadata_status(ctx, field, obj) case "category": @@ -42846,6 +42988,8 @@ func (ec *executionContext) _GPT(ctx context.Context, sel ast.SelectionSet, obj out.Values[i] = ec._GPT_hot(ctx, field, obj) case "creator": out.Values[i] = ec._GPT_creator(ctx, field, obj) + case "isRecommended": + out.Values[i] = ec._GPT_isRecommended(ctx, field, obj) case "category": out.Values[i] = ec._GPT_category(ctx, field, obj) case "icon": diff --git a/apiserver/graph/generated/models_gen.go b/apiserver/graph/generated/models_gen.go index bda0021ce..55003c61e 100644 --- a/apiserver/graph/generated/models_gen.go +++ b/apiserver/graph/generated/models_gen.go @@ -120,6 +120,8 @@ type ApplicationMetadata struct { UpdateTimestamp *time.Time `json:"updateTimestamp,omitempty"` // IsPublic, 是否发布,即是否公开提供服务 IsPublic *bool `json:"isPublic,omitempty"` + // isRecommended, 是否推荐 + IsRecommended *bool `json:"isRecommended,omitempty"` // 应用状态 Status *string `json:"status,omitempty"` // category:所属分类 @@ -170,6 +172,8 @@ type CreateApplicationMetadataInput struct { Icon string `json:"icon"` // IsPublic, 是否发布,即是否公开提供服务 IsPublic *bool `json:"isPublic,omitempty"` + // isRecommended, 是否推荐 + IsRecommended *bool `json:"isRecommended,omitempty"` // category:所属分类 Category []*string `json:"category,omitempty"` } @@ -865,6 +869,8 @@ type Gpt struct { Hot *int64 `json:"hot,omitempty"` // creator: 创造者 Creator *string `json:"creator,omitempty"` + // isRecommended, 是否推荐 + IsRecommended *bool `json:"isRecommended,omitempty"` // category:gpt所属分类 Category []*string `json:"category,omitempty"` // icon: base64的图标 @@ -1735,6 +1741,8 @@ type UpdateApplicationMetadataInput struct { Icon string `json:"icon"` // IsPublic, 是否发布,即是否公开提供服务 IsPublic *bool `json:"isPublic,omitempty"` + // isRecommended, 是否推荐 + IsRecommended *bool `json:"isRecommended,omitempty"` // category:所属分类 Category []*string `json:"category,omitempty"` } diff --git a/apiserver/graph/schema/application.gql b/apiserver/graph/schema/application.gql index 75fdaa9cc..9ecb77d6a 100644 --- a/apiserver/graph/schema/application.gql +++ b/apiserver/graph/schema/application.gql @@ -13,6 +13,7 @@ mutation createApplication($input:CreateApplicationMetadataInput!){ creationTimestamp updateTimestamp isPublic + isRecommended status category } @@ -34,6 +35,7 @@ mutation updateApplication($input: UpdateApplicationMetadataInput!){ creationTimestamp updateTimestamp isPublic + isRecommended status category } @@ -61,6 +63,7 @@ mutation updateApplicationConfig($input: UpdateApplicationConfigInput!){ creationTimestamp updateTimestamp isPublic + isRecommended status category } @@ -111,6 +114,7 @@ query getApplication($name: String!, $namespace: String!){ creationTimestamp updateTimestamp isPublic + isRecommended status category } @@ -166,6 +170,7 @@ query listApplications($input: ListCommonInput!) { creationTimestamp updateTimestamp isPublic + isRecommended status category } diff --git a/apiserver/graph/schema/application.graphqls b/apiserver/graph/schema/application.graphqls index f6e2649d4..173017ab6 100644 --- a/apiserver/graph/schema/application.graphqls +++ b/apiserver/graph/schema/application.graphqls @@ -194,6 +194,11 @@ type ApplicationMetadata { """IsPublic, 是否发布,即是否公开提供服务""" isPublic: Boolean + """ + isRecommended, 是否推荐 + """ + isRecommended: Boolean + """ 应用状态 """ @@ -248,6 +253,11 @@ input CreateApplicationMetadataInput { """ isPublic: Boolean + """ + isRecommended, 是否推荐 + """ + isRecommended: Boolean + """ category:所属分类 """ @@ -297,6 +307,11 @@ input UpdateApplicationMetadataInput { """ isPublic: Boolean + """ + isRecommended, 是否推荐 + """ + isRecommended: Boolean + """ category:所属分类 """ diff --git a/apiserver/graph/schema/gpt.gql b/apiserver/graph/schema/gpt.gql index a43d5d6f4..01e09fcdc 100644 --- a/apiserver/graph/schema/gpt.gql +++ b/apiserver/graph/schema/gpt.gql @@ -6,6 +6,7 @@ query getGPT($name: String!){ description hot creator + isRecommended category icon prologue @@ -32,6 +33,7 @@ query listGPTs($input: ListGPTInput!) { description hot creator + isRecommended category icon prologue diff --git a/apiserver/graph/schema/gpt.graphqls b/apiserver/graph/schema/gpt.graphqls index a1f5ae3d1..121dae474 100644 --- a/apiserver/graph/schema/gpt.graphqls +++ b/apiserver/graph/schema/gpt.graphqls @@ -55,6 +55,11 @@ type GPT { """ creator: String + """ + isRecommended, 是否推荐 + """ + isRecommended: Boolean + """ category:gpt所属分类 """ diff --git a/apiserver/pkg/application/application.go b/apiserver/pkg/application/application.go index fc5801de5..d37243a75 100644 --- a/apiserver/pkg/application/application.go +++ b/apiserver/pkg/application/application.go @@ -93,6 +93,7 @@ func cr2app(prompt *apiprompt.Prompt, chainConfig *apichain.CommonChainConfig, r CreationTimestamp: &app.CreationTimestamp.Time, UpdateTimestamp: UpdateTimestamp, IsPublic: pointer.Bool(app.Spec.IsPublic), + IsRecommended: pointer.Bool(app.Spec.IsRecommended), Status: pointer.String(status), }, Prologue: pointer.String(app.Spec.Prologue), @@ -174,6 +175,7 @@ func app2metadata(app *v1alpha1.Application) (*generated.ApplicationMetadata, er UpdateTimestamp: UpdateTimestamp, Icon: pointer.String(app.Spec.Icon), IsPublic: pointer.Bool(app.Spec.IsPublic), + IsRecommended: pointer.Bool(app.Spec.IsRecommended), Status: pointer.String(status), Category: common.GetAppCategory(app), }, nil @@ -192,10 +194,11 @@ func CreateApplication(ctx context.Context, c client.Client, input generated.Cre DisplayName: input.DisplayName, Description: pointer.StringPtrDerefOr(input.Description, ""), }, - Icon: input.Icon, - IsPublic: pointer.BoolDeref(input.IsPublic, false), - Prologue: "", - Nodes: []v1alpha1.Node{}, + Icon: input.Icon, + IsPublic: pointer.BoolDeref(input.IsPublic, false), + IsRecommended: pointer.BoolDeref(input.IsRecommended, false), + Prologue: "", + Nodes: []v1alpha1.Node{}, }, } app = addCategory(app, input.Category) @@ -219,6 +222,7 @@ func UpdateApplication(ctx context.Context, c client.Client, input generated.Upd app.Spec.Description = pointer.StringDeref(input.Description, app.Spec.Description) app.Spec.Icon = input.Icon app.Spec.IsPublic = pointer.BoolDeref(input.IsPublic, app.Spec.IsPublic) + app.Spec.IsRecommended = pointer.BoolDeref(input.IsRecommended, app.Spec.IsRecommended) if !reflect.DeepEqual(app, oldApp) { if err := c.Update(ctx, app); err != nil { return nil, err diff --git a/config/crd/bases/arcadia.kubeagi.k8s.com.cn_applications.yaml b/config/crd/bases/arcadia.kubeagi.k8s.com.cn_applications.yaml index e1bdea8ee..4cdc52f62 100644 --- a/config/crd/bases/arcadia.kubeagi.k8s.com.cn_applications.yaml +++ b/config/crd/bases/arcadia.kubeagi.k8s.com.cn_applications.yaml @@ -65,6 +65,10 @@ spec: description: IsPublic Set whether the current application provides services to the public type: boolean + isRecommended: + description: IsRecommended Set whether the current application is + recognized as recommended to users + type: boolean nodes: description: Nodes items: diff --git a/controllers/base/application_controller.go b/controllers/base/application_controller.go index 5dd59a9c0..58762b773 100644 --- a/controllers/base/application_controller.go +++ b/controllers/base/application_controller.go @@ -283,14 +283,25 @@ func (r *ApplicationReconciler) reconcile(ctx context.Context, log logr.Logger, } } appRaw := app.DeepCopy() + // Set public label if app.Spec.IsPublic { if app.Labels == nil { app.Labels = make(map[string]string, 1) } - app.Labels[arcadiav1alpha1.AppPublicLabelKey] = "" + app.Labels[arcadiav1alpha1.AppPublicLabelKey] = "true" } else { delete(app.Labels, arcadiav1alpha1.AppPublicLabelKey) } + // Set recommended label + if app.Spec.IsRecommended { + if app.Labels == nil { + app.Labels = make(map[string]string, 1) + } + app.Labels[arcadiav1alpha1.AppRecommendedLabelKey] = "true" + } else { + delete(app.Labels, arcadiav1alpha1.AppRecommendedLabelKey) + } + if !reflect.DeepEqual(app, appRaw) { return app, ctrl.Result{Requeue: true}, r.Patch(ctx, app, client.MergeFrom(appRaw)) } diff --git a/deploy/charts/arcadia/Chart.yaml b/deploy/charts/arcadia/Chart.yaml index 604e35ed4..85452c221 100644 --- a/deploy/charts/arcadia/Chart.yaml +++ b/deploy/charts/arcadia/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: arcadia description: A Helm chart(Also a KubeBB Component) for KubeAGI Arcadia type: application -version: 0.3.25 +version: 0.3.26 appVersion: "0.2.1" keywords: diff --git a/deploy/charts/arcadia/README.md b/deploy/charts/arcadia/README.md index efdc09492..456c1185b 100644 --- a/deploy/charts/arcadia/README.md +++ b/deploy/charts/arcadia/README.md @@ -9,7 +9,7 @@ This Helm chart installs arcadia into Kubernetes. ## Configuration Definitions @ Values.yaml -**Before deploying arcadia chart, you should update values defined in `value.yaml`. ** +**Before deploying arcadia chart, you should update values defined in `value.yaml`.** ### global @@ -17,7 +17,21 @@ global settings of arcadia chart. | Parameter | Description | Default | | ------------------------ | ------------------------------------------------------------ | ----------- | -| `defaultVectorStoreType` | Defines the default vector database type, currently `chroma` and `pgvector` are available | `pgvector` | +| `global.storage.class` | Defines the default storage class for arcadia components,like `minio` `postgresql` `chroma` | `standard` | +| `global.defaultVectorStoreType` | Defines the default vector database type, currently `chroma` and `pgvector` are available | `pgvector` | +| `global.hostConfig` | Defines the default host config for arcadia deployments | hostnames with almost all the ingress hosts | + +### config + +configs of the operation console for arcadia + +| Parameter | Description | Default | +| ------------------------ | ------------------------------------------------------------ | ----------- | +| `config.embedder.enabled` | 标识是否启用系统默认的嵌入服务 | `false` | +| `config.embedder.model` | 指定作为系统默认嵌入服务使用的模型名称 | `bge-large-zh-v1.5` | +| `config.rerank.enabled` | 标识是否启用默认的重排序服务 | true | +| `config.rerank.model` | 设置用于重排序服务的默认模型名称 | `bge-reranker-large` | + ### controller @@ -25,14 +39,10 @@ configs of the core controller for arcadia | Parameter | Description | Default | | ------------------- | ------------------------------- | ------------------------ | -| `loglevel` | klog level of controller pod | `3` | -| `image` | image of controller pod | `kubeagi/arcadia:latest` | -| `imagePullPolicy` | pull policy of controller image | `IfNotPresent` | -| `resources.` | resource used by controller pod | | -| `- limits.cpu` | | `"1"` | -| `- limits.memory` | | `1024Mi` | -| `- requests.cpu` | | `10m` | -| `- requests.memory` | | `64Mi` | +| `controller.loglevel` | klog level of controller pod. 1: error 3: info 5: debug | `3` | +| `controller.image` | image of controller pod | `kubeagi/arcadia:latest` | +| `controller.imagePullPolicy` | pull policy of controller image | `IfNotPresent` | +| `controller.resources` | resource used by controller pod | | ### apiserver @@ -40,19 +50,18 @@ graphql and bff server | Parameter | Description | Default | | ------------------- | ---------------------------- | -------------------------------------------------------- | -| `bingKey` | | | -| `loglevel` | klog level of apiserver pod | 3 | -| `image` | image of apiserver pod | kubeagi/arcadia:latest | -| `enableplayground` | enable playground | `false` | -| `port` | port of apiserver | `8081` | -| `ingress.enabled` | enable ingress for apiserver | `true` | -| `ingress.path` | path of apiserver | `kubeagi-apis` | -| `ingress.host` | host of apiserver | `portal..nip.io` | -| `oidc.enabled` | enable oidc certification | `true` | -| `oidc.clientID` | oidc client ID | `bff-client` | -| `oidc.clientSecret` | oidc client Secret | | -| `oidc.issuerURL` | URL of issuer portal | `https://portal..nip.io/oidc` | -| `oidc.masterURL` | URL of master | `https://k8s..nip.io` | +| `apiserver.loglevel` | klog level of apiserver pod 1: error 3: info 5: debug | 3 | +| `apiserver.image` | image of apiserver pod | kubeagi/arcadia:latest | +| `apiserver.enableplayground` | enable playground | `false` | +| `apiserver.port` | port of apiserver | `8081` | +| `apiserver.ingress.enabled` | enable ingress for apiserver | `true` | +| `apiserver.ingress.path` | path of apiserver | `kubeagi-apis` | +| `apiserver.ingress.host` | host of apiserver | `portal..nip.io` | +| `apiserver.oidc.enabled` | enable oidc certification | `true` | +| `apiserver.oidc.clientID` | oidc client ID | `bff-client` | +| `apiserver.oidc.clientSecret` | oidc client Secret | `61324af0-1234-4f61-b110-ef57013267d6` | +| `apiserver.oidc.issuerURL` | URL of issuer portal | `https://portal..nip.io/oidc` | +| `apiserver.oidc.masterURL` | URL of master | `https://k8s..nip.io` | ### opsconsole @@ -60,23 +69,23 @@ portal for arcadia operation console | Parameter | Description | Default | | --------------- | --------------------------------- | ------------------------------------------- | -| `enabled` | enable arcadia web portal console | `true` | -| `kubebbEnabled` | enable kubebb platform | `true` | -| `image` | image of web console pod | `kubeagi/ops-console:latest` | -| `ingress.path` | ingress path of portal | `kubeagi-portal-public` | -| `ingress.host` | host of ingress path | `portal..nip.io` | +| `opsconsole.enabled` | enable arcadia web portal console | `true` | +| `opsconsole.kubebbEnabled` | enable kubebb platform | `true` | +| `opsconsole.image` | image of web console pod | `kubeagi/ops-console:latest` | +| `opsconsole.ingress.path` | ingress path of portal | `kubeagi-portal-public` | +| `opsconsole.ingress.host` | host of ingress path | `portal..nip.io` | -### agentportal +### gpts -portal for arcadia gpt service +configuration for gpt store | Parameter | Description | Default | | --------------- | --------------------------------- | ------------------------------------------- | -| `enabled` | enable arcadia agent portal | `true` | -| `kubebbEnabled` | enable kubebb platform | `true` | -| `image` | image of web console pod | `kubeagi/agent-portal:latest` | -| `ingress.path` | ingress path of portal | `` | -| `ingress.host` | host of ingress path | `gpts..nip.io` | +| `gpts.enabled` | enable arcadia gpt store | `true` | +| `gpts.public_namespace` | all gpt resources are public in this namespace | `true` | +| `gpts.agentportal.image` | image of web console pod | `kubeagi/agent-portal:latest` | +| `gpts.agentportal.ingress.path` | ingress path of agent portal | `` | +| `gpts.agentportal.ingress.host` | host of ingress path for agent portal | `gpts..nip.io` | ### fastchat @@ -84,11 +93,11 @@ fastchat is used as LLM serve platform for arcadia | Parameter | Description | Default | | ------------------ | --------------------------------- | ------------------------------------------------- | -| `enabled` | enable fastchat pod | `true` | -| `image.repository` | image of fastchat pod | `kubeagi/arcadia-fastchat` | -| `image.tag` | tag of fastchat image | `v0.2.0` | -| `ingress.enabled` | enable ingress of fastchat server | `true` | -| `ingress.host` | host of fastchat server | `fastchat-api..nip.io` | +| `fastchat.enabled` | enable fastchat pod | `true` | +| `fastchat.image.repository` | image of fastchat pod | `kubeagi/arcadia-fastchat` | +| `fastchat.image.tag` | tag of fastchat image | `v0.2.0` | +| `fastchat.ingress.enabled` | enable ingress of fastchat server | `true` | +| `fastchat.ingress.host` | host of fastchat server | `fastchat-api..nip.io` | ### minio @@ -96,28 +105,24 @@ minio is used as default Object-Storage-Service for arcadia. | Parameter | Description | Default | | -------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `image.repository` | image of minio pod | `kubeagi/minio` | -| `image.tag` | tag of the minio image | `RELEASE.2023-02-10T18-48-39Z` | -| `mode` | minio running mode | `standalone` | -| `rootUser` | root user name of minio | `"admin"` | -| `rootPassword` | root password of minio | `"Passw0rd!"` | -| `persistence.enabled` | enable persistant storage for minio service | `true` | -| `persistence.storageClass` | class of persistant storage | `"standard"` | -| `persistence.size` | size of persistant storage | `30Gi` | -| `ingress.enabled` | enable ingress of minio service | `true` | -| `ingress.api.enabled` | enable ingress of minio api | `true` | -| `ingress.api.insecure` | set if api can be accessed insecurely | `false` | -| `ingress.api.port` | port of minio api | `9000` | -| `ingress.api.host` | host of minio api | `minio-api..nip.io` | -| `ingress.console.enabled` | enable ingress of minio console | `false` | -| `ingress.console.port` | port of minio console | `9001` | -| `ingress.console.host` | host of minio console | `minio-console..nip.io` | -| `ingress.cert.ipAddresses` | IP address | `` | -| `ingress.cert.dnsNames` | Names of certified DNSes. | `minio-api..nip.io`
`minio-console..nip.io` | -| `buckets.name` | Name of the bucket | `*default-oss-bucket` | -| `buckets.policy` | Policy to be set on the bucket.[none\|download\|upload\|public\|custom] if set to custom, customPolicy must be set. | `"none"` | -| `buckets.versioning` | set versioning for bucket [true\|false] | `false` | -| `buckets.objectlocking` | set objectlocking for bucket [true\|false] NOTE: versioning is enabled by default if you use locking. | `false` | +| `minio.image.repository` | image of minio pod | `kubeagi/minio` | +| `minio.image.tag` | tag of the minio image | `RELEASE.2023-02-10T18-48-39Z` | +| `minio.mode` | minio running mode | `standalone` | +| `minio.rootUser` | root user name of minio | `"admin"` | +| `minio.rootPassword` | root password of minio | `"Passw0rd!"` | +| `minio.persistence.enabled` | enable persistant storage for minio service | `true` | +| `minio.persistence.storageClass` | class of persistant storage | `"standard"` | +| `minio.persistence.size` | size of persistant storage | `30Gi` | +| `minio.ingress.enabled` | enable ingress of minio service | `true` | +| `minio.ingress.api.enabled` | enable ingress of minio api | `true` | +| `minio.ingress.api.insecure` | set if api can be accessed insecurely | `false` | +| `minio.ingress.api.port` | port of minio api | `9000` | +| `minio.ingress.api.host` | host of minio api | `minio-api..nip.io` | +| `minio.ingress.console.enabled` | enable ingress of minio console | `false` | +| `minio.ingress.console.port` | port of minio console | `9001` | +| `minio.ingress.console.host` | host of minio console | `minio-console..nip.io` | +| `minio.ingress.cert.ipAddresses` | IP address | `` | +| `minio.ingress.cert.dnsNames` | Names of certified DNSes. | `minio-api..nip.io`
`minio-console..nip.io` | ### dataprocess @@ -125,10 +130,12 @@ configs of data processing service | Parameter | Description | Default | | --------------------------- | ------------------------- | -------------------------------- | -| `enabled` | enable dataprocess pod | `true` | -| `image` | image of dataprocess pod | `kubeagi/data-processing:latest` | -| `port` | port of dataprocess | `28888` | -| `config.llm.qa_retry_count` | retry limit of QA process | `'2'` | +| `dataprocess.enabled` | enable dataprocess pod | `true` | +| `dataprocess.image` | image of dataprocess pod | `kubeagi/data-processing:latest` | +| `dataprocess.port` | port of dataprocess | `28888` | +| `dataprocess.config.llm.qa_retry_count` | retry limit of QA process | `'2'` | +| `dataprocess.config.worker` | default pallel workers when generation QA | `'1'` | +| `dataprocess.config.chunkSize` | default chunksize when split document | `'500'` | ### postgresql @@ -136,17 +143,17 @@ configs of postgresql service. Posgresql service will be used in: dataprocessing | Parameter | Description | Default | | --------------------------------- | ------------------------------------- | -------------------------------------- | -| `enabled` | enable postgresql | `true` | -| `global.storageClass` | storage class of postgresql | `"standard"` | -| `global.postgresql.auth` | default auth settrings of postgresql | | +| `postgresql.enabled` | enable postgresql | `true` | +| `postgresql.global.storageClass` | storage class of postgresql | `"standard"` | +| `postgresql.global.postgresql.auth` | default auth settrings of postgresql | | | `- .username` | default username | `"admin"` | | `- .password` | default password | `"Passw0rd!"` | | `- .database` | default database | `"arcadia"` | -| `image.registry` | postgresql image registry | `docker.io` | -| `image.repository` | postgresql image repo name | `kubeagi/postgresql` | -| `image.tag` | postgresql image repo tag | `16.1.0-debian-11-r18-pgvector-v0.5.1` | -| `image.pullPolicy` | postgresql image pull policy | `IfNotPresent` | -| `primary.initdb.scriptsConfigMap` | config map when initializing database | `pg-init-data` | +| `postgresql.image.registry` | postgresql image registry | `docker.io` | +| `postgresql.image.repository` | postgresql image repo name | `kubeagi/postgresql` | +| `postgresql.image.tag` | postgresql image repo tag | `16.1.0-debian-11-r18-pgvector-v0.5.1` | +| `postgresql.image.pullPolicy` | postgresql image pull policy | `IfNotPresent` | +| `postgresql.primary.initdb.scriptsConfigMap` | config map when initializing database | `pg-init-data` | ### chromadb @@ -154,13 +161,13 @@ configs to deploy chromadb instance | Parameter | Description | Default | | --------------------------------- | ------------------------------ | ------------------ | -| `enabled` | enable chromadb instance | `false` | -| `image.repository` | chromadb image repo name | `kubeagi/chromadb` | -| `chromadb.apiVersion` | chromadb api version | `"0.4.18"` | -| `chromadb.auth.enabled` | enable chromadb auth | `false` | -| `chromadb.serverHttpPort` | chromadb server port | `8000` | -| `chromadb.dataVolumeStorageClass` | class of chromadb data storage | `"standard"` | -| `chromadb.dataVolumeSize` | size of chromadb data storage | `"1Gi"` | +| `chromadb.enabled` | enable chromadb instance | `false` | +| `chromadb.image.repository` | chromadb image repo name | `kubeagi/chromadb` | +| `chromadb.chromadb.apiVersion` | chromadb api version | `"0.4.18"` | +| `chromadb.chromadb.auth.enabled` | enable chromadb auth | `false` | +| `chromadb.chromadb.serverHttpPort` | chromadb server port | `8000` | +| `chromadb.chromadb.dataVolumeStorageClass` | class of chromadb data storage | `"standard"` | +| `chromadb.chromadb.dataVolumeSize` | size of chromadb data storage | `"1Gi"` | ### ray @@ -168,7 +175,7 @@ ray is a unified framework for scaling AI and Python applications. In kubeagi, w | Parameter | Description | Default / Sample | | ----------------- | ----------------------------------------- | ----------------------------------------------------- | -| `clusters` | lists of GPU clusters used for inference. | | +| `ray.clusters` | lists of GPU clusters used for inference. | | | ` - .name` | name of GPU cluster | `3090-2-GPUs` | | `- .headAddress` | head address of ray cluster | `raycluster-kuberay-head-svc.kuberay-system.svc:6379` | | `- pythonVersion` | python version of ray cluster | `3.9.18` | diff --git a/deploy/charts/arcadia/crds/arcadia.kubeagi.k8s.com.cn_applications.yaml b/deploy/charts/arcadia/crds/arcadia.kubeagi.k8s.com.cn_applications.yaml index e1bdea8ee..4cdc52f62 100644 --- a/deploy/charts/arcadia/crds/arcadia.kubeagi.k8s.com.cn_applications.yaml +++ b/deploy/charts/arcadia/crds/arcadia.kubeagi.k8s.com.cn_applications.yaml @@ -65,6 +65,10 @@ spec: description: IsPublic Set whether the current application provides services to the public type: boolean + isRecommended: + description: IsRecommended Set whether the current application is + recognized as recommended to users + type: boolean nodes: description: Nodes items: diff --git a/deploy/charts/arcadia/templates/agent-portal.yaml b/deploy/charts/arcadia/templates/agent-portal.yaml index 91fcc6fdb..ef46e4a9b 100644 --- a/deploy/charts/arcadia/templates/agent-portal.yaml +++ b/deploy/charts/arcadia/templates/agent-portal.yaml @@ -1,4 +1,4 @@ -{{- if .Values.agentportal.enabled }} +{{- if .Values.gpts.enabled }} apiVersion: v1 data: .env.production: | @@ -32,7 +32,7 @@ spec: app: {{ .Release.Name }}-agentportal spec: containers: - - image: {{ .Values.agentportal.image }} + - image: {{ .Values.gpts.agentportal.image }} imagePullPolicy: IfNotPresent name: agentportal env: @@ -116,7 +116,7 @@ metadata: namespace: {{ .Release.Namespace }} spec: rules: - - host: {{ .Values.agentportal.ingress.host }} + - host: {{ .Values.gpts.agentportal.ingress.host }} http: paths: - backend: @@ -124,6 +124,6 @@ spec: name: {{ .Release.Name }}-agentportal port: number: 3000 - path: "/{{ .Values.agentportal.ingress.path }}" + path: "/{{ .Values.gpts.agentportal.ingress.path }}" pathType: ImplementationSpecific {{- end }} diff --git a/deploy/charts/arcadia/templates/config.yaml b/deploy/charts/arcadia/templates/config.yaml index 830742bd1..ea1bafe87 100644 --- a/deploy/charts/arcadia/templates/config.yaml +++ b/deploy/charts/arcadia/templates/config.yaml @@ -71,6 +71,7 @@ data: database: {{ .Values.postgresql.global.postgresql.auth.database }} # configurations for gpts gptsConfig: | + public_namespace: {{ .Values.gpts.public_namespace }} categories: - id: 1 name: "通用对话" diff --git a/deploy/charts/arcadia/values.yaml b/deploy/charts/arcadia/values.yaml index f5b1a600e..230f42289 100644 --- a/deploy/charts/arcadia/values.yaml +++ b/deploy/charts/arcadia/values.yaml @@ -1,6 +1,4 @@ global: - oss: - bucket: &default-oss-bucket "arcadia" ## @param global.defaultVectorStoreType Defines the default vector database type, currently `chroma` and `pgvector` are available ## When the option is `chroma`, it needs `chromadb.enabled` to be `true` as well to work. ## When the option is `pgvector`, it needs `postgresql.enabled` to be `true` as well to work. @@ -36,6 +34,7 @@ config: # @param imagePullPolcy ImagePullPolicy # @param resources Resources to be used controller: + # 1: error 3: info 5: debug loglevel: 3 image: kubeagi/arcadia:v0.2.1 imagePullPolicy: IfNotPresent @@ -74,15 +73,17 @@ opsconsole: ingress: path: kubeagi-portal-public host: portal..nip.io - -# @section portal for arcadia GPT store -agentportal: + +# @section configurations for GPT Store +gpts: enabled: true - kubebbEnabled: true - image: kubeagi/agent-portal:latest - ingress: - path: "" - host: gpts..nip.io + # all gpt resources are public in this namespace + public_namespace: gpts + agentportal: + image: kubeagi/agent-portal:latest + ingress: + path: "" + host: gpts..nip.io # @section fastchat is used as fastchat configurations for arcadia fastchat: @@ -124,19 +125,6 @@ minio: dnsNames: - minio-api..nip.io - minio-console..nip.io - buckets: - # Name of the bucket - - name: *default-oss-bucket - # Policy to be set on the - # bucket [none|download|upload|public|custom] - # if set to custom, customPolicy must be set. - policy: "none" - # set versioning for - # bucket [true|false] - versioning: false - # set objectlocking for - # bucket [true|false] NOTE: versioning is enabled by default if you use locking - objectlocking: false # @section dataprocess is used to configure data processing service # Related project: https://github.com/kubeagi/arcadia/tree/main/data-processing @@ -150,8 +138,6 @@ dataprocess: worker: 1 chunkSize: 500 - - # @section postgresql is used to configure postgresql service # Posgresql service will be used in two parts: # - dataprocessing diff --git a/pkg/config/gpts_config.go b/pkg/config/gpts_config.go index eca985e6a..edf01f01f 100644 --- a/pkg/config/gpts_config.go +++ b/pkg/config/gpts_config.go @@ -35,7 +35,9 @@ var ( // GPTsConfig is the configurations for GPT Store type GPTsConfig struct { - Categories []Category `json:"categories,omitempty"` + // PublicNamespace is the namespace which all gpt-releated resources are public + PublicNamespace string `json:"public_namespace,omitempty"` + Categories []Category `json:"categories,omitempty"` } // Category in gpt store diff --git a/tests/deploy-values.yaml b/tests/deploy-values.yaml index f435d1d42..f8f0f6a67 100644 --- a/tests/deploy-values.yaml +++ b/tests/deploy-values.yaml @@ -47,13 +47,13 @@ opsconsole: host: portal.test.nip.io # @section portal for arcadia gpts -agentportal: +gpts: enabled: true - kubebbEnabled: false - image: kubeagi/agent-portal:latest - ingress: - path: "" - host: gpts.test.nip.io + agentportal: + image: kubeagi/agent-portal:latest + ingress: + path: "" + host: gpts.test.nip.io # @section fastchat is used as fastchat configurations for arcadia fastchat: