641 Commits

Author SHA1 Message Date
CrazyMax
1bd26bf901 Merge pull request #5977 from austinvazquez/update-runtime-components-05162025
Dockerfile: update container runtime components
2025-05-28 11:23:34 +02:00
Anthony Nandaa
f736b448d7 fix: wcow: cache: add lock for enable/disable privileges
Fixes #5906, reverts #5980

Previously, due to lack of a sync mechanism, we'd end up
with some race condition (occassionally) due to one deferred
disableProcessPrivileges call happening before the rest
complete.

Fix this by introducing a mutex to coordinate the enabling
and disabling of the privileges.

Signed-off-by: Anthony Nandaa <profnandaa@gmail.com>
2025-05-23 13:47:12 +03:00
Tonis Tiigi
9a5dff09b5 vendor: update to containerd v2.1.1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-21 09:09:33 -06:00
Tonis Tiigi
2307fb7d12 allow duration based filters on diskusage requests
Allows similar time-based filter that is allowed for
prune requests so that DiskUsage request can be used to
check which records would be candidates for pruning.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-18 20:30:18 -07:00
CrazyMax
eb7b57f947 lint: fix after merge conflict
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-05-14 10:53:52 +02:00
Akihiro Suda
d0dd5acc72 Merge pull request #3867 from HileQAQ/main
Support for building overlaybd images
2025-05-14 12:54:01 +09:00
Tõnis Tiigi
b46daef219 Merge pull request #5814 from tonistiigi/go-1.24
update to go1.24
2025-05-13 07:36:59 -07:00
Tonis Tiigi
b40bfd1d08 cache: improve migration to image manifest cache
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-12 16:46:40 -07:00
liulanzheng
c097f43378 Support for building overlaybd images
Signed-off-by: liulanzheng <lanzheng.liulz@alibaba-inc.com>
2025-05-12 14:20:20 +08:00
Tonis Tiigi
9fcedf9807 update gopls to go1.24 compatible version
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-07 18:23:20 -07:00
Tonis Tiigi
69d3d44145 lint: add unconvert
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-02 12:44:01 -07:00
Tonis Tiigi
1e512a15c3 lint: add fatcontext
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-02 12:19:22 -07:00
Tonis Tiigi
c6a1dcd6b5 lint: correcting errorlint and some err113 cases
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-02 12:19:22 -07:00
Tonis Tiigi
f1f56c2b77 golangci-lint: v2 upgrade
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-02 12:19:17 -07:00
Tõnis Tiigi
37daea90eb Merge pull request #5863 from tonistiigi/sort-update
lint: update some sorting code to newer generics based libs
2025-04-09 09:38:30 -07:00
Tonis Tiigi
f6a7201314 remotecache: enable image-manifest by default
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-04-08 09:23:23 -07:00
Tõnis Tiigi
b65adf5b91 Merge pull request #5827 from tonistiigi/prune-min-space-fix
prune: update free-space filter when no max-space set
2025-04-07 11:32:55 -07:00
Jonathan A. Sternberg
66016a8c63 vendor: switch from idtools to moby/sys/user
Convert usages of `github.com/docker/docker/pkg/idtools` to
`github.com/moby/sys/user` in order to break the dependency between
buildkit and docker.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-04-02 10:22:02 -05:00
Tonis Tiigi
ac123b493f prune: update free-space filter when no max-space set
When free-space filter is set without max-space or reserved-space
filter, the behaviour is that if the filter matches some records
then these records would be pruned, but if it doesn't match any
(there are more free space than filter sets already) then the keepBytes
would be left to 0, resulting records to be deleted as if no storage
constraint was set at all.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-24 09:42:07 -07:00
Tõnis Tiigi
ac8a2b143a Merge pull request #5831 from tonistiigi/trace-extract
cache: add tracing spans for layer extraction
2025-03-24 09:38:12 -07:00
Tonis Tiigi
f6c142ec23 lint: update some sorting code to newer generics based libs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-20 10:32:02 -07:00
Tonis Tiigi
910c4c3ec6 go.mod: update minimum go version to go1.23
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-18 17:58:45 -07:00
Tonis Tiigi
f46527a1b6 cache: add tracing spans for layer extraction
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-10 17:34:32 -07:00
Tonis Tiigi
b5286f8dcb apply x/tools/modernize fixes
Autogenerated with couple of manual patches.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-07 08:18:45 -08:00
Tonis Tiigi
63bccf123b gha: mitigate cachev2 flakiness
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-03 09:43:30 -08:00
Anthony Nandaa
877d8a771e feat: wcow: add support for bind and cache mounts
Currently, mounts are not supported for WCOW builds,
see #5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [x] add client integration tests (not all, `llb.AddMount` not
  complete)

Fixes #5603

