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.
As those checks are not consuming any digest, we just use them to assess
if we need to build or not certain packages. The backend will refuse the
image if not configured appropriately
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
When depending on those package otherwise we try to compile the full
tree instead of reconstrucing the image which is result of a join while
keeping the revdep tree invariate
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
Add api call which uses go-container registry to create OCI images from
standard tar archives.
Consume new API when generating final images instead of docker building them
and adapts/add tests as necessary.
This change now allows to carry over xattrs to final images.
Fixes#266
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.
- Ditch multiple libraries for progressbar, spinner, colors and replace
with pterm
- Detect when running on terminal and disable automatically spinner
- Add support for multiple progress bars
- Huge rewrite of the configuration part. No more crazy stuff with viper
CLI commands now correctly overrides default config file as expected
- Limit banner to be displayed on relevant parts
Fixes#211Fixes#105Fixes#247Fixes#233
Instead of merely storing files into disk use a real cache.
This also makes possible finally to reference artifacts in the cache with the
package checksum, which solves the cache hit checksum failures we had
previously.
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.
This changeset allows to have shared templates in a static folder
"templates" present in each luet tree. If the directory is present, it
gets scanned and templated accordingly on top of each package. This
allows to use such folder to store custom blocks to share between
packages.
This is still experimental and subject to change, this is just a first
pass version to provide the feature. It needs to be refined still as it
would be more elegant to use the helm engine properly and map our
structure to the engine instead of adapting it roughly.
Fixes#224
docker.Untar
(https://github.com/mudler/luet/blob/master/vendor/github.com/docker/docker/pkg/archive/archive.go#L942) requires absolute paths.
We didn't do any input validation before, assuming the path passed by
were absolute since they were coming from YAML configuration files, now
that this is not the truth anymore we need to sanitize the input.
With this change we check if the given path is absolute or relative, if
it's relative we calculate the absolute path and use it in place.
While this breaks current hashing, it ties also the spec content to the
hash, in this way if we change something in the spec folder, it breaks
the hashing for the package.
Signed-off-by: Ettore Di Giacinto <mudler@sabayon.org>
This commit starts deprecation of `join` keyword in favor of
`requires_final_images` as boolean in the compilation spec.
The change is driven by two reasons: syntax and guarantee unique hashes.
- the hashtree when computing a hash it analizes the requires field of
each spec, ignoring the join field
- the join field doesn't add much value. Having it separate suggests
that a spec can contain both `requires` and `join`, but that's not
actually true. We just act differently on the same list.
Signed-off-by: Ettore Di Giacinto <mudler@sabayon.org>