AuroraDB IT - Error creating EC2 runner instance

Closes #33874

- Use venv to install python dependencies
- Utilise latest ansible version
- Utilise RHEL 9 image to update python versions

Signed-off-by: Ryan Emerson <remerson@redhat.com>
This commit is contained in:
Ryan Emerson 2024-10-15 17:43:37 +01:00 committed by GitHub
parent 586ef7d726
commit 74caf48b63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View file

@ -13,7 +13,7 @@ CLUSTER_NAME=$3
case $OPERATION in case $OPERATION in
requirements) requirements)
ansible-galaxy collection install -r requirements.yml ansible-galaxy collection install -r requirements.yml
pip3 install --user "ansible==9.*" boto3 botocore pip3 install ansible boto3 botocore
;; ;;
create|delete|start|stop) create|delete|start|stop)
if [ -f "env.yml" ]; then ANSIBLE_CUSTOM_VARS_ARG="-e @env.yml"; fi if [ -f "env.yml" ]; then ANSIBLE_CUSTOM_VARS_ARG="-e @env.yml"; fi

View file

@ -4,7 +4,8 @@ cluster_size: 1
cidr_ip: "{{ control_host_ip.stdout }}/32" cidr_ip: "{{ control_host_ip.stdout }}/32"
ami_name: RHEL-8.8.0_HVM-20230503-x86_64-54-Hourly2-GP2 # aws ec2 describe-images --owners 309956199498 --filters "Name=architecture,Values=x86_64" "Name=virtualization-type,Values=hvm" --region eu-west-1 --no-include-deprecated --query 'Images[] | sort_by(@, &CreationDate)[].Name'
ami_name: RHEL-9.4_HVM_GA-20240827-x86_64-0-Hourly2-GP3
instance_type: t3.large instance_type: t3.large
instance_volume_size: 20 instance_volume_size: 20

View file

@ -459,7 +459,10 @@ jobs:
zip -u /tmp/keycloak.zip aws.pem zip -u /tmp/keycloak.zip aws.pem
cd .github/scripts/ansible cd .github/scripts/ansible
python3 -m venv .venv
source .venv/bin/activate
./aws_ec2.sh requirements ./aws_ec2.sh requirements
pipx inject ansible-core boto3 botocore
./aws_ec2.sh create ${AWS_REGION} ${EC2_CLUSTER_NAME} ./aws_ec2.sh create ${AWS_REGION} ${EC2_CLUSTER_NAME}
./keycloak_ec2_installer.sh ${AWS_REGION} ${EC2_CLUSTER_NAME} /tmp/keycloak.zip ./keycloak_ec2_installer.sh ${AWS_REGION} ${EC2_CLUSTER_NAME} /tmp/keycloak.zip
./mvn_ec2_runner.sh ${AWS_REGION} ${EC2_CLUSTER_NAME} "clean install -B -DskipTests -Pdistribution" ./mvn_ec2_runner.sh ${AWS_REGION} ${EC2_CLUSTER_NAME} "clean install -B -DskipTests -Pdistribution"
@ -557,6 +560,7 @@ jobs:
if: always() if: always()
working-directory: .github/scripts/ansible working-directory: .github/scripts/ansible
run: | run: |
source .venv/bin/activate
./aws_ec2.sh delete ${{ steps.aurora-init.outputs.region }} ${{ steps.ec2-create.outputs.ec2_cluster }} ./aws_ec2.sh delete ${{ steps.aurora-init.outputs.region }} ${{ steps.ec2-create.outputs.ec2_cluster }}
- name: Delete Aurora DB - name: Delete Aurora DB