Skip to content

pytorchjob-generator: add successTTLDuration #129

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

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tools/pytorchjob-generator/chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ customize the Jobs generated by the tool.
| failureGracePeriodDuration | string | The AppWrapper defaults will be used | Customize the failureGracePeriod; see https://project-codeflare.github.io/appwrapper/arch-fault-tolerance/ |
| retryPausePeriodDuration | string | The AppWrapper defaults will be used | Customize the retryPausePeriod; see https://project-codeflare.github.io/appwrapper/arch-fault-tolerance/ |
| retryLimit | integer | The AppWrapper defaults will be used | Customize the retryLimit; see https://project-codeflare.github.io/appwrapper/arch-fault-tolerance/ |
| forcefulDeletionGracePeriodDuration | string | The AppWrapper defaults will be used | Customize the forcefulDelectionGracePeriod; see https://project-codeflare.github.io/appwrapper/arch-fault-tolerance/ |
| forcefulDeletionGracePeriodDuration | string | The AppWrapper defaults will be used | Customize the forcefulDeletionGracePeriod; see https://project-codeflare.github.io/appwrapper/arch-fault-tolerance/ |
| deletionOnFailureGracePeriodDuration | string | The AppWrapper defaults will be used | Customize the deletionOnFailureGracePeriod; see https://project-codeflare.github.io/appwrapper/arch-fault-tolerance/ |
| restartPolicy | string | `"Never"` | Set Kubernertes policy for restarting failed containers "in place" (without restarting the Pod). |
| successTTLDuration | string | The AppWrapper defaults will be used | Customize the successTTL; see https://project-codeflare.github.io/appwrapper/arch-fault-tolerance/ |
| restartPolicy | string | `"Never"` | Set Kubernetes policy for restarting failed containers "in place" (without restarting the Pod). |
| terminationGracePeriodSeconds | integer | Kubernetes's default value is used | Set a non-default pod termination grace period (in seconds). |
3 changes: 3 additions & 0 deletions tools/pytorchjob-generator/chart/templates/appwrapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ metadata:
{{- if .Values.deletionOnFailureGracePeriodDuration }}
workload.codeflare.dev.appwrapper/deletionOnFailureGracePeriodDuration: "{{ .Values.deletionOnFailureGracePeriodDuration }}"
{{- end }}
{{- if .Values.successTTLDuration }}
workload.codeflare.dev.appwrapper/successTTLDuration: "{{ .Values.successTTLDuration }}"
{{- end }}
{{- if or .Values.queueName .Values.customLabels }}
labels:
{{- if .Values.queueName }}
Expand Down
2 changes: 2 additions & 0 deletions tools/pytorchjob-generator/chart/tests/helloworld_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ tests:
retryLimit: 42
forcefulDeletionGracePeriodDuration: "19s"
deletionOnFailureGracePeriodDuration: "2s"
successTTLDuration: "600s"
asserts:
- isSubset:
path: metadata.annotations
Expand All @@ -197,6 +198,7 @@ tests:
workload.codeflare.dev.appwrapper/retryLimit: "42"
workload.codeflare.dev.appwrapper/forcefulDeletionGracePeriodDuration: "19s"
workload.codeflare.dev.appwrapper/deletionOnFailureGracePeriodDuration: "2s"
workload.codeflare.dev.appwrapper/successTTLDuration: "600s"

- it: Setting integer fault tolerance annotation to 0
set:
Expand Down
4 changes: 4 additions & 0 deletions tools/pytorchjob-generator/chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@
"deletionOnFailureGracePeriodDuration" : { "oneOf" : [
{ "type": "null" },
{ "$ref": "#/$defs/duration" }
]},
"successTTLDuration" : { "oneOf" : [
{ "type": "null" },
{ "$ref": "#/$defs/duration" }
]}
},

Expand Down
9 changes: 7 additions & 2 deletions tools/pytorchjob-generator/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ retryPausePeriodDuration:
# @default -- The AppWrapper defaults will be used
retryLimit:

# -- (string) Customize the forcefulDelectionGracePeriod; see https://project-codeflare.github.io/appwrapper/arch-fault-tolerance/
# -- (string) Customize the forcefulDeletionGracePeriod; see https://project-codeflare.github.io/appwrapper/arch-fault-tolerance/
# @section -- Fault Tolerance
# @default -- The AppWrapper defaults will be used
forcefulDeletionGracePeriodDuration:
Expand All @@ -265,7 +265,12 @@ forcefulDeletionGracePeriodDuration:
# @default -- The AppWrapper defaults will be used
deletionOnFailureGracePeriodDuration:

# -- (string) Set Kubernertes policy for restarting failed containers "in place" (without restarting the Pod).
# -- (string) Customize the successTTL; see https://project-codeflare.github.io/appwrapper/arch-fault-tolerance/
# @section -- Fault Tolerance
# @default -- The AppWrapper defaults will be used
successTTLDuration:

# -- (string) Set Kubernetes policy for restarting failed containers "in place" (without restarting the Pod).
# @section -- Fault Tolerance
restartPolicy: "Never"

Expand Down