wangao1236 commented on code in PR #175:
URL: https://github.com/apache/incubator-uniffle/pull/175#discussion_r954745773


##########
deploy/kubernetes/operator/api/uniffle/v1alpha1/remoteshuffleservice_types.go:
##########
@@ -18,49 +18,303 @@
 package v1alpha1
 
 import (
+       "k8s.io/api/autoscaling/v2beta2"
+       corev1 "k8s.io/api/core/v1"
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
+type ShuffleServerUpgradeStrategyType string
+
+const (
+       PartitionUpgrade ShuffleServerUpgradeStrategyType = "PartitionUpgrade"
+       SpecificUpgrade  ShuffleServerUpgradeStrategyType = "SpecificUpgrade"
+       FullUpgrade      ShuffleServerUpgradeStrategyType = "FullUpgrade"
+       FullRestart      ShuffleServerUpgradeStrategyType = "FullRestart"
+)
+
+type RSSPhase string
+
+const (
+       // RSSPending represents RSS object is pending.
+       RSSPending RSSPhase = "Pending"
+       // RSSRunning represents RSS object is running normally.
+       RSSRunning RSSPhase = "Running"
+       // RSSTerminating represents RSS object is terminating.
+       RSSTerminating RSSPhase = "Terminating"
+       // RSSFailed represents RSS object has been failed.
+       RSSFailed RSSPhase = "Failed"
+       // RSSUpgrading represents RSS object is upgrading.
+       RSSUpgrading RSSPhase = "Upgrading"
+)
+
 // EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
 // NOTE: json tags are required.  Any new fields you add must have json tags 
for the fields to be serialized.
 
-// RemoteshuffleserviceSpec defines the desired state of Remoteshuffleservice
-type RemoteshuffleserviceSpec struct {
-       // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
-       // Important: Run "make" to regenerate code after modifying this file
+// RemoteShuffleServiceSpec defines the desired state of RemoteShuffleService.
+type RemoteShuffleServiceSpec struct {
+       // Coordinator contains configurations of the coordinators.
+       Coordinator *CoordinatorConfig `json:"coordinator"`
 
-       // Foo is an example field of Remoteshuffleservice. Edit 
remoteshuffleservice_types.go to remove/update
-       Foo string `json:"foo,omitempty"`
+       // ShuffleServer contains configuration of the shuffle servers.
+       ShuffleServer *ShuffleServerConfig `json:"shuffleServer"`
+
+       // ConfigMapName indicates configMap name stores configurations of 
coordinators and shuffle servers.
+       ConfigMapName string `json:"configMapName"`
 }
 
-// RemoteshuffleserviceStatus defines the observed state of 
Remoteshuffleservice
-type RemoteshuffleserviceStatus struct {
+// CoordinatorConfig records configuration used to generate workload of 
coordination.
+type CoordinatorConfig struct {
+       *CommonConfig `json:",inline"`
+
+       // +kubebuilder:default:=true
+       // Sync indicates whether we need to sync configurations to the running 
coordinators.
+       // +optional
+       Sync *bool `json:"sync,omitempty"`
+
+       // +kubebuilder:default:=2
+       // Count is the number of coordinator workloads to be generated.
+       // +optional
+       Count *int32 `json:"count,omitempty"`
+
+       // +kubebuilder:default:=1
+       // Replicas is the initial replicas of coordinators.
+       // +optional
+       Replicas *int32 `json:"replicas,omitempty"`
+
+       // +kubebuilder:default:=19997
+       // RPCPort defines rpc port used by coordinators.
+       // +optional
+       RPCPort *int32 `json:"rpcPort,omitempty"`
+
+       // +kubebuilder:default:=19996
+       // HTTPPort defines http port used by coordinators.
+       // +optional
+       HTTPPort *int32 `json:"httpPort,omitempty"`
+
+       // +kubebuilder:default:=/config/exclude_nodes
+       // ExcludeNodesFilePath indicates exclude nodes file path in 
coordinators' containers.
+       // +optional
+       ExcludeNodesFilePath string `json:"excludeNodesFilePath,omitempty"`
+
+       // RPCNodePort defines rpc port of node port service used for 
coordinators' external access.
+       RPCNodePort []int32 `json:"rpcNodePort"`
+
+       // HTTPNodePort defines http port of node port service used for 
coordinators' external access.
+       HTTPNodePort []int32 `json:"httpNodePort"`
+}
+
+// ShuffleServerConfig records configuration used to generate workload of 
shuffle servers.
+type ShuffleServerConfig struct {
+       *CommonConfig `json:",inline"`
+
+       // +kubebuilder:default:=false
+       // Sync indicates whether we need to sync configurations to the running 
shuffle servers.
+       // +optional
+       Sync *bool `json:"sync,omitempty"`
+
+       // +kubebuilder:default:=1
+       // Replicas is the initial replicas of shuffle servers.
+       // +optional
+       Replicas *int32 `json:"replicas,omitempty"`
+
+       // +kubebuilder:default:=19997
+       // RPCPort defines rpc port used by shuffle servers.
+       // +optional
+       RPCPort *int32 `json:"rpcPort,omitempty"`
+
+       // +kubebuilder:default:=19996
+       // HTTPPort defines http port used by shuffle servers.
+       // +optional
+       HTTPPort *int32 `json:"httpPort,omitempty"`
+
+       // RPCNodePort defines rpc port of node port service used for shuffle 
servers' external access.
+       // +optional
+       RPCNodePort *int32 `json:"rpcNodePort,omitempty"`
+
+       // HTTPNodePort defines http port of node port service used for shuffle 
servers' external access.
+       // +optional
+       HTTPNodePort *int32 `json:"httpNodePort,omitempty"`
+
+       // UpgradeStrategy defines upgrade strategy of shuffle servers.
+       UpgradeStrategy *ShuffleServerUpgradeStrategy `json:"upgradeStrategy"`
+}
+
+// ShuffleServerUpgradeStrategy defines upgrade strategy of shuffle servers.
+type ShuffleServerUpgradeStrategy struct {
+       // Type represents upgrade type of shuffle servers, including 
partition, specific copy and full upgrade.
+       Type ShuffleServerUpgradeStrategyType `json:"type"`
+
+       // Partition means the minimum number that needs to be upgraded, the 
copies whose numbers are greater than or
+       // equal to this number needs to be upgraded.
+       // +optional
+       Partition *int32 `json:"partition,omitempty"`
+
+       // SpecificNames indicates the specific pod names of shuffle servers 
which we want to upgrade.
+       // +optional
+       SpecificNames []string `json:"specificNames,omitempty"`
+}
+
+// RSSAutoscaler describes the desired functionality of the HPA object to be 
generated,
+// which automatically manages the replica count of any resource implementing 
the scale
+// subresource based on the metrics specified.
+type RSSAutoscaler struct {

Review Comment:
   Ok, after discussion, I will remove this field first and add it in the 
future according to the requirements.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to