Development quickstart

This is quick start guide for developing and building this project from source on a Linux machine.

Get the source

The canonical development location of this project is on GitHub. You can fetch the full source with history via git:

git clone https://github.com/coreos/zincati.git
cd zincati

It is recommend to fork a copy of the project to your own GitHub account, and add it as an additional remote:

git remote add my-fork git@github.com:<YOURUSER>/zincati.git

Install Rust toolchain

This project is written in Rust, and requires a stable toolchain to build. Additionally, clippy and rustfmt are used by CI jobs to ensure that patches are properly formatted and linted.

You can obtain a Rust toolchain via many distribution methods, but the simplest way is via rustup:

rustup component add clippy
rustup component add rustfmt
rustup install stable

Build and test

Building and testing is handled via cargo and make:

make build
make check

If you prefer running builds in a containerized environment, you can use the FCOS buildroot image at quay.io/coreos-assembler/fcos-buildroot:testing-devel:

docker pull quay.io/coreos-assembler/fcos-buildroot:testing-devel
docker run --rm -v "$(pwd):/source:z" quay.io/coreos-assembler/fcos-buildroot:testing-devel bash -c "cd source; make"

The FCOS buildroot image is the same image that is used by integration jobs in CI. It contains all the required dependencies and can be used to build other CoreOS projects too (not only Zincati).

Assemble custom OS images

coreos-assembler (cosa) makes it very handy to embed build artifacts in a custom OS image, in order to test patches in the final environment.

Once a new cosa workspace has been initialized, you can place the binaries in the overrides/ directory before building your custom image:

pushd /tmp
mkdir test-image
cd test-image
cosa init https://github.com/coreos/fedora-coreos-config
popd
docker run --rm -v "$(pwd):/source:z" -v "/tmp/test-image:/assembler:z" \
    -e DESTDIR="/assembler/overrides/rootfs" -e TARGETDIR="/assembler/tmp/zincati/target" \
    quay.io/coreos-assembler/fcos-buildroot:testing-devel bash -c "cd source; make install"
pushd /tmp/test-image
cosa fetch
cosa build

For more details, see coreos-assembler overrides documentation.

build-fast for faster iteration

It is possible to use the CoreOS Assembler’s build-fast command for faster iteration. See here for instructions on fast-building a qemu image for testing.