Skip to content

Commit

Permalink
[Feature] Support ARM image for test (#2699)
Browse files Browse the repository at this point in the history
  • Loading branch information
simotw authored Dec 31, 2024
1 parent 7b18090 commit a9beafb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ray-operator/test/support/environment.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package support

import (
"fmt"
"os"
"runtime"
"strings"
)

const (
Expand All @@ -20,7 +23,15 @@ func GetRayVersion() string {
}

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

func lookupEnvOrDefault(key, value string) string {
Expand Down

0 comments on commit a9beafb

Please sign in to comment.