-
Notifications
You must be signed in to change notification settings - Fork 64
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 maxRetry and patch option #145
base: master
Are you sure you want to change the base?
feat: add maxRetry and patch option #145
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
c194290
to
46bf673
Compare
|
||
type Patch struct { | ||
// +optional | ||
Spec *v1alpha1.JobSpec `json:"spec,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.
Why do we need to store this field here? Can't we use the known information to get the original jobtemplate object? Or directly patch itself?
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.
In my usage scenario, I still need to Patch some information to replace the content of the JobTemplate. Avoid partial differences causing an explosion in the number of JobTemplates.
User case:
apiVersion: flow.volcano.sh/v1alpha1
kind: JobTemplate
metadata:
name: a
spec:
tasks:
- spec:
containers:
- image: tf2.16-cuda11-xxx:v1.0.1
command:
- sh
- -c
- ./script.py --dateset a.txt --mode 1
imagePullPolicy: IfNotPresent
name: nginx
resources:
requests:
cpu: "1"
restartPolicy: OnFailure
---
apiVersion: flow.volcano.sh/v1alpha1
kind: JobFlow
metadata:
name: test-flow1
namespace: default
spec:
jobRetainPolicy: delete
flows:
- name: a
---
apiVersion: flow.volcano.sh/v1alpha1
kind: JobFlow
metadata:
name: test-flow2
namespace: default
spec:
jobRetainPolicy: delete
- name: a
patch:
spec:
tasks:
- spec:
containers:
- image: tf2.16-cuda11-xxx:v1.0.2 # just different image
command:
- sh
- -c
- ./script.py --dateset b.txt --mode 2 # just different args
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.
sorry for this. I don't see what patch does. It seems to make the whole cr configuration more complicated.
291789f
to
08fef71
Compare
It doesn't look good. How about just adding a maxRetry field? |
type Flow struct {
// +kubebuilder:validation:MinLength=1
// +required
Name string `json:"name"`
// +optional
DependsOn *DependsOn `json:"dependsOn,omitempty"`
// +optional
MaxRetry *MaxRetry `json:"maxRetry,omitempty"`
} |
Signed-off-by: dongjiang <[email protected]>
cebc0eb
to
615f915
Compare
Thanks @hwdef @googs1025 |
ref: volcano-sh/volcano#3846