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(kserve): automates installation and configuration of KServe prerequisites #691

Merged
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1d7055f
Implement installation and configuration of KServe prerequisites
israel-hdez Nov 1, 2023
b971312
Fix feedback and finish TODOs
israel-hdez Nov 7, 2023
82b9ba5
Fix more feedback
israel-hdez Nov 7, 2023
4be6c25
Merge branch 'incubation' into kserve-mesh-serverless-prereq
bartoszmajsak Nov 8, 2023
470168d
chore: updates apis/dscinitialization/v1/servicemesh_types.go
bartoszmajsak Nov 8, 2023
cbc6d32
fix: renames imports after merge
bartoszmajsak Nov 8, 2023
6e7642b
Run make lint after merge with incubation
israel-hdez Nov 8, 2023
394b575
Fix more feedback
israel-hdez Nov 8, 2023
882ea26
Add unit tests for serverless feature
israel-hdez Nov 9, 2023
343f666
Merge branch 'incubation' into kserve-mesh-serverless-prereq
israel-hdez Nov 9, 2023
f77c763
Fix linter errors
israel-hdez Nov 9, 2023
4b5b005
Add unit tests for service mesh feature
israel-hdez Nov 10, 2023
9b75b63
wip: serverless as part of kserve
bartoszmajsak Nov 10, 2023
d753b4d
chore: removes identitytype from CRD
bartoszmajsak Nov 10, 2023
a13df5b
feat: ensures that serverless config is removed when KServe is enabled
bartoszmajsak Nov 10, 2023
b089fd6
chore: checks if service mesh is configured when serving is enabled
bartoszmajsak Nov 10, 2023
d384afe
fix: returns error on fail to remove serverless
bartoszmajsak Nov 10, 2023
2805355
chore(dsci): attempts to reduce test flakyness
bartoszmajsak Nov 10, 2023
bbeef9e
chore: removes misleading TODO
bartoszmajsak Nov 10, 2023
364b743
Fix Dockerfile
israel-hdez Nov 11, 2023
61fa9ff
Merge branch 'incubation' into kserve-mesh-serverless-prereq
israel-hdez Nov 11, 2023
a04fda3
chore: regenerates bundle
bartoszmajsak Nov 13, 2023
036abed
Merge branch 'incubation' into kserve-mesh-serverless-prereq
bartoszmajsak Nov 13, 2023
723b9d6
Feedback: fix zdtsw comments
israel-hdez Nov 13, 2023
503e2d8
Merge branch 'incubation' into kserve-mesh-serverless-prereq
bartoszmajsak Nov 14, 2023
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
3 changes: 2 additions & 1 deletion Dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ COPY components/ components/
COPY controllers/ controllers/
COPY main.go main.go
COPY pkg/ pkg/
COPY infrastructure/ infrastructure/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
Expand All @@ -51,4 +52,4 @@ RUN chown -R 1001:0 /opt/manifests &&\
chmod -R a+r /opt/manifests
USER 1001

ENTRYPOINT ["/manager"]
ENTRYPOINT ["/manager"]
1 change: 0 additions & 1 deletion apis/datasciencecluster/v1/zz_generated.deepcopy.go

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

53 changes: 11 additions & 42 deletions apis/dscinitialization/v1/dscinitialization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
conditionsv1 "github.com/openshift/custom-resource-status/conditions/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

infrav1 "github.com/opendatahub-io/opendatahub-operator/v2/infrastructure/v1"
)

// +operator-sdk:csv:customresourcedefinitions:order=1
Expand All @@ -35,9 +37,17 @@ type DSCInitializationSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=2
// +optional
Monitoring Monitoring `json:"monitoring,omitempty"`
// Configures Service Mesh as networking layer for Data Science Clusters components.
// The Service Mesh is a mandatory prerequisite for single model serving (KServe) and
// you should review this configuration if you are planning to use KServe.
// For other components, it enhances user experience; e.g. it provides unified
// authentication giving a Single Sign On experience.
bartoszmajsak marked this conversation as resolved.
Show resolved Hide resolved
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=3
// +optional
ServiceMesh infrav1.ServiceMeshSpec `json:"serviceMesh,omitempty"`
// Internal development useful field to test customizations.
// This is not recommended to be used in production environment.
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=3
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=4
// +optional
DevFlags DevFlags `json:"devFlags,omitempty"`
}
Expand Down Expand Up @@ -107,50 +117,9 @@ type DSCInitializationList struct {
Items []DSCInitialization `json:"items"`
}

// FeatureTracker is a cluster-scoped resource for tracking objects
// created through Features API for Data Science Platform.
// It's primarily used as owner reference for resources created across namespaces so that they can be
// garbage collected by Kubernetes when they're not needed anymore.
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster
type FeatureTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec FeatureTrackerSpec `json:"spec,omitempty"`
Status FeatureTrackerStatus `json:"status,omitempty"`
}

func (s *FeatureTracker) ToOwnerReference() metav1.OwnerReference {
return metav1.OwnerReference{
APIVersion: s.APIVersion,
Kind: s.Kind,
Name: s.Name,
UID: s.UID,
}
}

// FeatureTrackerSpec defines the desired state of FeatureTracker.
type FeatureTrackerSpec struct {
}

// FeatureTrackerStatus defines the observed state of FeatureTracker.
type FeatureTrackerStatus struct {
}

// +kubebuilder:object:root=true

// FeatureTrackerList contains a list of FeatureTracker.
type FeatureTrackerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []FeatureTracker `json:"items"`
}

func init() {
SchemeBuilder.Register(
&DSCInitialization{},
&DSCInitializationList{},
&FeatureTracker{},
&FeatureTrackerList{},
)
}
91 changes: 1 addition & 90 deletions apis/dscinitialization/v1/zz_generated.deepcopy.go

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

52 changes: 52 additions & 0 deletions apis/features/v1/features_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package v1

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

// FeatureTracker represents a cluster-scoped resource in the Data Science Cluster,
// specifically designed for monitoring and managing objects created via the internal Features API.
// This resource serves a crucial role in cross-namespace resource management, acting as
// an owner reference for various resources. The primary purpose of the FeatureTracker
// is to enable efficient garbage collection by Kubernetes. This is essential for
// ensuring that resources are automatically cleaned up and reclaimed when they are
// no longer required.
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster
type FeatureTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec FeatureTrackerSpec `json:"spec,omitempty"`
Status FeatureTrackerStatus `json:"status,omitempty"`
}

func (s *FeatureTracker) ToOwnerReference() metav1.OwnerReference {
return metav1.OwnerReference{
APIVersion: s.APIVersion,
Kind: s.Kind,
Name: s.Name,
UID: s.UID,
}
}

// FeatureTrackerSpec defines the desired state of FeatureTracker.
type FeatureTrackerSpec struct {
}

// FeatureTrackerStatus defines the observed state of FeatureTracker.
type FeatureTrackerStatus struct {
}

// +kubebuilder:object:root=true

// FeatureTrackerList contains a list of FeatureTracker.
type FeatureTrackerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []FeatureTracker `json:"items"`
}

func init() {
SchemeBuilder.Register(
&FeatureTracker{},
&FeatureTrackerList{},
)
}
37 changes: 37 additions & 0 deletions apis/features/v1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
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.
*/

// +kubebuilder:object:generate=true
// +groupName=features.opendatahub.io

// Package v1 contains API Schema definitions for the datasciencecluster v1 API group
package v1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects.
GroupVersion = schema.GroupVersion{Group: "features.opendatahub.io", Version: "v1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
Loading
Loading