Commit Graph

119 Commits (6e82a4a89bded14acf08068e222cf31ee41afd7b)

Author SHA1 Message Date
CrazyMax bb746566db
buildinfo: change buildinfo attr export key to bool
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-16 21:22:54 +01:00
CrazyMax cdaafb9303
buildinfo: use metadata to set frontend build sources
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-14 21:55:20 +01:00
CrazyMax b2e5d1938d
buildinfo: set frontend attrs to bridge result
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-14 21:55:20 +01:00
CrazyMax 83a483a9fe
buildinfo: opt-in inline build attributes
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-14 21:55:19 +01:00
CrazyMax b4e37a867f
buildinfo: refactor
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-14 21:55:18 +01:00
Tõnis Tiigi 45fc3ed510
Merge pull request #2561 from cpuguy83/keep-non-distributable
Do not re-tag non-distributable blob descriptors
2022-02-10 18:19:43 -08:00
CrazyMax 3532f5c0cf
image exporter: return image descriptor in response
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-10 02:39:58 +01:00
Brian Goff 758410d74a Cleanup foreign-layers implementation
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-02-10 01:12:42 +00:00
Brian Goff 893bfddbc9 Move non-dist layer conversion to GetRemotes
This just makes sure the logic for the layer conversion is all in one
place and settable by a common option.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-02-10 01:12:42 +00:00
Brian Goff 78bb7137ee Do not re-tag non-distributable blob descriptors
Before this change buildkit was changing the media type for
non-distributable layers to normal layers.
It was also clearing out the urls to get those blobs.

Now the layer mediatype and URL's are preserved.
If a layer blob is seen more than once, if it has extra URL's they will
be appended to the stored value.

On export there is now a new exporter option to preserve the
non-distributable data values.
All URL's seen by buildkit will be added to the exported content.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-02-10 01:12:42 +00:00
Tonis Tiigi cab33b1e31 exporter: support for compression-level
compression-level option can be set on export to
define the preferred speed vs compression ratio. The
value is a number dependent on the compression algorithm.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-02-01 15:21:46 -08:00
Tonis Tiigi dc21885891 hack: enable more linters
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-01-19 12:20:30 -08:00
Erik Sipsma 03ed0548ef cache: Replace Parent method with LayerChain.
The Parent method will no longer make sense with forthcoming Merge and
Diff support as refs will become capable of having multiple parents. It
was also only ever used externally to get the full chain of refs for
each layer in the ref's chain.

The newly added LayerChain method replaces Parents with a method that
just returns a slice of refs for each layer in the ref's chain. This
will work more seamlessly with Merge and Diff (in which case it returns
the "flattened" ancestors of the ref) in addition to being a bit easier
to use for the exiting cases anyways.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-11-17 11:02:16 -08:00
Kohei Tokunaga f9e0346b34 Propagate compression options to the inline cache export
Co-authored-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-10-22 15:43:32 +09:00
CrazyMax 5fcc94454f
Generate and embed build sources
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-09-18 01:39:35 +02:00
Tonis Tiigi 8b5c4d74ef exporter: support creating blobs with zstd compression
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-09-05 22:43:15 -07:00
Erik Sipsma a9f1980ebb Refactor cache metadata interface.
There are a few goals with this refactor:
1. Remove external access to fields that no longer make sense and/or
   won't make sense soon due to other potential changes. For example,
   there can now be multiple blobs associated with a ref (for different
   compression types), so the fact that you could access the "Blob"
   field from the Info method on Ref incorrectly implied there was just
   a single blob for the ref. This is on top of the fact that there is
   no need for external access to blob digests.
2. Centralize use of cache metadata inside the cache package.
   Previously, many parts of the code outside the cache package could
   obtain the bolt storage item for any ref and read/write it directly.
   This made it hard to understand what fields are used and when. Now,
   the Metadata method has been removed from the Ref interface and
   replaced with getters+setters for metadata fields we want to expose
   outside the package, which makes it much easier to track and
   understand. Similar changes have been made to the metadata search
   interface.
3. Use a consistent getter+setter interface for metadata, replacing
   the mix of interfaces like Metadata(), Size(), Info() and other
   inconsistencies.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-08-25 19:15:09 +00:00
