Kai Lueke 0bd6d1aae5 jenkins/kola/aws.sh: use larger arm64 instance type for kubeadm
Currently the kubeadm tests fail on arm64 because the instance type
only offers 1 vCPU:
cluster.go:117: error execution phase preflight: [preflight] Some fatal errors occurred:
cluster.go:117: [ERROR NumCPU]: the number of available CPUs 1 is less than the required 2

Switch to the next larger instance type which has 2 vCPUS.
2021-10-21 14:03:39 +02:00

64 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
set -ex
rm -rf *.tap _kola_temp*
NAME="jenkins-${JOB_NAME##*/}-${BUILD_NUMBER}"
if [[ "${AWS_INSTANCE_TYPE}" != "" ]]; then
instance_type="${AWS_INSTANCE_TYPE}"
elif [[ "${BOARD}" == "arm64-usr" ]]; then
instance_type="a1.large"
elif [[ "${BOARD}" == "amd64-usr" ]]; then
instance_type="t3.small"
fi
# If the OFFER is empty, it should be treated as the basic offering.
if [[ "${OFFER}" == "" ]]; then
OFFER="basic"
fi
# Append the offer as oem suffix.
if [[ "${OFFER}" != "basic" ]]; then
OEM_SUFFIX="_${OFFER}"
fi
if [[ "${KOLA_TESTS}" == "" ]]; then
KOLA_TESTS="*"
fi
if [[ "${AWS_AMI_ID}" == "" ]]; then
[ -s verify.asc ] && verify_key=--verify-key=verify.asc || verify_key=
mkdir -p tmp
bin/cork download-image \
--cache-dir=tmp \
--json-key="${GOOGLE_APPLICATION_CREDENTIALS}" \
--platform="aws${OEM_SUFFIX}" \
--root="${DOWNLOAD_ROOT}/boards/${BOARD}/${FLATCAR_VERSION}" \
--sanity-check=false --verify=true $verify_key
bunzip2 "tmp/flatcar_production_ami_vmdk${OEM_SUFFIX}_image.vmdk.bz2"
BUCKET="flatcar-kola-ami-import-${AWS_REGION}"
trap 'bin/ore -d aws delete --region="${AWS_REGION}" --name="${NAME}" --ami-name="${NAME}" --file="tmp/flatcar_production_ami_vmdk${OEM_SUFFIX}_image.vmdk" --bucket "s3://${BUCKET}/${BOARD}/"; rm -r tmp/' EXIT
bin/ore aws initialize --region="${AWS_REGION}" --bucket "${BUCKET}"
AWS_AMI_ID=$(bin/ore aws upload --force --region="${AWS_REGION}" --name=${NAME} --ami-name="${NAME}" --ami-description="Flatcar Test ${NAME}" --file="tmp/flatcar_production_ami_vmdk${OEM_SUFFIX}_image.vmdk" --bucket "s3://${BUCKET}/${BOARD}/" | jq -r .HVM)
echo "Created new AMI ${AWS_AMI_ID} (will be removed after testing)"
fi
# Do not expand the kola test patterns globs
set -o noglob
timeout --signal=SIGQUIT 6h bin/kola run \
--parallel=8 \
--basename="${NAME}" \
--board="${BOARD}" \
--aws-ami="${AWS_AMI_ID}" \
--aws-region="${AWS_REGION}" \
--aws-type="${instance_type}" \
--aws-iam-profile="${AWS_IAM_PROFILE}" \
--platform=aws \
--channel="${GROUP}" \
--offering="${OFFER}" \
--tapfile="${JOB_NAME##*/}.tap" \
--torcx-manifest=torcx_manifest.json \
${KOLA_TESTS}
set +o noglob