Skip to content

Commit 3ff44b7

Browse files
authored
Merge branch 'main' into android11_gsi_test
2 parents f06865e + 7761086 commit 3ff44b7

1,119 files changed

Lines changed: 29440 additions & 14230 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,22 @@
1919
# of the below options.
2020

2121
BasedOnStyle: Google
22-
IncludeBlocks: Preserve
22+
# Enforce grouping and sorting of #include directives into distinct blocks
23+
# separated by a blank line, evaluated in the order listed below:
24+
IncludeBlocks: Regroup
25+
IncludeCategories:
26+
# 1. Project headers (cuttlefish/, allocd/, and external_proto/)
27+
- Regex: '^[<"](cuttlefish|allocd|external_proto)/'
28+
Priority: 4
29+
# 2. Plain C external third-party library headers inside angle brackets
30+
- Regex: '^<(zip|zlib|png|lz4|archive|tinyxml2|pcre2)\.h>'
31+
Priority: 3
32+
# 3. C/POSIX system headers (any other angle-bracket header ending in .h)
33+
- Regex: '^<.*\.h>'
34+
Priority: 1
35+
# 4. C++ standard library headers (extensionless angle-bracket headers)
36+
- Regex: '^<[a-z_]*>'
37+
Priority: 2
38+
# 5. External third-party library headers inside double quotes
39+
- Regex: '.*'
40+
Priority: 3

.github/actions/bazel-9-readiness/action.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ runs:
33
using: "composite"
44
steps:
55
- name: Setup apt
6-
run: sudo apt-get update -y && sudo apt-get upgrade -y
6+
run: |
7+
sudo apt-get purge firefox
8+
sudo apt-get update -y && sudo apt-get upgrade -y
79
shell: bash
810
- name: Install dependencies
911
run: |
Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,40 @@
11
name: 'Build debian packages for Cuttlefish host'
22
inputs:
3-
deploy-channel:
3+
debian-version:
44
required: false
5-
yyyymmddhhmm:
5+
image-version:
66
required: false
77
runs:
88
using: "composite"
99
steps:
1010
- name: Modify version format
11-
if: inputs.deploy-channel != ''
11+
if: inputs.debian-version != ''
1212
run: |
13-
case "${INPUTS_DEPLOY_CHANNEL}" in
14-
stable)
15-
# Stable version format : X.Y.Z
16-
SEMVER=$(echo ${GITHUB_REF_NAME} | grep -oE '[0-9]+.[0-9]+.[0-9]+')
17-
sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(${SEMVER})/g" \
18-
base/debian/changelog
19-
sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(${SEMVER})/g" \
20-
container/debian/changelog
21-
sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(${SEMVER})/g" \
22-
frontend/debian/changelog
23-
sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(${SEMVER})/g" \
24-
cuttlefish-integration-gigabyte-arm64/debian/changelog
25-
;;
26-
unstable|nightly)
27-
# Unstable/nightly version format : X.Y.Z~gitYYYYMMDDHHMM.<Github SHA 8 digit>
28-
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
29-
SUFFIX="~git${INPUTS_YYYYMMDDHHMM}.${SHORT_SHA}"
30-
sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(\1${SUFFIX})/g" \
31-
base/debian/changelog
32-
sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(\1${SUFFIX})/g" \
33-
container/debian/changelog
34-
sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(\1${SUFFIX})/g" \
35-
frontend/debian/changelog
36-
sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(\1${SUFFIX})/g" \
37-
cuttlefish-integration-gigabyte-arm64/debian/changelog
38-
;;
39-
*)
40-
exit 1
41-
;;
42-
esac
13+
FILES=(
14+
"base/debian/changelog"
15+
"container/debian/changelog"
16+
"frontend/debian/changelog"
17+
"cuttlefish-integration-gigabyte-arm64/debian/changelog"
18+
)
19+
20+
for FILE in "${FILES[@]}"; do
21+
sed -i "1s/(\([0-9]\+.[0-9]\+.[0-9]\+\))/(${INPUTS_DEBIAN_VERSION})/g" "$FILE"
22+
done
4323
shell: bash
4424
env:
45-
INPUTS_DEPLOY_CHANNEL: ${{ inputs.deploy-channel }}
46-
INPUTS_YYYYMMDDHHMM: ${{ inputs.yyyymmddhhmm }}
25+
INPUTS_DEBIAN_VERSION: ${{ inputs.debian-version }}
4726
- name: Build CF debian packages
4827
run: |
28+
IMAGE_OPT=""
29+
if [ -n "${INPUTS_IMAGE_VERSION}" ]; then
30+
IMAGE_OPT="-e container_image_name=us-docker.pkg.dev/android-cuttlefish-artifacts/cuttlefish-orchestration/cuttlefish-orchestration:${INPUTS_IMAGE_VERSION}"
31+
fi
32+
4933
sudo docker build --file "tools/buildutils/cw/Containerfile" --tag "android-cuttlefish-build" .
5034
sudo docker run -v=$PWD:/mnt/build -w /mnt/build -v=$HOME/bazel-disk-cache:/root/bazel-disk-cache android-cuttlefish-build base -d /root/bazel-disk-cache
51-
sudo docker run -v=$PWD:/mnt/build -w /mnt/build android-cuttlefish-build container
35+
sudo docker run ${IMAGE_OPT} -v=$PWD:/mnt/build -w /mnt/build android-cuttlefish-build container
5236
sudo docker run -v=$PWD:/mnt/build -w /mnt/build android-cuttlefish-build frontend
5337
sudo docker run -v=$PWD:/mnt/build -w /mnt/build android-cuttlefish-build cuttlefish-integration-gigabyte-arm64
5438
shell: bash
39+
env:
40+
INPUTS_IMAGE_VERSION: ${{ inputs.image-version }}