Kohei Tokunaga f8d30d567e Add `estargz` compression type
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-08-24 14:10:09 +09:00
Koichi Shiraishi 50ae0d8cf4
all: unify the go-digest package import alias to digest
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
2021-08-11 08:29:12 +09:00
Koichi Shiraishi 671ae38fb7
all: unify the specs-go package import alias to ocispecs
ocispecs means "O"pen "C"ontainer "I"nitiative image-spec/"specs"-go/v1
                      opencontainers          /image-spec/specs-go/v1

Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
2021-08-11 08:29:09 +09:00
CrazyMax f4a67d7e9c
Exporter config digest typo
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-07-15 20:42:36 +02:00
Aaron Lehmann 87dcc7bbe2 Add span for layer export
This can be a significant amount of time that isn't currently accounted
for in traces.

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-07-14 11:27:08 -07:00
Morlay 18b49fd7dc refactor to use util/bklog instead of using logurs directly
Signed-off-by: Morlay <morlay.null@gmail.com>
2021-07-13 11:42:31 +08:00
Tõnis Tiigi b055d2d55c
Merge pull request #2057 from ktock/export-compression
exporter: Enable to specify the compression type for all layers of the finally exported image
2021-07-06 21:52:36 -07:00
ktock 3152eab58f Enable to forcefully specify compression type
Signed-off-by: ktock <ktokunaga.mail@gmail.com>
2021-07-07 12:00:06 +09:00
Cory Bennett b1d441b175 [#2112] progress.FromContext returns a writer factory
this allows progress.Controller to manage the writer lifecycle

Signed-off-by: Cory Bennett <cbennett@netflix.com>
2021-06-28 18:58:29 +00:00
Tonis Tiigi 1098f8ee82 exporter: return config digest when exporting single-arch image
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-12-14 13:26:16 -08:00
Tonis Tiigi e3b05289d8 add session injection to remote loading
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-11-02 22:20:44 -08:00
Tonis Tiigi ecf070a027 exec: use platform specific default path
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-23 15:30:23 -07:00
Akihiro Suda dda009a58c
Merge pull request #1739 from tonistiigi/empty-layer
clear file mount stubs and fix empty layer cases
2020-10-21 00:42:45 +09:00
Tonis Tiigi c7f5979dd4 exporter: avoid descriptor annotations on docker manifests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-19 12:54:47 -07:00
Tonis Tiigi c8b8d6ce63 exptypes: define empty gz layer digest
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-18 23:39:23 -07:00
Tonis Tiigi f9d7f1cf4a exporter: don’t keep timestamp for empty layer
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-18 23:39:23 -07:00
Tonis Tiigi b474dbf55f resolver: clean up unused resolver pool
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-13 17:27:18 -07:00
Erik Sipsma 55cbd19dec Add support for lazily-pulled blobs in cache manager.
This allows the layers of images to only be pulled if/once they are actually
required.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2020-08-05 17:18:43 -07:00
Tonis Tiigi c8190b1518 lint: enable golint
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-19 09:28:24 -07:00
Tonis Tiigi 2e9987ad16 session: track sessions with a group construct
Avoid hidden session passing and allow one session to drop when
multiple builds share a vertex.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-05 00:15:25 -07:00
Erik Sipsma 61bd44337b image export: Use correct media type when creating new layer blobs.
There are a few bugs in the image export related code being fixed here.
GetMediaTypeForLayers was iterating over diffPairs in the wrong order, resulting
in it always returning nil for images with more than one layer. This actually
worked most of the time because it accidentally triggered a separate codepath
meant to handle v0.6 migrations where mediatypes left empty get filled in.
However, fixing that bug revealed another existing bug where the "oci" parameter
in the image exporter was not being honored except when the v0.6 codepath got
followed, resulting in images to always have oci layer media types even when
docker types are used for the rest of the image descriptors.

Due to the interaction between these various bugs, the only practical end effect
previously was that single-layer images could use the wrong layer media type. An
existing test has been expanded to cover that case in a previous commit.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2020-06-24 12:07:00 -07:00
Tonis Tiigi c78e875977 remove last instances of errors cause
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-24 11:25:53 -07:00
Tonis Tiigi 37b8832d00 upgrade errors checks to Is()
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-18 22:53:38 -07:00
Tonis Tiigi 2c3cf11fde resolver: update to new registryhosts based config
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-03-05 19:56:43 -08:00
Wei Fu 65388edc6c exporter: support compression for layer blob data
Allow user to choose the compression type for layer data. Gzip is
default compression for layer exporter, which consume more Cpu resources
and take long time to export. With compression option, user can use
nocompressed option to export to save time. And future, zstd is one new
option for end-user.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-12-09 23:51:38 +08:00
Tõnis Tiigi e486c1193f
Merge pull request #1247 from tonistiigi/dangling-naming
exporter: add canonical and dangling image naming
2019-11-12 10:02:04 -08:00
Tonis Tiigi 044271e0ad exporter: add canonical and dangling image naming
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-11-06 17:32:24 -08:00
Tonis Tiigi 01cfdcd8f2 exporter: keeps blob refs on images
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-11-06 17:30:21 -08:00
Tonis Tiigi 339d4b2fef leaseutil: mark temporary leases with timestamps
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-10-16 10:35:50 -07:00
Tonis Tiigi bbc8b6dc6f exporter: remove label based linking
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-10-16 10:33:03 -07:00
Tonis Tiigi a9209caa93 clean up temporary leases on startup after crash
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-10-16 10:32:57 -07:00
Tonis Tiigi 688e2c2272 cache: update components to new lease based cache manager
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-10-16 10:32:04 -07:00
Tonis Tiigi 5d617c557d vendor: update containerd to f0821348
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-20 17:03:04 -07:00