.
├── build.md
├── build.sh
├── deploy
│ ├── ...
├── deploy.sh
├── docker
│ ├── controller
│ │ ├── Dockerfile.local
│ │ └── Dockerfile.remote
├── e2e
│ └── src
├── local-test.sh
├── src
│ └── <controller_name>_controller.rs
├──...
Controller source should be put in src/, with e2e test in e2e/src and test workload specified in deploy/
verus_commit: 3b6b805ac86cd6640d59468341055c7fa14cff07
kind_version: 0.23.0
go_version: "^1.20"
Please refer to
.github/workflows/ci.ymlfor the most recent versions used.
VERUS_DIR=../verus ./build.sh <controller_name.rs> [other verus arguments]
Make sure VERUS_DIR points to verus repo location and built binary exists, <controller_name> corresponds to entry file in src
More argument usage by
verus --help
VERUS_DIR=../verus ./build.sh <controller_name.rs> [--no-verify] [other verus arguments]
--no-verify is optional for fast build. Controller built without this option from the section above can be directly used, but verifications could take long time.
-
Build controller binary by
build.sh -
Build controller docker image
Base image and builder image is specified in
docker/controller/Dockerfile.[local|remote]respectively -
Setup cluster, apply controller image using kind.
-
Apply test specified in
e2e/srcand workload indeploybydeploy.sh
This process can be automated with:
1-3
./local-test.sh <controller_name> [--build|--build-remote]
Usage:
--build: Call ./build.sh to build the controller before test, should have VERUS_DIR speccified
--build-remote: Call ./build.sh to build the controller image using Verus builder. This is useful when host has different runtime environment from image (Ubuntu 22.04), for example, different glibc version
unspecified: Just use existing built controller image to set up kind cluster. Assume the image is named as `local/$app-controller:v0.1.0`
If deployment/test failed, you can manually run ./deploy.sh <controller_name> [local|remote] to reset the e2e test environment.
4
cd e2e
cargo run -- <controller_name>
More examples in
.github/workflows/ci.yml