Skip to content

Commit 6863684

Browse files
committed
Enable unattended upgrades on Ubuntu nodes for soak testing
1 parent 7077081 commit 6863684

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed

.github/workflows/integration-tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Integration tests
22

33
on:
4+
workflow_dispatch: {}
5+
schedule:
6+
- cron: "0 3 * * *" # every night
47
push:
58
branches:
69
- "master"

scripts/lib/cluster.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ function up-test-cluster() {
3030
if [[ "$RUN_BOTTLEROCKET_TEST" == true ]]; then
3131
echo "Copying bottlerocket config to $CLUSTER_CONFIG"
3232
cp $CLUSTER_TEMPLATE_PATH/bottlerocket.yaml $CLUSTER_CONFIG
33+
elif [[ "$RUN_UBUNTU_TEST" == true ]]; then
34+
echo "Copying ubuntu config to $CLUSTER_CONFIG"
35+
cp $CLUSTER_TEMPLATE_PATH/ubuntu.yaml $CLUSTER_CONFIG
3336
elif [[ "$RUN_PERFORMANCE_TESTS" == true ]]; then
3437
echo "Copying perf test cluster config to $CLUSTER_CONFIG"
3538
cp $CLUSTER_TEMPLATE_PATH/perf-cluster.yml $CLUSTER_CONFIG

scripts/run-integration-tests.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ARCH=$(go env GOARCH)
2929
: "${RUN_KOPS_TEST:=false}"
3030
: "${RUN_BOTTLEROCKET_TEST:=false}"
3131
: "${RUN_PERFORMANCE_TESTS:=false}"
32+
: "${RUN_SOAK_TEST:=false}"
3233
: "${RUNNING_PERFORMANCE:=false}"
3334
: "${KOPS_VERSION=v1.33.0-beta.1}"
3435

@@ -57,6 +58,9 @@ on_error() {
5758
if [[ $RUN_PERFORMANCE_TESTS == true ]]; then
5859
emit_cloudwatch_metric "performance_test_status" "0"
5960
fi
61+
if [[ $RUN_SOAK_TEST == true ]]; then
62+
emit_cloudwatch_metric "soak_test_status" "0"
63+
fi
6064
# Make sure we destroy any cluster that was created if we hit run into an
6165
# error when attempting to run tests against the
6266
if [[ $RUNNING_PERFORMANCE == false ]]; then
@@ -284,6 +288,30 @@ if [[ "$RUN_PERFORMANCE_TESTS" == true ]]; then
284288
uninstall_cw_agent
285289
fi
286290

291+
if [[ "$RUN_SOAK_TEST" == true ]]; then
292+
echo "*******************************************************************************"
293+
echo "Running soak tests on current image"
294+
echo ""
295+
START=$SECONDS
296+
297+
GINKGO_TEST_BUILD="$SCRIPT_DIR/../test/build"
298+
TEST_IMAGE_REGISTRY=${TEST_IMAGE_REGISTRY:-"617930562442.dkr.ecr.us-west-2.amazonaws.com"}
299+
300+
(CGO_ENABLED=0 ginkgo $EXTRA_GINKGO_FLAGS --no-color --focus="SOAK_TEST" -v --timeout 3h --fail-on-pending $GINKGO_TEST_BUILD/cni.test -- \
301+
--cluster-kubeconfig="$KUBECONFIG" \
302+
--cluster-name="$CLUSTER_NAME" \
303+
--aws-region="$REGION" \
304+
--aws-vpc-id="$VPC_ID" \
305+
--ng-name-label-key="kubernetes.io/os" \
306+
--ng-name-label-val="linux" \
307+
--test-image-registry=$TEST_IMAGE_REGISTRY \
308+
--publish-cw-metrics=true \
309+
$ENDPOINT_OPTION)
310+
311+
SOAK_DURATION=$((SECONDS - START))
312+
echo "TIMELINE: Soak tests took $SOAK_DURATION seconds."
313+
fi
314+
287315
if [[ $RUN_KOPS_TEST == true ]]; then
288316
run_kops_conformance
289317
fi
@@ -299,6 +327,9 @@ if [[ "$DEPROVISION" == true ]]; then
299327
elif [[ "$RUN_PERFORMANCE_TESTS" == true ]]; then
300328
eksctl delete cluster $CLUSTER_NAME
301329
emit_cloudwatch_metric "performance_test_status" "1"
330+
elif [[ "$RUN_SOAK_TEST" == true ]]; then
331+
eksctl delete cluster $CLUSTER_NAME --disable-nodegroup-eviction
332+
emit_cloudwatch_metric "soak_test_status" "1"
302333
else
303334
down-test-cluster
304335
fi

scripts/test/config/ubuntu.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
apiVersion: eksctl.io/v1alpha5
3+
kind: ClusterConfig
4+
5+
metadata:
6+
name: CLUSTER_NAME_PLACEHOLDER
7+
region: us-west-2
8+
9+
managedNodeGroups:
10+
- name: cni-test-arm64-ubuntu-mng
11+
instanceType: c6g.xlarge
12+
desiredCapacity: 3
13+
amiFamily: UbuntuPro2404
14+
minSize: 3
15+
maxSize: 3
16+
volumeSize: 40
17+
releaseVersion: ""
18+
preBootstrapCommands:
19+
- |
20+
# Enable unattended upgrades for soak testing
21+
apt-get update
22+
apt-get install -y unattended-upgrades
23+
echo 'Unattended-Upgrade::Automatic-Reboot "false";' >> /etc/apt/apt.conf.d/50unattended-upgrades
24+
echo 'Unattended-Upgrade::Remove-Unused-Dependencies "true";' >> /etc/apt/apt.conf.d/50unattended-upgrades
25+
systemctl enable unattended-upgrades
26+
systemctl start unattended-upgrades
27+
tags:
28+
group: amazon-vpc-cni-k8s-arm64-ubuntu
29+
- name: cni-test-x86-ubuntu-mng
30+
instanceType: c5.xlarge
31+
desiredCapacity: 3
32+
amiFamily: UbuntuPro2404
33+
minSize: 3
34+
maxSize: 3
35+
volumeSize: 40
36+
releaseVersion: ""
37+
preBootstrapCommands:
38+
- |
39+
# Enable unattended upgrades for soak testing
40+
apt-get update
41+
apt-get install -y unattended-upgrades
42+
echo 'Unattended-Upgrade::Automatic-Reboot "false";' >> /etc/apt/apt.conf.d/50unattended-upgrades
43+
echo 'Unattended-Upgrade::Remove-Unused-Dependencies "true";' >> /etc/apt/apt.conf.d/50unattended-upgrades
44+
systemctl enable unattended-upgrades
45+
systemctl start unattended-upgrades
46+
tags:
47+
group: amazon-vpc-cni-k8s-x86-ubuntu
48+
availabilityZones:
49+
- us-west-2a
50+
- us-west-2b
51+
- us-west-2c
52+
- us-west-2d

0 commit comments

Comments
 (0)