Skip to content

Commit

Permalink
Merge pull request containers#374 from cevich/use_image_search
Browse files Browse the repository at this point in the history
Cirrus: Update meta-task for EC2 image
  • Loading branch information
openshift-merge-robot authored Aug 29, 2022
2 parents 24b52d0 + a797837 commit aca2e8e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
11 changes: 7 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ env:
# Save a little typing (path relative to $CIRRUS_WORKING_DIR)
SCRIPT_BASE: "./contrib/cirrus"
FEDORA_NAME: "fedora-36"
IMAGE_SUFFIX: "c5353795591864320"
IMAGE_SUFFIX: "c5823947156488192"
FEDORA_NETAVARK_IMAGE: "fedora-netavark-${IMAGE_SUFFIX}"
AARDVARK_DNS_BRANCH: "main"
AARDVARK_DNS_URL: "https://api.cirrus-ci.com/v1/artifact/github/containers/aardvark-dns/success/binary.zip?branch=${AARDVARK_DNS_BRANCH}"
FEDORA_NETAVARK_AARCH64_AMI_ID: "ami-00d7ccde5eaacc50e"
FEDORA_NETAVARK_AARCH64_AMI: "fedora-netavark-aws-arm64-${IMAGE_SUFFIX}"
EC2_INST_TYPE: "t4g.xlarge"


gcp_credentials: ENCRYPTED[d6efdb7d6d4c61e3831df2193ca6348bb02f26cd931695f69d41930b1965f7dab72a838ca0902f6ed8cde66c7deddae2]
Expand Down Expand Up @@ -75,8 +76,8 @@ build_task:
build_aarch64_task:
alias: "build_aarch64"
ec2_instance: &standard_build_ec2_aarch64
image: "${FEDORA_NETAVARK_AARCH64_AMI_ID}"
type: t4g.xlarge
image: "${FEDORA_NETAVARK_AARCH64_AMI}"
type: $EC2_INST_TYPE
region: us-east-1
architecture: arm64 # CAUTION: This has to be "arm64", not "aarch64"
cargo_cache: &cargo_cache_aarch64
Expand Down Expand Up @@ -234,8 +235,10 @@ meta_task:
env:
# Space-separated list of images used by this repository state
IMGNAMES: "${FEDORA_NETAVARK_IMAGE}"
EC2IMGNAMES: "${FEDORA_NETAVARK_AARCH64_AMI}"
BUILDID: "${CIRRUS_BUILD_ID}"
REPOREF: "${CIRRUS_REPO_NAME}"
AWSINI: ENCRYPTED[34663ab52255921d163085d348f5695b19ae49b8fec398282b9cd9aecadcb0144544e203ec553d38734f201b6885fd0a]
GCPJSON: ENCRYPTED[e7e6e13b98eb34f480a12412a048e3fb78a02239c229659e136b7a27e2ab25a5bbb61ab6016e322cb6f777fa2c9f9520]
GCPNAME: ENCRYPTED[f3fc6da8fe283ef506d7b18467a81153ea8e18b1d3cd76e79dcd6f566f20fdd3651522432d3d232f4d69eeb1502d1f6b]
GCPPROJECT: libpod-218412
Expand Down
1 change: 1 addition & 0 deletions contrib/cirrus/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ make_cienv(){
}

complete_setup(){
set +x
msg "************************************************************"
msg "Completing environment setup, writing vars:"
msg "************************************************************"
Expand Down
23 changes: 18 additions & 5 deletions hack/get_ci_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <<EOF
in_get_ci_vm "$1" # handles GET_CI_VM==0 case
case "$GET_CI_VM" in
1)
cat <<EOF
DESTDIR="/var/tmp/netavark"
UPSTREAM_REPO="https://github.com/containers/netavark.git"
CI_ENVFILE="/etc/ci_environment"
Expand All @@ -40,6 +42,15 @@ GCLOUD_CPUS="2"
GCLOUD_MEMORY="4Gb"
GCLOUD_DISK="200"
EOF
;;
2)
# get_ci_vm APIv2 configuration details
echo "AWS_PROFILE=containers"
;;
*)
echo "Error: Your get_ci_vm container image is too old."
;;
esac
elif [[ "$1" == "--setup" ]]; then
in_get_ci_vm "$1"
# get_ci_vm container entrypoint calls us with this option on the
Expand All @@ -48,16 +59,18 @@ elif [[ "$1" == "--setup" ]]; then
echo "+ Running environment setup" > /dev/stderr
./contrib/cirrus/setup.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" \
-e SRCDIR=/src \
-e GCLOUD_ZONE="$GCLOUD_ZONE" \
-e DEBUG="${DEBUG:-0}" \
-e A_DEBUG="${A_DEBUG:-0}" \
-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

0 comments on commit aca2e8e

Please sign in to comment.