talos/hack/test/e2e-qemu.sh
Andrey Smirnov ff0d4b305a feat: build Talos images/artifacts for amd64/arm64
By default, build outside of Drone works the same and builds only amd64
version, loads images back into dockerd, etc.

If multiple platforms are used, multi-arch images are built which can't
be exported to docker or to `.tar` image, they're always pushed to the
registry (even for PR builds to our internal CI registry).

Artifacts as files (initramfs, kernel) now have `-arch` suffix:
`vmlinuz-amd64`, `initramfs-amd64.xz`. "Magic" script normalizes output
paths depending on whether single platform or multiple platforms were
given.

VM provisioners accept magic `${ARCH}` in initramfs/kernel paths which
gets replaced by cluster architecture.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-09-27 10:32:07 -07:00

66 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
set -eou pipefail
source ./hack/test/e2e.sh
PROVISIONER=qemu
CLUSTER_NAME=e2e-${PROVISIONER}
case "${CI:-false}" in
true)
QEMU_FLAGS=""
INSTALLER_TAG="${TAG}"
;;
*)
QEMU_FLAGS="--with-bootloader=false"
INSTALLER_TAG="latest"
;;
esac
case "${CUSTOM_CNI_URL:-false}" in
false)
CUSTOM_CNI_FLAG=
;;
*)
CUSTOM_CNI_FLAG="--custom-cni-url=${CUSTOM_CNI_URL}"
;;
esac
case "${WITH_UEFI:-false}" in
true)
QEMU_FLAGS="${QEMU_FLAGS} --with-uefi"
;;
esac
function create_cluster {
build_registry_mirrors
"${TALOSCTL}" cluster create \
--provisioner "${PROVISIONER}" \
--name "${CLUSTER_NAME}" \
--masters=3 \
--mtu 1500 \
--memory 2048 \
--cpus 2.0 \
--cidr 172.20.1.0/24 \
--install-image ${REGISTRY:-ghcr.io}/talos-systems/installer:${INSTALLER_TAG} \
--with-init-node=false \
--crashdump \
${REGISTRY_MIRROR_FLAGS} \
${QEMU_FLAGS} \
${CUSTOM_CNI_FLAG}
"${TALOSCTL}" config node 172.20.1.2
}
function destroy_cluster() {
"${TALOSCTL}" cluster destroy --name "${CLUSTER_NAME}" --provisioner "${PROVISIONER}"
}
create_cluster
get_kubeconfig
run_talos_integration_test
run_kubernetes_integration_test
destroy_cluster