Commit Graph

443 Commits (4997b57f1d92eeff54849eadba39a3136bbdfdf4)

Author SHA1 Message Date
Akihiro Suda 44891f4cb9
Merge pull request #2369 from tonistiigi/resolver-timeout-fixes
resolver timeout fixes
2021-09-21 14:29:01 +09:00
Tonis Tiigi 161b581e71 solver: increase timeout for job registration
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-09-18 21:28:45 -07: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
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
Erik Sipsma 808091a4e1 solver: include cachemap index in flightcontrol.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-08-16 17:26:36 +00:00
Cory Bennett 0b683eb1ff add missing ExtraHosts to gateway exec
Also adding tests for ExtraHosts and NetMode via gateway exec

Signed-off-by: Cory Bennett <cbennett@netflix.com>
2021-08-15 02:51:37 +00: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
Tõnis Tiigi d3cd28f59f
Merge pull request #2249 from claudiubelu/fixes-missing-passwd-file
Skips getting UID/GUID if passwd/group file is not found
2021-07-13 13:57:11 -07:00
Claudiu Belu 449d010a72 Skips getting UID/GUID if passwd/group file is not found
When running a WORKDIR instruction, buildkit will create that folder
and chown it to the currently set user. For this, it will try to read
the /etc/passwd file to get the proper UID, and if that user is not
found in the file, the root user will be considered as the owner.

However, Windows image do not have that file, which will result in
an error while building the image. We can consider not finding
the /etc/passwd file as the same as not finding the user in the file,
which would solve this issue.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-07-13 19:06:33 +00: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
Tonis Tiigi b1c80cf0ab caps: add cap for gha cache backend
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-09 20:49:26 -07:00
Tõnis Tiigi 9df59934cd
Merge pull request #2218 from tonistiigi/error-suggest
dockerfile: add suggestions to how to fix certain errors
2021-07-07 10:52:07 -07: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
Tonis Tiigi 4e4152832c dockerfile: remove unnecessary error wrappings
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-02 17:29:32 -07:00
Akihiro Suda 1a7543a105
Merge pull request #2163 from tonistiigi/detect-otel-env 2021-07-03 01:01:34 +09:00
Erik Sipsma 3c4f73768b
Merge pull request #2217 from sipsma/fileop-ref-leak
Fix ref leak if fileop ref fails to mount.
2021-07-01 17:38:55 -07:00
Erik Sipsma f3604724d4 Fix ref leak if fileop ref fails to mount.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-07-01 23:38:13 +00:00
Tõnis Tiigi 7d386663ec
Merge pull request #2216 from sipsma/cleancache
Remove unneeded Finalize method from ImmutableRef.
2021-07-01 16:35:33 -07:00
Erik Sipsma b85ef15689 Remove unneeded Finalize method from ImmutableRef.
Finalize was only used outside the cache package in one place, which
called it with the commit arg set to false. The code path followed
when commit==false turned out to essentially be a no-op because
it set "retain cache" to true if it was already set to true.

It was thus safe to remove the only external call to it and remove it
from the interface. This should be helpful for future efforts to
simplify the equal{Mutable,Immutable} fields in cacheRecord, which exist
due to the "lazy commit" feature that Finalize is tied into.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-07-01 17:54:59 +00:00
Akihiro Suda 8d70a9e098
Merge pull request #2215 from tonistiigi/improve-errors
Improve build errors and remove useless grpc prefix
2021-07-01 14:33:40 +09:00
Tonis Tiigi a27d7c3d81 exec: improve error message on exec errors
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-30 21:10:37 -07:00
Akihiro Suda be8ab28a0a
Merge pull request #2081 from tonistiigi/local-differ-none
Allow none differ on local source to avoid false Dockerfile matches
2021-07-01 09:42:24 +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 1d0597e85a handle unconfigured spans without errors
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-22 08:27:35 -07:00
Tonis Tiigi c773a215c1 integration: add common context base to all integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-18 20:49:49 -07:00
Sebastiaan van Stijn c325f89fa1
replace uses of deprecated containerd/sys.RunningInUserNS()
This utility was moved to a separate package, which has no dependencies.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-18 11:14:26 +02:00
Tonis Tiigi b10f25944b correctly validate span from context
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-15 21:11:27 -07:00
Tonis Tiigi 8f50bae3f1 replace opentracing with opentelemetry tracers
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-15 21:11:27 -07:00
Tonis Tiigi a7b155e30c llb: don't allow content diff for now
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-11 21:15:10 -07:00
Tonis Tiigi baa4fcdb0f add differ support for local source
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-11 21:15:07 -07:00
Akihiro Suda 817955dc8d
Merge pull request #2116 from tonistiigi/git-subdir
git: support subdir component
2021-06-08 14:27:50 +09:00
Tõnis Tiigi 8df5671844
Merge pull request #2082 from aaronlehmann/copy-include-exclude
Add IncludePatterns and ExcludePatterns options for Copy
2021-06-01 12:47:13 -07:00
Tõnis Tiigi e51dbe9fae
Merge pull request #2123 from hinshun/abs-mountpoint
Transform relative mountpoints for exec mounts in the executor
2021-05-26 19:37:52 -07:00
Aaron Lehmann b27fc6169b Combine include/exclude caps into a single cap
Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-05-26 13:48:03 -07:00
Aaron Lehmann 626744c9e7 Cache awareness of IncludePatterns/ExcludePatterns
Consider IncludePatterns and ExcludePattern when calculating content
hashes.

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-05-26 13:48:03 -07:00
Aaron Lehmann b545c281c1 Add capabilities for copy include/exclude patterns
Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-05-26 13:48:03 -07:00
Aaron Lehmann 7660af2f1d Add IncludePatterns and ExcludePatterns options for Copy
Allow include and exclude patterns to be specified for the "copy" op,
similarly to "local".

