Skip to content

Commit

Permalink
Allow testing with any number of concurrent ginkgo processes
Browse files Browse the repository at this point in the history
This is the only tech debt that remains in order for anyone
to be able to run kubevirt tests with any amount of concurrent ginkgo
processes
(`export KUBEVIRT_E2E_PARALLEL_NODES=<NUM>` on the host executing the
tests).

Signed-off-by: Alex Kalenyuk <[email protected]>
  • Loading branch information
akalenyu committed Jul 21, 2024
1 parent 8016033 commit 615ba32
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions hack/build-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ for arg in $args; do
--image-prefix=${image_prefix} \
--image-pull-policy=${image_pull_policy} \
--infra-replicas=${infra_replicas} \
--test-image-replicas=${test_image_replicas} \
--input-file=${infile} \
--kubevirt-logo-path=${kubevirt_logo_path} \
--namespace=${namespace} \
Expand Down
1 change: 1 addition & 0 deletions hack/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ conn_check_ipv6_address=${CONN_CHECK_IPV6_ADDRESS:-""}
conn_check_dns=${CONN_CHECK_DNS:-""}
migration_network_nic=${MIGRATION_NETWORK_NIC:-"eth1"}
infra_replicas=${KUBEVIRT_INFRA_REPLICAS:-0}
test_image_replicas=${KUBEVIRT_E2E_PARALLEL_NODES:-6}
common_instancetypes_version=${COMMON_INSTANCETYPES_VERSION:-"v1.0.1"}
cluster_instancetypes_sha256=${CLUSTER_INSTANCETYPES_SHA256:-"ebd37dae0ed07ae1a79bb09b27b4fe8b971ff371ee900119e1906e1574ecf829"}
cluster_preferences_sha256=${CLUSTER_PREFERENCES_SHA256:-"fa7e6cb6b21116d4ef200f4e9e774e38f26862055f62a23c7f926610f0d25ba4"}
Expand Down
2 changes: 1 addition & 1 deletion hack/manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ echo "Building manifests..."

${KUBEVIRT_PATH}hack/dockerized "KUBEVIRT_NO_BAZEL=${KUBEVIRT_NO_BAZEL} BUILD_ARCH=${BUILD_ARCH} && CSV_VERSION=${CSV_VERSION} QUAY_REPOSITORY=${QUAY_REPOSITORY} \
DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} KUBEVIRT_PROVIDER=${KUBEVIRT_PROVIDER} KUBEVIRT_ONLY_USE_TAGS=${KUBEVIRT_ONLY_USE_TAGS} \
IMAGE_PULL_POLICY=${IMAGE_PULL_POLICY} VERBOSITY=${VERBOSITY} PACKAGE_NAME=${PACKAGE_NAME} KUBEVIRT_INFRA_REPLICAS=${KUBEVIRT_INFRA_REPLICAS} \
IMAGE_PULL_POLICY=${IMAGE_PULL_POLICY} VERBOSITY=${VERBOSITY} PACKAGE_NAME=${PACKAGE_NAME} KUBEVIRT_INFRA_REPLICAS=${KUBEVIRT_INFRA_REPLICAS} KUBEVIRT_E2E_PARALLEL_NODES=${KUBEVIRT_E2E_PARALLEL_NODES} \
KUBEVIRT_INSTALLED_NAMESPACE=${KUBEVIRT_INSTALLED_NAMESPACE} feature_gates=${FEATURE_GATES} runbook_url_template=${RUNBOOK_URL_TEMPLATE} ./hack/build-manifests.sh"

echo "Done $0"
18 changes: 6 additions & 12 deletions images/disks-images-provider/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,18 @@ mkdir -p /images/datavolume1 /images/datavolume2 /images/datavolume3
echo "copy all images to host mount directory"
cp -R /images/* /hostImages/
echo "make the alpine image ready for parallel use"
cp -r /hostImages/alpine hostImages/alpine1
cp -r /hostImages/alpine hostImages/alpine2
cp -r /hostImages/alpine hostImages/alpine3
cp -r /hostImages/alpine hostImages/alpine4
cp -r /hostImages/alpine hostImages/alpine5
cp -r /hostImages/alpine hostImages/alpine6
for ((n = 1; n <= $(($NUM_TEST_IMAGE_REPLICAS)); n++)); do
cp -r /hostImages/alpine hostImages/alpine${n}
done
rm -rf /hostImages/alpine
mkdir -p /local-storage/hotplug-test
cp -r /hostImages/custom/disk.img /local-storage/hotplug-test/disk.img
chmod -R 777 /local-storage/hotplug-test

echo "make the custom image ready for parallel use"
cp -r /hostImages/custom hostImages/custom1
cp -r /hostImages/custom hostImages/custom2
cp -r /hostImages/custom hostImages/custom3
cp -r /hostImages/custom hostImages/custom4
cp -r /hostImages/custom hostImages/custom5
cp -r /hostImages/custom hostImages/custom6
for ((n = 1; n <= $(($NUM_TEST_IMAGE_REPLICAS)); n++)); do
cp -r /hostImages/custom hostImages/custom${n}
done
rm -rf /hostImages/custom
chmod -R 777 /hostImages

Expand Down
3 changes: 3 additions & 0 deletions manifests/testing/disks-images-provider.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ spec:
- name: target
image: {{.DockerPrefix}}/disks-images-provider:{{.DockerTag}}
imagePullPolicy: Always
env:
- name: NUM_TEST_IMAGE_REPLICAS
value: {{.TestImageReplicas}}
lifecycle:
preStop:
exec:
Expand Down
4 changes: 4 additions & 0 deletions tools/manifest-templator/manifest-templator.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ type templateData struct {
PriorityClassSpec string
FeatureGates []string
InfraReplicas uint8
TestImageReplicas string
GeneratedManifests map[string]string
VirtOperatorImage string
VirtApiImage string
Expand Down Expand Up @@ -120,6 +121,7 @@ func main() {
runbookURLTemplate := flag.String("runbook-url-template", "", "")
featureGates := flag.String("feature-gates", "", "")
infraReplicas := flag.Uint("infra-replicas", 0, "")
testImageReplicas := flag.String("test-image-replicas", "0", "")
virtOperatorImage := flag.String("virt-operator-image", "", "custom image for virt-operator")
virtApiImage := flag.String("virt-api-image", "", "custom image for virt-api. "+customImageExample)
virtControllerImage := flag.String("virt-controller-image", "", "custom image for virt-controller. "+customImageExample)
Expand Down Expand Up @@ -158,6 +160,7 @@ func main() {
data.ImagePrefix = *imagePrefix
data.ImagePullPolicy = *imagePullPolicy
data.Verbosity = fmt.Sprintf("\"%s\"", *verbosity)
data.TestImageReplicas = fmt.Sprintf("\"%s\"", *testImageReplicas)
data.CsvVersion = *csvVersion
data.QuayRepository = *quayRepository
data.VirtOperatorSha = *virtOperatorSha
Expand Down Expand Up @@ -204,6 +207,7 @@ func main() {
data.ImagePrefix = "{{.ImagePrefix}}"
data.ImagePullPolicy = "{{.ImagePullPolicy}}"
data.Verbosity = "{{.Verbosity}}"
data.TestImageReplicas = "{{.TestImageReplicas}}"
data.CsvVersion = "{{.CsvVersion}}"
data.QuayRepository = "{{.QuayRepository}}"
data.VirtOperatorSha = "{{.VirtOperatorSha}}"
Expand Down

0 comments on commit 615ba32

Please sign in to comment.