Skip to content

Commit

Permalink
feature: hpa for jointinference
Browse files Browse the repository at this point in the history
Signed-off-by: ming.tang <[email protected]>
  • Loading branch information
tangming1996 committed Dec 16, 2024
1 parent 6f0b2a4 commit ed93801
Show file tree
Hide file tree
Showing 1,456 changed files with 118,229 additions and 50,991 deletions.
885 changes: 635 additions & 250 deletions build/crds/sedna.io_featureextractionservices.yaml

Large diffs are not rendered by default.

1,898 changes: 1,355 additions & 543 deletions build/crds/sedna.io_federatedlearningjobs.yaml

Large diffs are not rendered by default.

2,865 changes: 2,007 additions & 858 deletions build/crds/sedna.io_incrementallearningjobs.yaml

Large diffs are not rendered by default.

3,356 changes: 2,710 additions & 646 deletions build/crds/sedna.io_jointinferenceservices.yaml

Large diffs are not rendered by default.

2,865 changes: 2,007 additions & 858 deletions build/crds/sedna.io_lifelonglearningjobs.yaml

Large diffs are not rendered by default.

2,853 changes: 2,024 additions & 829 deletions build/crds/sedna.io_objectsearchservices.yaml

Large diffs are not rendered by default.

1,898 changes: 1,355 additions & 543 deletions build/crds/sedna.io_objecttrackingservices.yaml

Large diffs are not rendered by default.

917 changes: 651 additions & 266 deletions build/crds/sedna.io_reidjobs.yaml

Large diffs are not rendered by default.

917 changes: 651 additions & 266 deletions build/crds/sedna.io_videoanalyticsjobs.yaml

Large diffs are not rendered by default.

75 changes: 38 additions & 37 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,50 @@ require (
github.com/gorilla/websocket v1.4.2
github.com/microcosm-cc/bluemonday v1.0.18
github.com/minio/minio-go/v7 v7.0.10
github.com/onsi/ginkgo v1.11.0
github.com/onsi/gomega v1.7.0
github.com/spf13/cobra v1.1.1
github.com/onsi/ginkgo v1.14.0
github.com/onsi/gomega v1.10.1
github.com/spf13/cobra v1.2.1
github.com/spf13/pflag v1.0.5
gorm.io/driver/sqlite v1.1.4
gorm.io/gorm v1.20.9
k8s.io/api v0.21.4
k8s.io/apimachinery v0.21.4
k8s.io/client-go v0.21.4
k8s.io/code-generator v0.21.4
k8s.io/component-base v0.21.4
k8s.io/klog/v2 v2.8.0
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7
k8s.io/kubernetes v1.21.4
k8s.io/api v0.23.0
k8s.io/apimachinery v0.23.0
k8s.io/client-go v0.23.0
k8s.io/code-generator v0.23.0
k8s.io/component-base v0.23.0
k8s.io/klog/v2 v2.30.0
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65
k8s.io/kubernetes v1.23.0
sigs.k8s.io/yaml v1.2.0
)

