abi-mno-clab-push #109
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
--- | |
run-name: abi-mno-${{ github.ref_name }}-${{ github.event_name }} | |
name: abi-mno | |
on: # yamllint disable-line rule:truthy | |
push: | |
workflow_dispatch: | |
jobs: | |
stage0: | |
name: Setup HV | |
runs-on: [self-hosted, green] | |
outputs: | |
RUNNER: ${{ runner.name }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clean Virtual Infra | |
run: | | |
./telco-ocp-lab --clean --dry-run=false -a -auto-timeout 0s --continue-on-error | |
- name: Setup Virtual Infra - ${{ runner.name }} | |
run: | | |
echo '${{ secrets.PULL_SECRET }}' > .pull-secret.json | |
echo '${{ secrets.WG_AUTH }}' > .wg-auth | |
echo "${{ secrets.CI_SSH_KEY }}" > .id_rsa && chmod 600 .id_rsa | |
./telco-ocp-lab --setup --dry-run=false -a -auto-timeout 0s | |
./telco-ocp-lab --ipforwarding --dry-run=false -a -auto-timeout 0s | |
- name: Reserve Runner | |
run: | | |
podman exec workstation bash -ce ' | |
GITHUB_TOKEN='${{ secrets.GH_TOKEN }}' ./bin/label-runner.sh ${{ runner.name }} -green +taken -ready | |
' | |
stage1: | |
name: Deploy MNO - ${{needs.stage0.outputs.RUNNER}} | |
runs-on: ${{needs.stage0.outputs.RUNNER}} | |
needs: [stage0] | |
if: needs.stage0.result == 'success' | |
steps: | |
- name: Deploy MNO using agent-based | |
timeout-minutes: 120 | |
run: | | |
podman exec workstation bash -ce ' | |
# export OCP_RELEASE=quay.io/openshift-release-dev/ocp-release:4.16.0-ec.5-x86_64 | |
export OCP_RELEASE=quay.io/openshift-release-dev/ocp-release:4.15.10-x86_64 | |
oc adm release extract --tools $OCP_RELEASE --registry-config=.pull-secret.json | |
tar xzf openshift-install-linux-*tar.gz --directory=/usr/local/bin openshift-install | |
openshift-install version | |
cat /etc/redhat-release | |
nmstatectl version | |
folder=/share/mno | |
cp -r mno-template "${folder}" | |
PULL_SECRET=$(jq '.' -c ".pull-secret.json") | |
sed -i "s/PULLSECRET/$PULL_SECRET/g" "${folder}"/install-config.yaml | |
openshift-install agent create image --log-level info --dir "${folder}" | |
source ./redfish-actions/sushy.sh | |
for node in $(cat "${folder}"/bmc-hosts); | |
do | |
power_off "$node" | |
media_eject "$node" | |
media_insert "$node" http://10.10.20.200:9000/mno/agent.x86_64.iso | |
boot_once "$node" | |
power_on "$node" | |
done | |
mkdir -p ~/.kube && cp "${folder}"/auth/kubeconfig ~/.kube/config | |
export KUBECONFIG=/share/mno/auth/kubeconfig | |
./bin/patch-no-validation-ai.sh #https://issues.redhat.com/browse/OCPBUGS-31631 | |
openshift-install agent wait-for install-complete --log-level info --dir /share/mno | |
oc get clusterversion && oc get co | |
' | |
echo "wget http://10.0.0.1:9000/mno/auth/kubeconfig -O ~/.kube/${{ runner.name }}.yaml" | |
echo "curl -s http://10.0.0.1:9000/mno/auth/kubeadmin-\password | xsel --input --clipboard" | |
- name: Patch Cluster CRs | |
timeout-minutes: 10 | |
run: | | |
podman exec workstation bash -ce ' | |
oc patch network.operator cluster --type=merge --patch-file day1/network-operator-patch.yaml | |
oc patch OperatorHub cluster --type merge --patch-file day1/operatorhub-patch.yaml | |
oc patch configs.imageregistry cluster --type=merge --patch-file day1/image-registry-patch.yaml | |
oc patch configs.imageregistry cluster --type=merge --patch-file day1/image-registry-patch.yaml | |
' | |
stage2: | |
name: Deploy Metallb | |
runs-on: ${{needs.stage0.outputs.RUNNER}} | |
needs: [stage0, stage1] | |
if: needs.stage1.result == 'success' | |
timeout-minutes: 20 | |
steps: | |
- name: Install Metallb/Sriov | |
timeout-minutes: 10 | |
run: | | |
podman exec workstation bash -ce ' | |
# oc apply -f mno-template/day1/99-metallb-operator.yaml | |
# until oc get metallb 2>/dev/null; do sleep 30; done | |
# sleep 30 | |
# oc -n metallb-system wait deploy metallb-operator-webhook-server --for=condition=available | |
# sleep 30 | |
# oc apply -k mno-template/day1/ | |
' | |
stage3: | |
name: Test Metallb | |
runs-on: ${{needs.stage0.outputs.RUNNER}} | |
needs: [stage0, stage1, stage2] | |
if: needs.stage2.result == 'success' | |
steps: | |
- name: SmokeTest Metallb setup | |
run: | | |
podman exec workstation bash -ce ' | |
# oc apply -f dayX/green-net.yaml | |
# oc apply -f dayX/red-net.yaml | |
# | |
# oc wait --for=condition=ready pod -l app=red --timeout=320s | |
# oc wait --for=condition=ready pod -l app=green --timeout=320s | |
' | |
# podman exec green bash -cex ' | |
# echo "from green client to access the service in green segment (static routes)" | |
# curl --retry 5 -s http://5.5.5.1:5555/hostname -w " #local" | |
# # curl --retry 5 -s http://5.5.5.2/hostname -w " #cluster" | |
# ' | |
# podman exec red bash -cex ' | |
# echo "from red client to access the service in red segment (static routes)" | |
# curl --retry 5 -s http://6.6.6.1:6666/hostname -w " #local" | |
# ' | |
on-success: | |
name: On Success | |
runs-on: ${{needs.stage0.outputs.RUNNER}} | |
needs: [stage0, stage1, stage3] | |
if: ${{ success() }} | |
steps: | |
- name: Readd Label | |
run: | | |
podman exec workstation bash -c ' | |
GITHUB_TOKEN='${{ secrets.GH_TOKEN }}' ./bin/label-runner.sh ${{ runner.name }} +ready -taken | |
' | |
on-fail: | |
name: On Failure | |
runs-on: ${{needs.stage0.outputs.RUNNER}} | |
needs: [stage0, stage1, stage3] | |
if: ${{ failure() }} | |
steps: | |
- name: Readd Label | |
run: | | |
podman exec workstation bash -c ' | |
GITHUB_TOKEN='${{ secrets.GH_TOKEN }}' ./bin/label-runner.sh ${{ runner.name }} +green -taken | |
' |