mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-07-15 21:57:15 +00:00
ci: Add some time measurements to CI scripts
Add some use of "time" to measure the wallclock time for various items within our CI scripts. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
fa0fdc6500
commit
d59fe4eee7
@ -5,21 +5,21 @@ set -x
|
|||||||
source $HOME/.cargo/env
|
source $HOME/.cargo/env
|
||||||
|
|
||||||
# Install cargo components
|
# Install cargo components
|
||||||
rustup component add clippy
|
time rustup component add clippy
|
||||||
rustup component add rustfmt
|
time rustup component add rustfmt
|
||||||
cargo install --force cargo-audit
|
time cargo install --force cargo-audit
|
||||||
|
|
||||||
# Run cargo builds and checks
|
# Run cargo builds and checks
|
||||||
cargo rustc --bin cloud-hypervisor -- -D warnings
|
time cargo rustc --bin cloud-hypervisor -- -D warnings
|
||||||
cargo rustc --bin vhost_user_net -- -D warnings
|
time cargo rustc --bin vhost_user_net -- -D warnings
|
||||||
cargo test
|
time cargo test
|
||||||
cargo audit
|
time cargo audit
|
||||||
cargo rustc --bin cloud-hypervisor --no-default-features --features "pci,acpi" -- -D warnings
|
time cargo rustc --bin cloud-hypervisor --no-default-features --features "pci,acpi" -- -D warnings
|
||||||
cargo rustc --bin vhost_user_net --no-default-features --features "pci,acpi" -- -D warnings
|
time cargo rustc --bin vhost_user_net --no-default-features --features "pci,acpi" -- -D warnings
|
||||||
cargo clippy --all-targets --all-features -- -D warnings
|
time cargo clippy --all-targets --all-features -- -D warnings
|
||||||
cargo rustc --bin cloud-hypervisor --no-default-features --features "pci" -- -D warnings
|
time cargo rustc --bin cloud-hypervisor --no-default-features --features "pci" -- -D warnings
|
||||||
cargo rustc --bin vhost_user_net --no-default-features --features "pci" -- -D warnings
|
time cargo rustc --bin vhost_user_net --no-default-features --features "pci" -- -D warnings
|
||||||
cargo rustc --bin cloud-hypervisor --no-default-features --features "mmio" -- -D warnings
|
time cargo rustc --bin cloud-hypervisor --no-default-features --features "mmio" -- -D warnings
|
||||||
cargo rustc --bin vhost_user_net --no-default-features --features "mmio" -- -D warnings
|
time cargo rustc --bin vhost_user_net --no-default-features --features "mmio" -- -D warnings
|
||||||
find . \( -name "*.rs" ! -wholename "*/out/*.rs" \) | xargs rustfmt --check
|
time sh -c 'find . \( -name "*.rs" ! -wholename "*/out/*.rs" \) | xargs rustfmt --check'
|
||||||
cargo build --release
|
time cargo build --release
|
||||||
|
@ -10,7 +10,7 @@ FW_URL=$(curl --silent https://api.github.com/repos/cloud-hypervisor/rust-hyperv
|
|||||||
FW="$WORKLOADS_DIR/hypervisor-fw"
|
FW="$WORKLOADS_DIR/hypervisor-fw"
|
||||||
if [ ! -f "$FW" ]; then
|
if [ ! -f "$FW" ]; then
|
||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
wget --quiet $FW_URL
|
time wget --quiet $FW_URL
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ CLEAR_OS_IMAGE_URL="https://cloudhypervisorstorage.blob.core.windows.net/images/
|
|||||||
CLEAR_OS_IMAGE="$WORKLOADS_DIR/$CLEAR_OS_IMAGE_NAME"
|
CLEAR_OS_IMAGE="$WORKLOADS_DIR/$CLEAR_OS_IMAGE_NAME"
|
||||||
if [ ! -f "$CLEAR_OS_IMAGE" ]; then
|
if [ ! -f "$CLEAR_OS_IMAGE" ]; then
|
||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
wget --quiet $CLEAR_OS_IMAGE_URL
|
time wget --quiet $CLEAR_OS_IMAGE_URL
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ CLEAR_OS_RAW_IMAGE_NAME="clear-31310-cloudguest-raw.img"
|
|||||||
CLEAR_OS_RAW_IMAGE="$WORKLOADS_DIR/$CLEAR_OS_RAW_IMAGE_NAME"
|
CLEAR_OS_RAW_IMAGE="$WORKLOADS_DIR/$CLEAR_OS_RAW_IMAGE_NAME"
|
||||||
if [ ! -f "$CLEAR_OS_RAW_IMAGE" ]; then
|
if [ ! -f "$CLEAR_OS_RAW_IMAGE" ]; then
|
||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
qemu-img convert -p -f qcow2 -O raw $CLEAR_OS_IMAGE_NAME $CLEAR_OS_RAW_IMAGE_NAME
|
time qemu-img convert -p -f qcow2 -O raw $CLEAR_OS_IMAGE_NAME $CLEAR_OS_RAW_IMAGE_NAME
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ BIONIC_OS_IMAGE_URL="https://cloudhypervisorstorage.blob.core.windows.net/images
|
|||||||
BIONIC_OS_IMAGE="$WORKLOADS_DIR/$BIONIC_OS_IMAGE_NAME"
|
BIONIC_OS_IMAGE="$WORKLOADS_DIR/$BIONIC_OS_IMAGE_NAME"
|
||||||
if [ ! -f "$BIONIC_OS_IMAGE" ]; then
|
if [ ! -f "$BIONIC_OS_IMAGE" ]; then
|
||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
wget --quiet $BIONIC_OS_IMAGE_URL
|
time wget --quiet $BIONIC_OS_IMAGE_URL
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ BIONIC_OS_RAW_IMAGE_NAME="bionic-server-cloudimg-amd64-raw.img"
|
|||||||
BIONIC_OS_RAW_IMAGE="$WORKLOADS_DIR/$BIONIC_OS_RAW_IMAGE_NAME"
|
BIONIC_OS_RAW_IMAGE="$WORKLOADS_DIR/$BIONIC_OS_RAW_IMAGE_NAME"
|
||||||
if [ ! -f "$BIONIC_OS_RAW_IMAGE" ]; then
|
if [ ! -f "$BIONIC_OS_RAW_IMAGE" ]; then
|
||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
qemu-img convert -p -f qcow2 -O raw $BIONIC_OS_IMAGE_NAME $BIONIC_OS_RAW_IMAGE_NAME
|
time qemu-img convert -p -f qcow2 -O raw $BIONIC_OS_IMAGE_NAME $BIONIC_OS_RAW_IMAGE_NAME
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ EOAN_OS_IMAGE_URL="https://cloudhypervisorstorage.blob.core.windows.net/images/$
|
|||||||
EOAN_OS_IMAGE="$WORKLOADS_DIR/$EOAN_OS_IMAGE_NAME"
|
EOAN_OS_IMAGE="$WORKLOADS_DIR/$EOAN_OS_IMAGE_NAME"
|
||||||
if [ ! -f "$EOAN_OS_IMAGE" ]; then
|
if [ ! -f "$EOAN_OS_IMAGE" ]; then
|
||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
wget --quiet $EOAN_OS_IMAGE_URL
|
time wget --quiet $EOAN_OS_IMAGE_URL
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ EOAN_OS_RAW_IMAGE_NAME="eoan-server-cloudimg-amd64-raw.img"
|
|||||||
EOAN_OS_RAW_IMAGE="$WORKLOADS_DIR/$EOAN_OS_RAW_IMAGE_NAME"
|
EOAN_OS_RAW_IMAGE="$WORKLOADS_DIR/$EOAN_OS_RAW_IMAGE_NAME"
|
||||||
if [ ! -f "$EOAN_OS_RAW_IMAGE" ]; then
|
if [ ! -f "$EOAN_OS_RAW_IMAGE" ]; then
|
||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
qemu-img convert -p -f qcow2 -O raw $EOAN_OS_IMAGE_NAME $EOAN_OS_RAW_IMAGE_NAME
|
time qemu-img convert -p -f qcow2 -O raw $EOAN_OS_IMAGE_NAME $EOAN_OS_RAW_IMAGE_NAME
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -76,10 +76,10 @@ LINUX_CUSTOM_DIR="linux-custom"
|
|||||||
if [ ! -f "$VMLINUX_IMAGE" ]; then
|
if [ ! -f "$VMLINUX_IMAGE" ]; then
|
||||||
SRCDIR=$PWD
|
SRCDIR=$PWD
|
||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
git clone --depth 1 "https://github.com/cloud-hypervisor/linux.git" -b "virtio-fs-virtio-iommu" $LINUX_CUSTOM_DIR
|
time git clone --depth 1 "https://github.com/cloud-hypervisor/linux.git" -b "virtio-fs-virtio-iommu" $LINUX_CUSTOM_DIR
|
||||||
pushd $LINUX_CUSTOM_DIR
|
pushd $LINUX_CUSTOM_DIR
|
||||||
cp $SRCDIR/resources/linux-virtio-fs-virtio-iommu-config .config
|
cp $SRCDIR/resources/linux-virtio-fs-virtio-iommu-config .config
|
||||||
make bzImage -j `nproc`
|
time make bzImage -j `nproc`
|
||||||
cp vmlinux $VMLINUX_IMAGE
|
cp vmlinux $VMLINUX_IMAGE
|
||||||
cp arch/x86/boot/bzImage $BZIMAGE_IMAGE
|
cp arch/x86/boot/bzImage $BZIMAGE_IMAGE
|
||||||
popd
|
popd
|
||||||
@ -93,8 +93,8 @@ if [ ! -f "$VIRTIOFSD" ]; then
|
|||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
git clone --depth 1 "https://gitlab.com/virtio-fs/qemu.git" -b "virtio-fs-dev" $QEMU_DIR
|
git clone --depth 1 "https://gitlab.com/virtio-fs/qemu.git" -b "virtio-fs-dev" $QEMU_DIR
|
||||||
pushd $QEMU_DIR
|
pushd $QEMU_DIR
|
||||||
./configure --prefix=$PWD --target-list=x86_64-softmmu
|
time ./configure --prefix=$PWD --target-list=x86_64-softmmu
|
||||||
make virtiofsd -j `nproc`
|
time make virtiofsd -j `nproc`
|
||||||
cp virtiofsd $VIRTIOFSD
|
cp virtiofsd $VIRTIOFSD
|
||||||
popd
|
popd
|
||||||
rm -rf $QEMU_DIR
|
rm -rf $QEMU_DIR
|
||||||
@ -164,13 +164,13 @@ sudo bash -c "echo 10 > /sys/kernel/mm/ksm/sleep_millisecs"
|
|||||||
sudo bash -c "echo 1 > /sys/kernel/mm/ksm/run"
|
sudo bash -c "echo 1 > /sys/kernel/mm/ksm/run"
|
||||||
|
|
||||||
# Ensure test binary has the same caps as the cloud-hypervisor one
|
# Ensure test binary has the same caps as the cloud-hypervisor one
|
||||||
cargo test --no-run --features "integration_tests" -- --nocapture
|
time cargo test --no-run --features "integration_tests" -- --nocapture
|
||||||
ls target/debug/deps/cloud_hypervisor-* | xargs -n 1 sudo setcap cap_net_admin+ep
|
ls target/debug/deps/cloud_hypervisor-* | xargs -n 1 sudo setcap cap_net_admin+ep
|
||||||
|
|
||||||
sudo adduser $USER kvm
|
sudo adduser $USER kvm
|
||||||
newgrp kvm << EOF
|
newgrp kvm << EOF
|
||||||
export RUST_BACKTRACE=1
|
export RUST_BACKTRACE=1
|
||||||
cargo test --features "integration_tests" -- --nocapture
|
time cargo test --features "integration_tests" -- --nocapture
|
||||||
EOF
|
EOF
|
||||||
RES=$?
|
RES=$?
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ if [ $RES -eq 0 ]; then
|
|||||||
|
|
||||||
newgrp kvm << EOF
|
newgrp kvm << EOF
|
||||||
export RUST_BACKTRACE=1
|
export RUST_BACKTRACE=1
|
||||||
cargo test --features "integration_tests,mmio" -- --nocapture
|
time cargo test --features "integration_tests,mmio" -- --nocapture
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
RES=$?
|
RES=$?
|
||||||
|
Loading…
Reference in New Issue
Block a user