Aurora IT tests failing periodically with download of node (#34107)

Closes #33767
Co-authored-by: Jon Koops <jonkoops@gmail.com>
Signed-off-by: Ryan Emerson <remerson@redhat.com>
This commit is contained in:
Ryan Emerson 2024-10-23 14:19:10 +01:00 committed by GitHub
parent 358d234538
commit 044d71bd77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 41 additions and 17 deletions

View file

@ -54,18 +54,6 @@ runs:
key: ${{ steps.weekly-cache-key.outputs.key }} key: ${{ steps.weekly-cache-key.outputs.key }}
enableCrossOsArchive: true enableCrossOsArchive: true
- name: Get Node.js and PNPM versions - id: node-cache
id: tooling-versions name: Node cache
shell: bash uses: ./.github/actions/node-cache
run: |
echo "node=$(mvn help:evaluate -Dexpression=node.version -q -DforceStdout | cut -c 2-)" >> $GITHUB_OUTPUT
echo "pnpm=$(mvn help:evaluate -Dexpression=pnpm.version -q -DforceStdout)" >> $GITHUB_OUTPUT
# Downloading Node.js often fails due to network issues, therefore we cache the artifacts downloaded by the frontend plugin.
- uses: actions/cache@v4
name: Cache Node.js related artifacts
with:
path: |
~/.m2/repository/com/github/eirslett/node
~/.m2/repository/com/github/eirslett/pnpm
key: ${{ runner.os }}-frontend-plugin-artifacts-${{ steps.tooling-versions.outputs.node }}-${{ steps.tooling-versions.outputs.pnpm }}

21
.github/actions/node-cache/action.yml vendored Normal file
View file

@ -0,0 +1,21 @@
name: Node Cache
description: Caches Node and PNPM binaries
runs:
using: composite
steps:
- name: Get Node.js and PNPM versions
id: tooling-versions
shell: bash
run: |
echo "node=$(mvn help:evaluate -Dexpression=node.version -q -DforceStdout | cut -c 2-)" >> $GITHUB_OUTPUT
echo "pnpm=$(mvn help:evaluate -Dexpression=pnpm.version -q -DforceStdout)" >> $GITHUB_OUTPUT
# Downloading Node.js often fails due to network issues, therefore we cache the artifacts downloaded by the frontend plugin.
- uses: actions/cache@v4
name: Cache Node.js and PNPM binaries
with:
path: |
~/.m2/repository/com/github/eirslett/node
~/.m2/repository/com/github/eirslett/pnpm
key: ${{ runner.os }}-frontend-plugin-artifacts-${{ steps.tooling-versions.outputs.node }}-${{ steps.tooling-versions.outputs.pnpm }}

View file

@ -9,6 +9,8 @@ fi
REGION=$1 REGION=$1
CLUSTER_NAME=$2 CLUSTER_NAME=$2
KEYCLOAK_SRC=$3 KEYCLOAK_SRC=$3
MAVEN_ARCHIVE=$4
ansible-playbook -i ${CLUSTER_NAME}_${REGION}_inventory.yml keycloak.yml \ ansible-playbook -i ${CLUSTER_NAME}_${REGION}_inventory.yml keycloak.yml \
-e "keycloak_src=\"${KEYCLOAK_SRC}\"" -e "keycloak_src=\"${KEYCLOAK_SRC}\"" \
-e "maven_archive=\"${MAVEN_ARCHIVE}\""

View file

@ -2,6 +2,7 @@
ansible_ssh_user: ec2-user ansible_ssh_user: ec2-user
# Workspace on the remote hosts # Workspace on the remote hosts
kc_home: /opt/keycloak kc_home: /opt/keycloak
m2_home: ~/.m2
update_system_packages: no update_system_packages: no
install_java: yes install_java: yes
java_version: 21 java_version: 21

View file

@ -27,3 +27,10 @@
src: "{{ keycloak_src }}" src: "{{ keycloak_src }}"
dest: "{{ kc_home }}" dest: "{{ kc_home }}"
owner: "{{ ansible_ssh_user }}" owner: "{{ ansible_ssh_user }}"
- name: Install Maven repository on the remote hosts
unarchive:
src: "{{ maven_archive }}"
creates: "{{ kc_home }}"
dest: "{{ kc_home }}"
owner: "{{ ansible_ssh_user }}"

View file

@ -418,6 +418,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- id: node-cache
name: Node cache
uses: ./.github/actions/node-cache
- id: aurora-init - id: aurora-init
name: Initialize Aurora environment name: Initialize Aurora environment
run: | run: |
@ -457,6 +461,7 @@ jobs:
git archive --format=zip --output /tmp/keycloak.zip $GITHUB_REF git archive --format=zip --output /tmp/keycloak.zip $GITHUB_REF
zip -u /tmp/keycloak.zip aws.pem zip -u /tmp/keycloak.zip aws.pem
tar -C ~/ -czvf m2.tar.gz .m2
cd .github/scripts/ansible cd .github/scripts/ansible
python3 -m venv .venv python3 -m venv .venv
@ -464,7 +469,7 @@ jobs:
./aws_ec2.sh requirements ./aws_ec2.sh requirements
pipx inject ansible-core boto3 botocore 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 m2.tar.gz
./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"
./mvn_ec2_runner.sh ${AWS_REGION} ${EC2_CLUSTER_NAME} "clean install -B -DskipTests -pl testsuite/integration-arquillian/servers/auth-server/quarkus -Pauth-server-quarkus -Pdb-aurora-postgres -Dmaven.build.cache.enabled=true" ./mvn_ec2_runner.sh ${AWS_REGION} ${EC2_CLUSTER_NAME} "clean install -B -DskipTests -pl testsuite/integration-arquillian/servers/auth-server/quarkus -Pauth-server-quarkus -Pdb-aurora-postgres -Dmaven.build.cache.enabled=true"