Skip to content

Commit 210b102

Browse files
committed
test: Parameterize CodeFlare SDK version
1 parent ecf16dc commit 210b102

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ MCAD_CRD ?= ${MCAD_REPO}/config/crd?ref=${MCAD_REF}
2424
# KUBERAY_VERSION defines the default version of the KubeRay operator
2525
KUBERAY_VERSION ?= v0.5.0
2626

27+
# CODEFLARE_SDK_VERSION defines the default version of the CodeFlare SDK
28+
CODEFLARE_SDK_VERSION ?= 0.4.4
29+
2730
# OPERATORS_REPO_ORG points to GitHub repository organization where bundle PR is opened against
2831
# OPERATORS_REPO_FORK_ORG points to GitHub repository fork organization where bundle build is pushed to
2932
OPERATORS_REPO_ORG ?= redhat-openshift-ecosystem
@@ -132,6 +135,7 @@ defaults:
132135
@echo "const (" >> $(DEFAULTS_FILE)
133136
@echo " MCADImage = \"$(MCAD_IMAGE)\"" >> $(DEFAULTS_FILE)
134137
@echo " InstaScaleImage = \"$(INSTASCALE_IMAGE)\"" >> $(DEFAULTS_FILE)
138+
@echo " CodeFlareSDKVersion = \"$(CODEFLARE_SDK_VERSION)\"" >> $(DEFAULTS_FILE)
135139
@echo "" >> $(DEFAULTS_FILE)
136140
@echo ")" >> $(DEFAULTS_FILE)
137141
@echo "" >> $(DEFAULTS_FILE)

controllers/defaults.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package controllers
55
// ***********************
66

77
const (
8-
MCADImage = "quay.io/project-codeflare/mcad-controller:release-v1.31.0"
9-
InstaScaleImage = "quay.io/project-codeflare/instascale-controller:v0.0.4"
8+
MCADImage = "quay.io/project-codeflare/mcad-controller:release-v1.31.0"
9+
InstaScaleImage = "quay.io/project-codeflare/instascale-controller:v0.0.4"
10+
CodeFlareSDKVersion = "0.4.4"
1011
)

test/e2e/mnist_raycluster_sdk_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func TestMNISTRayClusterSDK(t *testing.T) {
155155
{
156156
Name: "test",
157157
Image: "quay.io/opendatahub/notebooks:jupyter-minimal-ubi8-python-3.8-4c8f26e",
158-
Command: []string{"/bin/sh", "-c", "pip install codeflare-sdk==0.4.4 && cp /test/* . && python mnist_raycluster_sdk.py" + " " + namespace.Name},
158+
Command: []string{"/bin/sh", "-c", "pip install codeflare-sdk==" + GetCodeFlareSDKVersion() + " && cp /test/* . && python mnist_raycluster_sdk.py" + " " + namespace.Name},
159159
VolumeMounts: []corev1.VolumeMount{
160160
{
161161
Name: "test",

test/support/codeflare.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
Copyright 2023.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package support
18+
19+
import (
20+
"os"
21+
22+
"github.com/project-codeflare/codeflare-operator/controllers"
23+
)
24+
25+
func GetCodeFlareSDKVersion() string {
26+
if value, ok := os.LookupEnv("CODEFLARE_SDK_VERSION"); ok {
27+
return value
28+
}
29+
return controllers.CodeFlareSDKVersion
30+
}

0 commit comments

Comments
 (0)