Skip to content

Commit adcea8e

Browse files
authored
chore: run yamlft pre-commit hook (#3729)
only on `ray-operator/config/samples` dir to keep YAML formatting consistent. Signed-off-by: David Xia <[email protected]>
1 parent 848d400 commit adcea8e

File tree

53 files changed

+1750
-1748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1750
-1748
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ repos:
7575
- --ignore=.github/pull_request_template.md
7676
- --disable=MD033
7777

78+
- repo: https://github.com/google/yamlfmt
79+
rev: v0.17.0
80+
hooks:
81+
- id: yamlfmt
82+
files: ^ray-operator/config/samples/
83+
7884
- repo: https://github.com/norwoodj/helm-docs
7985
rev: v1.14.2
8086
hooks:

.yamlfmt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
formatter:
2+
indentless_arrays: true
3+
retain_line_breaks: true

ray-operator/config/samples/pytorch-mnist/ray-job.pytorch-mnist.yaml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,38 @@ spec:
2323
template:
2424
spec:
2525
containers:
26-
- name: ray-head
27-
image: rayproject/ray:2.46.0
28-
ports:
29-
- containerPort: 6379
30-
name: gcs-server
31-
- containerPort: 8265 # Ray dashboard
32-
name: dashboard
33-
- containerPort: 10001
34-
name: client
35-
resources:
36-
limits:
37-
cpu: "1"
38-
memory: "4Gi"
39-
requests:
40-
cpu: "1"
41-
memory: "4Gi"
26+
- name: ray-head
27+
image: rayproject/ray:2.46.0
28+
ports:
29+
- containerPort: 6379
30+
name: gcs-server
31+
- containerPort: 8265 # Ray dashboard
32+
name: dashboard
33+
- containerPort: 10001
34+
name: client
35+
resources:
36+
limits:
37+
cpu: "1"
38+
memory: "4Gi"
39+
requests:
40+
cpu: "1"
41+
memory: "4Gi"
4242
workerGroupSpecs:
43-
- replicas: 2
44-
minReplicas: 1
45-
maxReplicas: 5
46-
groupName: small-group
47-
rayStartParams: {}
48-
# Pod template
49-
template:
50-
spec:
51-
containers:
52-
- name: ray-worker
53-
image: rayproject/ray:2.46.0
54-
resources:
55-
limits:
56-
cpu: "3"
57-
memory: "4Gi"
58-
requests:
59-
cpu: "3"
60-
memory: "4Gi"
43+
- replicas: 2
44+
minReplicas: 1
45+
maxReplicas: 5
46+
groupName: small-group
47+
rayStartParams: {}
48+
# Pod template
49+
template:
50+
spec:
51+
containers:
52+
- name: ray-worker
53+
image: rayproject/ray:2.46.0
54+
resources:
55+
limits:
56+
cpu: "3"
57+
memory: "4Gi"
58+
requests:
59+
cpu: "3"
60+
memory: "4Gi"

ray-operator/config/samples/pytorch-resnet-image-classifier/ray-job.pytorch-image-classifier.yaml

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -30,82 +30,82 @@ spec:
3030
spec:
3131
serviceAccountName: pytorch-distributed-training
3232
containers:
33-
- name: ray-head
34-
image: rayproject/ray:2.46.0
35-
env:
36-
- name: NUM_WORKERS
37-
value: "4"
38-
ports:
39-
- containerPort: 6379
40-
name: gcs-server
41-
- containerPort: 8265
42-
name: dashboard
43-
- containerPort: 10001
44-
name: client
45-
resources:
46-
limits:
47-
cpu: "1"
48-
memory: "8G"
49-
requests:
50-
cpu: "1"
51-
memory: "8G"
52-
volumeMounts:
53-
- mountPath: /tmp/ray
54-
name: ray-logs
55-
- mountPath: /mnt/cluster_storage
56-
name: cluster-storage
33+
- name: ray-head
34+
image: rayproject/ray:2.46.0
35+
env:
36+
- name: NUM_WORKERS
37+
value: "4"
38+
ports:
39+
- containerPort: 6379
40+
name: gcs-server
41+
- containerPort: 8265
42+
name: dashboard
43+
- containerPort: 10001
44+
name: client
45+
resources:
46+
limits:
47+
cpu: "1"
48+
memory: "8G"
49+
requests:
50+
cpu: "1"
51+
memory: "8G"
52+
volumeMounts:
53+
- mountPath: /tmp/ray
54+
name: ray-logs
55+
- mountPath: /mnt/cluster_storage
56+
name: cluster-storage
5757
volumes:
58-
- name: ray-logs
59-
emptyDir: {}
60-
- name: cluster-storage
61-
csi:
62-
driver: gcsfuse.csi.storage.gke.io
63-
volumeAttributes:
64-
bucketName: GCS_BUCKET
65-
mountOptions: "implicit-dirs,uid=1000,gid=100"
58+
- name: ray-logs
59+
emptyDir: {}
60+
- name: cluster-storage
61+
csi:
62+
driver: gcsfuse.csi.storage.gke.io
63+
volumeAttributes:
64+
bucketName: GCS_BUCKET
65+
mountOptions: "implicit-dirs,uid=1000,gid=100"
6666
workerGroupSpecs:
67-
- replicas: 4
68-
minReplicas: 4
69-
maxReplicas: 4
70-
groupName: gpu-group
71-
rayStartParams:
72-
dashboard-host: '0.0.0.0'
73-
template:
74-
metadata:
75-
annotations:
76-
gke-gcsfuse/volumes: "true"
77-
gke-gcsfuse/cpu-limit: "0"
78-
gke-gcsfuse/memory-limit: 5Gi
79-
gke-gcsfuse/ephemeral-storage-limit: 10Gi
80-
spec:
81-
serviceAccountName: pytorch-distributed-training
82-
tolerations:
83-
- key: "nvidia.com/gpu"
84-
operator: "Exists"
85-
effect: "NoSchedule"
86-
containers:
87-
- name: ray-worker
88-
image: rayproject/ray-ml:2.46.0.0e19ea-py39
89-
resources:
90-
limits:
91-
cpu: "1"
92-
memory: "8G"
93-
nvidia.com/gpu: "1"
94-
requests:
95-
cpu: "1"
96-
memory: "8G"
97-
nvidia.com/gpu: "1"
98-
volumeMounts:
99-
- mountPath: /tmp/ray
100-
name: ray-logs
101-
- mountPath: /mnt/cluster_storage
102-
name: cluster-storage
103-
volumes:
104-
- name: ray-logs
105-
emptyDir: {}
106-
- name: cluster-storage
107-
csi:
108-
driver: gcsfuse.csi.storage.gke.io
109-
volumeAttributes:
110-
bucketName: GCS_BUCKET
111-
mountOptions: "implicit-dirs,uid=1000,gid=100"
67+
- replicas: 4
68+
minReplicas: 4
69+
maxReplicas: 4
70+
groupName: gpu-group
71+
rayStartParams:
72+
dashboard-host: '0.0.0.0'
73+
template:
74+
metadata:
75+
annotations:
76+
gke-gcsfuse/volumes: "true"
77+
gke-gcsfuse/cpu-limit: "0"
78+
gke-gcsfuse/memory-limit: 5Gi
79+
gke-gcsfuse/ephemeral-storage-limit: 10Gi
80+
spec:
81+
serviceAccountName: pytorch-distributed-training
82+
tolerations:
83+
- key: "nvidia.com/gpu"
84+
operator: "Exists"
85+
effect: "NoSchedule"
86+
containers:
87+
- name: ray-worker
88+
image: rayproject/ray-ml:2.46.0.0e19ea-py39
89+
resources:
90+
limits:
91+
cpu: "1"
92+
memory: "8G"
93+
nvidia.com/gpu: "1"
94+
requests:
95+
cpu: "1"
96+
memory: "8G"
97+
nvidia.com/gpu: "1"
98+
volumeMounts:
99+
- mountPath: /tmp/ray
100+
name: ray-logs
101+
- mountPath: /mnt/cluster_storage
102+
name: cluster-storage
103+
volumes:
104+
- name: ray-logs
105+
emptyDir: {}
106+
- name: cluster-storage
107+
csi:
108+
driver: gcsfuse.csi.storage.gke.io
109+
volumeAttributes:
110+
bucketName: GCS_BUCKET
111+
mountOptions: "implicit-dirs,uid=1000,gid=100"

ray-operator/config/samples/pytorch-text-classifier/ray-job.pytorch-distributed-training.yaml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,27 @@ spec:
2626
operator: "Exists"
2727
effect: "NoSchedule"
2828
containers:
29-
- name: ray-head
30-
image: rayproject/ray-ml:2.46.0.0e19ea-py311-gpu
31-
ports:
32-
- containerPort: 6379
33-
name: gcs-server
34-
- containerPort: 8265
35-
name: dashboard
36-
- containerPort: 10001
37-
name: client
38-
resources:
39-
limits:
40-
cpu: "2"
41-
memory: "8G"
42-
nvidia.com/gpu: "1"
43-
requests:
44-
cpu: "2"
45-
memory: "8G"
46-
nvidia.com/gpu: "1"
47-
volumeMounts:
48-
- mountPath: /tmp/ray
49-
name: ray-logs
29+
- name: ray-head
30+
image: rayproject/ray-ml:2.46.0.0e19ea-py311-gpu
31+
ports:
32+
- containerPort: 6379
33+
name: gcs-server
34+
- containerPort: 8265
35+
name: dashboard
36+
- containerPort: 10001
37+
name: client
38+
resources:
39+
limits:
40+
cpu: "2"
41+
memory: "8G"
42+
nvidia.com/gpu: "1"
43+
requests:
44+
cpu: "2"
45+
memory: "8G"
46+
nvidia.com/gpu: "1"
47+
volumeMounts:
48+
- mountPath: /tmp/ray
49+
name: ray-logs
5050
volumes:
51-
- name: ray-logs
52-
emptyDir: {}
51+
- name: ray-logs
52+
emptyDir: {}

ray-operator/config/samples/ray-cluster-alb-ingress.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ metadata:
1414
spec:
1515
ingressClassName: alb
1616
rules:
17-
- http:
18-
paths:
19-
- path: /
20-
pathType: Prefix
21-
backend:
22-
service:
23-
name: ray-cluster-kuberay-head-svc # Your head pod service
24-
port:
25-
number: 8265
17+
- http:
18+
paths:
19+
- path: /
20+
pathType: Prefix
21+
backend:
22+
service:
23+
name: ray-cluster-kuberay-head-svc # Your head pod service
24+
port:
25+
number: 8265

ray-operator/config/samples/ray-cluster.auth.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
---
21
apiVersion: v1
32
kind: ConfigMap
43
metadata:
54
name: kube-rbac-proxy
65
data:
7-
config-file.yaml: |+
6+
config-file.yaml: |
87
authorization:
98
resourceAttributes:
109
namespace: default
@@ -80,9 +79,7 @@ spec:
8079
command:
8180
- bash
8281
- -c
83-
- wget -T 2 -q -O- http://localhost:52365/api/local_raylet_healthz | grep
84-
success && wget -T 10 -q -O- http://localhost:8443/api/gcs_healthz | grep
85-
success
82+
- wget -T 2 -q -O- http://localhost:52365/api/local_raylet_healthz | grep success && wget -T 10 -q -O- http://localhost:8443/api/gcs_healthz | grep success
8683
failureThreshold: 10
8784
initialDelaySeconds: 10
8885
periodSeconds: 5
@@ -93,9 +90,7 @@ spec:
9390
command:
9491
- bash
9592
- -c
96-
- wget -T 2 -q -O- http://localhost:52365/api/local_raylet_healthz | grep
97-
success && wget -T 10 -q -O- http://localhost:8443/api/gcs_healthz | grep
98-
success
93+
- wget -T 2 -q -O- http://localhost:52365/api/local_raylet_healthz | grep success && wget -T 10 -q -O- http://localhost:8443/api/gcs_healthz | grep success
9994
failureThreshold: 120
10095
initialDelaySeconds: 30
10196
periodSeconds: 5
@@ -104,10 +99,10 @@ spec:
10499
- name: kube-rbac-proxy
105100
image: quay.io/brancz/kube-rbac-proxy:v0.18.1
106101
args:
107-
- "--insecure-listen-address=0.0.0.0:8265"
108-
- "--upstream=http://127.0.0.1:8443/"
109-
- "--config-file=/etc/kube-rbac-proxy/config-file.yaml"
110-
- "--logtostderr=true"
102+
- "--insecure-listen-address=0.0.0.0:8265"
103+
- "--upstream=http://127.0.0.1:8443/"
104+
- "--config-file=/etc/kube-rbac-proxy/config-file.yaml"
105+
- "--logtostderr=true"
111106
volumeMounts:
112107
- name: config
113108
mountPath: /etc/kube-rbac-proxy

0 commit comments

Comments
 (0)