Skip to content

Commit

Permalink
allow queue-name label to be disabled (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrove-oss authored Oct 22, 2024
1 parent c990de5 commit 6fc8d97
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tools/pytorchjob-generator/chart/templates/appwrapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,13 @@ metadata:
{{- if .Values.deletionOnFailureGracePeriodDuration }}
workload.codeflare.dev.appwrapper/deletionOnFailureGracePeriodDuration: "{{ .Values.deletionOnFailureGracePeriodDuration }}"
{{- end }}
{{- if or .Values.queueName .Values.customLabels }}
labels:
{{- if .Values.queueName }}
kueue.x-k8s.io/queue-name: {{ .Values.queueName }}
{{- end }}
{{- include "mlbatch.customLabels" . | indent 8 }}
{{- end }}
spec:
components:
- template:
Expand Down
9 changes: 8 additions & 1 deletion tools/pytorchjob-generator/chart/tests/helloworld_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ tests:
- isEmpty:
path: spec.components[0].template.spec.pytorchReplicaSpecs.Worker.template.spec.containers[0].volumeMounts

- it: queueName can be disabled
set:
queueName:
asserts:
- notExists:
path: metadata.labels

- it: Enabling sshGitConfig injects the envvars, volumes, and volumeMounts
set:
sshGitCloneConfig.secretName: my-git-secret
Expand Down Expand Up @@ -157,7 +164,7 @@ tests:
workload.codeflare.dev.appwrapper/forcefulDeletionGracePeriodDuration: "19s"
workload.codeflare.dev.appwrapper/deletionOnFailureGracePeriodDuration: "2s"

- it: Setting jsut one tolerance annotation
- it: Setting just one tolerance annotation
set:
deletionOnFailureGracePeriodDuration: "6h"
asserts:
Expand Down
5 changes: 4 additions & 1 deletion tools/pytorchjob-generator/chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"properties": {
"namespace": { "$ref": "#/$defs/rfc1123Label" },
"jobName": { "type": "string" },
"queueName": { "$ref": "#/$defs/rfc1123Label" },
"queueName": { "oneOf": [
{ "type": "null" },
{ "$ref": "#/$defs/rfc1123Label" }
]},
"priority": { "type": "string", "enum": [ "default-priority", "low-priority", "high-priority" ] },
"customLabels": { "oneOf": [
{ "type": "null" },
Expand Down

0 comments on commit 6fc8d97

Please sign in to comment.