ci-automation: Initial test script for Digital Ocean

This commit is contained in:
Krzesimir Nowak 2022-04-21 17:26:47 +02:00
parent 4adf8df751
commit b6bb07acdc
2 changed files with 81 additions and 0 deletions

View File

@ -82,3 +82,13 @@ GCE_IMAGE_NAME="flatcar_production_gce.tar.gz"
GCE_GCS_IMAGE_UPLOAD="gs://flatcar-jenkins/developer/gce-ci" GCE_GCS_IMAGE_UPLOAD="gs://flatcar-jenkins/developer/gce-ci"
GCE_MACHINE_TYPE="${GCE_MACHINE_TYPE:-n1-standard-2}" GCE_MACHINE_TYPE="${GCE_MACHINE_TYPE:-n1-standard-2}"
GCE_PARALLEL="${PARALLEL_TESTS:-4}" GCE_PARALLEL="${PARALLEL_TESTS:-4}"
# -- Digital Ocean --
# Use the "@ARCH@", "@CHANNEL@" and "@VERNUM@" placeholders. They will
# be replaced.
DO_IMAGE_URL="https://${BUILDCACHE_SERVER}/images/@ARCH@/@VERNUM@/flatcar_production_digitalocean_image.bin.bz2"
DO_CONFIG_FILE='do-token.json'
DO_REGION='sfo3'
DO_MACHINE_SIZE='s-2vcpu-2gb'
DO_PARALLEL='8'

View File

@ -0,0 +1,71 @@
#!/bin/bash
# Copyright (c) 2022 The Flatcar Maintainers.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -euo pipefail
# Test execution script for the Digital Ocean vendor image.
# This script is supposed to run in the mantle container.
work_dir="$1"; shift
arch="$1"; shift
vernum="$1"; shift
tapfile="$1"; shift
# $@ now contains tests / test patterns to run
source ci-automation/ci_automation_common.sh
source sdk_lib/sdk_container_common.sh
mkdir -p "${work_dir}"
cd "${work_dir}"
# We never ran Digital Ocean on arm64, so for now fail it as an
# unsupported option.
if [[ "${arch}" == "arm64" ]]; then
echo "1..1" > "${tapfile}"
echo "not ok - all digital ocean tests" >> "${tapfile}"
echo " ---" >> "${tapfile}"
echo " ERROR: ARM64 tests not supported on Digital Ocean." | tee -a "${tapfile}"
echo " ..." >> "${tapfile}"
exit 1
fi
channel="$(get_git_channel)"
if [[ "${channel}" = 'developer' ]]; then
channel='alpha'
fi
image_name="ci-${vernum//+/-}"
testscript="$(basename "$0")"
image_url="${DO_IMAGE_URL//@ARCH@/${arch}}"
image_url="${image_url//@CHANNEL@/${channel}}"
image_url="${image_url//@VERNUM@/${vernum}}"
ore do create-image \
--config-file="${DO_CONFIG_FILE}" \
--region="${DO_REGION}" \
--name="${image_name}" \
--url="${image_url}"
trap 'ore do delete-image \
--name="${image_name}" \
--config-file="${DO_CONFIG_FILE}"' EXIT
set -x
timeout --signal=SIGQUIT 4h\
kola run \
--do-size="${DO_MACHINE_SIZE}" \
--do-region="${DO_REGION}" \
--basename="${image_name}" \
--do-config-file="${DO_CONFIG_FILE}" \
--do-image="${image_name}" \
--parallel="${DO_PARALLEL}" \
--platform=do \
--channel="${channel}" \
--tapfile="${tapfile}" \
--torcx-manifest='../torcx_manifest.json' \
"${@}"
set +x