Commit Graph

78 Commits

Author SHA1 Message Date
Valentine Burley
6203846120 ci/android: Move sourcing setup-test-env.sh before set -uex
This prevents printing the various aliases and exports, and cleans up the
job logs.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35792>
2025-06-30 10:15:15 +00:00
Antonio Ospite
abb9ebed26 ci/android: download S3_ANDROID_ARTIFACT_NAME in cuttlefish-runner.sh
Downloading the android artifacts separately is really a peculiarity of
cuttlefish jobs, where we need mesa artifacts for both the host and the
guest.

So move the separate download of android artifacts to
cuttlefish-runner.sh

This aligns with the .test-android definition being cuttlefish specific,
and it also matches the original comment in that definition regarding
S3_ANDROID_ARTIFACT_NAME.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35380>
2025-06-27 09:27:45 +00:00
Valentine Burley
9a52a25a9e ci: Allow ANGLE_TAG to be unset in -runner scripts
The android-runner scripts use `set -u`, which causes them to fail if
ANGLE_TAG is not defined. This issue went unnoticed because all current
Android jobs set ANGLE_TAG.

Update all -runner scripts to tolerate ANGLE_TAG being unset.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35362>
2025-06-05 15:18:23 +00:00
Antonio Ospite
088a4b0e23 ci/android: configure both hard limits and soft limits
The soft limits cannot go above the hard limits values, so the hard
limits should be configured too, just in case default limits values set
by the kernel or the init process are too small.

E.g. when booting with `init=/bin/sh` we have:

$ cat /proc/1/limits
Limit                     Soft Limit           Hard Limit           Units
...
Max open files            1024                 4096                 files
...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35126>
2025-06-04 15:43:42 +00:00
Guilherme Gallo
cf6f97a224 ci/android: reduce launch_cvd memory limit to 4GB by default
We only have 8GB on the Brya Chromebook used for venus testing, and the
job is unstable because using all the available RAM causes OOM kills.

So reduce launch_cvd memory limit to 4GB by default, still allowing to
change the default by setting the CUTTLEFISH_MEMORY variable in jobs
that might want a different value.

This change has been inspired by CROSVM_MEMORY, but a new variable is
used because technically cuttlefish can also use qemu in some setups,
not only crosvm.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35126>
2025-06-04 15:43:41 +00:00
Guilherme Gallo
769a4aa34e ci/android: disable errexit in trap function
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35126>
2025-06-04 15:43:41 +00:00
Guilherme Gallo
16754dbd13 ci/android: Add gitlab section for logs uploads
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35126>
2025-06-04 15:43:40 +00:00
Valentine Burley
5b60cae2af ci/android: Make android-runner scripts safe for set -u
Also make having VK_DRIVER set mandatory for Cuttlefish.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35277>
2025-06-03 13:58:11 +00:00
Antonio Ospite
3e2f43bb13 ci/android: only use custom kernel for venus GPU_MODEs
The venus GPU_MODEs require some patches to the Android 14 kernel to
work, so custom built bzImage and initramfs.img need to be passed to
launch_cvd.

However specifying a custom kernel triggers some image repacking which
is quite expensive in terms of I/O; so, since the custom kernel is only
needed for the venus GPU_MODEs, avoid specifying it for the other modes
to speed up launching cuttlefish in those cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34468>
2025-04-17 11:07:17 +00:00
Antonio Ospite
e774584faa ci/android: factor out a generic android-runner.sh from cuttlefish-runner.sh
Some of the commands in cuttlefish-runner.sh, like updating mesa and
ANGLE, are not specific to cuttlefish, in general they can be executed
on any Android device under test.

So split those commands out of cuttlefish-runner.sh and put them into an
android-runner.sh script.

