From dfd5d6d43c7ae60779526bd86757ea0facc82e33 Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Tue, 19 Aug 2025 10:32:16 +0200 Subject: [PATCH] Add STACKIT Signed-off-by: Robin Schneider --- ci-automation/ci-config.env | 8 ++++ ci-automation/garbage_collect.sh | 1 + ci-automation/garbage_collect_cloud.sh | 2 + ci-automation/vendor-testing/stackit.sh | 50 +++++++++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100755 ci-automation/vendor-testing/stackit.sh diff --git a/ci-automation/ci-config.env b/ci-automation/ci-config.env index cfacd062975..2b34b48e08c 100644 --- a/ci-automation/ci-config.env +++ b/ci-automation/ci-config.env @@ -179,3 +179,11 @@ HETZNER_PARALLEL="${PARALLEL_TESTS:-1}" AKAMAI_PARALLEL="${PARALLEL_TESTS:-1}" AKAMAI_REGION="us-ord" AKAMAI_INSTANCE_TYPE="g6-standard-2" + +# -- STACKIT -- +STACKIT_PARALLEL="${PARALLEL_TESTS:-1}" +STACKIT_IMAGE_NAME="flatcar_production_stackit_image.img" +: ${STACKIT_amd64_INSTANCE_TYPE:="c2i.8"} +: ${STACKIT_arm64_INSTANCE_TYPE:="g1r.4d"} +: ${STACKIT_arm64_LOCATION:="eu01-2"} +: ${STACKIT_amd64_LOCATION:="eu01-2"} diff --git a/ci-automation/garbage_collect.sh b/ci-automation/garbage_collect.sh index bef1db3fc87..fb095fec52a 100644 --- a/ci-automation/garbage_collect.sh +++ b/ci-automation/garbage_collect.sh @@ -264,6 +264,7 @@ function _garbage_collect_impl() { --env OPENSTACK_CREDS \ --env BRIGHTBOX_CLIENT_ID --env BRIGHTBOX_CLIENT_SECRET \ --env AKAMAI_TOKEN \ + --env STACKIT_SERVICE_ACCOUNT \ -w /work -v "$PWD":/work "${mantle_ref}" /work/ci-automation/garbage_collect_cloud.sh echo diff --git a/ci-automation/garbage_collect_cloud.sh b/ci-automation/garbage_collect_cloud.sh index 56d9191f671..bef6909b9fa 100755 --- a/ci-automation/garbage_collect_cloud.sh +++ b/ci-automation/garbage_collect_cloud.sh @@ -13,6 +13,8 @@ timeout --signal=SIGQUIT 60m ore brightbox gc --duration 6h \ --brightbox-client-id="${BRIGHTBOX_CLIENT_ID}" --brightbox-client-secret="${BRIGHTBOX_CLIENT_SECRET}" timeout --signal=SIGQUIT 60m ore akamai gc --duration 6h \ --akamai-token="${AKAMAI_TOKEN}" +timeout --signal=SIGQUIT 60m ore stackit gc --duration 6h \ + --stackit-service-account-key-path=<(echo "${STACKIT_SERVICE_ACCOUNT}" | base64 --decode) secret_to_file aws_credentials_config_file "${AWS_CREDENTIALS}" for channel in alpha beta stable lts; do for arch in amd64 arm64; do diff --git a/ci-automation/vendor-testing/stackit.sh b/ci-automation/vendor-testing/stackit.sh new file mode 100755 index 00000000000..ea8c30e31bb --- /dev/null +++ b/ci-automation/vendor-testing/stackit.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright (c) 2025 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 STACKIT vendor. +# This script is supposed to run in the mantle container. + +source ci-automation/vendor_test.sh + +stackit_instance_type_var="STACKIT_${CIA_ARCH}_INSTANCE_TYPE" +stackit_instance_type="${!stackit_instance_type_var}" + +stackit_location_var="STACKIT_${CIA_ARCH}_LOCATION" +stackit_location="${!stackit_location_var}" + +copy_from_buildcache "images/${CIA_ARCH}/${CIA_VERNUM}/${STACKIT_IMAGE_NAME}" . + +kola_test_basename="ci-${CIA_VERNUM//[+.]/-}" + +# Upload the image on STACKIT. +IMAGE_ID=$(ore stackit \ + --stackit-service-account-key-path=<(echo "${STACKIT_SERVICE_ACCOUNT}" | base64 --decode) \ + --stackit-project-id="${STACKIT_PROJECT_ID}" \ + create-image \ + --board "${CIA_ARCH}-usr" \ + --name "${kola_test_basename}" \ + --file="${STACKIT_IMAGE_NAME}" +) + +set -x + +timeout --signal=SIGQUIT 2h kola run \ + --board="${CIA_ARCH}-usr" \ + --parallel="${STACKIT_PARALLEL}" \ + --tapfile="${CIA_TAPFILE}" \ + --channel="${CIA_CHANNEL}" \ + --basename="${kola_test_basename}" \ + --platform=stackit \ + --stackit-service-account-key-path=<(echo "${STACKIT_SERVICE_ACCOUNT}" | base64 --decode) \ + --stackit-project-id="${STACKIT_PROJECT_ID}" \ + --stackit-image-id="${IMAGE_ID}" \ + --stackit-type="${stackit_instance_type}" \ + --stackit-availability-zone="${stackit_location}" \ + --image-version "${CIA_VERNUM}" \ + "${@}" + +set +x