forked from kruize/autotune
-
Notifications
You must be signed in to change notification settings - Fork 1
187 lines (166 loc) · 6.69 KB
/
test-on-pr.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
176
177
178
179
180
181
182
183
184
185
186
name: Test on Pull Request
# Controls when the action will run.
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'design/**'
- 'examples/**'
- 'extensions/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# This workflow contains two jobs called "build autotune" and "build crc"
build_autotune:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Setup Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.16.0'
kubernetes version: 'v1.19.2'
- name: Build autotune
run: |
echo Build autotune
pr_number=${{ github.event.pull_request.number }}
echo "pr_number=${pr_number}" >> "$GITHUB_ENV"
./build.sh -i autotune_operator:pr_${pr_number}
docker images | grep autotune
- name: Check cluster info on minikube
run: |
kubectl cluster-info
kubectl get pods -n kube-system
- name: Install Prometheus on minikube
run: |
echo Install Prometheus on minikube
cd scripts
./prometheus_on_minikube.sh -as
- name: Deploy kruize in experiment mode
run: |
echo Deploy kruize in experiment mode
cp ./manifests/autotune/autotune-operator-deployment.yaml_template ./manifests/autotune/autotune-operator-deployment.yaml_template.old
sed -e "s/imagePullPolicy: Always/imagePullPolicy: IfNotPresent/g" ./manifests/autotune/autotune-operator-deployment.yaml_template.old > ./manifests/autotune/autotune-operator-deployment.yaml_template
echo "***************************************************************"
cat ./manifests/autotune/autotune-operator-deployment.yaml_template
echo "***************************************************************"
echo "PR_NUMBER = ${{ env.pr_number }}"
./deploy.sh -c minikube -i autotune_operator:pr_${{ env.pr_number }}
sleep 20
- name: Capture ffdc logs
if: always()
run: |
echo "Capturing ffdc logs"
./scripts/ffdc.sh -d ${GITHUB_WORKSPACE}
- name: Archive results
if: always()
run: |
cd ${GITHUB_WORKSPACE}
tar cvf autotune_results.tar kruize_*log.txt
- name: Upload results
if: always()
uses: actions/upload-artifact@v3
with:
name: autotune-results
path: ./autotune_results.tar
retention-days: 2
build_crc:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
repository: kruize/autotune
- name: Setup Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.16.0'
kubernetes version: 'v1.19.2'
- name: Build crc
run: |
echo Build crc
pr_number=${{ github.event.pull_request.number }}
echo "pr_number=${pr_number}" >> "$GITHUB_ENV"
./build.sh -i autotune_operator:pr_${pr_number}
docker images | grep autotune
- name: Check cluster info on minikube
run: |
kubectl cluster-info
kubectl get pods -n kube-system
- name: Install Prometheus on minikube
run: |
echo Install Prometheus on minikube
cd scripts
./prometheus_on_minikube.sh -as
- name: Deploy Kruize in crc mode
run: |
echo Deploy kruize in crc mode
echo "***************************************************************"
cp ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml.old
sed -e "s/imagePullPolicy: Always/imagePullPolicy: IfNotPresent/g" ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml.old > ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml
cat ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml
cd tests
echo "PR_NUMBER = ${{ env.pr_number }}"
./test_autotune.sh -c minikube -i autotune_operator:pr_${{ env.pr_number }} --testsuite=remote_monitoring_tests --testcase=test_e2e --resultsdir=${GITHUB_WORKSPACE}
- name: Capture ffdc logs
if: always()
run: |
echo "Capturing ffdc logs"
./scripts/ffdc.sh -m crc -d ${GITHUB_WORKSPACE}/kruize_test_results
- name: Archive results
if: always()
run: |
cd ${GITHUB_WORKSPACE}
tar cvf crc_results.tar kruize_test_results
- name: Upload results
if: always()
uses: actions/upload-artifact@v3
with:
name: crc-results
path: ./crc_results.tar
retention-days: 2
test_crc_manifest_build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Setup Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.16.0'
kubernetes version: 'v1.19.2'
- name: Check cluster info on minikube
run: |
kubectl cluster-info
kubectl get pods -n kube-system
- name: Install Prometheus on minikube
run: |
echo Install Prometheus on minikube
cd scripts
./prometheus_on_minikube.sh -as
- name: Test with manifest kruize build in crc mode
run: |
echo Test with manifest kruize build in crc mode
echo "***************************************************************"
cd tests
./test_autotune.sh -c minikube --testsuite=remote_monitoring_tests --testcase=test_e2e --resultsdir=${GITHUB_WORKSPACE}
- name: Capture ffdc logs
if: always()
run: |
./scripts/ffdc.sh -m crc -d ${GITHUB_WORKSPACE}/kruize_test_results
- name: Archive results
if: always()
run: |
cd ${GITHUB_WORKSPACE}
tar cvf crc_manifest_results.tar kruize_test_results
- name: Upload results
if: always()
uses: actions/upload-artifact@v3
with:
name: crc-manifest-results
path: ./crc_manifest_results.tar
retention-days: 2