For example, when testing a physical Android device instead of a virtual
device, a mesa-ci job will call android-runner.sh directly instead of
cuttlefish-runner.sh

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34111>
2025-03-26 17:25:55 +00:00
Antonio Ospite
83b0b07cce ci/android: increase the waiting time to stop the cuttlefish launcher
Increase the timeout of stop_cvd even more, sometimes 20 seconds are not
enough.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34111>
2025-03-26 17:25:55 +00:00
Antonio Ospite
6ef9213524 ci/android: don't set EGL_PLATFORM on the host before launching cuttlefish
Setting EGL_PLATFORM on the host system is not really necessary for
running cuttlefish, this is probably a left-over from previous
experiments.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34111>
2025-03-26 17:25:55 +00:00
Antonio Ospite
bac77bb30d ci/android: add a job using android-cts instead of deqp-runner
We also want to run Android CTS in the Android jobs.

Since the Android CTS is quite large, download it and strip it down to
only contain the interesting tests, so to reduce the space taken in the
container image.

Eventually we might want to have android-cts be run via deqp-runner
itself, but for now add a proof-of-concept mechanism which calls the
android-cts directly and uses an ad-hoc handling of expectations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:17 +00:00
Antonio Ospite
a6a38667f9 ci/android: add an android-deqp-runner.sh script
To run deqp-runner in cuttlefish we do something similar to
deqp-runner.sh but adapted to be used on Android via adb.

Isolate those adapted commands in an android-deqp-runner.sh script so
that in the future it will be easier to compare with deqp-runner.sh and
evaluate if deqp-runner.sh and android-deqp-runner.sh could be possibly
consolidated into a single script.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:17 +00:00
Antonio Ospite
e3a941720e ci/android: move all dEQP handling in one place in cuttlefish-runner.sh
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:17 +00:00
Antonio Ospite
ef496469bf ci/android: pass -vsock_guest_cid to launch_cvd
This reduces the risk of conflicting ports on the host system.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:17 +00:00
Antonio Ospite
074297aea1 ci/android: push /deqp-gles/mustpass/egl-main.txt.zst
Push /deqp-gles/mustpass/egl-main.txt.zst instead of the uncompressed
version which also have a version number in the path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:17 +00:00
Antonio Ospite
ae574a08c6 ci/android: use an x86_64_only cuttlefish image
In .gitlab-ci/cuttlefish-runner.sh 32bit libraries were removed but they
were not being replaced with newer ones, however this caused some
problems because by default the x86_64 target in AOSP is still
multi-library and for example the 32bit zygote process ended up crashing
because of the missing 32bit libraries, causing a general system
instability.

Since the CI is only building 64bit libraries for the android target,
use an x86_64_only cuttlefish product which only has components and
libraries built for the 64bit target, this avoids dealing with 32bit
EGL/Vulkan libraries at all, preventing any possible cause of
instability.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:17 +00:00
Antonio Ospite
7b4aa9cf80 ci/android: increase the waiting time to stop the cuttlefish launcher
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:17 +00:00
Antonio Ospite
0a267694db ci/android: stop cuttlefish before copying the logs, to log everything
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:17 +00:00
Antonio Ospite
6d4ebb3ff4 ci/android: disable modem simulator in cuttlefish, it is not needed
Disable the modem simulator in cuttlefish, it is not needed for testing
the graphics subsystem and avoids opening a few vsock ports which
reduces the chance of collisions in case of multiple instances of
cuttlefish running concurrently.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:17 +00:00
Antonio Ospite
e9b98b53b4 ci/android: disable audio in cuttlefish, it is not needed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:17 +00:00
Antonio Ospite
a8f98befe3 ci/android: don't set HOME globally in cuttlefish-runner.sh
Having HOME defined globally could mess up other things like adb config
files.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:16 +00:00
Antonio Ospite
f8fc7297cb ci/android: don't do unnecessary cleanup
Cleaning up and stopping cuttlefish before launching it is not strictly
necessary when using gitlab shared runners.

This can be added back later when we have a better justification.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33499>
2025-03-12 10:29:16 +00:00
Guilherme Gallo
11f8dffec4 ci/angle: remove USE_ANGLE variable
Now that every ANGLE use is covered by tag consistency checks
(structured tagging), we don't need the USE_ANGLE flag anymore, because
if we have ANGLE_TAG set, it means that ANGLE is required in this job.

