mirror of
https://github.com/containers/podman.git
synced 2025-10-17 03:04:21 +08:00
Merge pull request #15145 from cevich/ec2_get_ci_vm
[CI:DOCS] Cirrus: Support EC2 instances in hack/get_ci_vm.sh
This commit is contained in:
@ -204,10 +204,11 @@ build_aarch64_task:
|
|||||||
only_if: "$CIRRUS_CRON != 'multiarch'"
|
only_if: "$CIRRUS_CRON != 'multiarch'"
|
||||||
ec2_instance: &standard_build_ec2_aarch64
|
ec2_instance: &standard_build_ec2_aarch64
|
||||||
image: ${VM_IMAGE_NAME}
|
image: ${VM_IMAGE_NAME}
|
||||||
type: t4g.xlarge
|
type: ${EC2_INST_TYPE}
|
||||||
region: us-east-1
|
region: us-east-1
|
||||||
architecture: arm64 # CAUTION: This has to be "arm64", not "aarch64".
|
architecture: arm64 # CAUTION: This has to be "arm64", not "aarch64".
|
||||||
env: &stdenvars_aarch64
|
env: &stdenvars_aarch64
|
||||||
|
EC2_INST_TYPE: "t4g.xlarge"
|
||||||
DISTRO_NV: ${FEDORA_AARCH64_NAME}
|
DISTRO_NV: ${FEDORA_AARCH64_NAME}
|
||||||
VM_IMAGE_NAME: ${FEDORA_AARCH64_AMI_ID}
|
VM_IMAGE_NAME: ${FEDORA_AARCH64_AMI_ID}
|
||||||
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
|
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
|
||||||
@ -695,9 +696,10 @@ podman_machine_task:
|
|||||||
- rootless_integration_test
|
- rootless_integration_test
|
||||||
ec2_instance:
|
ec2_instance:
|
||||||
image: "${VM_IMAGE_NAME}"
|
image: "${VM_IMAGE_NAME}"
|
||||||
type: m5zn.metal # Bare-metal instance is required
|
type: "${EC2_INST_TYPE}"
|
||||||
region: us-east-1
|
region: us-east-1
|
||||||
env:
|
env:
|
||||||
|
EC2_INST_TYPE: "m5zn.metal" # Bare-metal instance is required
|
||||||
TEST_FLAVOR: "machine"
|
TEST_FLAVOR: "machine"
|
||||||
PRIV_NAME: "rootless" # intended use-case
|
PRIV_NAME: "rootless" # intended use-case
|
||||||
DISTRO_NV: "${FEDORA_NAME}"
|
DISTRO_NV: "${FEDORA_NAME}"
|
||||||
|
@ -15,7 +15,7 @@ SCRIPT_FILEPATH=$(realpath "${BASH_SOURCE[0]}")
|
|||||||
SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH")
|
SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH")
|
||||||
REPO_DIRPATH=$(realpath "$SCRIPT_DIRPATH/../")
|
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}"
|
GET_CI_VM="${GET_CI_VM:-0}"
|
||||||
in_get_ci_vm() {
|
in_get_ci_vm() {
|
||||||
if ((GET_CI_VM==0)); then
|
if ((GET_CI_VM==0)); then
|
||||||
@ -27,8 +27,10 @@ in_get_ci_vm() {
|
|||||||
# get_ci_vm APIv1 container entrypoint calls into this script
|
# get_ci_vm APIv1 container entrypoint calls into this script
|
||||||
# to obtain required repo. specific configuration options.
|
# to obtain required repo. specific configuration options.
|
||||||
if [[ "$1" == "--config" ]]; then
|
if [[ "$1" == "--config" ]]; then
|
||||||
in_get_ci_vm "$1"
|
in_get_ci_vm "$1" # handles GET_CI_VM==0 case
|
||||||
cat <<EOF
|
case "$GET_CI_VM" in
|
||||||
|
1)
|
||||||
|
cat <<EOF
|
||||||
DESTDIR="/var/tmp/go/src/github.com/containers/podman"
|
DESTDIR="/var/tmp/go/src/github.com/containers/podman"
|
||||||
UPSTREAM_REPO="https://github.com/containers/podman.git"
|
UPSTREAM_REPO="https://github.com/containers/podman.git"
|
||||||
CI_ENVFILE="/etc/ci_environment"
|
CI_ENVFILE="/etc/ci_environment"
|
||||||
@ -40,8 +42,18 @@ GCLOUD_CPUS="2"
|
|||||||
GCLOUD_MEMORY="4Gb"
|
GCLOUD_MEMORY="4Gb"
|
||||||
GCLOUD_DISK="200"
|
GCLOUD_DISK="200"
|
||||||
EOF
|
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
|
elif [[ "$1" == "--setup" ]]; then
|
||||||
in_get_ci_vm "$1"
|
in_get_ci_vm "$1"
|
||||||
|
unset GET_CI_VM
|
||||||
# get_ci_vm container entrypoint calls us with this option on the
|
# get_ci_vm container entrypoint calls us with this option on the
|
||||||
# Cirrus-CI environment instance, to perform repo.-specific setup.
|
# Cirrus-CI environment instance, to perform repo.-specific setup.
|
||||||
cd $REPO_DIRPATH
|
cd $REPO_DIRPATH
|
||||||
@ -54,8 +66,9 @@ elif [[ "$1" == "--setup" ]]; then
|
|||||||
echo "+ Running environment setup" > /dev/stderr
|
echo "+ Running environment setup" > /dev/stderr
|
||||||
./contrib/cirrus/setup_environment.sh
|
./contrib/cirrus/setup_environment.sh
|
||||||
else
|
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/.config/gcloud/ssh
|
||||||
|
mkdir -p $HOME/.aws
|
||||||
podman run -it --rm \
|
podman run -it --rm \
|
||||||
--tz=local \
|
--tz=local \
|
||||||
-e NAME="$USER" \
|
-e NAME="$USER" \
|
||||||
@ -65,5 +78,6 @@ else
|
|||||||
-v $REPO_DIRPATH:/src:O \
|
-v $REPO_DIRPATH:/src:O \
|
||||||
-v $HOME/.config/gcloud:/root/.config/gcloud:z \
|
-v $HOME/.config/gcloud:/root/.config/gcloud:z \
|
||||||
-v $HOME/.config/gcloud/ssh:/root/.ssh:z \
|
-v $HOME/.config/gcloud/ssh:/root/.ssh:z \
|
||||||
|
-v $HOME/.aws:/root/.aws:z \
|
||||||
quay.io/libpod/get_ci_vm:latest "$@"
|
quay.io/libpod/get_ci_vm:latest "$@"
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user