This commit is multi-fold and impacts several areas:
- Don't re-generate final artifact locally if already present while
building with `requires_final_images`.
- Expose to CLI a way to build final images without pushing them.
- The packages listed with `requires_final_images` now are evaluated by
the solver so the full deptree is took into account
Fixes: https://github.com/mudler/luet/issues/294
This refactors DefaultPackage into types.Package and gets rid of the
interface. This is a preceeding for a follow up where accessors will be
removed from the code.
It also does several cleanup, so we get rid also of some unneeded
dependencies.
This commit is multi-fold as it also refactors internally context and logger
as interfaces so it is easier to plug luet as a library externally.
Introduces a garbage collector (related to #227) but doesn't handle yet
parallelism.
Closes#265
Add --push-final-images, --push-final-images-repository and
--push-final-images-force to luet build.
--push-final-images enables pushing final artifact during build. Each
package built will be packed and pushed to the final repository
specified with --push-final-images-repository. By default if no
final-repository is specified and pushing final images is enabled will
default to the cache repository.
--push-final-images-force allows to force-push final images even if
there are already available on the specified registry
It holds necessary state plus additional information relative to the
context which we are being run to (e.g. if we are in a terminal or not).
Besides in the future we can use it also as a contextual logger to
provide more smart logging capabilities.
This also replace the general global configuration instance that
previously was share between the core components.
The BuildTree implementation was in parallel-build-tools, which actually makes
sense to share in the compiler as can be used as another way to trigger
builds.
The CLI helpers were split in several CIs
implementations. This moves a new layout where we expose several
packages, as we will refactor things slowly.
* Reduce possibility of circular dependency
Just by adding an import for bus to anything in the helper dir, we would
run into a circular dependency due to how things are structured. That
means that we cannot set any events for unpacking or docker helper
pulling an image.
This commit tries to work around this by doing several things.
- Remove full imports of the helper module by segmentating some modules
into their own submodule, like docker or match so just using a small match
function doesnt bring the whole module
- Removing a simple function to check if a dir exists from importing
the full helper module and instead write the function (5 lines)
- Using logrus in the bus module instead of logger, which avoids a
circular dependency
Signed-off-by: Itxaka <igarcia@suse.com>
* Add two new events for unpacking an image
Both pre and post unpacking an image
Signed-off-by: Itxaka <igarcia@suse.com>
A new keyword `join` is introduced to generate the parent image. It
takes precedence over a `requires` or a `image` already defined in a
spec.
It will generate all the artifacts from the packages listed and join
them in a single image which will be used as parent for the package
build process.
This is a change which invalidates priorly generated hashes.
Fixes#173
Add "provides" field in packages (which affect both runtime and buildtime deps).
It replaces all the occurences in the deptree before solving, actually
allowing to swap packages and provide virtuals. Along with a mechanism
for package rename #25.
Fixes races conditions and make the DB Switchable. Also prepare inside
the CompilationSpec the tree of the deps to be built, and parallelize
only the building jobs.
Closes#7
Signed-off-by: Ettore Di Giacinto <mudler@gentoo.org>
Add CompilationSpecs type to handle slices of CompilationSpec, to
perform operation such as Unique() and Remove().
Add also dependencies and the spec associated to the Artifact, to track
how the artifact was generated.
Add revdeps compilation wrapper, and unit tests
Whenever we update the tree with new informations, all the sibilings
needs to be updated as well
Also switch to inmemory db for recipe - even if this should be a switch