Skip to content

Commit

Permalink
feat: add a controller implementation of rag
Browse files Browse the repository at this point in the history
  • Loading branch information
0xff-dev committed Jan 29, 2024
1 parent 457703f commit 2715965
Show file tree
Hide file tree
Showing 7 changed files with 812 additions and 4 deletions.
21 changes: 21 additions & 0 deletions api/evaluation/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package v1alpha1

import (
"reflect"

batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
)
Expand Down Expand Up @@ -134,3 +136,22 @@ func RagStatus(rag *RAG) (string, RAGPhase, string) {
}
return status, phase, phaseMsg
}

func RAGSpecChanged(a, b RAGSpec) bool {
if !reflect.DeepEqual(*a.Application, *b.Application) {
return true
}
if !reflect.DeepEqual(a.Datasets, b.Datasets) {
return true
}
if !reflect.DeepEqual(a.JudgeLLM, b.JudgeLLM) {
return true
}
if !reflect.DeepEqual(*a.Storage, *b.Storage) {
return true
}
if a.ServiceAccountName != b.ServiceAccountName {
return true
}
return false
}
12 changes: 12 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ rules:
- get
- list
- watch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- '*'
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -408,6 +414,12 @@ rules:
- subjectaccessreviews
verbs:
- create
- apiGroups:
- batch
resources:
- jobs
verbs:
- '*'
- apiGroups:
- chain.arcadia.kubeagi.k8s.com.cn
resources:
Expand Down
Loading

0 comments on commit 2715965

Please sign in to comment.