-
Notifications
You must be signed in to change notification settings - Fork 1
153 lines (144 loc) · 5.99 KB
/
agent-based-mno.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
---
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
'