CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
47 lines
1.4 KiB
Bash
Executable File
47 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# shellcheck disable=SC1091 # The relative paths in this file only become valid at runtime.
|
|
# shellcheck disable=SC2086 # we want word splitting
|
|
set -e
|
|
|
|
VSOCK_STDOUT=$1
|
|
VSOCK_STDERR=$2
|
|
VM_TEMP_DIR=$3
|
|
|
|
mount -t proc none /proc
|
|
mount -t sysfs none /sys
|
|
mkdir -p /dev/pts
|
|
mount -t devpts devpts /dev/pts
|
|
mkdir /dev/shm
|
|
mount -t tmpfs -o noexec,nodev,nosuid tmpfs /dev/shm
|
|
mount -t tmpfs tmpfs /tmp
|
|
|
|
. ${VM_TEMP_DIR}/crosvm-env.sh
|
|
. ${VM_TEMP_DIR}/setup-test-env.sh
|
|
|
|
# .gitlab-ci.yml script variable is using relative paths to install directory,
|
|
# so change to that dir before running `crosvm-script`
|
|
cd "${CI_PROJECT_DIR}"
|
|
|
|
# The exception is the dEQP binary, as it needs to run from its own directory
|
|
[ -z "${DEQP_BIN_DIR}" ] || cd "${DEQP_BIN_DIR}"
|
|
|
|
# Use a FIFO to collect relevant error messages
|
|
STDERR_FIFO=/tmp/crosvm-stderr.fifo
|
|
mkfifo -m 600 ${STDERR_FIFO}
|
|
|
|
dmesg --level crit,err,warn -w > ${STDERR_FIFO} &
|
|
DMESG_PID=$!
|
|
|
|
# Transfer the errors and crosvm-script output via a pair of virtio-vsocks
|
|
socat -d -u pipe:${STDERR_FIFO} vsock-listen:${VSOCK_STDERR} &
|
|
socat -d -U vsock-listen:${VSOCK_STDOUT} \
|
|
system:"stdbuf -eL bash ${VM_TEMP_DIR}/crosvm-script.sh 2> ${STDERR_FIFO}; echo \$? > ${VM_TEMP_DIR}/exit_code",nofork
|
|
|
|
kill ${DMESG_PID}
|
|
wait
|
|
|
|
sync
|
|
poweroff -d -n -f || true
|
|
|
|
sleep 1 # Just in case init would exit before the kernel shuts down the VM
|