This document explains how to develop and test Modus.
To build a custom BuildKit frontend, please first generate a Dockerfile for it, e.g.:
./target/debug/modus transpile Modusfile 'all("frontend", "release")' > /tmp/modus-frontend.Dockerfile
After that, build a frontend image:
docker build -f /tmp/modus-frontend.Dockerfile . -t my-buildkit-frontend
The frontend can be enabled by passing its name to modus build
using the option --custom-buildkit-frontend
:
modus build ... --custom-buildkit-frontend my-buildkit-frontend
To run integration tests, use the following command:
cd test
python -m unittest discover
Use the environment variable MODUS_EXECUTABLE
to specify the modus executable (modus
by default), and MODUS_BUILDKIT_FRONTEND
to specify custom BuildKit frontend (None
by default).
The GitHub Actions workflow handles building, testing and making a draft release on GitHub, but the following steps need to be done manually:
-
Increment the version number in
modus/Cargo.toml
andmodus-lib/Cargo.toml
. Note that themodus-lib
dependency inmodus/Cargo.toml
also need to have its version incremented. -
Commit these changes, then create a new git tag pointing to the version bumping commit with the next version number, e.g.:
git tag 0.1.2
and push the tag to trigger the workflow:
git push && git push --tags
-
Once the workflow is complete, publish the source code to crates.io with:
./cargo-publish.sh
-
The workflow will only create a draft release on GitHub. Go to the Releases page and publish the draft.