replace (
// https://github.com/kubernetes/kubernetes/issues/79384
k8s.io/api => k8s.io/api v0.21.4
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.21.4
k8s.io/apimachinery => k8s.io/apimachinery v0.21.4
k8s.io/apiserver => k8s.io/apiserver v0.21.4
k8s.io/cli-runtime => k8s.io/cli-runtime v0.21.4
k8s.io/client-go => k8s.io/client-go v0.21.4
k8s.io/cloud-provider => k8s.io/cloud-provider v0.21.4
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.21.4
k8s.io/code-generator => k8s.io/code-generator v0.21.4
k8s.io/component-base => k8s.io/component-base v0.21.4
k8s.io/component-helpers => k8s.io/component-helpers v0.21.4
k8s.io/controller-manager => k8s.io/controller-manager v0.21.4
k8s.io/cri-api => k8s.io/cri-api v0.21.4
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.21.4
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.21.4
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.21.4
k8s.io/kube-proxy => k8s.io/kube-proxy v0.21.4
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.21.4
k8s.io/kubectl => k8s.io/kubectl v0.21.4
k8s.io/kubelet => k8s.io/kubelet v0.21.4
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.21.4
k8s.io/metrics => k8s.io/metrics v0.21.4
k8s.io/mount-utils => k8s.io/mount-utils v0.21.4
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.21.4
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.21.4
k8s.io/sample-controller => k8s.io/sample-controller v0.21.4
k8s.io/api => k8s.io/api v0.23.0
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.23.0
k8s.io/apimachinery => k8s.io/apimachinery v0.23.0
k8s.io/apiserver => k8s.io/apiserver v0.23.0
k8s.io/cli-runtime => k8s.io/cli-runtime v0.23.0
k8s.io/client-go => k8s.io/client-go v0.23.0
k8s.io/cloud-provider => k8s.io/cloud-provider v0.23.0
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.23.0
k8s.io/code-generator => k8s.io/code-generator v0.23.0
k8s.io/component-base => k8s.io/component-base v0.23.0
k8s.io/component-helpers => k8s.io/component-helpers v0.23.0
k8s.io/controller-manager => k8s.io/controller-manager v0.23.0
k8s.io/cri-api => k8s.io/cri-api v0.23.0
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.23.0
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.23.0
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.23.0
k8s.io/kube-proxy => k8s.io/kube-proxy v0.23.0
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.23.0
k8s.io/kubectl => k8s.io/kubectl v0.23.0
k8s.io/kubelet => k8s.io/kubelet v0.23.0
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.23.0
k8s.io/metrics => k8s.io/metrics v0.23.0
k8s.io/mount-utils => k8s.io/mount-utils v0.23.0
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.23.0
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.0
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.23.0
k8s.io/sample-controller => k8s.io/sample-controller v0.23.0
)
713 changes: 432 additions & 281 deletions go.sum

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions pkg/apis/sedna/v1alpha1/jointinferenceservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1

import (
autoscalingv2 "k8s.io/api/autoscaling/v2"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand All @@ -42,17 +43,56 @@ type JointInferenceServiceSpec struct {
CloudWorker CloudWorker `json:"cloudWorker"`
}

// HPA describes the desired functionality of the HorizontalPodAutoscaler.
type HPA struct {
// minReplicas is the lower limit for the number of replicas to which the autoscaler
// can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the
// alpha feature gate HPAScaleToZero is enabled and at least one Object or External
// metric is configured. Scaling is active as long as at least one metric value is
// available.
// +optional
MinReplicas *int32 `json:"minReplicas,omitempty"`

// maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
// It cannot be less that minReplicas.
MaxReplicas int32 `json:"maxReplicas"`

// metrics contains the specifications for which to use to calculate the
// desired replica count (the maximum replica count across all metrics will
// be used). The desired replica count is calculated multiplying the
// ratio between the target value and the current value by the current
// number of pods. Ergo, metrics used must decrease as the pod count is
// increased, and vice-versa. See the individual metric source types for
// more information about how each type of metric must respond.
// +optional
Metrics []autoscalingv2.MetricSpec `json:"metrics,omitempty"`

// behavior configures the scaling behavior of the target
// in both Up and Down directions (scaleUp and scaleDown fields respectively).
// If not set, the default HPAScalingRules for scale up and scale down are used.
// +optional
Behavior *autoscalingv2.HorizontalPodAutoscalerBehavior `json:"behavior,omitempty"`
}

// EdgeWorker describes the data a edge worker should have
type EdgeWorker struct {
Model SmallModel `json:"model"`
HardExampleMining HardExampleMining `json:"hardExampleMining"`
Template v1.PodTemplateSpec `json:"template"`

// HPA describes the desired functionality of the HorizontalPodAutoscaler.
// +optional
HPA *HPA `json:"hpa"`
}

// CloudWorker describes the data a cloud worker should have
type CloudWorker struct {
Model BigModel `json:"model"`
Template v1.PodTemplateSpec `json:"template"`

// HPA describes the desired functionality of the HorizontalPodAutoscaler.
// +optional
HPA *HPA `json:"hpa"`
}

// SmallModel describes the small model
Expand Down
45 changes: 45 additions & 0 deletions pkg/apis/sedna/v1alpha1/zz_generated.deepcopy.go

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

34 changes: 27 additions & 7 deletions pkg/client/clientset/versioned/clientset.go

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

5 changes: 4 additions & 1 deletion pkg/client/clientset/versioned/fake/clientset_generated.go

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

14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/fake/register.go

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

14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/scheme/register.go

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

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

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

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

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

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

Loading

0 comments on commit ed93801

Please sign in to comment.