Skip to content

Commit 6add923

Browse files
authored
Merge pull request #22039 from medyagh/prow_docker_arm
ci: add docker docker test with arm64 arch to prow
2 parents 10f2dd8 + 29ab228 commit 6add923

File tree

6 files changed

+114
-7
lines changed

6 files changed

+114
-7
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# Copyright 2025 The Kubernetes Authors All rights reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e
18+
set -x
19+
20+
OS="linux"
21+
ARCH="arm64"
22+
DRIVER="docker"
23+
CONTAINER_RUNTIME="docker"
24+
EXTRA_START_ARGS=""
25+
EXTRA_TEST_ARGS=""
26+
JOB_NAME="Docker_docker_Linux_arm64"
27+
28+
# marking all directories ('*') as trusted, since .git belongs to root, not minikube user
29+
git config --global --add safe.directory '*'
30+
COMMIT=$(git rev-parse HEAD)
31+
MINIKUBE_LOCATION=$COMMIT
32+
33+
34+
# when docker is the driver, we run integration tests directly in prow cluster
35+
# by default, prow jobs run in root, so we must switch to a non-root user to run docker driver
36+
37+
38+
source ./hack/prow/common.sh

hack/prow/integration_pre_install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ CONTAINER_RUNTIME="docker"
2424
# in prow, if you want libvirtd to be run, you have to start a privileged container as root
2525
EXTRA_START_ARGS=""
2626
EXTRA_TEST_ARGS=""
27-
JOB_NAME="KVM_Docker_Linux_X86-64"
2827

2928

3029
# install docker if not present

hack/prow/minitest/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ var testers = map[string]tester.MiniTestTester{
3838
"kvm-containerd-linux-amd64-integration": &tester.KVMContainerdLinuxAmd64IntegrationTester{},
3939
"kvm-crio-linux-amd64-integration": &tester.KVMCRIOLinuxAmd64IntegrationTester{},
4040
"none-docker-linux-amd64-integration": &tester.NoneDockerLinuxAmd64IntegrationTester{},
41+
"docker-linux-arm64-integration": &tester.DockerLinuxArm64IntegrationTester{},
4142
}
4243

