From e55ae613c579090db9bb28b2e232c604d85f810a Mon Sep 17 00:00:00 2001 From: Supreeth Ramakrishna Date: Mon, 6 Oct 2025 22:55:46 +0000 Subject: [PATCH 1/3] Modify soak test integration for ubuntu --- scripts/lib/cluster.sh | 3 ++ scripts/run-integration-tests.sh | 31 +++++++++++++++++++ scripts/test/config/ubuntu.yaml | 52 ++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 scripts/test/config/ubuntu.yaml diff --git a/scripts/lib/cluster.sh b/scripts/lib/cluster.sh index c94a9ef922..684d194a71 100644 --- a/scripts/lib/cluster.sh +++ b/scripts/lib/cluster.sh @@ -30,6 +30,9 @@ function up-test-cluster() { if [[ "$RUN_BOTTLEROCKET_TEST" == true ]]; then echo "Copying bottlerocket config to $CLUSTER_CONFIG" cp $CLUSTER_TEMPLATE_PATH/bottlerocket.yaml $CLUSTER_CONFIG + elif [[ "$RUN_UBUNTU_TEST" == true ]]; then + echo "Copying ubuntu config to $CLUSTER_CONFIG" + cp $CLUSTER_TEMPLATE_PATH/ubuntu.yaml $CLUSTER_CONFIG elif [[ "$RUN_PERFORMANCE_TESTS" == true ]]; then echo "Copying perf test cluster config to $CLUSTER_CONFIG" cp $CLUSTER_TEMPLATE_PATH/perf-cluster.yml $CLUSTER_CONFIG diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index 6d5968b5af..a091f707e1 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -28,7 +28,9 @@ ARCH=$(go env GOARCH) : "${RUN_CONFORMANCE:=false}" : "${RUN_KOPS_TEST:=false}" : "${RUN_BOTTLEROCKET_TEST:=false}" +: "${RUN_UBUNTU_TEST:=false}" : "${RUN_PERFORMANCE_TESTS:=false}" +: "${RUN_SOAK_TEST:=false}" : "${RUNNING_PERFORMANCE:=false}" : "${KOPS_VERSION=v1.33.0-beta.1}" @@ -57,6 +59,9 @@ on_error() { if [[ $RUN_PERFORMANCE_TESTS == true ]]; then emit_cloudwatch_metric "performance_test_status" "0" fi + if [[ $RUN_SOAK_TEST == true ]]; then + emit_cloudwatch_metric "soak_test_status" "0" + fi # Make sure we destroy any cluster that was created if we hit run into an # error when attempting to run tests against the if [[ $RUNNING_PERFORMANCE == false ]]; then @@ -284,6 +289,29 @@ if [[ "$RUN_PERFORMANCE_TESTS" == true ]]; then uninstall_cw_agent fi +if [[ "$RUN_SOAK_TEST" == true ]]; then + echo "*******************************************************************************" + echo "Running soak tests on current image" + echo "" + START=$SECONDS + + GINKGO_TEST_BUILD="$SCRIPT_DIR/../test/build" + TEST_IMAGE_REGISTRY=${TEST_IMAGE_REGISTRY:-"public.ecr.aws/eks"} + + (CGO_ENABLED=0 ginkgo --no-color --focus="SOAK_TEST" -v --timeout 3h --fail-on-pending $GINKGO_TEST_BUILD/cni.test -- \ + --cluster-kubeconfig="$KUBECONFIG_PATH" \ + --cluster-name="$CLUSTER_NAME" \ + --aws-region="$AWS_DEFAULT_REGION" \ + --aws-vpc-id="$VPC_ID" \ + --ng-name-label-key="kubernetes.io/os" \ + --ng-name-label-val="ubuntu" \ + --test-image-registry=$TEST_IMAGE_REGISTRY \ + --publish-cw-metrics=true ) + + SOAK_DURATION=$((SECONDS - START)) + echo "TIMELINE: Soak tests took $SOAK_DURATION seconds." +fi + if [[ $RUN_KOPS_TEST == true ]]; then run_kops_conformance fi @@ -299,6 +327,9 @@ if [[ "$DEPROVISION" == true ]]; then elif [[ "$RUN_PERFORMANCE_TESTS" == true ]]; then eksctl delete cluster $CLUSTER_NAME emit_cloudwatch_metric "performance_test_status" "1" + elif [[ "$RUN_SOAK_TEST" == true ]]; then + eksctl delete cluster $CLUSTER_NAME --disable-nodegroup-eviction + emit_cloudwatch_metric "soak_test_status" "1" else down-test-cluster fi diff --git a/scripts/test/config/ubuntu.yaml b/scripts/test/config/ubuntu.yaml new file mode 100644 index 0000000000..f3efa87d63 --- /dev/null +++ b/scripts/test/config/ubuntu.yaml @@ -0,0 +1,52 @@ +--- +apiVersion: eksctl.io/v1alpha5 +kind: ClusterConfig + +metadata: + name: CLUSTER_NAME_PLACEHOLDER + region: us-west-2 + +managedNodeGroups: + - name: cni-test-arm64-ubuntu-mng + instanceType: c6g.xlarge + desiredCapacity: 3 + amiFamily: UbuntuPro2404 + minSize: 3 + maxSize: 3 + volumeSize: 40 + releaseVersion: "" + preBootstrapCommands: + - | + # Enable unattended upgrades for soak testing + apt-get update + apt-get install -y unattended-upgrades + echo 'Unattended-Upgrade::Automatic-Reboot "false";' >> /etc/apt/apt.conf.d/50unattended-upgrades + echo 'Unattended-Upgrade::Remove-Unused-Dependencies "true";' >> /etc/apt/apt.conf.d/50unattended-upgrades + systemctl enable unattended-upgrades + systemctl start unattended-upgrades + tags: + group: amazon-vpc-cni-k8s-arm64-ubuntu + - name: cni-test-x86-ubuntu-mng + instanceType: c5.xlarge + desiredCapacity: 3 + amiFamily: UbuntuPro2404 + minSize: 3 + maxSize: 3 + volumeSize: 40 + releaseVersion: "" + preBootstrapCommands: + - | + # Enable unattended upgrades for soak testing + apt-get update + apt-get install -y unattended-upgrades + echo 'Unattended-Upgrade::Automatic-Reboot "false";' >> /etc/apt/apt.conf.d/50unattended-upgrades + echo 'Unattended-Upgrade::Remove-Unused-Dependencies "true";' >> /etc/apt/apt.conf.d/50unattended-upgrades + systemctl enable unattended-upgrades + systemctl start unattended-upgrades + tags: + group: amazon-vpc-cni-k8s-x86-ubuntu +availabilityZones: + - us-west-2a + - us-west-2b + - us-west-2c + - us-west-2d From 56653a7edbecfa9bef8ce8d81d076233d893a8a5 Mon Sep 17 00:00:00 2001 From: Supreeth Ramakrishna Date: Mon, 13 Oct 2025 01:26:58 -0700 Subject: [PATCH 2/3] Add build --- scripts/run-integration-tests.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index a091f707e1..c101aac128 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -32,6 +32,8 @@ ARCH=$(go env GOARCH) : "${RUN_PERFORMANCE_TESTS:=false}" : "${RUN_SOAK_TEST:=false}" : "${RUNNING_PERFORMANCE:=false}" +: "${EXTRA_GINKGO_FLAGS:=""}" +: "${ENDPOINT_OPTION:=""}" : "${KOPS_VERSION=v1.33.0-beta.1}" if [[ -z $EKS_CLUSTER_VERSION || -z $K8S_VERSION ]]; then @@ -295,10 +297,13 @@ if [[ "$RUN_SOAK_TEST" == true ]]; then echo "" START=$SECONDS + echo "Building test binaries..." + make build-test-binaries + GINKGO_TEST_BUILD="$SCRIPT_DIR/../test/build" TEST_IMAGE_REGISTRY=${TEST_IMAGE_REGISTRY:-"public.ecr.aws/eks"} - (CGO_ENABLED=0 ginkgo --no-color --focus="SOAK_TEST" -v --timeout 3h --fail-on-pending $GINKGO_TEST_BUILD/cni.test -- \ + (CGO_ENABLED=0 ginkgo $EXTRA_GINKGO_FLAGS --no-color --focus="SOAK_TEST" -v --timeout 3h --fail-on-pending $GINKGO_TEST_BUILD/cni.test -- \ --cluster-kubeconfig="$KUBECONFIG_PATH" \ --cluster-name="$CLUSTER_NAME" \ --aws-region="$AWS_DEFAULT_REGION" \ @@ -306,7 +311,8 @@ if [[ "$RUN_SOAK_TEST" == true ]]; then --ng-name-label-key="kubernetes.io/os" \ --ng-name-label-val="ubuntu" \ --test-image-registry=$TEST_IMAGE_REGISTRY \ - --publish-cw-metrics=true ) + --publish-cw-metrics=true \ + $ENDPOINT_OPTION) SOAK_DURATION=$((SECONDS - START)) echo "TIMELINE: Soak tests took $SOAK_DURATION seconds." From 49811fb2478c6c796b5037336fd20a19d7f3ed77 Mon Sep 17 00:00:00 2001 From: Supreeth Ramakrishna Date: Mon, 13 Oct 2025 02:58:28 -0700 Subject: [PATCH 3/3] minor fix --- scripts/run-integration-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index c101aac128..fe4cc6dd56 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -309,7 +309,7 @@ if [[ "$RUN_SOAK_TEST" == true ]]; then --aws-region="$AWS_DEFAULT_REGION" \ --aws-vpc-id="$VPC_ID" \ --ng-name-label-key="kubernetes.io/os" \ - --ng-name-label-val="ubuntu" \ + --ng-name-label-val="linux" \ --test-image-registry=$TEST_IMAGE_REGISTRY \ --publish-cw-metrics=true \ $ENDPOINT_OPTION)