-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for modelmeshserving as component
- add new modelcontroller component: do not show in DSC.components - e2e on modelcontroller wont run in parallel but after others are done - if modelmesh is enabled, or kserve (later) is enabled, modelcontroller should be managed Signed-off-by: Wen Zhou <wenzhou@redhat.com>
- Loading branch information
Showing
35 changed files
with
1,851 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
Copyright 2023. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1 | ||
|
||
import ( | ||
"github.com/opendatahub-io/opendatahub-operator/v2/apis/components" | ||
operatorv1 "github.com/openshift/api/operator/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const ( | ||
ModelControllerComponentName = "odh-model-controller" // shared by kserve and modelmeshserving | ||
// value should match whats set in the XValidation below | ||
ModelControllerInstanceName = "default-modelcontroller" | ||
ModelControllerKind = "ModelController" | ||
) | ||
|
||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:resource:scope=Cluster | ||
// +kubebuilder:validation:XValidation:rule="self.metadata.name == 'default-modelcontroller'",message="ModelController name must be default-modelcontroller" | ||
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`,description="Ready" | ||
// +kubebuilder:printcolumn:name="Reason",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].reason`,description="Reason" | ||
|
||
// ModelController is the Schema for the modelmeshservings API | ||
type ModelController struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ModelControllerSpec `json:"spec,omitempty"` | ||
Status ModelControllerStatus `json:"status,omitempty"` | ||
} | ||
|
||
// ModelControllerSpec defines the desired state of ModelController | ||
type ModelControllerSpec struct { | ||
// ModelControllerCommonSpec `json:",inline"` | ||
components.DevFlagsSpec `json:",inline"` | ||
ModelMeshServing operatorv1.ManagementState `json:"modelMeshServing,omitempty"` | ||
// TODO Kserve | ||
} | ||
|
||
type ModelControllerCommonSpec struct { | ||
components.DevFlagsSpec `json:",inline"` | ||
} | ||
|
||
// ModelControllerStatus defines the observed state of ModelController | ||
type ModelControllerStatus struct { | ||
components.Status `json:",inline"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// ModelControllerList contains a list of ModelController | ||
type ModelControllerList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ModelController `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&ModelController{}, &ModelControllerList{}) | ||
} | ||
|
||
func (c *ModelController) GetDevFlags() *components.DevFlags { return nil } | ||
|
||
func (c *ModelController) GetStatus() *components.Status { | ||
return &c.Status.Status | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.