4344
func main() {
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
Copyright 2025 The Kubernetes Authors All rights reserved.
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 tester
18+
19+
import (
20+
"fmt"
21+
"os"
22+
23+
"k8s.io/klog/v2"
24+
)
25+
26+
var _ MiniTestTester = &KVMDockerLinuxAmd64IntegrationTester{}
27+
28+
// this runs the integration tests with none driver and a docker container runtime.
29+
type DockerLinuxArm64IntegrationTester struct {
30+
}
31+
32+
// Run implements MiniTestTester.
33+
func (k *DockerLinuxArm64IntegrationTester) Run(runner MiniTestRunner) error {
34+
if up, err := runner.IsUp(); err != nil || !up {
35+
klog.Errorf("tester: deployed environment is not up: %v", err)
36+
}
37+
if err := runner.SyncToRemote(".", "~/minikube", []string{".cache"}); err != nil {
38+
klog.Errorf("failed to sync file in docker deployer: %v", err)
39+
}
40+
pr := os.Getenv("PULL_NUMBER")
41+
42+
var testErr error
43+
// install docker and libvirtd first then run the test in a new shell
44+
if err := runner.Execute("cd minikube && ./hack/prow/integration_pre_install.sh"); err != nil {
45+
klog.Errorf("failed to install docker in env: %v", err)
46+
return err
47+
}
48+
if testErr = runner.Execute(fmt.Sprintf("cd minikube && PULL_NUMBER=\"%s\" ./hack/prow/integration_docker_docker_linux_arm64.sh", pr)); testErr != nil {
49+
klog.Errorf("failed to execute command in env: %v", testErr)
50+
// don't return here, we still want to collect the test reports
51+
}
52+
53+
// prow requires result file to be copied to $ARTIFACTS. All other files will not be persisted.
54+
if err := copyFileToArtifact(runner); err != nil {
55+
return err
56+
}
57+
return testErr
58+
59+
}

hack/prow/prow.mk

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
# Integration tests using local prow docker
1+
# ----------------------------------------------------------------
2+
# Bellow Integration tests run in a prow container (no external cloud vm)
3+
# ----------------------------------------------------------------
24
.PHONY: integration-prow-kvm-docker-linux-x86-64
35
integration-prow-docker-docker-linux-x86-64:
46
./hack/prow/minikube_cross_build.sh $(GO_VERSION) linux amd64
57
./hack/prow/util/integration_prow_wrapper.sh ./hack/prow/integration_docker_docker_linux_x86-64.sh
68

9+
.PHONY: integration-prow-docker-docker-linux-arm64
10+
integration-prow-docker-docker-linux-arm64:
11+
./hack/prow/minikube_cross_build.sh $(GO_VERSION) linux arm64
12+
./hack/prow/util/integration_prow_wrapper.sh ./hack/prow/integration_docker_docker_linux_arm64.sh
13+
14+
715
integration-prow-docker-containerd-linux-x86-64:
816
./hack/prow/minikube_cross_build.sh $(GO_VERSION) linux amd64
917
./hack/prow/util/integration_prow_wrapper.sh ./hack/prow/integration_docker_containerd_linux_x86-64.sh
@@ -12,27 +20,29 @@ integration-prow-docker-crio-linux-x86-64:
1220
./hack/prow/minikube_cross_build.sh $(GO_VERSION) linux amd64
1321
./hack/prow/util/integration_prow_wrapper.sh ./hack/prow/integration_docker_crio_linux_x86-64.sh
1422

23+
# ----------------------------------------------------------------
24+
# Bellow Integration tests run in cloud VM using boskos
25+
# ----------------------------------------------------------------
1526

16-
# Integration tests using boskos to manage GCP projects
1727
.PHONY: integration-prow-none-docker-linux-x86-64
1828
integration-prow-none-docker-linux-x86-64: setup-prow-gcp-ssh-keys build-mini-test
1929
./hack/prow/minikube_cross_build.sh $(GO_VERSION) linux amd64
20-
./out/minitest --deployer boskos --tester none-docker-linux-amd64-integration --config hack/prow/bosksos-nested.json
30+
./out/minitest --deployer boskos --tester none-docker-linux-amd64-integration --config hack/prow/boskos-cfg-x86.json
2131

2232
.PHONY: integration-prow-kvm-docker-linux-x86-64
2333
integration-prow-kvm-docker-linux-x86-64: setup-prow-gcp-ssh-keys build-mini-test
2434
./hack/prow/minikube_cross_build.sh $(GO_VERSION) linux amd64
25-
./out/minitest --deployer boskos --tester kvm-docker-linux-amd64-integration --config hack/prow/bosksos-nested.json
35+
./out/minitest --deployer boskos --tester kvm-docker-linux-amd64-integration --config hack/prow/boskos-cfg-x86.json
2636

2737
.PHONY: integration-prow-kvm-containerd-linux-x86-64
2838
integration-prow-kvm-containerd-linux-x86-64: setup-prow-gcp-ssh-keys build-mini-test
2939
./hack/prow/minikube_cross_build.sh $(GO_VERSION) linux amd64
30-
./out/minitest --deployer boskos --tester kvm-containerd-linux-amd64-integration --config hack/prow/bosksos-nested.json
40+
./out/minitest --deployer boskos --tester kvm-containerd-linux-amd64-integration --config hack/prow/boskos-cfg-x86.json
3141

3242
.PHONY: integration-prow-kvm-crio-linux-x86-64
3343
integration-prow-kvm-crio-linux-x86-64: setup-prow-gcp-ssh-keys build-mini-test
3444
./hack/prow/minikube_cross_build.sh $(GO_VERSION) linux amd64
35-
./out/minitest --deployer boskos --tester kvm-crio-linux-amd64-integration --config hack/prow/bosksos-nested.json
45+
./out/minitest --deployer boskos --tester kvm-crio-linux-amd64-integration --config hack/prow/boskos-cfg-x86.json
3646

3747
.PHONY: build-mini-test
3848
build-mini-test: # build minitest binary

0 commit comments

Comments
 (0)