This repository contains a bunch of tools, one can use with Chisel for various purposes such as CI/CD.
The sdf tool supports a few subcommands which can check/verify/install slice
definition files.
Using go install:
go install github.com/rebornplusplus/chisel-tools/cmd/sdf@latest
Or, build:
go build ./cmd/sdf/
The sdf install sub-command installs all slices from a specified list of
files. This is particularly helpful in CI/CD when checking if the added slice
definition files are good and installable.
-
-r, --releaseis used to pass the chisel-releases directory path. -
-a, --archis used to set the package architecture. If unset, it defaults toamd64. -
The
sdf installcommand supports installing the slices in parallel. The-w, --workersoption is used to set the number of concurrent installations. If left unset, the default is 10. If the number of slices is less than the number of workers, the number of workers is reduced to the number of slices. -
Instead of installing the slices one by one, one can leverage the
--combineoption to install all slices together in one go. -
The
--pruneoption, if set, does something clever. It does not install all of the slices in those files. Instead, it only installs those top-level slices that do not appear as a dependency of any other slices. This ensures minimal installation while a complete error coverage of installing the slices. -
To get the whole list of errors,
-c, --continue-on-errormay be used. -
A package may be unavailable for a certain architecture. To ignore those errors of "package not found", one should set
--ignore-missing. -
In a similar note, the
--ensure-existenceoption, if set, verifies that each package in the slice definition files exists for some architecture.
The following installs all of the slices in the slices/ directory for arm64
architecture with upto 20 workers, ignoring the missing packages for arm64
while also asserting that each package exists for some architecture. It also
only installs the top-level slices.
sdf install --release ./chisel-releases/ --arch arm64 \
--prune \
--workers 20 \
--ignore-missing \
--ensure-existence \
slices/*.yaml