Setup e2e_node to support testing on ARM64

* Enable dockerized build with --use-dockerized-build=true
* Build and create test artifacts for ARM64 with --target-build-arch=arm64
* Prepull multi-arch ready container image
* Download ARM64 binaries/packages if running on ARM64 machine
This commit is contained in:
Ike Ma
2023-03-30 17:01:38 +00:00
parent 6d09ab86c2
commit e21cf9a54e
7 changed files with 57 additions and 9 deletions

View File

@@ -21,6 +21,7 @@ import (
"fmt"
"os"
"os/user"
"runtime"
"sync"
"time"
@@ -61,7 +62,6 @@ var NodePrePullImageList = sets.NewString(
imageutils.GetPauseImageName(),
imageutils.GetE2EImage(imageutils.NodePerfNpbEp),
imageutils.GetE2EImage(imageutils.NodePerfNpbIs),
imageutils.GetE2EImage(imageutils.NodePerfTfWideDeep),
imageutils.GetE2EImage(imageutils.Etcd),
)
@@ -70,6 +70,11 @@ var NodePrePullImageList = sets.NewString(
// 2. the ones passed in from framework.TestContext.ExtraEnvs
// So this function needs to be called after the extra envs are applied.
func updateImageAllowList(ctx context.Context) {
// Architecture-specific image
if !isRunningOnArm64() {
// NodePerfTfWideDeep is only supported on x86_64, pulling in arm64 will fail
NodePrePullImageList = NodePrePullImageList.Insert(imageutils.GetE2EImage(imageutils.NodePerfTfWideDeep))
}
// Union NodePrePullImageList and PrePulledImages into the framework image pre-pull list.
e2epod.ImagePrePullList = NodePrePullImageList.Union(commontest.PrePulledImages)
// Images from extra envs
@@ -96,6 +101,10 @@ func updateImageAllowList(ctx context.Context) {
}
}
func isRunningOnArm64() bool {
return runtime.GOARCH == "arm64"
}
func getNodeProblemDetectorImage() string {
const defaultImage string = "registry.k8s.io/node-problem-detector/node-problem-detector:v0.8.7"
image := os.Getenv("NODE_PROBLEM_DETECTOR_IMAGE")