Signed-off-by: Anthony Nandaa <profnandaa@gmail.com>
2025-02-20 21:19:03 +03:00
CrazyMax
2d4d460317 cache(gha): fix missing user-agent for importer
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-02-19 16:34:25 +01:00
CrazyMax
3c19db6684 cache(gha): set user-agent for github cache service requests
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-02-19 12:55:42 +01:00
CrazyMax
1c917b4290 test: handle gha cache v2
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-02-18 19:07:45 +01:00
CrazyMax
3b4e28a10a cache(gha): don't require url attr if url_v2 is set
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-02-17 18:45:17 +01:00
Tõnis Tiigi
3c20a7c2a1 Merge pull request #5735 from tonistiigi/gha-url-v2
gha: allow url_v2 input attribute
2025-02-13 10:28:46 -08:00
Pranav Pandit
1d5af106e8 Add back support for azblob cache
Signed-off-by: Pranav Pandit <pranavp@microsoft.com>
2025-02-13 04:28:17 +00:00
Tonis Tiigi
dea6c49160 gha: allow url_v2 input attribute
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-02-12 17:37:08 -08:00
Tonis Tiigi
497a00c948 update go-actions-cache to bd99cf5bbc65 (v2 API)
Brings in initial support for V2 Cache API

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-02-11 12:36:13 -08:00
Tonis Tiigi
c23fdcafcc remove azure remote cache backend
This is blocking upgrade to Github Actions Cache V2 API and
update to latest release has not happened.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-02-11 10:21:40 -08:00
Tõnis Tiigi
c4f673e5b9 Merge pull request #5597 from bpaquet/fix_5584
[s3 cache] Fix upload of downloaded layer
2025-02-10 16:55:09 -08:00
Tõnis Tiigi
0e3037c018 Merge pull request #5652 from crazy-max/test-gha-own-suite
test: move gha cache to its own suite
2025-02-10 15:26:55 -08:00
Bertrand Paquet
914c553703 [s3 cache] Fix upload of downloaded layer
Signed-off-by: Bertrand Paquet <bertrand.paquet@gmail.com>
2025-01-17 16:57:24 +01:00
Tõnis Tiigi
e7185ace0b Merge pull request #5636 from jsternberg/unroll-prune-loop
cache: convert prune loop from recursive invocation to iterative
2025-01-16 14:35:44 -08:00
Jonathan A. Sternberg
45177dade2 contenthash: clear ModeIrregular before sending to archive/tar
Clears ModeIrregular from the checksum generation. This may be sent by
the client when the version of Go used is post Go 1.23. The behavior of
`os.Stat` was modified in Go 1.23 to set `ModeIrregular` on reparse
points in Windows. This clears `ModeIrregular` when any mode is set
which was the previous behavior of `os.Stat`.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-01-15 13:03:48 -06:00
Alberto Garcia Hierro
8d83d36a96 chore: annotate errors returned from NewFromStat() with the file path
Otherwise it is very tricky to understand which file produced the error.
Should help with https://github.com/docker/for-win/issues/14083

Signed-off-by: Alberto Garcia Hierro <damaso.hierro@docker.com>
2025-01-15 11:42:34 +00:00
CrazyMax
89d550b9de test: move gha cache to its own suite
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-01-14 15:09:05 +01:00
Sebastiaan van Stijn
d709e4bb1c vendor: google.golang.org/protobuf v1.35.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-14 14:03:31 +01:00
Marat Radchenko
5be7edb69c Upgrade to containerd 2
Co-authored-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2025-01-13 16:42:48 -08:00
Jonathan A. Sternberg
174fb8ad5c cache: convert prune loop from recursive invocation to iterative
The prune logic would prune multiple times because one prune could cause
more things to be capable of pruning and change the logic. This was done
through a recursive invocation.

Since go doesn't have support for function tail calls, this would result
in a new stack entry for each loop. This unrolls the logic so the prune
function is invoked iteratively rather than recursively.

`prune` and `pruneOnce` have also had their names swapped. In general,
`pruneOnce` implies that it runs a single prune while `prune` sounds
like the top level function. The current code had this reversed and
`pruneOnce` would call `prune` and `prune` would call itself
recursively.

I've also updated a section in the controller that invoked prune on each
worker. In older versions of Go, the current version was correct because
those versions of Go would reuse the location for each loop which would
cause goroutines to all reference the same worker instead of different
workers.

Recent versions of Go have changed the behavior so this is no longer
needed.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-01-13 10:26:54 -06:00
lvyaoting
5a0e70133a chore: fix some function name in comment
Signed-off-by: lvyaoting <lvyaoting@outlook.com>
2024-12-05 21:41:09 +08:00
Brian Goff
de14049ae0 Use view transaction for metadata read
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-11-25 22:39:03 +00:00
Marat Radchenko
0a5a80cfec Remove pre-Go 1.17 build tags
Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2024-11-21 10:58:27 +03:00
Tonis Tiigi
e05a89e0b8 improve stacks of cancels from defers
In this case the current stack trace points to the line
where the context was created. Instead the stack should be
captured when the defer is running so the return path to
the defer call is also part of the stack.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-11-19 18:40:00 -08:00
Erik Sipsma
c10b272812 contenthash: don't delete records when a directory is only modified
Before this commit, HandleChange would always recursively remove records
whenever any Modify change was applied to a directory path.

This was wasteful in the case where HandleChange was called only due to
a metadata modification to a directory. In that case, it makes sense to
*update* the directory's node but no existing entries under the
directory need to be thrown away.

Now, we only recursively remove records under a directory for the Delete
case and when a Modify change replaces a directory with a non-directory.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2024-11-14 20:22:23 -08:00