Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bjwswang authored Nov 16, 2023
2 parents 413a91e + a38c689 commit 6e42f76
Show file tree
Hide file tree
Showing 17 changed files with 2,636 additions and 293 deletions.
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,26 @@ build-graphql-server: gql-gen
@CGO_ENABLED=0 GOOS=linux go build -o bin/graphql-server graphql-server/go-server/main.go


# prepare for git push
.PHONY: prepare-push
config_rule_line_num = $(shell grep -n "rules:" config/rbac/role.yaml | cut -d: -f1)
chart_rule_line_num = $(shell grep -n "rules:" charts/arcadia/templates/rbac.yaml | cut -d: -f1)
prepare-push: manifests generate fmt vet
@echo "install golangci-lint"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@echo "run golangci-lint with auto-fix"
@golangci-lint run --fix -v ./...
@echo "copy crds to charts"
@cp config/crd/bases/* charts/arcadia/crds
@echo "copy role to charts"
@sed -n '$(config_rule_line_num),$$p' config/rbac/role.yaml > tmp_role.yaml
@sed -i '' '$(chart_rule_line_num),$$d' charts/arcadia/templates/rbac.yaml
@cat tmp_role.yaml >> charts/arcadia/templates/rbac.yaml
@rm -f tmp_role.yaml

# Commands for Data-Processing
DATA_PROCESSING_IMAGE ?= kubebb/dp-base

.PHONY: docker-build-dp-base
docker-build-dp-base:
docker build -f ./data-process/Dockerfile.base -t $(DATA_PROCESSING_IMAGE):$(VERSION) ./data-process/

docker build -f ./data-process/Dockerfile.base -t $(DATA_PROCESSING_IMAGE):$(VERSION) ./data-process/
4 changes: 2 additions & 2 deletions api/v1alpha1/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
var (
// LabelDatasetScene defines the content type of this dataset
LabelDatasetContentType = Group + "/content-type"
// LabelDatasetBestCase defines the best case to use this dataset
LabelDatasetBestCase = Group + "/best-case"
// LabelDatasetField defines the best field to use this dataset
LabelDatasetField = Group + "/field"
LabelDatasetFinalizer = Group + "/finalizers"
)
4 changes: 2 additions & 2 deletions api/v1alpha1/dataset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type DatasetSpec struct {
// ContentType defines dataset
ContentType string `json:"contentType"`

// bestCase defines the best case to use this dataset
BestCase string `json:"bestCase,omitempty"`
// Model application fields
Field string `json:"field,omitempty"`
}

// DatasetStatus defines the observed state of Dataset
Expand Down
3 changes: 3 additions & 0 deletions api/v1alpha1/model_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ type ModelSpec struct {
// Description defines datasource description
Description string `json:"description,omitempty"`

// Model application fields
Field string `json:"field,omitempty"`

// Type defines what kind of model this is
Type ModelType `json:"type,omitempty"`

Expand Down
2 changes: 1 addition & 1 deletion 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.23
version: 0.1.24
appVersion: "0.0.1"

keywords:
Expand Down
6 changes: 3 additions & 3 deletions charts/arcadia/crds/arcadia.kubeagi.k8s.com.cn_datasets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ spec:
spec:
description: DatasetSpec defines the desired state of Dataset
properties:
bestCase:
description: bestCase defines the best case to use this dataset
type: string
contentType:
description: ContentType defines dataset
type: string
Expand All @@ -57,6 +54,9 @@ spec:
displayName:
description: DisplayName defines datasource display name
type: string
field:
description: Model application fields
type: string
required:
- contentType
type: object
Expand Down
3 changes: 3 additions & 0 deletions charts/arcadia/crds/arcadia.kubeagi.k8s.com.cn_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ spec:
displayName:
description: DisplayName defines dataset display name
type: string
field:
description: Model application fields
type: string
type:
description: Type defines what kind of model this is
type: string
Expand Down
1 change: 0 additions & 1 deletion charts/arcadia/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,3 @@ rules:
- get
- patch
- update

6 changes: 3 additions & 3 deletions config/crd/bases/arcadia.kubeagi.k8s.com.cn_datasets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ spec:
spec:
description: DatasetSpec defines the desired state of Dataset
properties:
bestCase:
description: bestCase defines the best case to use this dataset
type: string
contentType:
description: ContentType defines dataset
type: string
Expand All @@ -57,6 +54,9 @@ spec:
displayName:
description: DisplayName defines datasource display name
type: string
field:
description: Model application fields
type: string
required:
- contentType
type: object
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/arcadia.kubeagi.k8s.com.cn_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ spec:
displayName:
description: DisplayName defines dataset display name
type: string
field:
description: Model application fields
type: string
type:
description: Type defines what kind of model this is
type: string
Expand Down
4 changes: 2 additions & 2 deletions controllers/dataset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func (r *DatasetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
instance.Labels[arcadiav1alpha1.LabelDatasetContentType] = instance.Spec.ContentType
update = true
}
if v, ok := instance.Labels[arcadiav1alpha1.LabelDatasetBestCase]; !ok || v != instance.Spec.BestCase {
instance.Labels[arcadiav1alpha1.LabelDatasetBestCase] = instance.Spec.BestCase
if v, ok := instance.Labels[arcadiav1alpha1.LabelDatasetField]; !ok || v != instance.Spec.Field {
instance.Labels[arcadiav1alpha1.LabelDatasetField] = instance.Spec.Field
update = true
}
if !utils.ContainString(instance.Finalizers, arcadiav1alpha1.Finalizer) {
Expand Down
Loading

0 comments on commit 6e42f76

Please sign in to comment.