Skip to content

Commit 6a22196

Browse files
Support Multi-Arch Image in CI (#4348)
* Add KuberayTestArch environment variable for architecture override in tests This commit introduces a new environment variable KuberayTestArch that allows overriding the detected architecture in test environments. Previously, the system only relied on runtime.GOARCH to determine if ARM64 architecture was being used, but this change enables explicit architecture specification through the environment variable. This is particularly useful for testing scenarios where you want to force a specific architecture regardless of the actual runtime environment, improving test flexibility and consistency across different platforms. Signed-off-by: KunWuLuan <kunwuluan@gmail.com> * update Signed-off-by: Future-Outlier <eric901201@gmail.com> --------- Signed-off-by: KunWuLuan <kunwuluan@gmail.com> Signed-off-by: Future-Outlier <eric901201@gmail.com> Co-authored-by: Future-Outlier <eric901201@gmail.com>
1 parent 81c526d commit 6a22196

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

ray-operator/test/support/environment.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package support
22

33
import (
4-
"fmt"
54
"os"
6-
"runtime"
7-
"strings"
85
)
96

107
const (
@@ -25,15 +22,7 @@ func GetRayVersion() string {
2522
}
2623

2724
func GetRayImage() string {
28-
rayImage := lookupEnvOrDefault(KuberayTestRayImage, RayImage)
29-
// detect if we are running on arm64 machine, most likely apple silicon
30-
// the os name is not checked as it also possible that it might be linux
31-
// also check if the image does not have the `-aarch64` suffix
32-
if runtime.GOARCH == "arm64" && !strings.HasSuffix(rayImage, "-aarch64") {
33-
rayImage = rayImage + "-aarch64"
34-
fmt.Printf("Modified Ray Image to: %s for ARM chips\n", rayImage)
35-
}
36-
return rayImage
25+
return lookupEnvOrDefault(KuberayTestRayImage, RayImage)
3726
}
3827

3928
func GetKubeRayUpgradeVersion() string {

0 commit comments

Comments
 (0)