Depends on https://github.com/tonistiigi/fsutil/pull/101

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-05-26 13:48:03 -07:00
Edgar Lee 9aeed7b193 Transform relative mountpoints for exec mounts in the executor
Signed-off-by: Edgar Lee <edgarl@netflix.com>
2021-05-20 15:17:27 -07:00
Tonis Tiigi 3bdb6b5159 git: support subdir component
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-05-19 22:13:04 -07:00
Vlad A. Ionescu 60d38f972c Move config under worker config. Add new integration test to GHA matrix.
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
2021-05-13 14:55:36 +03:00
Vlad A. Ionescu b3cf7c43cf Switch to Acquire API.
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
2021-05-12 13:41:33 +03:00
Vlad A. Ionescu 489e17aea9 Add a configuration item to limit parallelism.
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
2021-05-10 15:47:59 +03:00
Tõnis Tiigi f113b49307
Merge pull request #2086 from thaJeztah/add_all_proxy
Add "ALL_PROXY" to list of default args / proxy env-vars
2021-04-26 09:09:44 -07:00
Sebastiaan van Stijn a743d4ba02
Add "ALL_PROXY" to list of default args / proxy env-vars
Relates to a82fff6377/docs/packages.md (proxies)

> (..) the first four of these are the standard built-in build-arg options
> available for `docker build`
> (..) The last, `all_proxy`, is a standard var used for socks proxying. Since
> it is not built into `docker build`, if you want to use it, you will need to
> add the following line to the dockerfile:
>
>     ARG all_proxy

Given the we support all other commonly known proxy env-vars by default, it makes
sense to add this one as well.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-24 18:19:02 +02:00
Aaron Lehmann 61bb15a47f Add hack to preserve Dockerfile RUN cache compatibility after mount cache bugfix
Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-04-14 08:53:08 -07:00
Aaron Lehmann 0e106e6967 Fix missing mounts in execOp cache map
A bug in cloneExecOp prevented mounts from being included in the digest
computed for the execOp cache map. This could lead to an exec being
wrongly cached when a different mount was used for a subsequent
execution.

Repro case:
https://gist.github.com/aaronlehmann/cfeaefc028df8127fb85b9b5f9125f2d

In this example, pass2 should generate an empty diff because the /from
and /to mounts are the same busybox image. But before the fix, it uses
the cached result from pass1 (with different mounts) instead.

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2021-04-13 22:04:28 -07:00
Tonis Tiigi 86154daec1 solver: check for input index existence
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-04-07 22:02:42 -07:00
Sebastiaan van Stijn 292685db37
solve: remove duplicate filepath.Join
I saw these, and there was no comment in the code explaining if there was a reason
for this; these were added in 2be999ba52, but couldn't
find a mention about these particular lines in the review comments, and I couldn't
think of a special reason for it ':-)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-29 13:24:55 +02:00
Tonis Tiigi bee77d81b9 solver: check for edge dependency before merging
In some cases edges that depend on each other
can have identical cache keys. This happens for
example when empty layers are optimized out by
the differ between identical commands. We need to
detect this case and avoid merge.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-03-18 19:55:35 -07:00