From 1e4a141d881696948db52de5801d8ea64079ac0c Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Wed, 27 Jul 2022 16:05:06 -0400 Subject: Cirrus: Support EC2 instances in hack/get_ci_vm.sh ***Depends on:*** https://github.com/containers/automation_images/pull/160 Signed-off-by: Chris Evich --- .cirrus.yml | 6 ++++-- hack/get_ci_vm.sh | 22 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 9daf33ba2..223fc5b53 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -204,10 +204,11 @@ build_aarch64_task: only_if: "$CIRRUS_CRON != 'multiarch'" ec2_instance: &standard_build_ec2_aarch64 image: ${VM_IMAGE_NAME} - type: t4g.xlarge + type: ${EC2_INST_TYPE} region: us-east-1 architecture: arm64 # CAUTION: This has to be "arm64", not "aarch64". env: &stdenvars_aarch64 + EC2_INST_TYPE: "t4g.xlarge" DISTRO_NV: ${FEDORA_AARCH64_NAME} VM_IMAGE_NAME: ${FEDORA_AARCH64_AMI_ID} CTR_FQIN: ${FEDORA_CONTAINER_FQIN} @@ -695,9 +696,10 @@ podman_machine_task: - rootless_integration_test ec2_instance: image: "${VM_IMAGE_NAME}" - type: m5zn.metal # Bare-metal instance is required + type: "${EC2_INST_TYPE}" region: us-east-1 env: + EC2_INST_TYPE: "m5zn.metal" # Bare-metal instance is required TEST_FLAVOR: "machine" PRIV_NAME: "rootless" # intended use-case DISTRO_NV: "${FEDORA_NAME}" diff --git a/hack/get_ci_vm.sh b/hack/get_ci_vm.sh index 6632a0178..bdd947bba 100755 --- a/hack/get_ci_vm.sh +++ b/hack/get_ci_vm.sh @@ -15,7 +15,7 @@ SCRIPT_FILEPATH=$(realpath "${BASH_SOURCE[0]}") SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH") REPO_DIRPATH=$(realpath "$SCRIPT_DIRPATH/../") -# Help detect if we were called by get_ci_vm container +# Help detect what get_ci_vm container called this script GET_CI_VM="${GET_CI_VM:-0}" in_get_ci_vm() { if ((GET_CI_VM==0)); then @@ -27,8 +27,10 @@ in_get_ci_vm() { # get_ci_vm APIv1 container entrypoint calls into this script # to obtain required repo. specific configuration options. if [[ "$1" == "--config" ]]; then - in_get_ci_vm "$1" - cat < /dev/stderr ./contrib/cirrus/setup_environment.sh else - # Create and access VM for specified Cirrus-CI task + # Pass this repo and CLI args into container for VM creation/management mkdir -p $HOME/.config/gcloud/ssh + mkdir -p $HOME/.aws podman run -it --rm \ --tz=local \ -e NAME="$USER" \ @@ -65,5 +78,6 @@ else -v $REPO_DIRPATH:/src:O \ -v $HOME/.config/gcloud:/root/.config/gcloud:z \ -v $HOME/.config/gcloud/ssh:/root/.ssh:z \ + -v $HOME/.aws:/root/.aws:z \ quay.io/libpod/get_ci_vm:latest "$@" fi -- cgit v1.2.3-54-g00ecf