2023-06-05 18:24:33 +02:00
|
|
|
alias build := youki-release
|
|
|
|
alias youki := youki-dev
|
|
|
|
|
|
|
|
ROOT := `git rev-parse --show-toplevel`
|
|
|
|
|
|
|
|
# build
|
|
|
|
|
|
|
|
# build all binaries
|
|
|
|
build-all: youki-release rust-oci-tests-bin runtimetest
|
|
|
|
|
|
|
|
# build youki in dev mode
|
|
|
|
youki-dev:
|
2023-06-07 07:33:25 +02:00
|
|
|
./scripts/build.sh -o {{ ROOT }} -c youki
|
2023-06-05 18:24:33 +02:00
|
|
|
|
|
|
|
# build youki in release mode
|
|
|
|
youki-release:
|
2023-06-07 07:33:25 +02:00
|
|
|
./scripts/build.sh -o {{ ROOT }} -r -c youki
|
2023-06-05 18:24:33 +02:00
|
|
|
|
|
|
|
# build runtimetest binary
|
|
|
|
runtimetest:
|
2023-06-07 07:33:25 +02:00
|
|
|
./scripts/build.sh -o {{ ROOT }} -r -c runtimetest
|
2023-06-05 18:24:33 +02:00
|
|
|
|
|
|
|
# build rust oci tests binary
|
|
|
|
rust-oci-tests-bin:
|
2023-06-07 07:33:25 +02:00
|
|
|
./scripts/build.sh -o {{ ROOT }} -r -c integration-test
|
2023-06-05 18:24:33 +02:00
|
|
|
|
|
|
|
# Tests
|
|
|
|
|
|
|
|
# run oci tests
|
|
|
|
test-oci: oci-tests rust-oci-tests
|
|
|
|
|
|
|
|
# run all tests except rust-oci
|
|
|
|
test-all: unittest featuretest oci-tests containerd-test # currently not doing rust-oci here
|
|
|
|
|
|
|
|
# run cargo unittests
|
|
|
|
unittest:
|
|
|
|
cd ./crates
|
|
|
|
LD_LIBRARY_PATH=${HOME}/.wasmedge/lib cargo test --all --all-targets --all-features
|
|
|
|
|
2023-06-08 06:49:17 +02:00
|
|
|
# run purmutated feature compilation tests
|
2023-06-05 18:24:33 +02:00
|
|
|
featuretest:
|
|
|
|
./scripts/features_test.sh
|
|
|
|
|
|
|
|
# run oci integration tests
|
2023-06-07 07:33:25 +02:00
|
|
|
oci-tests:
|
|
|
|
./scripts/oci_integration_tests.sh {{ ROOT }}
|
2023-06-05 18:24:33 +02:00
|
|
|
|
|
|
|
# run rust oci integration tests
|
|
|
|
rust-oci-tests: youki-release runtimetest rust-oci-tests-bin
|
2023-06-07 07:33:25 +02:00
|
|
|
./scripts/rust_integration_tests.sh {{ ROOT }}/youki
|
2023-06-05 18:24:33 +02:00
|
|
|
|
|
|
|
# validate rust oci integration tests on runc
|
|
|
|
validate-rust-oci-runc: runtimetest rust-oci-tests-bin
|
|
|
|
./scripts/rust_integration_tests.sh runc
|
|
|
|
|
|
|
|
# run containerd integration tests
|
|
|
|
containerd-test: youki-dev
|
|
|
|
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant up
|
|
|
|
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant provision --provision-with test
|
|
|
|
|
2023-06-07 07:33:25 +02:00
|
|
|
# misc
|
2023-06-05 18:24:33 +02:00
|
|
|
|
|
|
|
# run bpftrace hack
|
|
|
|
hack-bpftrace:
|
|
|
|
BPFTRACE_STRLEN=120 ./hack/debug.bt
|
|
|
|
|
|
|
|
# run linting on project
|
|
|
|
lint:
|
|
|
|
cargo fmt --all -- --check
|
2023-06-07 07:33:25 +02:00
|
|
|
cargo clippy --all --all-targets --all-features -- -D warnings
|
|
|
|
|
2023-06-08 06:49:17 +02:00
|
|
|
# run spellcheck
|
|
|
|
spellcheck:
|
|
|
|
typos
|
|
|
|
|
2023-06-07 07:33:25 +02:00
|
|
|
# run format on project
|
|
|
|
format:
|
|
|
|
cargo fmt --all
|
2023-06-05 18:24:33 +02:00
|
|
|
|
|
|
|
# cleans up generated artifacts
|
|
|
|
clean:
|
2023-06-07 07:33:25 +02:00
|
|
|
./scripts/clean.sh {{ ROOT }}
|
|
|
|
|
2023-06-08 06:49:17 +02:00
|
|
|
# install tools used in dev
|
|
|
|
dev-prepare:
|
|
|
|
cargo install typos-cli
|
|
|
|
|
2023-06-09 19:34:23 +02:00
|
|
|
# setup dependencies in CI
|
2023-06-07 07:33:25 +02:00
|
|
|
ci-prepare:
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
# Check if system is Ubuntu
|
|
|
|
if [[ -f /etc/lsb-release ]]; then
|
|
|
|
source /etc/lsb-release
|
|
|
|
if [[ $DISTRIB_ID == "Ubuntu" ]]; then
|
|
|
|
echo "System is Ubuntu"
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get install -y \
|
|
|
|
pkg-config \
|
|
|
|
libsystemd-dev \
|
|
|
|
libdbus-glib-1-dev \
|
|
|
|
build-essential \
|
|
|
|
libelf-dev \
|
|
|
|
libseccomp-dev \
|
|
|
|
libclang-dev \
|
|
|
|
libssl-dev \
|
|
|
|
criu
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Unknown system. The CI is only configured for Ubuntu. You will need to forge your own path. Good luck!"
|
|
|
|
exit 1
|