Skip to content

Commit

Permalink
feat: autoscaling for MonoVertex
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Wang <[email protected]>
  • Loading branch information
whynowy committed Aug 12, 2024
1 parent 2fce26a commit 908bcf6
Show file tree
Hide file tree
Showing 25 changed files with 1,547 additions and 17 deletions.
2 changes: 2 additions & 0 deletions hack/generate-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ gen-protoc(){

gen-protoc pkg/apis/proto/daemon/daemon.proto

gen-protoc pkg/apis/proto/mvtxdaemon/mvtxdaemon.proto

gen-protoc pkg/apis/proto/isb/message.proto

gen-protoc pkg/apis/proto/wmb/wmb.proto
Expand Down
20 changes: 20 additions & 0 deletions pkg/apis/numaflow/v1alpha1/mono_vertex_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ func (mv MonoVertex) GetDaemonDeploymentName() string {
return fmt.Sprintf("%s-mv-daemon", mv.Name)
}

func (mv MonoVertex) GetDaemonServiceURL() string {
return fmt.Sprintf("%s.%s.svc:%d", mv.GetDaemonServiceName(), mv.Namespace, MonoVertexDaemonServicePort)
}

func (mv MonoVertex) Scalable() bool {
return !mv.Spec.Scale.Disabled
}

func (mv MonoVertex) GetDaemonServiceObj() *corev1.Service {
labels := map[string]string{
KeyPartOf: Project,
Expand Down Expand Up @@ -518,6 +526,18 @@ func (mvs *MonoVertexStatus) MarkPhaseRunning() {
mvs.MarkPhase(MonoVertexPhaseRunning, "", "")
}

// IsHealthy indicates whether the MonoVertex is in healthy status
func (mvs *MonoVertexStatus) IsHealthy() bool {
switch mvs.Phase {
case MonoVertexPhaseFailed:
return false
case MonoVertexPhaseRunning:
return mvs.IsReady()
default:
return false
}
}

// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type MonoVertexList struct {
Expand Down
299 changes: 299 additions & 0 deletions pkg/apis/proto/mvtxdaemon/mvtxdaemon.pb.go

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

Loading

0 comments on commit 908bcf6

Please sign in to comment.