Skip to content

Commit

Permalink
Update the spec names
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffwan committed Aug 28, 2024
1 parent dc497d2 commit f6be5ea
Show file tree
Hide file tree
Showing 7 changed files with 16,065 additions and 7,025 deletions.
3 changes: 2 additions & 1 deletion api/orchestration/v1alpha1/rayclusterfleet_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 (
rayclusterv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -39,7 +40,7 @@ type RayClusterFleetSpec struct {

// Template describes the pods that will be created.
// The only allowed template.spec.restartPolicy value is "Always".
Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"`
Template rayclusterv1.RayClusterSpec `json:"template" protobuf:"bytes,3,opt,name=template"`

// The deployment strategy to use to replace existing pods with new ones.
// +optional
Expand Down
2 changes: 1 addition & 1 deletion api/orchestration/v1alpha1/rayclusterreplicaset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type RayClusterReplicaSetSpec struct {
// insufficient replicas are detected.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
// +optional
RayClusterSpec *rayclusterv1.RayClusterSpec `json:"rayClusterSpec,omitempty"`
Template rayclusterv1.RayClusterSpec `json:"template,omitempty"`
}

// RayClusterReplicaSetStatus defines the observed state of RayClusterReplicaSet
Expand Down
7 changes: 1 addition & 6 deletions api/orchestration/v1alpha1/zz_generated.deepcopy.go

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

22,900 changes: 15,942 additions & 6,958 deletions config/crd/bases/orchestration.aibrix.ai_rayclusterfleets.yaml

Large diffs are not rendered by default.

114 changes: 57 additions & 57 deletions config/crd/bases/orchestration.aibrix.ai_rayclusterreplicasets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,63 @@ spec:
Defaults to 0 (pod will be considered available as soon as it is ready)
format: int32
type: integer
rayClusterSpec:
replicas:
description: |-
Replicas is the number of desired replicas.
This is a pointer to distinguish between explicit zero and unspecified.
Defaults to 1.
More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
format: int32
type: integer
selector:
description: |-
Selector is a label query over RayCluster that should match the replica count.
Label keys and values that must match in order to be controlled by this replica set.
It must match the pod template's labels.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
template:
description: |-
Template is the object that describes the pod that will be created if
insufficient replicas are detected.
Expand Down Expand Up @@ -16512,62 +16568,6 @@ spec:
required:
- headGroupSpec
type: object
replicas:
description: |-
Replicas is the number of desired replicas.
This is a pointer to distinguish between explicit zero and unspecified.
Defaults to 1.
More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
format: int32
type: integer
selector:
description: |-
Selector is a label query over RayCluster that should match the replica count.
Label keys and values that must match in order to be controlled by this replica set.
It must match the pod template's labels.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
required:
- selector
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ package rayclusterfleet
import (
"context"

rayclusterv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -51,7 +55,35 @@ var _ = Describe("RayClusterFleet Controller", func() {
Name: resourceName,
Namespace: "default",
},
// TODO(user): Specify other spec details if needed.
Spec: orchestrationv1alpha1.RayClusterFleetSpec{
MinReadySeconds: 0,
Strategy: appsv1.DeploymentStrategy{
Type: appsv1.RollingUpdateDeploymentStrategyType,
},
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"foot": "bar",
},
},
Template: rayclusterv1.RayClusterSpec{
HeadGroupSpec: rayclusterv1.HeadGroupSpec{
ServiceType: corev1.ServiceTypeClusterIP,
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "test",
Image: "test-image",
},
},
},
},
RayStartParams: map[string]string{},
},
RayVersion: "fake-ray-version",
HeadServiceAnnotations: map[string]string{},
},
},
}
Expect(k8sClient.Create(ctx, resource)).To(Succeed())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ package rayclusterreplicaset
import (
"context"

rayclusterv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
corev1 "k8s.io/api/core/v1"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -51,7 +54,32 @@ var _ = Describe("RayClusterReplicaSet Controller", func() {
Name: resourceName,
Namespace: "default",
},
// TODO(user): Specify other spec details if needed.
Spec: orchestrationv1alpha1.RayClusterReplicaSetSpec{
MinReadySeconds: 0,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"foot": "bar",
},
},
Template: rayclusterv1.RayClusterSpec{
HeadGroupSpec: rayclusterv1.HeadGroupSpec{
ServiceType: corev1.ServiceTypeClusterIP,
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "test",
Image: "test-image",
},
},
},
},
RayStartParams: map[string]string{},
},
RayVersion: "fake-ray-version",
HeadServiceAnnotations: map[string]string{},
},
},
}
Expect(k8sClient.Create(ctx, resource)).To(Succeed())
}
Expand Down

0 comments on commit f6be5ea

Please sign in to comment.