Commit Graph

14 Commits

Author SHA1 Message Date
Guilt
6745691eb5
[CI][doc][build] Trim script and sonic-slave-* folders files trailing blanks (#15161)
- run pre-commit tox profile to trim all trailing blanks
- use several commits with a per-folder based strategy
  to ease their merge

Issue #15114

Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
2023-05-24 09:25:12 -07:00
xumia
60c80ad26d
[Build] Fix the build unstalbe issue caused by the kvm not ready (#12180)
Why I did it
Fix the build unstable issue caused by the kvm 9000 port is not ready to use in 2 seconds.

2022-09-02T10:57:30.8122304Z + /usr/bin/kvm -m 8192 -name onie -boot order=cd,once=d -cdrom target/files/bullseye/onie-recovery-x86_64-kvm_x86_64_4_asic-r0.iso -device e1000,netdev=onienet -netdev user,id=onienet,hostfwd=:0.0.0.0:3041-:22 -vnc 0.0.0.0:0 -vga std -drive file=target/sonic-6asic-vs.img,media=disk,if=virtio,index=0 -drive file=./sonic-installer.img,if=virtio,index=1 -serial telnet:127.0.0.1:9000,server
2022-09-02T10:57:30.8123378Z + sleep 2.0
2022-09-02T10:57:30.8123889Z + '[' -d /proc/284923 ']'
2022-09-02T10:57:30.8124528Z + echo 'to kill kvm:  sudo kill 284923'
2022-09-02T10:57:30.8124994Z to kill kvm:  sudo kill 284923
2022-09-02T10:57:30.8125362Z + ./install_sonic.py
2022-09-02T10:57:30.8125720Z Trying 127.0.0.1...
2022-09-02T10:57:30.8126041Z telnet: Unable to connect to remote host: Connection refused

How I did it
Waiting more time until the tcp port 9000 is ready, waiting for 60 seconds in maximum.
2022-09-27 06:55:19 +08:00
xumia
a1d3d99457
[Build] Increase the size of the installer image (#11869)
#### Why I did it
Fix the build failure caused by the installer image size too small. The installer image is only used during the build, not impact the final images.
See https://dev.azure.com/mssonic/build/_build/results?buildId=139926&view=logs&j=cef3d8a9-152e-5193-620b-567dc18af272&t=359769c4-8b5e-5976-a793-85da132e0a6f

```
+ fallocate -l 2048M ./sonic-installer.img
+ mkfs.vfat ./sonic-installer.img
mkfs.fat 4.2 (2021-01-31)
++ mktemp -d
+ tmpdir=/tmp/tmp.TqdDSc00Cn
+ mount -o loop ./sonic-installer.img /tmp/tmp.TqdDSc00Cn
+ cp target/sonic-vs.bin /tmp/tmp.TqdDSc00Cn/onie-installer.bin
cp: error writing '/tmp/tmp.TqdDSc00Cn/onie-installer.bin': No space left on device
[  FAIL LOG END  ] [ target/sonic-vs.img.gz ]
```

#### How I did it
Increase the size from 2048M to 4096M.
Why not increase to 16G like qcow2 image?
The qcow2 supports the sparse disk, although a big disk size allocated, but it will not consume the real disk size. The falocate does not support the sparse disk. We do not want to allocate a very big disk, but no use at all. It will require more space to build.
2022-08-29 11:15:42 -07:00
Shilong Liu
3bbe562bca
[build] Increase vs platform kvm disk size (#10001)
#### Why I did it
Info: Attempting file://dev/vdb/onie-installer ...
Info: Attempting file://dev/vdb/onie-installer.bin ...
cp: write error: No space left on device
Failure: local_fs_run():/dev/vdb Unable to copy /tmp/tmp.CPY0ad/onie-installer.bin to tmpfs

vs image is failing. Increase kvm device space.
2022-02-21 21:42:27 -08:00
Saikrishna Arcot
4803847e5e
Remove the rw folder from the image after installing in KVM (#8746)
* Remove the rw folder from the image after installing in KVM

When the image is installed from within KVM and then loaded, some files
(such as timer stamp files) are created as part of that bootup that then
get into the final image. This can cause some side effects, such as
systemd thinking that some persistent timers need to run because the
last trigger time got missed.

Therefore, at the end of the check_install.py script, remove the rw
folder so that it doesn't exist in the image, and that when this image
is started up in a KVM setup for the first time, it starts with a truly
clean slate.

Without this change, the issue seen was that for fstrim.timer, a stamp
file would be present in /var/lib/systemd/timers (and for other timers
that are marked as persistent). This would then cause fstrim.service to
get started immediately when starting a QEMU setup if the timer for that
service missed a trigger, and not wait 10 minutes after bootup. In the
case of fstrim.timer, that means if the image was started in QEMU after
next Monday, since that timer is scheduled to be triggered weekly.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>

* Split installation of SONiC and test bootup into two separate scripts

Just removing the rw directory causes other issues, since the first boot
tasks no longer run since that file isn't present. Also, just recreating
that file doesn't completely help, because there are some files that are
moved from the /host folder into the base filesystem layer, and so are
no longer available.

Instead, split the installation of SONiC and doing the test bootup into
two separate scripts and two separate KVM instances. The first KVM
instance is the one currently being run, while the second one has the
`-snapshot` flag added in, which means any changes to the disk image
don't take effect.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
2021-12-10 13:13:35 -08:00
xumia
dae0887394
[Build]: Fix tmpfs space not enough issue when building vs image (#9438)
Fix no space left on device issue in tmpfs.
2021-12-01T06:30:40.1651742Z cp: write error: No space left on device
2021-12-01T06:30:40.1652225Z Failure: local_fs_run():/dev/vdb Unable to copy /tmp/tmp.gl4Sgp/onie-installer.bin to tmpfs
2021-12-03 23:32:36 +08:00
Chris Ward
f8688bef8d
[kvm] improve the handling of compact_memory during kvm image build (#9184)
Build failed on a Ubuntu 20.04 system with kvm kernel, which does not have the /proc/sys/vm/compact_memory 
Should check if compact_memory is writeable before doing it.

Signed-off-by: Chris Ward <tjcw@uk.ibm.com>
2021-11-10 08:31:03 -08:00
Guohan Lu
3001bbcd28 [kvm]: print running process when build kvm fails
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-02-06 15:11:31 -08:00
Guohan Lu
83c51e4803 [kvm]: install net-tools package for debug
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-30 17:38:33 -08:00
lguohan
9b2bc880de
[kvm]: add debug cmd for build_kvm_image.sh (#6472)
dump netstat info on error

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-17 11:05:33 -08:00
Guohan Lu
f1cc577c75 [build_kvm]: mount /proc to show memory
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2020-04-17 04:51:51 +00:00
lguohan
5299644dc0
[kvmbuild]: print out kvm_log on error (#4384)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2020-04-07 12:31:20 -07:00
Guohan Lu
bd72844f75 [kvm]: increase the kvm installer size to 2G for dbg image
Signed-off-by: Guohan Lu <gulv@microsoft.com>
2019-12-28 21:21:09 +00:00
lguohan
8d4516ca3d
[kvm]: increase mem to 3G to avoid OOM during onie installation (#3811)
Signed-off-by: Guohan Lu <gulv@microsoft.com>
2019-11-23 12:30:22 -08:00