Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add service name in bento and bentorequest #58

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions apis/resources/v1alpha1/bento_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ type BentoSpec struct {
// +kubebuilder:validation:Required
Tag string `json:"tag"`
// +kubebuilder:validation:Required
Image string `json:"image"`
Context *BentoContext `json:"context,omitempty"`
Runners []BentoRunner `json:"runners,omitempty"`
Models []BentoModel `json:"models,omitempty"`
Image string `json:"image"`
ServiceName string `json:"serviceName,omitempty"`
Context *BentoContext `json:"context,omitempty"`
Runners []BentoRunner `json:"runners,omitempty"`
Models []BentoModel `json:"models,omitempty"`

ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
}
Expand Down
1 change: 1 addition & 0 deletions apis/resources/v1alpha1/bentorequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ type BentoRequestSpec struct {
// +kubebuilder:validation:Required
BentoTag string `json:"bentoTag"`
DownloadURL string `json:"downloadUrl,omitempty"`
ServiceName string `json:"serviceName,omitempty"`
Context *BentoContext `json:"context,omitempty"`
Runners []BentoRunner `json:"runners,omitempty"`
Models []BentoModel `json:"models,omitempty"`
Expand Down
5 changes: 2 additions & 3 deletions apis/resources/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions config/crd/bases/resources.yatai.ai_bentoes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ spec:
- name
type: object
type: array
serviceName:
type: string
tag:
type: string
required:
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/resources.yatai.ai_bentorequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,8 @@ spec:
- name
type: object
type: array
serviceName:
type: string
required:
- bentoTag
type: object
Expand Down
11 changes: 6 additions & 5 deletions controllers/resources/bentorequest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,12 @@ func (r *BentoRequestReconciler) Reconcile(ctx context.Context, req ctrl.Request
Namespace: bentoRequest.Namespace,
},
Spec: resourcesv1alpha1.BentoSpec{
Tag: bentoRequest.Spec.BentoTag,
Image: imageInfo.ImageName,
Context: bentoRequest.Spec.Context,
Runners: bentoRequest.Spec.Runners,
Models: bentoRequest.Spec.Models,
Tag: bentoRequest.Spec.BentoTag,
Image: imageInfo.ImageName,
ServiceName: bentoRequest.Spec.ServiceName,
Context: bentoRequest.Spec.Context,
Runners: bentoRequest.Spec.Runners,
Models: bentoRequest.Spec.Models,
},
}

Expand Down
4 changes: 4 additions & 0 deletions helm/yatai-image-builder-crds/templates/bentorequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ spec:
- name
type: object
type: array
serviceName:
type: string
tag:
type: string
required:
Expand Down Expand Up @@ -944,6 +946,8 @@ spec:
- name
type: object
type: array
serviceName:
type: string
required:
- bentoTag
type: object
Expand Down
Loading