-
Notifications
You must be signed in to change notification settings - Fork 16
175 lines (171 loc) · 6.66 KB
/
integration_tests.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Integration Tests
on:
push:
branches:
- '**'
jobs:
collect_kubernetes_versions:
runs-on: ubuntu-22.04
outputs:
kuber_versions: ${{ steps.versions.outputs.kuber_versions }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install software
run: pip3 install yq
- name: Parse kubernetes versions
id: versions
run: |
versions=$(cat ./kubemarine/resources/configurations/compatibility/kubernetes_versions.yaml | \
python3 -m yq -c '.compatibility_map | keys')
echo Parsed versions: $versions
echo "kuber_versions=$versions" >> $GITHUB_OUTPUT
test-default-installation:
runs-on: ubuntu-22.04
needs: collect_kubernetes_versions
env:
KUBERNETES_VERSION: ${{ matrix.kubernetes-version }}
cluster_yaml_file: ./ci/default_cluster.yaml
strategy:
fail-fast: false
matrix:
kubernetes-version: ${{ fromJSON(needs.collect_kubernetes_versions.outputs.kuber_versions) }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Check ips
run: ip a
- name: Ssh preparation
run: |
ssh-keygen -t rsa -b 4096 -N "" -f ~/.ssh/id_rsa -q
cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
ssh-keyscan -H 172.17.0.1 >> ~/.ssh/known_hosts
- name: Test ssh connection
run: ssh -i ~/.ssh/id_rsa 172.17.0.1 echo "Test"
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install Kubemarine with dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Remove moby-runc to resolve conflicts
run: sudo apt remove moby-runc
- name: Install rename
run: sudo apt install rename
- name: Install and start journald
run: |
sudo apt update && sudo apt install -y systemd
sudo systemctl start systemd-journald.service
- name: Check Iaas
id: test_check_iaas
run: kubemarine check_iaas -c ${{ env.cluster_yaml_file }} --dump-location ./results/check_iaas_dump/
- name: Install
id: test_install
run: kubemarine install -c ${{ env.cluster_yaml_file }} --disable-cumulative-points --dump-location ./results/install_dump/
- name: Check paas
id: test_check_paas
run: kubemarine check_paas -c ${{ env.cluster_yaml_file }} --dump-location ./results/check_paas_dump/
- name: Get events kubectl
if: failure()
run: sudo kubectl get events --sort-by='.metadata.creationTimestamp' -A
- name: Collect journalctl logs
if: failure()
run: |
sudo journalctl -u kubelet -u kube-proxy -u kube-apiserver -u kube-controller-manager -u kube-scheduler > ./results/journald_kube-logs.txt
sudo journalctl > ./results/journald-logs.txt
- name: Change not-recommended symbols in dump files
if: failure()
run: rename 's/[:]/_/g' ./results/*/dump/*
- name: Collect dump artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: default_cluster_procedure_dumps-${{ matrix.kubernetes-version }}
path: ./results/
retention-days: 7
test-extended-installation:
runs-on: ubuntu-22.04
env:
cluster_yaml_file: ./ci/extended_cluster.yaml
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Check ips
run: ip a
- name: Ssh preparation
run: |
ssh-keygen -t rsa -b 4096 -N "" -f ~/.ssh/id_rsa -q
cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
ssh-keyscan -H 172.17.0.1 >> ~/.ssh/known_hosts
- name: Add ip alias
run: sudo ifconfig docker0:0 172.17.1.1 up
- name: Test ssh connection
run: ssh -i ~/.ssh/id_rsa 172.17.0.1 echo "Test"
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install Kubemarine with dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Remove moby-runc to resolve conflicts
run: sudo apt remove moby-runc
- name: Install rename
run: sudo apt install rename
- name: Install and start journald
run: |
sudo apt update && sudo apt install -y systemd
sudo systemctl start systemd-journald.service
- name: Check Iaas
id: test_check_iaas
run: kubemarine check_iaas -c ${{ env.cluster_yaml_file }} --dump-location ./results/check_iaas_dump/
- name: Install
id: test_install
run: kubemarine install -c ${{ env.cluster_yaml_file }} --disable-cumulative-points --dump-location ./results/install_dump/
- name: Check paas
id: test_check_paas
run: kubemarine check_paas -c ${{ env.cluster_yaml_file }} --dump-location ./results/check_paas_dump/
- name: Get events kubectl
if: failure()
run: sudo kubectl get events --sort-by='.metadata.creationTimestamp' -A
- name: Collect journalctl logs
if: failure()
run: |
sudo journalctl -u kubelet -u kube-proxy -u kube-apiserver -u kube-controller-manager -u kube-scheduler > ./results/journald_kube-logs.txt
sudo journalctl > ./results/journald-logs.txt
- name: Change not-recommended symbols in dump files
if: failure()
run: rename 's/[:]/_/g' ./results/*/dump/*
- name: Collect dump artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: extended_cluster_procedure_dumps
path: ./results/
retention-days: 7
thirdparties_sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: pip install . && pip uninstall -y kubemarine
- name: Run scripts/thirdparties/sync.py
run: python scripts/thirdparties/sync.py --refresh-manifests
- name: Check source code unchanged
run: |
if ! git diff --staged --exit-code; then
echo ""
echo -e "\033[91mkubernetes_versions.yaml may be not synchronized with internal compatibility maps, or plugin manifests. See diff above.\033[0m"
echo -e "\033[91mDo not change internal compatibility maps manually. Use scripts/thirdparties/sync.py to synchronize the compatibility maps.\033[0m"
exit 1
fi