Skip to content

Commit c8f9181

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 9fd0505 + 9c96f44 commit c8f9181

File tree

6 files changed

+37
-39
lines changed

6 files changed

+37
-39
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/openshift/api v0.0.0-20230823114715-5fdd7511b790
1212
github.com/openshift/client-go v0.0.0-20221019143426-16aed247da5c
1313
github.com/project-codeflare/appwrapper v0.27.0
14-
github.com/project-codeflare/codeflare-common v0.0.0-20240930133152-11fd6e3be6b3
14+
github.com/project-codeflare/codeflare-common v0.0.0-20241216183607-222395d38924
1515
github.com/ray-project/kuberay/ray-operator v1.2.1
1616
go.uber.org/zap v1.27.0
1717
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
226226
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
227227
github.com/project-codeflare/appwrapper v0.27.0 h1:WiWw0Hi4rEXuFIEpm8nq1UqJHgVB6YtGcWzRrhRUTyE=
228228
github.com/project-codeflare/appwrapper v0.27.0/go.mod h1:7FpO90DLv0BAq4rwZtXKS9aRRfkR9RvXsj3pgYF0HtQ=
229-
github.com/project-codeflare/codeflare-common v0.0.0-20240930133152-11fd6e3be6b3 h1:Eupu9yxaGTddtoxb9SjrYJlokRHEYU5NNVRQmdXSNVs=
230-
github.com/project-codeflare/codeflare-common v0.0.0-20240930133152-11fd6e3be6b3/go.mod h1:v7XKwaDoCspsHQlWJNarO7gOpR+iumSS+c1bWs3kJOI=
229+
github.com/project-codeflare/codeflare-common v0.0.0-20241216183607-222395d38924 h1:jM+gYqn8eGmUoeQLGGYxlJgXZ1gbZgB2UtpKU9z0x9s=
230+
github.com/project-codeflare/codeflare-common v0.0.0-20241216183607-222395d38924/go.mod h1:DPSv5khRiRDFUD43SF8da+MrVQTWmxNhuKJmwSLOyO0=
231231
github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI=
232232
github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
233233
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=

main.go

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -171,36 +171,34 @@ func main() {
171171
kubeConfig.QPS = ptr.Deref(cfg.ClientConnection.QPS, rest.DefaultQPS)
172172
setupLog.V(2).Info("REST client", "qps", kubeConfig.QPS, "burst", kubeConfig.Burst)
173173

174-
selector, err := labels.Parse(controllers.RayClusterNameLabel)
175-
exitOnError(err, "unable to parse label selector")
176-
177-
cacheOpts := cache.Options{
178-
ByObject: map[client.Object]cache.ByObject{
179-
&corev1.Secret{}: {
180-
Label: selector,
181-
},
182-
&corev1.Service{}: {
183-
Label: selector,
184-
},
185-
&corev1.ServiceAccount{}: {
186-
Label: selector,
187-
},
188-
&networkingv1.Ingress{}: {
189-
Label: selector,
190-
},
191-
&networkingv1.NetworkPolicy{}: {
192-
Label: selector,
193-
},
194-
&rbacv1.ClusterRoleBinding{}: {
195-
Label: selector,
196-
},
197-
},
198-
}
199-
200-
if isOpenShift(ctx, kubeClient.DiscoveryClient) {
201-
cacheOpts.ByObject[&routev1.Route{}] = cache.ByObject{
174+
cacheOpts := cache.Options{}
175+
if cfg.AppWrapper == nil || !ptr.Deref(cfg.AppWrapper.Enabled, false) {
176+
selector, err := labels.Parse(controllers.RayClusterNameLabel)
177+
exitOnError(err, "unable to parse label selector")
178+
cacheOpts.ByObject = make(map[client.Object]cache.ByObject, 7)
179+
cacheOpts.ByObject[&corev1.Secret{}] = cache.ByObject{
180+
Label: selector,
181+
}
182+
cacheOpts.ByObject[&corev1.Service{}] = cache.ByObject{
183+
Label: selector,
184+
}
185+
cacheOpts.ByObject[&corev1.ServiceAccount{}] = cache.ByObject{
186+
Label: selector,
187+
}
188+
cacheOpts.ByObject[&networkingv1.Ingress{}] = cache.ByObject{
202189
Label: selector,
203190
}
191+
cacheOpts.ByObject[&networkingv1.NetworkPolicy{}] = cache.ByObject{
192+
Label: selector,
193+
}
194+
cacheOpts.ByObject[&rbacv1.ClusterRoleBinding{}] = cache.ByObject{
195+
Label: selector,
196+
}
197+
if isOpenShift(ctx, kubeClient.DiscoveryClient) {
198+
cacheOpts.ByObject[&routev1.Route{}] = cache.ByObject{
199+
Label: selector,
200+
}
201+
}
204202
}
205203

206204
mgr, err := ctrl.NewManager(kubeConfig, ctrl.Options{

test/e2e/mnist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def __init__(self, data_dir=PATH_DATASETS, hidden_size=64, learning_rate=2e-4):
7272
nn.Linear(hidden_size, self.num_classes),
7373
)
7474

75-
self.val_accuracy = Accuracy()
76-
self.test_accuracy = Accuracy()
75+
self.val_accuracy = Accuracy(task="multiclass", num_classes=10)
76+
self.test_accuracy = Accuracy(task="multiclass", num_classes=10)
7777

7878
def forward(self, x):
7979
x = self.model(x)

test/e2e/mnist_pip_requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pytorch_lightning==1.9.5
2-
torchmetrics==0.9.1
3-
torchvision==0.12.0
1+
pytorch_lightning==2.4.0
2+
torchmetrics==1.6.0
3+
torchvision==0.20.1

test/e2e/mnist_rayjob_raycluster_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ func constructRayJob(_ Test, namespace *corev1.Namespace, rayCluster *rayv1.RayC
358358
Entrypoint: "python /home/ray/jobs/mnist.py",
359359
RuntimeEnvYAML: `
360360
pip:
361-
- pytorch_lightning==1.9.5
362-
- torchmetrics==0.9.1
363-
- torchvision==0.12.0
361+
- pytorch_lightning==2.4.0
362+
- torchmetrics==1.6.0
363+
- torchvision==0.20.1
364364
env_vars:
365365
MNIST_DATASET_URL: "` + GetMnistDatasetURL() + `"
366366
PIP_INDEX_URL: "` + GetPipIndexURL() + `"

0 commit comments

Comments
 (0)