-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add design docs for dataflow affinity using any preceding data operations #68
Conversation
…operations Signed-off-by: xliuqq <[email protected]>
name: step1-download-model | ||
namespace: default | ||
... | ||
--- |
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.
可以提供一个affinity依赖上一个dataProcess的例子。
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.
已提供
## 设计 | ||
|
||
> 字段改动,因此当前设计对 v1.0.1 和 v1.0.2 的 DataFlow Affinity 不兼容。 | ||
> |
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.
是否可以定义一个通用的结构体 ObjectRef 来包含引用操作的必要字段, 这样来保持向前兼容:
type ObjectRef struct {
// API version of the referent operation
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// Kind specifies the type of the referent operation
// +required
// +kubebuilder:validation:Enum=DataLoad;DataBackup;DataMigrate;DataProcess
Kind string `json:"kind"`
// Name specifies the name of the referent operation
// +required
Name string `json:"name"`
// Namespace specifies the namespace of the referent operation.
// +optional
Namespace string `json:"namespace,omitempty"`
}
在其他结构体中使用 ObjectRef
然后,在需要引用操作的地方使用这个通用结构体。例如,在 OperationRef 和 AffinityStrategy 中使用 ObjectRef:
type OperationRef struct {
ObjectRef `json:",inline"`
// AffinityStrategy specifies the pod affinity strategy with the referent operation.
// +optional
AffinityStrategy AffinityStrategy `json:"affinityStrategy,omitempty"`
}
type AffinityStrategy struct {
// Specifies the dependent preceding operation in a workflow. If not set, use `RunAfter` field.
// +optional
DependOn *ObjectRef `json:"dependOn,omitempty"`
// Policy one of: "", "Require", "Prefer"
// +optional
Policy AffinityPolicy `json:"policy,omitempty"`
Prefers []Prefer `json:"prefers,omitempty"`
Requires []Require `json:"requires,omitempty"`
}
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.
我的疑问是:
是否保留 AffinityStrategy 定义在 RunAfter: OperationRef
里面?如果是的话,就可以兼容,抽象出 ObjectRef。
@cheyang
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.
我倾向于AffinityStrategy放在OperationRef中,因为不想提供单独AffinityStrategy,也有含义,也是有runAfter的语义。FYI @TrafalgarZZZ
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.
已修改。
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.
是否可以定义一个通用的结构体 ObjectRef 来包含引用操作的必要字段, 这样来保持向前兼容:
type ObjectRef struct { // API version of the referent operation // +optional APIVersion string `json:"apiVersion,omitempty"` // Kind specifies the type of the referent operation // +required // +kubebuilder:validation:Enum=DataLoad;DataBackup;DataMigrate;DataProcess Kind string `json:"kind"` // Name specifies the name of the referent operation // +required Name string `json:"name"` // Namespace specifies the namespace of the referent operation. // +optional Namespace string `json:"namespace,omitempty"` }在其他结构体中使用 ObjectRef 然后,在需要引用操作的地方使用这个通用结构体。例如,在 OperationRef 和 AffinityStrategy 中使用 ObjectRef:
type OperationRef struct { ObjectRef `json:",inline"` // AffinityStrategy specifies the pod affinity strategy with the referent operation. // +optional AffinityStrategy AffinityStrategy `json:"affinityStrategy,omitempty"` } type AffinityStrategy struct { // Specifies the dependent preceding operation in a workflow. If not set, use `RunAfter` field. // +optional DependOn *ObjectRef `json:"dependOn,omitempty"` // Policy one of: "", "Require", "Prefer" // +optional Policy AffinityPolicy `json:"policy,omitempty"` Prefers []Prefer `json:"prefers,omitempty"` Requires []Require `json:"requires,omitempty"` }
这个对于inline
字段对于 java/python SDK 是否需要修改?SDK 能兼容吗?
metadata: | ||
name: step2-trtllm-convert | ||
# exposed affinity which will be filled in OperationStatus. | ||
fluid.io/affinity.labels: "node.kubernetes.io/instance-type" |
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.
data-operation.fluid.io/affinity.labels如何?
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.
兼容原先的标签吗?
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.
先不用兼容,因为这个功能还没有人真正使用。
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.
好的
Signed-off-by: xliuqq <[email protected]>
@cheyang @TrafalgarZZZ 是否还有其它的问题? |
add design docs for dataflow affinity using any preceding data operations