In detail, it means that the test job has inherited ANGLE_TAG from
`.container-builds-angle`.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33421>
2025-02-28 01:33:34 +00:00
Guilherme Gallo
3b01d6e900 ci/angle: test-time structured tag checks
Let's setup the CI to enable runner script to check if the ANGLE
binaries from the container/rootfs are matching the intended version.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33421>
2025-02-28 01:33:34 +00:00
Valentine Burley
05021a1786 ci/angle: Rework building ANGLE (again)
Make setting the ANGLE_ARCH variable optional by providing a default
based on DEBIAN_ARCH, while keeping it possible to override it, which is
expected to be necessary for the Android-arm64 build.

Exclude unnecessary third party dependencies in the .gclient file, which
allows us to delete our first local patch. Thanks to Yuly Novikov for the
suggestion.

Use -no-history for gclient sync, which is equivalent to git's --depth=1
argument. This greatly speeds up the process of fetching sources.

Thanks to this speedup fetching third_party/catapult is no longer an
issue, allowing us to remove our second local patch.

Since we're no longer applying local patches, use ANGLE_REV and
/angle/version as the base for our version check on Android.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Reviewed-by: Antonio Ospite <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33467>
2025-02-12 09:03:48 +00:00
Valentine Burley
2aab9ef3fd ci/android: Check ANGLE version
Save the current git hash to /angle/hash after applying local patches,
and use it to verify that we're using our own ANGLE build in
Cuttlefish.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Reviewed-by: Eric Engestrom <None>
Reviewed-by: Antonio Ospite <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33377>
2025-02-06 11:58:33 +00:00
Valentine Burley
0fc4aef848 ci/android: Build and use ANGLE
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Reviewed-by: Eric Engestrom <None>
Reviewed-by: Antonio Ospite <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33377>
2025-02-06 11:58:33 +00:00
Eric Engestrom
5f54beb307 ci/cuttlefish: drop rm libglapi.so now that it's no longer loaded
Fixes: 44bda7c258 ("dri: put shared-glapi into libgallium.*.so")
Reviewed-by: Antonio Ospite <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33388>
2025-02-05 18:47:32 +00:00
Antonio Ospite
4c42e06d17 ci/android: stop pushing libglapi.so since it's not available anymore
After commit 44bda7c258 (dri: put shared-glapi into libgallium.*.so,
2024-12-26) the mesa Android build does not have a separate libglapi.so
object anymore in the install dir, so stop pushing it to the Android
device in cuttlefish-runner.sh

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33261>
2025-01-29 16:36:59 +00:00
Antonio Ospite
5a71e39e94 ci/android: pass --max-fails to deqp-runner in cuttlefish-runner.sh
Pass --max-fails to depp-runner in cuttlefish-runner.sh too for
consistency with the deqp-runner.sh script.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33261>
2025-01-29 16:36:59 +00:00
Antonio Ospite
326655c51d ci/android: post-process testlog XML and create a junit.xml
Post-process the XML file created by testlog-to-xml invoked by
deqp-runner to create a junit.xml file, just like deqp-runner.sh does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33261>
2025-01-29 16:36:59 +00:00
Antonio Ospite
d0b00a63a7 ci/android: fix pulling results from Android device
Add a trailing dot to the remote directoyy in the `adb pull` command to
make sure to recursively pull only the **content** of the directory and
not the directory itself.

This prevents having `results/results/` in the artifacts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33261>
2025-01-29 16:36:59 +00:00
Antonio Ospite
1c96335d01 ci/android: improve handling of expectation files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33261>
2025-01-29 16:36:59 +00:00
Antonio Ospite
1f0bf2c4a4 ci/android: define an INSTALL var for the source of mesa artifacts
Define an INSTALL var for the source of mesa artifacts so that some code
can be copied over from deqp-runner.sh

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33261>
2025-01-29 16:36:59 +00:00
Valentine Burley
b53d09a417 android/ci: Allow specifying Vulkan driver in cuttlefish-runner.sh
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33132>
2025-01-22 01:15:22 +00:00
Antonio Ospite
44caff4aba ci/android: set VK_DRIVER_FILES before launching cuttlefish
Cuttlefish performs some checks on the host system before launching,
setting VK_DRIVER_FILES to the path of the host artifacts makes sure
that a vulkan library can be found on the host side.

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
d93626a84b ci/android: use a /data/deqp subdirectory on guest to store dEQP files
Use a /data/deqp subdirectory on the Android guest to store dEQP files,
so that the files are not mixed with unrelated ones under /data

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
a3c6f7aa5a ci/android: set XDG_CACHE_HOME and pass --shader-cache-dir to deqp-runner
Set XDG_CACHE_HOME when invoking deqp-runner so that mesa can create the
shader cache and avoid this error:

