19 Commits
Author SHA1 Message Date
Guillaume LoursandClaude Sonnet 5 467fa8ccc9 fix: share --parallel budget across down's ops and up's log-attach
down's outer ops dispatch bounded only how many ops ran concurrently,
separate from the semaphore already shared by image removal -- a
single network plus --rmi could spend up to 2x the configured
budget. Network and volume removal now share that same semaphore.

up's post-attach log streaming called ContainerInspect directly and
passed no limiter to doLogContainer, unlike `compose logs --follow`'s
equivalent path, so it never shared --parallel's budget either.

The plan executor also held a node's slot for its whole dependency
wait instead of just its own work, and internal/sync/tar.go's file
sync used a hardcoded cap of 16 instead of --parallel.

Signed-off-by: Guillaume Lours <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-10-01 16:02:14 +02:00
Endika Iglesias f519180b95 fix(watch): sync into a symlinked directory instead of failing
Signed-off-by: Endika Iglesias <[email protected]>
2026-08-18 17:25:13 +02:00
Lidang-Jiang 63601ebbb3 test: migrate tar_test.go from testify to gotest.tools/v3
Signed-off-by: Lidang-Jiang <[email protected]>
2026-04-03 12:29:07 +02:00
Lidang-Jiang 6ce3fb57a8 fix: return error on non-ErrNotExist stat failures in Tar.Sync()
Previously, Sync() only checked for fs.ErrNotExist when classifying
paths into copy vs delete. Non-NotExist stat errors (e.g. EACCES,
EIO) caused the condition to be false, falling through to the else
clause which incorrectly treated the path as copyable. This masked
real errors and led to cryptic failures downstream.

Restructure the condition into a three-way branch:
- err == nil → copy
- ErrNotExist → delete
- other errors → return immediately with context

This follows the pattern already used by entriesForPath() in the
same file.

Fixes #13654

Signed-off-by: Lidang Jiang <[email protected]>
Signed-off-by: Lidang-Jiang <[email protected]>
2026-04-03 12:29:07 +02:00
Sebastiaan van Stijn bfb5511d0d go.mod: bump github.com/moby/moby/api v1.53.0, moby/client v0.2.2
Also update TestDefaultNetworkSettings:
Test that the network with the highest priority is returned as
"primary" network, and other networks as extra networks.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
2026-02-11 12:32:37 +01:00
Sebastiaan van Stijn 93dd1a4558 internal/sync: replace go-multierror.Group with golang.org/x/sync/errgroup
The go-multierror Group is just a shallow wrapper around sync.WaitGroup;
https://github.com/hashicorp/go-multierror/blob/v1.1.1/group.go#L5-L38

It does not limit concurrency, but handles synchronisation to collect
all errors (if any) in a go-multierror.

This patch replaces the go-multierror.Group for a sync.ErrGroup (which
is slightly easier to use, and does allow for limiting concurrency if
wanted), and a basic slice with mutex to collect the errors and to produce
a stdlib multi-error through errors.Join

Signed-off-by: Sebastiaan van Stijn <[email protected]>
2025-08-25 11:22:25 +02:00
mountdisk b046a5ef72 chore: fix some minor issues in the comments
Signed-off-by: mountdisk <[email protected]>
2025-07-02 07:31:00 +02:00
Sebastiaan van Stijn 13cd780f30 migrate to use github.com/moby/go-archive
Signed-off-by: Sebastiaan van Stijn <[email protected]>
2025-04-17 13:28:49 +02:00
Sebastiaan van StijnandNicolas De Loof cf2fc2005c go.mod: docker/docker, docker/cli v28.0.0, buildx v0.21.1
full diff:

- https://github.com/docker/docker/compare/v27.5.1...v28.0.0
- https://github.com/docker/cli/compare/v27.5.1...v28.0.0
- https://github.com/docker/buildx/compare/v0.20.1...v0.21.1

Co-authored-by: Nicolas De Loof <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
2025-02-21 15:23:25 +01:00
Nicolas De Loof ed10804e0f manage watch applied to mulitple services
Signed-off-by: Nicolas De Loof <[email protected]>
2025-01-22 12:05:58 +01:00
Milas Bowman d203402998 chore(watch): remove old docker cp implementation
This has not been the default for quite a while and required
setting an environment variable to revert back.

The tar implementation is more performant and addresses several
edge cases with the original `docker cp` version, so it's time
to fully retire it.

The scaffolding for multiple sync implementations remains to
support future experimentation here.

Signed-off-by: Milas Bowman <[email protected]>
2024-02-13 12:56:53 -05:00
Nicolas De Loof 575f2ed7f2 watch: remove requirements for tar binary and for sync target to be rw
Signed-off-by: Nicolas De Loof <[email protected]>
2024-01-09 15:43:34 +01:00
Nicolas De Loof 26aca867d8 avoid use of service.Name when iterating on project.Services
Signed-off-by: Nicolas De Loof <[email protected]>
2023-12-05 18:54:31 +01:00
Nicolas De Loof cda04f288e adopt compose-go/v2
Signed-off-by: Nicolas De Loof <[email protected]>
2023-12-05 18:54:31 +01:00
Matthieu MOREL 4f694919ff deps: remove deprecated github.com/pkg/errors
Signed-off-by: Matthieu MOREL <[email protected]>
2023-09-29 06:28:58 +02:00
Milas Bowman 3b0742fd57 watch: batch & de-duplicate file events (#10865)
Adjust the debouncing logic so that it applies to all inbound file
events, regardless of whether they match a sync or rebuild rule.

When the batch is flushed out, if any event for the service is a
rebuild event, then the service is rebuilt and all sync events for
the batch are ignored. If _all_ events in the batch are sync events,
then a sync is triggered, passing the entire batch at once. This
provides a substantial performance win for the new `tar`-based
implementation, as it can efficiently transfer the changes in bulk.

Additionally, this helps with jitter, e.g. it's not uncommon for
there to be double-writes in quick succession to a file, so even if
there's not many files being modified at once, it can still prevent
some unnecessary transfers.

Signed-off-by: Milas Bowman <[email protected]>
2023-08-03 14:53:02 -04:00
Milas Bowman efd44de1b7 watch: support multiple containers for tar implementation (#10860)
Support services with scale > 1 for the tar watch sync.

Add a "lossy" multi-writer specific to pipes that writes the
tar data to each `io.PipeWriter`, which is connected to `stdin`
for the `tar` process being exec'd in the container.

The data is written serially to each writer. This could be
adjusted to do concurrent writes but that will rapidly increase
the I/O load, so is not done here - in general, 99% of the
time you'll be developing (and thus using watch/sync) with a
single replica of a service.

If a write fails, the corresponding `io.PipeWriter` is removed
from the active set and closed with an error.

This means that a single container copy failing won't stop
writes to the others that are succeeding. Of course, they will
be in an inconsistent state afterwards still, but that's a
different problem.

Signed-off-by: Milas Bowman <[email protected]>
2023-08-03 14:52:39 -04:00
Milas Bowman f65fd02383 watch: add tar sync implementation (#10853)
Brought to you by Tilt ❤️ 

Signed-off-by: Milas Bowman <[email protected]>
2023-08-01 14:39:08 -04:00
Milas Bowman cb17c3c8a6 watch: move sync logic into separate package
Just moving some code around in preparation for an alternative
sync implementation that can do bulk transfers by using `tar`.

Signed-off-by: Milas Bowman <[email protected]>
2023-07-19 12:25:13 +02:00