-
Notifications
You must be signed in to change notification settings - Fork 57
[slice] Rename states + add timeout #810
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
base: slice-main
Are you sure you want to change the base?
Changes from all commits
6843811
ed3cdda
b7ddc1d
c4bd76b
074a33a
890f1bc
6f6093d
8e7ca0a
55f4c9c
bf39be9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,15 +21,25 @@ import ( | |||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||||||||||||
| type Type string | ||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe like this?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the slice API, this is just copying the canonical version of this API (exists in some doc), and we need to match that.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like this
Suggested change
|
||||||||||||
|
|
||||||||||||
| const ( | ||||||||||||
| TypeV6e Type = "v6e" | ||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we relax validation for it in IsValidTPUAccelerator()?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will need to implement logic supporting v6 before relaxing this. |
||||||||||||
| TypeTpu7x Type = "tpu-v7x" | ||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| // SliceSpec defines the desired state of Slice. | ||||||||||||
| type SliceSpec struct { | ||||||||||||
| // AcceleratorType specifies the type of accelerator used in this slice. | ||||||||||||
| // Type specifies the type of accelerator used in this slice, e.g., "v6e", "tpu-v7x". | ||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| // +kubebuilder:validation:Immutable | ||||||||||||
| Type string `json:"type"` | ||||||||||||
| // +kubebuilder:validation:Enum=v6e;tpu-v7x | ||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move this validation to type? |
||||||||||||
| Type Type `json:"type"` | ||||||||||||
|
|
||||||||||||
| // Topology represents the network topology of the slice. | ||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| // It defines the physical arrangement of TPU chips in a 2D or 3D mesg. | ||||||||||||
| // The topology must be specified in `<X>x<Y>` or `<X>x<Y>x<Z>` format. | ||||||||||||
| // +kubebuilder:validation:Immutable | ||||||||||||
| // +kubebuilder:validation:Pattern=^\d+x\d+(x\d+)?$ | ||||||||||||
| Topology string `json:"topology"` | ||||||||||||
|
|
||||||||||||
| // Partition Ids denotes the set of partitions to use to form a slice | ||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also the same for status. |
||||||||||||
|
|
@@ -55,7 +65,7 @@ type SliceStatus struct { | |||||||||||
| // +kubebuilder:subresource:status | ||||||||||||
| // +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.type` | ||||||||||||
| // +kubebuilder:printcolumn:name="Topology",type=string,JSONPath=`.spec.topology` | ||||||||||||
| // +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[0].type` | ||||||||||||
| // +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].reason` | ||||||||||||
| // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" | ||||||||||||
| // Slice is the Schema for the slices API. | ||||||||||||
| type Slice struct { | ||||||||||||
|
|
@@ -75,22 +85,10 @@ type SliceList struct { | |||||||||||
| Items []Slice `json:"items"` | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| // SliceConditionType defines the type of condition | ||||||||||||
| type SliceConditionType string | ||||||||||||
|
|
||||||||||||
| const ( | ||||||||||||
| // Forming means the slice is being created and configured. | ||||||||||||
| Forming SliceConditionType = "Forming" | ||||||||||||
| // Ready means the slice is fully operational. | ||||||||||||
| Ready SliceConditionType = "Ready" | ||||||||||||
| // Degraded means the slice is operational but with reduced capacity or performance. | ||||||||||||
| Degraded SliceConditionType = "Degraded" | ||||||||||||
| // Deformed means the slice is being torn down. | ||||||||||||
| Deformed SliceConditionType = "Deformed" | ||||||||||||
| // Error means the slice has encountered an error and is not operational. | ||||||||||||
| Error SliceConditionType = "Error" | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| func init() { | ||||||||||||
| SchemeBuilder.Register(&Slice{}, &SliceList{}) | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| const ( | ||||||||||||
| SliceStateConditionType = "Ready" | ||||||||||||
| ) | ||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this note related to Type. Can we add some space between to avoid confusion?