Skip to content

Commit

Permalink
Cirrus: Improve CI VM image updates for EC2
Browse files Browse the repository at this point in the history
AWS EC2 keys VM images by an utterly unreadable, horrible to use,
generated "AMI ID" value.  This is very error prone for humans in
practice, since it's impossible to tell one image from the next by
eye.  Worse, EC2 permits duplicate name-tag values, complicating
image specification further.

However fortunately, Cirrus-CI recently implemented a feature by
which AMI's may be referenced by a name-tag search - choosing
the most recent AMI found.  Since the `containers/automation_images`
build workflow always assigns a unique name + `$IMAGE_SUFFIX` value,
we can simply re-use it for both AWS and GCP image specification.

In other words as of this commit, specifying new CI VM images can
be done by simply updating the `$IMAGE_SUFFIX` value as we've always
done.  No need to call out a specific AMI ID just for EC2 tasks.

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed Aug 9, 2022
1 parent 097cc6e commit d2d7898
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ env:

# Image identifiers
IMAGE_SUFFIX: "c5495735033528320"
FEDORA_AMI_ID: "ami-0df5df528071f1052" # matches c5495735033528320
FEDORA_AARCH64_AMI_ID: "ami-02ee8b3a782a78791" # matches c5495735033528320
# Complete image names
# EC2 images
FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}"
FEDORA_AARCH64_AMI: "fedora-podman-aws-arm64-${IMAGE_SUFFIX}"
# GCP Images
FEDORA_CACHE_IMAGE_NAME: "fedora-${IMAGE_SUFFIX}"
#PRIOR_FEDORA_CACHE_IMAGE_NAME: "prior-fedora-${IMAGE_SUFFIX}"
UBUNTU_CACHE_IMAGE_NAME: "ubuntu-${IMAGE_SUFFIX}"

# Container FQIN's
FEDORA_CONTAINER_FQIN: "quay.io/libpod/fedora_podman:${IMAGE_SUFFIX}"
#PRIOR_FEDORA_CONTAINER_FQIN: "quay.io/libpod/prior-fedora_podman:${IMAGE_SUFFIX}"
Expand Down Expand Up @@ -210,7 +210,7 @@ build_aarch64_task:
env: &stdenvars_aarch64
EC2_INST_TYPE: "t4g.xlarge"
DISTRO_NV: ${FEDORA_AARCH64_NAME}
VM_IMAGE_NAME: ${FEDORA_AARCH64_AMI_ID}
VM_IMAGE_NAME: ${FEDORA_AARCH64_AMI}
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
CI_DESIRED_RUNTIME: crun
TEST_FLAVOR: build
Expand Down Expand Up @@ -701,7 +701,7 @@ podman_machine_task:
TEST_FLAVOR: "machine"
PRIV_NAME: "rootless" # intended use-case
DISTRO_NV: "${FEDORA_NAME}"
VM_IMAGE_NAME: "${FEDORA_AMI_ID}"
VM_IMAGE_NAME: "${FEDORA_AMI}"
clone_script: *get_gosrc
setup_script: *setup
main_script: *main
Expand Down

0 comments on commit d2d7898

Please sign in to comment.