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..fe4cc6dd56 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -28,8 +28,12 @@ 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}" +: "${EXTRA_GINKGO_FLAGS:=""}" +: "${ENDPOINT_OPTION:=""}" : "${KOPS_VERSION=v1.33.0-beta.1}" if [[ -z $EKS_CLUSTER_VERSION || -z $K8S_VERSION ]]; then @@ -57,6 +61,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 +291,33 @@ 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 + + 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 $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" \ + --aws-vpc-id="$VPC_ID" \ + --ng-name-label-key="kubernetes.io/os" \ + --ng-name-label-val="linux" \ + --test-image-registry=$TEST_IMAGE_REGISTRY \ + --publish-cw-metrics=true \ + $ENDPOINT_OPTION) + + 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 +333,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