.github/actions/build-gigabyte-ampere-cuttlefish-installer/action.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
name: 'Build iso installer for Gigabyte Ampere server'
2+
inputs:
3+
deploy-channel:
4+
required: false
5+
debian-version:
6+
required: false
27
runs:
38
using: "composite"
49
steps:
@@ -17,11 +22,17 @@ runs:
1722
DEBIAN_ISO_URL: "https://deb.debian.org/debian/dists/trixie/main/installer-arm64/current/images/netboot/mini.iso"
1823
CI_PROJECT_NAME: ${{ github.event.repository.name }}
1924
CI_PIPELINE_ID: ${{ github.run_id }}
25+
INPUTS_DEPLOY_CHANNEL: ${{ inputs.deploy-channel }}
26+
INPUTS_DEBIAN_VERSION: ${{ inputs.debian-version }}
2027
shell: bash
2128
working-directory: ./gigabyte-ampere-cuttlefish-installer
2229
run: |
2330
sed -i "2i CI_PROJECT_NAME=${CI_PROJECT_NAME}" preseed/after_install_1.sh
2431
sed -i "3i CI_PIPELINE_ID=${CI_PIPELINE_ID}" preseed/after_install_1.sh
32+
if [ x"${INPUTS_DEPLOY_CHANNEL}" != x"" ]; then
33+
sed -i "s/^#DEPLOY_CHANNEL=/DEPLOY_CHANNEL=${INPUTS_DEPLOY_CHANNEL}/" preseed/after_install_1.sh
34+
sed -i "s/^#DEPLOY_VERSION=/DEPLOY_VERSION=${INPUTS_DEBIAN_VERSION}/" preseed/after_install_1.sh
35+
fi
2536
wget -nv -c ${DEBIAN_ISO_URL}
2637
./addpreseed.sh
2738
xz -9e preseed-mini.iso

.github/actions/deploy-debian-packages/action.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ runs:
1919
"cuttlefish-metrics"
2020
"cuttlefish-orchestration"
2121
"cuttlefish-user"
22+
"cuttlefish-podcvd"
2223
)
2324
2425
if [[ ${INPUTS_DEPLOY_CHANNEL} == "stable" ]]; then
2526
REPO=android-cuttlefish
2627
else
2728
REPO=android-cuttlefish-${INPUTS_DEPLOY_CHANNEL}
28-
# TODO: include cuttlefish-podcvd on stable afterwards
29-
PACKAGES+=("cuttlefish-podcvd")
3029
fi
3130
3231
pushd ${INPUTS_PATH}

.github/actions/deploy-docker-image/action.yaml

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,19 @@ name: 'Deploy docker image cuttlefish-orchestration'
22
inputs:
33
arch:
44
required: true
5-
deploy-channel:
5+
image-version:
66
required: true
7-
yyyymmddhhmm:
8-
required: false
97
runs:
108
using: "composite"
119
steps:
1210
- name: Deploy docker image into Artifact Registry
1311
run: |
14-
case "${INPUTS_DEPLOY_CHANNEL}" in
15-
stable)
16-
# Stable version tag : X.Y.Z-<amd64|arm64>
17-
SEMVER=$(echo ${GITHUB_REF_NAME} | grep -oE '[0-9]+.[0-9]+.[0-9]+')
18-
TAG="${SEMVER}-${INPUTS_ARCH}"
19-
;;
20-
unstable)
21-
# Unstable version tag : X.Y-<Github SHA 8 digit>-<amd64|arm64>
22-
SEMVER=$(echo ${GITHUB_REF_NAME} | grep -oE '[0-9]+.[0-9]+')
23-
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
24-
TAG="${SEMVER}-${SHORT_SHA}-${INPUTS_ARCH}"
25-
;;
26-
nightly)
27-
# Nightly version tag : gitYYYYMMDDHHMM-<Github SHA 8 digit>-<amd64|arm64>
28-
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
29-
TAG="git${INPUTS_YYYYMMDDHHMM}-${SHORT_SHA}-${INPUTS_ARCH}"
30-
;;
31-
*)
32-
exit 1
33-
;;
34-
esac
12+
TAG=${INPUTS_IMAGE_VERSION}-${INPUTS_ARCH}
3513
REMOTE_IMAGE_TAG=us-docker.pkg.dev/android-cuttlefish-artifacts/cuttlefish-orchestration/cuttlefish-orchestration:${TAG}
3614
3715
docker tag cuttlefish-orchestration ${REMOTE_IMAGE_TAG}
3816
docker push ${REMOTE_IMAGE_TAG}
3917
shell: bash
4018
env:
41-
INPUTS_DEPLOY_CHANNEL: ${{ inputs.deploy-channel }}
4219
INPUTS_ARCH: ${{ inputs.arch }}
43-
INPUTS_YYYYMMDDHHMM: ${{ inputs.yyyymmddhhmm }}
20+
INPUTS_IMAGE_VERSION: ${{ inputs.image-version }}

