Nightly CI #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly CI | |
on: | |
schedule: | |
- cron: '30 5 * * *' | |
workflow_dispatch: | |
inputs: {} | |
jobs: | |
unit: | |
if: github.repository == 'quay/quay' | |
name: Run all Test | |
runs-on: ubuntu-20.04 | |
env: | |
ZVSI_FP_NAME: quay-floating-ci | |
ZVSI_INSTANCE_NAME: quay-zvsi-ci | |
ZVSI_VPC: r018-b72c601c-c1d9-42cf-af66-c0f6da4ab982 | |
ZVSI_ZONE_NAME: eu-gb-3 | |
ZVSI_PROFILE_NAME: bz2-4x16 | |
ZVSI_SUBNET: 07a7-8ea5eb5d-d432-47fd-a90c-153ebcb6c2cb | |
ZVSI_IMAGE: r018-000c8ed2-fb20-436a-9b3a-8b4f062b50d2 | |
ZVSI_KEY: r018-ee997015-b88c-4500-874c-71f2175a8284 | |
ZVSI_RG_ID: 2e818eb391df4774977812b50ff0e8c9 | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: ['amd64','ppc64le','s390x'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install ibmcli and setup ibm login | |
if: ${{ matrix.platform == 's390x' }} | |
run: | | |
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh | |
ibmcloud login -q --apikey ${{ secrets.IBMCLOUD_API_KEY }} -r eu-gb | |
ibmcloud plugin install vpc-infrastructure | |
- name: Creation of ZVSI | |
if: ${{ matrix.platform == 's390x' }} | |
id: ZVSI | |
run: | | |
#creation of zvsi | |
ibmcloud is instance-create $ZVSI_INSTANCE_NAME $ZVSI_VPC $ZVSI_ZONE_NAME $ZVSI_PROFILE_NAME $ZVSI_SUBNET --image $ZVSI_IMAGE --keys $ZVSI_KEY --resource-group-id $ZVSI_RG_ID | |
#Reserving a floating ip to the ZVSI | |
ibmcloud is floating-ip-reserve $ZVSI_FP_NAME --zone $ZVSI_ZONE_NAME --resource-group-id $ZVSI_RG_ID --in $ZVSI_INSTANCE_NAME | |
#Bouding the Floating ip to the ZVSI | |
ibmcloud is floating-ip-update $ZVSI_FP_NAME --nic primary --in $ZVSI_INSTANCE_NAME | |
sleep 60 | |
#Saving the Floating IP to login ZVSI | |
ZVSI_HOST=$(ibmcloud is floating-ip $ZVSI_FP_NAME | awk '/Address/{print $2}') | |
echo $ZVSI_HOST | |
echo "IP=${ZVSI_HOST}" >> $GITHUB_OUTPUT | |
- name: Status of ZVSI | |
if: ${{ matrix.platform == 's390x' }} | |
run: | | |
check=$(ibmcloud is ins| awk '/'$ZVSI_INSTANCE_NAME'/{print $3}') | |
while [[ $check != "running" ]] | |
do | |
check=$(ibmcloud is ins | awk '/'$ZVSI_INSTANCE_NAME'/{print $3}') | |
if [[ $check == 'failed' ]] | |
then | |
echo "Failed to run the ZVSI" | |
break | |
fi | |
done | |
- name: Setup SSH config for builders | |
env: | |
BUILDER_PPC64LE_SSH_CONFIG: ${{ secrets.BUILDER_PPC64LE_SSH_CONFIG }} | |
BUILDER_PPC64LE_SSH_KEY: ${{ secrets.BUILDER_PPC64LE_SSH_KEY }} | |
BUILDER_PPC64LE_SSH_KNOWN_HOSTS: ${{ secrets.BUILDER_PPC64LE_SSH_KNOWN_HOSTS }} | |
run: | | |
mkdir ~/.ssh | |
chmod 700 ~/.ssh | |
touch ~/.ssh/id_builder_ppc64le | |
chmod 600 ~/.ssh/id_builder_ppc64le | |
echo "$BUILDER_PPC64LE_SSH_KEY" >~/.ssh/id_builder_ppc64le | |
touch ~/.ssh/known_hosts | |
chmod 600 ~/.ssh/known_hosts | |
cat >~/.ssh/known_hosts <<END | |
$BUILDER_PPC64LE_SSH_KNOWN_HOSTS | |
END | |
touch ~/.ssh/config | |
chmod 600 ~/.ssh/config | |
cat >~/.ssh/config <<END | |
Host builder-ppc64le | |
ServerAliveInterval 200 | |
ServerAliveCountMax 10 | |
IdentityFile "~/.ssh/id_builder_ppc64le" | |
$BUILDER_PPC64LE_SSH_CONFIG | |
END | |
- name: Create docker context | |
if: matrix.platform != 'amd64' && matrix.platform != 's390x' | |
run: | | |
docker context create ${{ matrix.platform }} --description "Node ${{ matrix.platform }}" --docker "host=ssh://builder-${{ matrix.platform }}" | |
docker context use ${{ matrix.platform }} | |
- name: Install dependencies and run tests on all arch except s390x | |
if: matrix.platform != 's390x' | |
run: >- | |
docker run | |
--rm | |
-w / | |
-e GH_REPOSITORY | |
-e GH_REF | |
ubuntu:20.04 | |
/bin/bash -c ' | |
export DEBIAN_FRONTEND=noninteractive; | |
apt-get -y update; | |
apt-get -y install libgpgme-dev libldap2-dev libsasl2-dev swig python3.9-dev python3-pip findutils git; | |
apt-get -y install libffi-dev libssl-dev libjpeg-dev; | |
git clone ${GH_REPOSITORY} build; | |
cd build && git checkout ${GH_REF}; | |
cat requirements-dev.txt | grep tox | xargs pip install; | |
tox -e py39-unit; | |
tox -e py39-e2e; | |
tox -e py39-registry;' | |
env: | |
GH_REPOSITORY: ${{ github.server_url }}/${{ github.repository }} | |
GH_REF: ${{ github.ref }} | |
- name: Install dependencies and run all tests on s390x ZVSI | |
if: matrix.platform == 's390x' | |
uses: appleboy/ssh-action@v0.1.10 | |
env: | |
GH_REPOSITORY: ${{ github.server_url }}/${{ github.repository }} | |
GH_REF: ${{ github.ref }} | |
with: | |
host: ${{ steps.ZVSI.outputs.IP }} | |
username: ${{ secrets.ZVSI_SSH_USER }} | |
key: ${{ secrets.ZVSI_PR_KEY }} | |
envs: GH_REPOSITORY,GH_REF | |
command_timeout: 100m | |
script: | | |
apt-get update -y | |
apt-get -y install build-essential libgpgme-dev libldap2-dev libsasl2-dev swig python3.9-dev python3-pip findutils git | |
apt-get -y install libffi-dev libssl-dev libjpeg-dev libpq-dev | |
git clone ${GH_REPOSITORY} build | |
cd build && git checkout ${GH_REF} | |
GRPC_LATEST=$(grep "grpcio" requirements.txt |cut -d "=" -f 3) | |
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 && python3 -m pip install -qq grpcio==${GRPC_LATEST} | |
cat requirements-dev.txt | grep tox | xargs python3 -m pip -qq install | |
#Unit | |
tox -e py39-unit | |
#e2e | |
tox -e py39-e2e | |
#registry | |
tox -e py39-registry | |
- name: Cleanup ZVSI | |
if: ${{ steps.ZVSI.conclusion == 'success' && always() }} | |
run: | | |
#Delete the created ZVSI | |
ibmcloud is instance-delete $ZVSI_INSTANCE_NAME --force | |
sleep 20 | |
#Release the created FP | |
ibmcloud is floating-ip-release $ZVSI_FP_NAME --force |