-
Notifications
You must be signed in to change notification settings - Fork 207
Expand file tree
/
Copy pathgigabyte-ampere-cuttlefish-installer.yaml
More file actions
308 lines (301 loc) · 13.6 KB
/
gigabyte-ampere-cuttlefish-installer.yaml
File metadata and controls
308 lines (301 loc) · 13.6 KB
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
name: Workflow for Gigabyte Ampere Server Cuttlefish Installer
on:
pull_request:
paths:
- 'gigabyte-ampere-cuttlefish-installer/**'
push:
branchs:
- '**'
jobs:
build-installer-iso-job:
runs-on: ubuntu-22.04
container:
image: debian@sha256:9258a75a7e4323c9e5562b361effc84ee747920116d8adfc98a465a5cdc9150e # debian:bookworm-20250407 (amd64)
defaults:
run:
working-directory: ./gigabyte-ampere-cuttlefish-installer
env:
DEBIAN_ISO_URL: "https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/mini.iso"
CI_PROJECT_NAME: ${{ github.event.repository.name }}
CI_PIPELINE_ID: ${{ github.run_id }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setting up build environment
run: |
apt-get update
apt-get upgrade -y
apt-get install -y sudo
apt-get install -y wget libarchive-tools
apt-get install -y xorriso
apt-get install -y cpio xz-utils
apt-get install -y fdisk
- name: Build the iso image
run: |
sed -i "2i CI_PROJECT_NAME=${CI_PROJECT_NAME}" preseed/after_install_1.sh
sed -i "3i CI_PIPELINE_ID=${CI_PIPELINE_ID}" preseed/after_install_1.sh
wget -nv -c ${DEBIAN_ISO_URL}
./addpreseed.sh
xz -9e preseed-mini.iso
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gigabyte-ampere-cuttlefish-installer-artifacts
path: gigabyte-ampere-cuttlefish-installer/preseed-mini.iso.xz
test-iso-qemu-job:
needs: [build-installer-iso-job]
runs-on: ubuntu-22.04-arm
container:
image: debian@sha256:2c91e484d93f0830a7e05a2b9d92a7b102be7cab562198b984a84fdbc7806d91 # debian:trixie-20260202
defaults:
run:
working-directory: ./gigabyte-ampere-cuttlefish-installer
env:
TEST_DISK_SIZE: "10G"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: gigabyte-ampere-cuttlefish-installer-artifacts
- name: Prepare test environment
uses: ./.github/actions/gigabyte-ampere-cuttlefish-installer-prepare-testbed
- name: Copy test scripts
run: |
cp -f tests/installer-iso-* .
- name: Run installer on qemu
run: |
./installer-iso-install.expect successful_install sheeFei2
- name: Extract partitions
run: |
./installer-iso-extract-partitions.sh
- name: Check if installation is successful
run: |
e2cp rootfs.img:/home/vsoc-01/successful_install successful_install
echo sheeFei2 > successful_install_compare
cmp successful_install successful_install_compare
- name: Check if kernel is installed
run: |
e2ls -l boot.img:/vmlinuz-*
e2cp boot.img:/$(e2ls boot.img:/vmlinuz-* | tail -1) .
test -e vmlinuz-*
- name: Check if Cuttlefish Debian packages are installed
run: |
e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator
e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator | grep cvd_host_orchestrator | grep root
- name: Check we don't have home partition
run: |
test '!' -e home.img
test-iso-multidisk-qemu-empty-disk-job:
needs: [build-installer-iso-job]
runs-on: ubuntu-22.04-arm
container:
image: debian@sha256:2c91e484d93f0830a7e05a2b9d92a7b102be7cab562198b984a84fdbc7806d91 # debian:trixie-20260202
defaults:
run:
working-directory: ./gigabyte-ampere-cuttlefish-installer
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: gigabyte-ampere-cuttlefish-installer-artifacts
- name: Prepare test environment
uses: ./.github/actions/gigabyte-ampere-cuttlefish-installer-prepare-testbed
- name: Copy test scripts
run: |
cp -f tests/installer-iso-* .
cp -f tests/multidisk/installer-iso-* .
- name: Create Empty 2 disks
run: |
./tests/multidisk/installer-create-empty-disk2.sh
- name: Run installer on qemu
run: |
./installer-iso-install.expect successful_install eD4uvei1
- name: Extract partitions
run: |
./installer-iso-extract-partitions-multidisk.sh
- name: Check if rootfs is larger than 8G.
run: |
test $(stat -c '%s' rootfs.img) '-gt' 8589934592
- name: Check if installation is successful
run: |
e2cp rootfs.img:/home/vsoc-01/successful_install successful_install
echo eD4uvei1 > successful_install_compare
cmp successful_install successful_install_compare
- name: Check if kernel is installed
run: |
e2ls -l boot.img:/vmlinuz-*
e2cp boot.img:/$(e2ls boot.img:/vmlinuz-* | tail -1) .
test -e vmlinuz-*
- name: Check if Cuttlefish Debian packages are installed
run: |
e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator
e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator | grep cvd_host_orchestrator | grep root
test-iso-multidisk-qemu-disk2-with-data-job:
needs: [build-installer-iso-job]
runs-on: ubuntu-22.04-arm
container:
image: debian@sha256:2c91e484d93f0830a7e05a2b9d92a7b102be7cab562198b984a84fdbc7806d91 # debian:trixie-20260202
defaults:
run:
working-directory: ./gigabyte-ampere-cuttlefish-installer
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: gigabyte-ampere-cuttlefish-installer-artifacts
- name: Prepare test environment
uses: ./.github/actions/gigabyte-ampere-cuttlefish-installer-prepare-testbed
- name: Copy test scripts
run: |
cp -f tests/installer-iso-* .
cp -f tests/multidisk/installer-iso-* .
- name: Create 2 disks with preinstalled partitions.
run: |
./tests/multidisk/installer-create-preinstalled-disk2.sh
- name: Run installer on qemu
run: |
./installer-iso-install.expect successful_install Daiyaik0
- name: Extract partitions
run: |
./installer-iso-extract-partitions-multidisk.sh
- name: Check if rootfs is larger than 8G.
run: |
test $(stat -c '%s' rootfs.img) '-gt' 8589934592
- name: Check if installation is successful
run: |
e2cp rootfs.img:/home/vsoc-01/successful_install successful_install
echo Daiyaik0 > successful_install_compare
cmp successful_install successful_install_compare
- name: Check if kernel is installed
run: |
e2ls -l boot.img:/vmlinuz-*
e2cp boot.img:/$(e2ls boot.img:/vmlinuz-* | tail -1) .
test -e vmlinuz-*
- name: Check if Cuttlefish Debian packages are installed
run: |
e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator
e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator | grep cvd_host_orchestrator | grep root
test-iso-multidisk-qemu-disk5-with-data-job:
needs: [build-installer-iso-job]
runs-on: ubuntu-22.04-arm
container:
image: debian@sha256:2c91e484d93f0830a7e05a2b9d92a7b102be7cab562198b984a84fdbc7806d91 # debian:trixie-20260202
defaults:
run:
working-directory: ./gigabyte-ampere-cuttlefish-installer
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: gigabyte-ampere-cuttlefish-installer-artifacts
- name: Prepare test environment
uses: ./.github/actions/gigabyte-ampere-cuttlefish-installer-prepare-testbed
- name: Copy test scripts
run: |
cp -f tests/installer-iso-* .
cp -f tests/multidisk/installer-iso-* .
- name: Create 5 disks with preinstalled partitions.
run: |
./tests/multidisk/installer-create-preinstalled-disk5.sh
- name: Run installer on qemu
run: |
./installer-iso-install.expect successful_install AiT7eipi
- name: Extract partitions
run: |
./installer-iso-extract-partitions-multidisk.sh
- name: Check if rootfs is larger than 8G.
run: |
test $(stat -c '%s' rootfs.img) '-gt' 8589934592
- name: Check if installation is successful
run: |
e2cp rootfs.img:/home/vsoc-01/successful_install successful_install
echo AiT7eipi > successful_install_compare
cmp successful_install successful_install_compare
- name: Check if kernel is installed
run: |
e2ls -l boot.img:/vmlinuz-*
e2cp boot.img:/$(e2ls boot.img:/vmlinuz-* | tail -1) .
test -e vmlinuz-*
- name: Check if Cuttlefish Debian packages are installed
run: |
e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator
e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator | grep cvd_host_orchestrator | grep root
test-iso-cf-qemu-job:
needs: [build-installer-iso-job]
runs-on: ubuntu-22.04-arm
container:
image: debian@sha256:2c91e484d93f0830a7e05a2b9d92a7b102be7cab562198b984a84fdbc7806d91 # debian:trixie-20260202
defaults:
run:
working-directory: ./gigabyte-ampere-cuttlefish-installer
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: gigabyte-ampere-cuttlefish-installer-artifacts
- name: Prepare test environment
uses: ./.github/actions/gigabyte-ampere-cuttlefish-installer-prepare-testbed
- name: Copy test scripts
run: |
cp -f tests/installer-iso-* .
- name: Run installer on qemu
run: |
./installer-iso-install.expect
- name: Download Cuttlefish
run: |
./utils/download-ci-cf.sh
- name: Start qemu again. Normal boot.
run: |
screen -d -m -L -Logfile console_001.log ./installer-iso-run-qemu.sh
while ! egrep "[^[:space:]]+[[:space:]]login:" console_001.log; do sleep 30; done
cp -f console_001.log console_001_p1.log
CONSOLELINES=$(cat console_001_p1.log | wc -l)
cat console_001_p1.log
grep "login:" console_001_p1.log > /dev/null
echo "CONSOLELINES=${CONSOLELINES}" >> $GITHUB_ENV
- name: Deploy cuttlefish
run: |
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'echo cuttlefish | sudo -S -k apt-get install -y unzip'
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'mkdir cf'
sshpass -p cuttlefish scp -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -P 33322 cvd-host_package.tar.gz vsoc-01@localhost:/home/vsoc-01/
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'cd cf; tar -xvf ../cvd-host_package.tar.gz'
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'rm -f cvd-host_package.tar.gz'
sshpass -p cuttlefish scp -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -P 33322 aosp_cf_arm64*_phone-*.zip vsoc-01@localhost:/home/vsoc-01/
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'cd cf; unzip ../aosp_cf_arm64*_phone-*.zip'
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'rm -f aosp_cf_arm64*_phone-*.zip'
- name: Run cuttlefish command line
run: |
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'cd cf; HOME=$PWD ./bin/launch_cvd -help' || true
- name: Run apt-cache policy
run: |
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'apt-cache policy'
- name: Test for lzop
run: |
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'lzop -V'
- name: Test for Google NTP server
run: |
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'ntpq -p'
CHECK_GOOGLE_TIME_SERVER=0
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'ntpq -p' | grep 'time1.google' && CHECK_GOOGLE_TIME_SERVER=1
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'ntpq -p' | grep '.GOOG.' && CHECK_GOOGLE_TIME_SERVER=1
if [ x"${CHECK_GOOGLE_TIME_SERVER}" != x"1" ]; then echo "Google Time Servers not found!"; false; fi
- name: Test for ulimit
run: |
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'ulimit -a'
test $(sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'ulimit -n') -ge 2048
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'update-alternatives --display iptables' | grep "link currently points to /usr/sbin/iptables-legacy"
- name: Shutdown qemu
run: |
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'echo cuttlefish | sudo -S -k shutdown -h 1'
while ! grep "reboot: Power down" console_001.log; do sleep 30; done
tail -n +"${CONSOLELINES}" console_001.log