.github/actions/deploy-gigabyte-ampere-cuttlefish-installer/action.yaml

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: 'Deploy installer for Gigabyte Ampere server'
22
inputs:
33
deploy-channel:
44
required: true
5-
yyyymmddhhmm:
6-
required: false
5+
image-version:
6+
required: true
77
path:
88
required: true
99
runs:
@@ -16,35 +16,14 @@ runs:
1616
- name: Deploy installer image into Artifact Registry
1717
run: |
1818
REPO=gigabyte-ampere-server-installer
19-
case "${INPUTS_DEPLOY_CHANNEL}" in
20-
stable)
21-
# Stable version tag : X.Y.Z
22-
SEMVER=$(echo ${GITHUB_REF_NAME} | grep -oE '[0-9]+.[0-9]+.[0-9]+')
23-
TAG="${SEMVER}"
24-
;;
25-
unstable)
26-
# Unstable version tag : X.Y-<Github SHA 8 digit>
27-
SEMVER=$(echo ${GITHUB_REF_NAME} | grep -oE '[0-9]+.[0-9]+')
28-
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
29-
TAG="${SEMVER}-${SHORT_SHA}"
30-
;;
31-
nightly)
32-
# Nightly version tag : gitYYYYMMDDHHMM-<Github SHA 8 digit>
33-
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
34-
TAG="git${INPUTS_YYYYMMDDHHMM}-${SHORT_SHA}"
35-
;;
36-
*)
37-
exit 1
38-
;;
39-
esac
4019
pushd ${INPUTS_PATH}
4120
gcloud artifacts versions delete ${INPUTS_DEPLOY_CHANNEL} \
4221
--location=us \
4322
--package="debian-installer" \
4423
--project="android-cuttlefish-artifacts" \
4524
--quiet \
4625
--repository="${REPO}" || true
47-
for VERSION in ${TAG} ${INPUTS_DEPLOY_CHANNEL}; do
26+
for VERSION in ${INPUTS_IMAGE_VERSION} ${INPUTS_DEPLOY_CHANNEL}; do
4827
gcloud artifacts generic upload \
4928
--location=us \
5029
--package="debian-installer" \
@@ -57,5 +36,5 @@ runs:
5736
shell: bash
5837
env:
5938
INPUTS_DEPLOY_CHANNEL: ${{ inputs.deploy-channel }}
60-
INPUTS_YYYYMMDDHHMM: ${{ inputs.yyyymmddhhmm }}
39+
INPUTS_IMAGE_VERSION: ${{ inputs.image-version }}
6140
INPUTS_PATH: ${{ inputs.path }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'Prepare testbed for Gigabyte Ampere Cloud installer'
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Install required packages
7+
shell: bash
8+
run: |
9+
apt-get update
10+
apt-get upgrade -y
11+
apt-get install -y sudo
12+
apt-get install -y debconf-utils
13+
echo "tzdata tzdata/Areas select Etc" | debconf-set-selections -v
14+
echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections -v
15+
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
16+
dpkg-reconfigure --frontend noninteractive tzdata
17+
echo "pbuilder pbuilder/mirrorsite string http://deb.debian.org/debian/" | debconf-set-selections -v
18+
DEBIAN_FRONTEND=noninteractive apt-get install -y pbuilder
19+
dpkg-reconfigure --frontend noninteractive pbuilder
20+
apt-get install -y util-linux util-linux-extra
21+
apt-get install -y xz-utils
22+
apt-get install -y qemu-system-arm
23+
apt-get install -y expect
24+
apt-get install -y gdisk
25+
apt-get install -y e2tools e2fsprogs
26+
apt-get install -y fatcat mtools dosfstools
27+
apt-get install -y guestfish
28+
apt-get install -y lvm2
29+
apt-get install -y ubuntu-dev-tools
30+
apt-get install -y sshpass
31+
apt-get install -y openssh-client
32+
apt-get install -y u-boot-qemu
33+
apt-get install -y udev libgudev-1.0-dev
34+
apt-get install -y wget curl
35+
apt-get install -y screen
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'Gigabyte Cloud installer first-boot with qemu'
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Cloud image first boot with qemu
7+
working-directory: ./gigabyte-ampere-cloud-installer
8+
shell: bash
9+
run: |
10+
screen -d -m -L -Logfile console_001.log ./tests/run-qemu.sh gigabyte-cidata.iso "-nographic"
11+
while ! egrep "[^[:space:]]+[[:space:]]login:" console_001.log; do sleep 30; done
12+
cp -f console_001.log console_001_p1.log
13+
CONSOLELINES=$(cat console_001_p1.log | wc -l)
14+
cat console_001_p1.log
15+
grep "login:" console_001_p1.log > /dev/null
16+
echo "CONSOLELINES=${CONSOLELINES}" >> $GITHUB_ENV
17+
- name: Wait for post install script finish
18+
working-directory: ./gigabyte-ampere-cloud-installer
19+
shell: bash
20+
run: |
21+
sshpass -p cuttlefish ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -p 33322 vsoc-01@localhost 'while [ ! -e /var/log/custom-startup.log ]; do sleep 30; echo "Check custom-startup.log"; done'
22+
sshpass -p cuttlefish scp -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -P 33322 vsoc-01@localhost:/var/log/custom-startup.log ./custom-startup.log
23+
CUSTOM_LOG_LINES=$(wc -l < ./custom-startup.log)
24+
cat ./custom-startup.log
25+
while ! grep "VM successful" ./custom-startup.log; do sleep 30; sshpass -p cuttlefish scp -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" -P 33322 vsoc-01@localhost:/var/log/custom-startup.log ./custom-startup.log; tail -n +${CUSTOM_LOG_LINES} ./custom-startup.log; CUSTOM_LOG_LINES=$(wc -l < ./custom-startup.log); done
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: 'Gigabyte Cuttlefish installer check preseed after install script'
2+
3+
inputs:
4+
emulate-nvidia:
5+
required: false
6+
default: "false"
7+
emulate-amd:
8+
required: false
9+
default: "false"
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Prepare test environment
15+
shell: bash
16+
run: |
17+
apt-get update
18+
apt-get upgrade -y
19+
apt-get install -y sudo
20+
apt-get install -y initramfs-tools
21+
apt-get install -y grub-efi-arm64
22+
apt-get install -y lsb-release
23+
apt-get install -y pciutils
24+
apt-get install -y apt-show-versions
25+
apt-get install -y linux-image-arm64 linux-headers-arm64
26+
- name: Setup non-free repository
27+
shell: bash
28+
run: |
29+
echo "deb http://deb.debian.org/debian $(lsb_release -c -s) contrib non-free non-free-firmware" | tee /etc/apt/sources.list.d/debian-nonfree-1.list
30+
apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 update
31+
- name: Setup backports repository
32+
shell: bash
33+
run: |
34+
if grep "apt-setup/services-select" preseed/preseed.cfg | grep backports | egrep '^[^#]'; then
35+
echo "deb http://deb.debian.org/debian $(lsb_release -c -s)-backports main contrib non-free non-free-firmware" | tee /etc/apt/sources.list.d/debian-backports-1.list
36+
apt -o Apt::Get::Assume-Yes=true -o APT::Color=0 -o DPkgPM::Progress-Fancy=0 update
37+
fi
38+
- name: Check nVidia GPU emulation
39+
shell: bash
40+
run: echo "EMULATE_NVIDIA_GPU=${{ inputs.emulate-nvidia }}" >> $GITHUB_ENV
41+
- name: Check AMD GPU emulation
42+
shell: bash
43+
run: echo "EMULATE_AMD_GPU=${{ inputs.emulate-amd }}" >> $GITHUB_ENV
44+
- name: Running tests
45+
working-directory: ./gigabyte-ampere-cuttlefish-installer
46+
shell: bash
47+
run: |
48+
./tests/test-after-install-script-kernel.sh
49+
sh after_install_1_kernel.sh
50+
apt-show-versions linux-image-arm64
51+
apt-show-versions linux-headers-arm64
52+
apt-show-versions firmware-amd-graphics
53+
apt-show-versions nvidia-open-kernel-dkms
54+
apt-show-versions nvidia-kernel-dkms
55+
apt-show-versions nvidia-driver
56+
apt-show-versions firmware-misc-nonfree

0 commit comments

Comments
 (0)