-----------------------------------------------------------------------
ERROR - dEQP error: Failed to create //.cache for shader cache (Read-only file system)---disabling.
-----------------------------------------------------------------------

And also pass --shader-cache-dir to deqp-runner for vulkan tests.

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
a3e444ff1d ci/android: use a native adb connection
Use a "native" adb connection, it seems to have better stability,
especially when transferring a lot of files with `adb push`.

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
030b5f310b ci/android: update list of deqp files pushed to the guest system
In particular push all the files in
/deqp-vk/external/vulkancts/modules/vulkan/ and /deqp-tools because they
are needed at runtime.

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
2a85675eff ci/android: also copy mesa vulkan libraries to the Android guest
Also copy mesa vulkan libraries to the Android guest, this makes it
possible to test venus with the latest upstream mesa build.

While at it also keep the *_angle libraries as they will be used by the
venus_guest_angle GPU_MODE.

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
948f179f65 ci/android: reorder PATH and LD_LIBRARY_PATH values to clarify priority
Prefer libraries from /cuttlefish when loading binaries, in particular
this solves some loading problem when launching
/cuttlefish/bin/virgl_render_server

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
5cec9b69fd ci/android: don't call cuttlefish-host-resources script
The /etc/init.d/cuttlefish-host-resources wnants to perform some
operations that are not really desirable on a gitlab shared runner, like
loading specific kernel modules.

Since the script does not seem to be strictly necessary for basic
operation of cuttlefish, don't call it at all, avoiding the kernel
modules problem.

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
6e1959c56a ci/android: fix result dir for Android guest execution of deqp-runner
Commit 4143199be7 (ci/android: Use common $RESULTS_DIR for cuttlefish,
2024-08-21) clarified the separation between the result dir used on the
host and shipped in the artifacts, and the result dir used in the
Android guest to collect test results, however the latter was not
correctly passed to deqp-runner.

Fix that so that deqp-runner can finally run.

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
4d3eced2c0 ci/android: fix warning when using chown
Fix warning when using chown:

-----------------------------------------------------------------------
+ chown root.kvm /dev/kvm
chown: warning: '.' should be ':': 'root.kvm'
-----------------------------------------------------------------------

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
8252ffbf11 ci/android: use a custom kernel when launching cuttlefish
Use a custom kernel when launching cuttlefish, this is needed for
-gpu_mode=venus.

And while at it also clean up the state from previous runs, this seems
to be required when passing a custom kernel.

In this change also pass -enable_bootanimation=false which makes
drm_virgl work, and pass -enable_minimal_mode=true to avoid using some
features which are not really needed.

Note that the file number limit has to be increased too in
.gitlab-ci/cuttlefish-runner.sh for cuttlefish to work properly.

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
3cc3384e95 ci/android: better separate host and guest mesa artifacts
Clarify that artifacts from the Android guest are downloaded explicitly
and put them under /mesa-android directory so that they don't clash with
the Linux host artifacts downloaded by gitlab under
"${CI_PROJECT_DIR}/install".

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00
Antonio Ospite
0c0e268761 ci/android: make cuttlefish-runner.sh more robust against different Android images
Different Android images may contain different graphic libraries, for
example images from Google using an old mesa version may have
libGLES_mesa.so, while newer Android images built with mesa from
upstream have libGLESv1_CM_mesa.so, etc.

Use `rm -f` instead of just `rm` to avoid running into errors when
a file does not exist, resulting in a failing job.

Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30895>
2025-01-02 19:31:41 +00:00