diff --git a/gigabyte-ampere-cuttlefish-installer/gitlab-ci.yml b/gigabyte-ampere-cuttlefish-installer/gitlab-ci.yml new file mode 100644 index 0000000000..d60af5bea0 --- /dev/null +++ b/gigabyte-ampere-cuttlefish-installer/gitlab-ci.yml @@ -0,0 +1,816 @@ +# This file is a template, and might need editing before it works on your project. +# This is a sample GitLab CI/CD configuration file that should run without any modifications. +# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts, +# it uses echo commands to simulate the pipeline execution. +# +# A pipeline is composed of independent jobs that run scripts, grouped into stages. +# Stages run in sequential order, but jobs within stages run in parallel. +# +# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages +# +# You can copy and paste this template into a new `.gitlab-ci.yml` file. +# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword. +# +# To contribute improvements to CI/CD templates, please follow the Development guide at: +# https://docs.gitlab.com/ee/development/cicd/templates.html +# This specific template is located at: +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml + +default: + image: debian:bookworm + +stages: # List of stages for jobs, and their order of execution + - build + - test-debianpackage + - deploy-debianpackage + - test-image + - deploy-image + +build-installer-iso-job: # This job runs in the build stage, which runs first. + stage: build + variables: + KUBERNETES_MEMORY_REQUEST: 4G + DEBIAN_ISO_URL: https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/mini.iso + script: + - echo "Prepare building environment" + - 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 + - echo "CI_PROJECT_NAME=${CI_PROJECT_NAME}" >> preseed/after_install_1.sh + - echo "CI_PIPELINE_ID=${CI_PIPELINE_ID}" >> preseed/after_install_1.sh + - echo "Download Debian installer" + - wget -nv -c ${DEBIAN_ISO_URL} + - echo "Creating ISO images with preseed" + - ./addpreseed.sh + - echo "Create artifact" + - xz -9e preseed-mini.iso + - echo "Build complete." + artifacts: + paths: + - preseed-mini.iso.xz + +build-cuttlefish-deb-job: + stage: build + variables: + KUBERNETES_MEMORY_REQUEST: 4G + DEBEMAIL: glt-gig-noreply@linaro.org + DEBFULLNAME: Linaro GLT Deb + CUTTLEFISH_GIT_URL: https://github.com/google/android-cuttlefish.git + CUTTLEFISH_GIT_BRANCH: main + tags: + - arm64-runner + script: + - echo "Prepare building environment" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - echo "pbuilder pbuilder/mirrorsite string http://deb.debian.org/debian/" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y pbuilder + - dpkg-reconfigure --frontend noninteractive pbuilder + - apt-get install -y p7zip-full + - apt-get install -y ubuntu-dev-tools qemu-user-static + - apt-get install -y git ca-certificates less + - apt-get install -y build-essential + - apt-get install -y devscripts equivs fakeroot dpkg-dev + - echo "Building package" + - ./build_cf_packages_native.sh + - echo "Compile complete." + - echo "Create artifact" + - cp -f android-cuttlefish/cuttlefish-base_*.deb . + - cp -f android-cuttlefish/cuttlefish-user_*.deb . + - cp -f android-cuttlefish/cuttlefish-integration_*.deb . + - cp -f android-cuttlefish/cuttlefish-common_*.deb . + - 7z a -mx=9 cuttlefish_packages.7z *.deb + artifacts: + paths: + - cuttlefish_packages.7z + +build-metapackage-deb-job: + stage: build + variables: + DEBEMAIL: glt-gig-noreply@linaro.org + DEBFULLNAME: Linaro GLT Deb + tags: + - arm64-runner + script: + - echo "Prepare building environment" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - echo "pbuilder pbuilder/mirrorsite string http://deb.debian.org/debian/" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y pbuilder + - dpkg-reconfigure --frontend noninteractive pbuilder + - apt-get install -y ubuntu-dev-tools qemu-user-static + - apt-get install -y git ca-certificates less + - apt-get install -y debhelper devscripts cdbs dpkg-dev equivs fakeroot + - apt-get install -y build-essential autoconf automake + - apt-get install -y p7zip-full + - echo "Building package" + - cd metapackage-linaro-gigamp; debuild --no-sign; cd .. + - echo "Compile complete." + - echo "Create artifact" + - 7z a -mx=9 meta_gigamp_packages.7z *.deb + artifacts: + paths: + - meta_gigamp_packages.7z + +build-kernel-aosp14-61-deb-job: + stage: build + variables: + KUBERNETES_MEMORY_REQUEST: 8G + KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 80G + KERNEL_MANIFEST_URL: https://android.googlesource.com/kernel/manifest/ + KERNEL_MANIFEST_BRANCH: common-android14-6.1 + tags: + - arm64-runner + script: + - echo "Prepare building environment" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - echo "pbuilder pbuilder/mirrorsite string http://deb.debian.org/debian/" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y pbuilder + - dpkg-reconfigure --frontend noninteractive pbuilder + - apt-get install -y git ca-certificates less + - apt-get install -y fakeroot + - apt-get install -y devscripts equivs + - apt-get install -y ubuntu-dev-tools + - apt-get install -y build-essential + - apt-get install -y p7zip-full + - apt-get install -y crossbuild-essential-arm64 + - ./utils/install_repo_package.sh + - echo "Install kernel build dependencies" + - ./kernel_dependencies.sh + - echo "Download AOSP kernel source code" + - ./kernel_download.sh + - echo "Building package" + - ./kernel_build_deb.sh + - echo "Compile complete." + - echo "Create artifact" + - cp `ls kernel-build-space/buildresult/linux-image-*.deb | grep -v dbg` . + - cp kernel-build-space/buildresult/linux-headers-*.deb . + - 7z a -mx=9 aosp_kernel_aosp14_61.7z *.deb + timeout: 6 hours + artifacts: + paths: + - aosp_kernel_aosp14_61.7z + +build-kernel-aosp15-61-deb-job: + stage: build + variables: + KUBERNETES_MEMORY_REQUEST: 8G + KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 80G + KERNEL_MANIFEST_URL: https://android.googlesource.com/kernel/manifest/ + KERNEL_MANIFEST_BRANCH: common-android15-6.1 + tags: + - arm64-runner + script: + - echo "Prepare building environment" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - echo "pbuilder pbuilder/mirrorsite string http://deb.debian.org/debian/" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y pbuilder + - dpkg-reconfigure --frontend noninteractive pbuilder + - apt-get install -y git ca-certificates less + - apt-get install -y fakeroot + - apt-get install -y devscripts equivs + - apt-get install -y ubuntu-dev-tools + - apt-get install -y build-essential + - apt-get install -y p7zip-full + - apt-get install -y crossbuild-essential-arm64 + - ./utils/install_repo_package.sh + - echo "Install kernel build dependencies" + - ./kernel_dependencies.sh + - echo "Download AOSP kernel source code" + - ./kernel_download.sh + - echo "Building package" + - ./kernel_build_deb.sh + - echo "Compile complete." + - echo "Create artifact" + - cp `ls kernel-build-space/buildresult/linux-image-*.deb | grep -v dbg` . + - cp kernel-build-space/buildresult/linux-headers-*.deb . + - 7z a -mx=9 aosp_kernel_aosp15_61.7z *.deb + timeout: 6 hours + artifacts: + paths: + - aosp_kernel_aosp15_61.7z + +build-kernel-aosp15-66-deb-job: + stage: build + variables: + KUBERNETES_MEMORY_REQUEST: 8G + KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 80G + KERNEL_MANIFEST_URL: https://android.googlesource.com/kernel/manifest/ + KERNEL_MANIFEST_BRANCH: common-android15-6.6 + tags: + - arm64-runner + script: + - echo "Prepare building environment" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - echo "pbuilder pbuilder/mirrorsite string http://deb.debian.org/debian/" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y pbuilder + - dpkg-reconfigure --frontend noninteractive pbuilder + - apt-get install -y git ca-certificates less + - apt-get install -y fakeroot + - apt-get install -y devscripts equivs + - apt-get install -y ubuntu-dev-tools + - apt-get install -y build-essential + - apt-get install -y p7zip-full + - apt-get install -y crossbuild-essential-arm64 + - ./utils/install_repo_package.sh + - echo "Install kernel build dependencies" + - ./kernel_dependencies.sh + - echo "Download AOSP kernel source code" + - ./kernel_download.sh + - echo "Building package" + - ./kernel_build_deb.sh + - echo "Compile complete." + - echo "Create artifact" + - cp `ls kernel-build-space/buildresult/linux-image-*.deb | grep -v dbg` . + - cp kernel-build-space/buildresult/linux-headers-*.deb . + - 7z a -mx=9 aosp_kernel_aosp15_66.7z *.deb + timeout: 6 hours + artifacts: + paths: + - aosp_kernel_aosp15_66.7z + +build-uboot-qemu-job: + stage: build + variables: + KUBERNETES_CPU_REQUEST: 1 + KUBERNETES_MEMORY_REQUEST: 2G + UBOOT_GIT_URL: git://git.denx.de/u-boot.git + UBOOT_GIT_BRANCH: v2023.10 + script: + - echo "Prepare building environment" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - apt-get install -y build-essential + - apt-get install -y gcc-aarch64-linux-gnu + - apt-get install -y git ca-certificates + - apt-get install -y bc flex bison + - apt-get install -y coccinelle + - apt-get install -y device-tree-compiler dfu-util efitools + - apt-get install -y gdisk graphviz imagemagick + - apt-get install -y liblz4-tool libgnutls28-dev libguestfs-tools + - apt-get install -y libncurses-dev + - apt-get install -y libpython3-dev libsdl2-dev libssl-dev + - apt-get install -y lz4 lzma lzma-alone openssl + - apt-get install -y pkg-config + - apt-get install -y python3 python3-asteval python3-coverage + - apt-get install -y python3-filelock + - apt-get install -y python3-pkg-resources python3-pycryptodome + - apt-get install -y python3-pyelftools + - apt-get install -y python3-pytest python3-pytest-xdist + - apt-get install -y python3-sphinxcontrib.apidoc + - apt-get install -y python3-sphinx-rtd-theme python3-subunit + - apt-get install -y python3-testtools python3-virtualenv + - apt-get install -y swig uuid-dev + - echo "Downloading" + - ./uboot/download_uboot.sh + - echo "Building" + - cd u-boot; ../uboot/build_uboot_qemu_aarch64.sh; cd - + - cp uboot_build_place/u-boot.bin . + - echo "Done" + timeout: 3 hours + artifacts: + paths: + - u-boot.bin + +test-install-cuttlefish-deb-job: # This job runs in the test stage. + stage: test-debianpackage # It only starts when the job in the build stage completes successfully. + needs: ["build-cuttlefish-deb-job"] + tags: + - arm64-runner + script: + - echo "Prepare test bed" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install git devscripts config-package-dev debhelper-compat golang curl + - apt-get install -y p7zip-full + - apt-get install -y openssh-server + - apt-get install -y --no-install-recommends udev + - apt-get install -y ebtables + - whoami + - usermod -aG kvm,render `whoami` + - echo "Running installation tests..." + - 7z x cuttlefish_packages.7z + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install ./*.deb + - usermod -aG cvdnetwork `whoami` + - echo "Done" + +test-install-metapackage-deb-job: + stage: test-debianpackage + needs: ["build-metapackage-deb-job"] + tags: + - arm64-runner + script: + - echo "Prepare test bed" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install git devscripts config-package-dev debhelper-compat golang curl + - apt-get install -y p7zip-full + - echo "Running installation tests..." + - 7z x meta_gigamp_packages.7z + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install ./*.deb + - test -e /etc/security/limits.d/95-linaro-gigamp-nofile.conf + - ulimit -n + - grep time1.google.com /etc/ntpsec/ntp.conf + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 purge metapackage-linaro-gigamp + - test $(grep time1.google.com /etc/ntpsec/ntp.conf | wc -l) -eq 0 + - echo "Done" + +test-install-kernel-aosp14-61-deb-job: # This job also runs in the test stage. + stage: test-debianpackage # It can run at the same time with other jobs (in parallel). + needs: ["build-kernel-aosp14-61-deb-job"] + tags: + - arm64-runner + script: + - echo "Prepare test bed" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - apt-get install -y p7zip-full zstd + - apt-get install -y initramfs-tools + - echo "Running installation tests..." + - 7z x aosp_kernel_aosp14_61.7z + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install ./*.deb + - test -e /boot/vmlinuz-*aosp*-linaro* + - test -e /boot/initrd.img-*aosp*-linaro* + - grep "CONFIG_FHANDLE=y" /boot/config-*aosp*-linaro* + - grep 'CONFIG_MODPROBE_PATH="/sbin/modprobe"' /boot/config-*aosp*-linaro* + - echo "Done" + +test-install-kernel-aosp15-61-deb-job: # This job also runs in the test stage. + stage: test-debianpackage # It can run at the same time with other jobs (in parallel). + needs: ["build-kernel-aosp15-61-deb-job"] + tags: + - arm64-runner + script: + - echo "Prepare test bed" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - apt-get install -y p7zip-full zstd + - apt-get install -y initramfs-tools + - echo "Running installation tests..." + - 7z x aosp_kernel_aosp15_61.7z + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install ./*.deb + - test -e /boot/vmlinuz-*aosp*-linaro* + - test -e /boot/initrd.img-*aosp*-linaro* + - grep "CONFIG_FHANDLE=y" /boot/config-*aosp*-linaro* + - grep 'CONFIG_MODPROBE_PATH="/sbin/modprobe"' /boot/config-*aosp*-linaro* + - echo "Done" + +test-install-kernel-aosp15-66-deb-job: # This job also runs in the test stage. + stage: test-debianpackage # It can run at the same time with other jobs (in parallel). + needs: ["build-kernel-aosp15-66-deb-job"] + tags: + - arm64-runner + script: + - echo "Prepare test bed" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - apt-get install -y p7zip-full zstd + - apt-get install -y initramfs-tools + - echo "Running installation tests..." + - 7z x aosp_kernel_aosp15_66.7z + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install ./*.deb + - test -e /boot/vmlinuz-*aosp*-linaro* + - test -e /boot/initrd.img-*aosp*-linaro* + - grep "CONFIG_FHANDLE=y" /boot/config-*aosp*-linaro* + - grep 'CONFIG_MODPROBE_PATH="/sbin/modprobe"' /boot/config-*aosp*-linaro* + - echo "Done" + +test-iso-qemu-job: + stage: test-image + tags: + - amd64-runner + variables: + KUBERNETES_MEMORY_REQUEST: 8G + KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 60G + KUBERNETES_POD_ANNOTATIONS_1: "MOUNT_DEV=yes" + script: + - echo "Test iso installer with qemu. This will take about 5 hours." + - echo "Prepare test bed" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - echo "pbuilder pbuilder/mirrorsite string http://deb.debian.org/debian/" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y pbuilder + - dpkg-reconfigure --frontend noninteractive pbuilder + - apt-get install -y util-linux util-linux-extra + - apt-get install -y xz-utils + - apt-get install -y qemu-system-arm + - apt-get install -y expect + - apt-get install -y e2tools + - apt-get install -y lvm2 + - apt-get install -y ubuntu-dev-tools + - apt-get install -y sshpass + - apt-get install -y u-boot-qemu + - pull-debian-debs u-boot-qemu + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install ./u-boot-qemu_*_all.deb + - xz -d preseed-mini.iso.xz + - chmod a-w preseed-mini.iso + - cp -f tests/installer-iso-* . + - echo "Run installer on qemu" + - ./installer-iso-install.expect successful_install sheeFei2 + - echo "Test if installation is successed" + - ./installer-iso-extract-partitions.sh + - e2cp rootfs.img:/home/vsoc-01/successful_install successful_install + - echo sheeFei2 > successful_install_compare + - cmp successful_install successful_install_compare + - echo "Test if AOSP kernel is installed" + - e2ls -l boot.img:/vmlinuz-*aosp*-linaro* + - e2cp boot.img:/$(e2ls boot.img:/vmlinuz-*aosp*-linaro* | tail -1) . + - test -e vmlinuz-*aosp*-linaro* + - echo "Test if Cuttlefish Debian packages are installed" + - e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator + - e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator | grep cvd_host_orchestrator | grep root + - echo "Make sure that we do not have home partitions anymore" + - test '!' -e home.img + - echo "Test successful" + timeout: 8 hours + +test-iso-multidisk-qemu-empty-disk-job: + stage: test-image + tags: + - amd64-runner + variables: + KUBERNETES_MEMORY_REQUEST: 8G + KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 60G + KUBERNETES_POD_ANNOTATIONS_1: "MOUNT_DEV=yes" + script: + - echo "Test iso installer with qemu. This will take about 5 hours." + - echo "Prepare test bed" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - echo "pbuilder pbuilder/mirrorsite string http://deb.debian.org/debian/" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y pbuilder + - dpkg-reconfigure --frontend noninteractive pbuilder + - apt-get install -y util-linux util-linux-extra + - apt-get install -y xz-utils + - apt-get install -y qemu-system-arm + - apt-get install -y expect + - apt-get install -y e2tools + - apt-get install -y lvm2 + - apt-get install -y ubuntu-dev-tools + - apt-get install -y sshpass + - apt-get install -y u-boot-qemu + - pull-debian-debs u-boot-qemu + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install ./u-boot-qemu_*_all.deb + - xz -d preseed-mini.iso.xz + - chmod a-w preseed-mini.iso + - cp -f tests/installer-iso-* . + - cp -f tests/multidisk/installer-iso-* . + - echo "Create disks" + - ./tests/multidisk/installer-create-empty-disk2.sh + - echo "Run installer on qemu" + - ./installer-iso-install.expect successful_install eD4uvei1 + - echo "Test if installation is successed" + - ./installer-iso-extract-partitions-multidisk.sh + - echo "Test if rootfs is larger than 8G. It should be." + - test $(stat -c '%s' rootfs.img) '-gt' 8589934592 + - e2cp rootfs.img:/home/vsoc-01/successful_install successful_install + - echo eD4uvei1 > successful_install_compare + - cmp successful_install successful_install_compare + - echo "Test if AOSP kernel is installed" + - e2ls -l boot.img:/vmlinuz-*aosp*-linaro* + - e2cp boot.img:/$(e2ls boot.img:/vmlinuz-*aosp*-linaro* | tail -1) . + - test -e vmlinuz-*aosp*-linaro* + - echo "Test if Cuttlefish Debian packages are installed" + - e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator + - e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator | grep cvd_host_orchestrator | grep root + - echo "Test successful" + timeout: 8 hours + +test-iso-multidisk-qemu-disk2-with-data-job: + stage: test-image + tags: + - amd64-runner + variables: + KUBERNETES_MEMORY_REQUEST: 8G + KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 60G + KUBERNETES_POD_ANNOTATIONS_1: "MOUNT_DEV=yes" + script: + - echo "Test iso installer with qemu. This will take about 5 hours." + - echo "Prepare test bed" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - echo "pbuilder pbuilder/mirrorsite string http://deb.debian.org/debian/" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y pbuilder + - dpkg-reconfigure --frontend noninteractive pbuilder + - apt-get install -y util-linux util-linux-extra + - apt-get install -y xz-utils + - apt-get install -y qemu-system-arm + - apt-get install -y expect + - apt-get install -y gdisk + - apt-get install -y e2tools fatcat mtools dosfstools + - apt-get install -y lvm2 + - apt-get install -y ubuntu-dev-tools + - apt-get install -y sshpass + - apt-get install -y u-boot-qemu + - pull-debian-debs u-boot-qemu + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install ./u-boot-qemu_*_all.deb + - apt-get install -y udev libgudev-1.0-dev + - xz -d preseed-mini.iso.xz + - chmod a-w preseed-mini.iso + - cp -f tests/installer-iso-* . + - cp -f tests/multidisk/installer-iso-* . + - echo "Create disks" + - ./tests/multidisk/installer-create-preinstalled-disk2.sh + - echo "Run installer on qemu" + - ./installer-iso-install.expect successful_install Daiyaik0 + - echo "Test if installation is successed" + - ./installer-iso-extract-partitions-multidisk.sh + - echo "Test if rootfs is larger than 8G. It should be." + - test $(stat -c '%s' rootfs.img) '-gt' 8589934592 + - e2cp rootfs.img:/home/vsoc-01/successful_install successful_install + - echo Daiyaik0 > successful_install_compare + - cmp successful_install successful_install_compare + - echo "Test if AOSP kernel is installed" + - e2ls -l boot.img:/vmlinuz-*aosp*-linaro* + - e2cp boot.img:/$(e2ls boot.img:/vmlinuz-*aosp*-linaro* | tail -1) . + - test -e vmlinuz-*aosp*-linaro* + - echo "Test if Cuttlefish Debian packages are installed" + - e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator + - e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator | grep cvd_host_orchestrator | grep root + - echo "Test successful" + timeout: 8 hours + +test-iso-multidisk-qemu-disk5-with-data-job: + stage: test-image + tags: + - amd64-runner + variables: + KUBERNETES_MEMORY_REQUEST: 8G + KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 90G + KUBERNETES_POD_ANNOTATIONS_1: "MOUNT_DEV=yes" + script: + - echo "Test iso installer with qemu. This will take about 5 hours." + - echo "Prepare test bed" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - echo "pbuilder pbuilder/mirrorsite string http://deb.debian.org/debian/" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y pbuilder + - dpkg-reconfigure --frontend noninteractive pbuilder + - apt-get install -y util-linux util-linux-extra + - apt-get install -y xz-utils + - apt-get install -y qemu-system-arm + - apt-get install -y expect + - apt-get install -y gdisk + - apt-get install -y e2tools fatcat mtools dosfstools + - apt-get install -y lvm2 + - apt-get install -y ubuntu-dev-tools + - apt-get install -y sshpass + - apt-get install -y u-boot-qemu + - pull-debian-debs u-boot-qemu + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install ./u-boot-qemu_*_all.deb + - apt-get install -y udev libgudev-1.0-dev + - xz -d preseed-mini.iso.xz + - chmod a-w preseed-mini.iso + - cp -f tests/installer-iso-* . + - cp -f tests/multidisk/installer-iso-* . + - echo "Create disks" + - ./tests/multidisk/installer-create-preinstalled-disk5.sh + - echo "Run installer on qemu" + - ./installer-iso-install.expect successful_install AiT7eipi + - echo "Test if installation is successed" + - ./installer-iso-extract-partitions-multidisk.sh + - echo "Test if rootfs is larger than 8G. It should be." + - test $(stat -c '%s' rootfs.img) '-gt' 8589934592 + - e2cp rootfs.img:/home/vsoc-01/successful_install successful_install + - echo AiT7eipi > successful_install_compare + - cmp successful_install successful_install_compare + - echo "Test if AOSP kernel is installed" + - e2ls -l boot.img:/vmlinuz-*aosp*-linaro* + - e2cp boot.img:/$(e2ls boot.img:/vmlinuz-*aosp*-linaro* | tail -1) . + - test -e vmlinuz-*aosp*-linaro* + - echo "Test if Cuttlefish Debian packages are installed" + - e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator + - e2ls -l rootfs.img:/usr/bin/cvd_host_orchestrator | grep cvd_host_orchestrator | grep root + - echo "Test successful" + timeout: 8 hours + +test-iso-cf-qemu-job: + stage: test-image + tags: + - amd64-runner + variables: + KUBERNETES_MEMORY_REQUEST: 8G + KUBERNETES_EPHEMERAL_STORAGE_REQUEST: 60G + script: + - echo "Test iso installer with qemu. This will take about 5 hours." + - echo "Prepare test bed" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y debconf-utils + - echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v + - echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + - dpkg-reconfigure --frontend noninteractive tzdata + - echo "pbuilder pbuilder/mirrorsite string http://deb.debian.org/debian/" | debconf-set-selections -v + - DEBIAN_FRONTEND=noninteractive apt-get install -y pbuilder + - dpkg-reconfigure --frontend noninteractive pbuilder + - apt-get install -y util-linux-extra + - apt-get install -y xz-utils + - apt-get install -y qemu-system-arm + - apt-get install -y expect + - apt-get install -y e2tools + - apt-get install -y ubuntu-dev-tools + - apt-get install -y u-boot-qemu + - apt-get install -y wget curl + - apt-get install -y openssh-client sshpass + - apt-get install -y screen + - pull-debian-debs u-boot-qemu + - apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 install ./u-boot-qemu_*_all.deb + - xz -d preseed-mini.iso.xz + - chmod a-w preseed-mini.iso + - cp -f tests/installer-iso-* . + - echo "Run installer on qemu" + - ./installer-iso-install.expect + - echo "Installation successed" + - echo "Download cuttlefish" + - ./utils/download-ci-cf.sh + - echo "Start qemu" + - screen -d -m -L -Logfile console_001.log ./installer-iso-run-qemu.sh + - echo "Wait for system run" + - sleep 300 + - 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 "Deploy cuttlefish" + - 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' + - echo "We cannot run cuttlefish in qemu due to lack of kvm. Just launch_cvd for testing" + - 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 + - echo "Test for lzop" + - sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'lzop -V' + - echo "Test for Google NTP" + - sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'ntpq -p' + - sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'ntpq -p | grep time1.google' + - echo "Test for ulimit" + - 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" + - echo "Shutdown qemu." + - sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'echo cuttlefish | sudo -S -k shutdown -h 1' + - echo "Wait for qemu stop" + - sleep 500; #waitpid -t 500 -e $(pidof screen) + - tail -n +"${CONSOLELINES}" console_001.log + - echo "Done." + timeout: 7 hours + +deploy-iso-job: # This job runs in the deploy stage. + stage: deploy-image # It only runs when all jobs in the test-image stage complete successfully. + environment: production + script: + - echo "Prepare environment" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y curl + - echo "Deploying application..." + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T preseed-mini.iso.xz "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/${CI_PIPELINE_ID}/preseed-mini.iso.xz" + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T preseed-mini.iso.xz "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/latest/preseed-mini.iso.xz" + - echo "Application successfully deployed." + +deploy-deb-job: + stage: deploy-debianpackage + environment: production + script: + - echo "Prepare environment" + - apt-get update + - apt-get upgrade -y + - apt-get install -y sudo + - apt-get install -y curl + - apt-get install -y gnupg + - apt-get install -y aptly + - apt-get install -y p7zip-full + - echo "Deploying application..." + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T cuttlefish_packages.7z "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/${CI_PIPELINE_ID}/cuttlefish_packages.7z" + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T aosp_kernel_aosp14_61.7z "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/${CI_PIPELINE_ID}/aosp_kernel_aosp14_61.7z" + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T aosp_kernel_aosp15_61.7z "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/${CI_PIPELINE_ID}/aosp_kernel_aosp15_61.7z" + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T aosp_kernel_aosp15_66.7z "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/${CI_PIPELINE_ID}/aosp_kernel_aosp15_66.7z" + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T meta_gigamp_packages.7z "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/${CI_PIPELINE_ID}/meta_gigamp_packages.7z" + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T cuttlefish_packages.7z "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/latest/cuttlefish_packages.7z" + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T aosp_kernel_aosp14_61.7z "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/latest/aosp_kernel_aosp14_61.7z" + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T aosp_kernel_aosp15_61.7z "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/latest/aosp_kernel_aosp15_61.7z" + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T aosp_kernel_aosp15_66.7z "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/latest/aosp_kernel_aosp15_66.7z" + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T meta_gigamp_packages.7z "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/latest/meta_gigamp_packages.7z" + - 7z x aosp_kernel_aosp14_61.7z + - 7z x aosp_kernel_aosp15_61.7z + - 7z x aosp_kernel_aosp15_66.7z + - 7z x cuttlefish_packages.7z + - 7z x meta_gigamp_packages.7z + - mkdir -p debs + - mv -f *.deb debs + - aptly repo create --distribution=bookworm --component=main linaro-release + - aptly repo add linaro-release "debs" + - gpg --batch --yes --import --passphrase "${DEBIAN_REPO_PRIVATE_KEY_PASSWORD}" "${DEBIAN_REPO_PRIVATE_KEY}" + - gpg --batch --yes --export -a glt-gig-noreply@linaro.org > linaro-glt-gig-archive-bookworm.asc + - aptly publish -batch -gpg-key="glt-gig-noreply@linaro.org" -passphrase="${DEBIAN_REPO_PRIVATE_KEY_PASSWORD}" -architectures=all,arm64,amd64 repo linaro-release + - cp -R "$HOME/.aptly/public" ./debian + - find debian -type f -exec curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T {} "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/${CI_PIPELINE_ID}/{}" \; + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T linaro-glt-gig-archive-bookworm.asc "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/${CI_PIPELINE_ID}/debian/linaro-glt-gig-archive-bookworm.asc" + - curl -u "$ARTIFACTS_AUTH_USERNAME":"$ARTIFACTS_AUTH_TOKEN" -XDELETE "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/latest/debian" + - find debian -type f -exec curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T {} "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/latest/{}" \; + - curl -L -u ${ARTIFACTS_AUTH_USERNAME}:${ARTIFACTS_AUTH_TOKEN} -T linaro-glt-gig-archive-bookworm.asc "${ARTIFACTS_URL}/${CI_PROJECT_NAME}/latest/debian/linaro-glt-gig-archive-bookworm.asc" + - echo "Application successfully deployed."