40 Commits
Author SHA1 Message Date
Nicolas De LoofandClaude Fable 5 e96ca020f2 build(deps): adopt compose-go jobs and the container-spec layering
compose-spec/compose-go#866 is merged: jobs top-level element, container
specification layered as ContainerSpec/WorkloadSpec, pre_start hooks
carrying the full container specification resolved at load time. Bump
to the merged head and adapt in the same movement — composite literals
setting moved fields wrap them into the embedded ContainerSpec /
WorkloadSpec (promoted field access was already source-compatible, so
this is literal-only, no behavior change), and pre_start handling is
typed against PreStartHook.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Nicolas De Loof <[email protected]>
2026-09-21 16:35:20 +02:00
Sebastiaan van Stijn 063ef45da1 golangci-lint: enable perfsprint linter
Signed-off-by: Sebastiaan van Stijn <[email protected]>
2026-09-10 10:25:34 +02:00
hiroto.toyoda 1ebdc06c18 feat(tracing): surface otel shutdown errors via --debug
OTel SDK/exporter errors already go through docker/cli's own
otel.SetErrorHandler(debug.OTELErrorHandler), installed by the plugin
framework at startup. Our own handler, installed at package init time,
was always clobbered before any command ran (plugin.Run() sets its handler
after all inits execute), so it never had any effect - verified by tracing
the exact call order and reproducing the flag behavior against a built
binary.

Drop that dead handler along with the COMPOSE_OTEL_DEBUG env var it
introduced. The one genuinely-discarded error (the tracer shutdown/flush
error in wrapRunE) now goes through logrus like everything else in the
codebase: it's already gated by --debug/-D via logrus's own level, so no
explicit check is needed.

Signed-off-by: hiroto.toyoda <[email protected]>
2026-09-02 17:12:12 +02:00
Sebastiaan van Stijn df75f82a6b chore(deps): github.com/docker/buildx v0.34.1, buildkit v0.30.0
Signed-off-by: Sebastiaan van Stijn <[email protected]>
2026-06-15 12:45:57 +02:00
Guillaume LoursandClaude Opus 4.6 182defa8aa feat: add Docker Desktop Logs view hints and navigation shortcut
Add CLI hooks handler to show "What's next:" hints pointing to the
Docker Desktop Logs view after `docker logs`, `docker compose logs`,
and `docker compose up -d`.

Add `l` keyboard shortcut in the `compose up` navigation menu to
open the Logs view, gated on Docker Desktop feature flag and settings.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
2026-04-10 15:26:08 +02:00
Sebastiaan van Stijn 92a7ac1fa2 fix mixed assertion libraries in tests
Before this, assertion libraries were mixed, sometimes
even in the same file.

    git grep -l '"gotest.tools/v3/' | wc -l
    75
    git grep -l '"github.com/stretchr/testify' | wc -l
    24

Signed-off-by: Sebastiaan van Stijn <[email protected]>
2026-03-31 17:32:51 +02:00
Sebastiaan van Stijn f9828dfab9 modernize some code
Results of running the modernize command, with some minor changes
afterwards (removing the `contains` and `hasStatus` helper functions);

    go install golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest
    modernize -fix ./...

Signed-off-by: Sebastiaan van Stijn <[email protected]>
2026-02-12 15:31:35 +01: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
zjumathcode 13d70b1c11 refactor: replace interface{} with any for clarity and modernization
Signed-off-by: zjumathcode <[email protected]>
2025-12-02 08:41:49 +01:00
Sebastiaan van Stijn dc66e6bad1 golangci-lint: use gci formatter instead of goimports
Most files already grouped imports into "stdlib -> other -> local",
but some files didn't. The gci formatter is similar to goimports, but
has better options to make sure imports are grouped in the expected
order (and to make sure no additional groups are present).

This formatter has a 'fix' function, so code can be re-formatted auto-
matically;

    golangci-lint run -v --fix

Signed-off-by: Sebastiaan van Stijn <[email protected]>
2025-12-01 12:21:50 +01:00
Nicolas De Loof 2b4543935c next release will be major version v5.x
Signed-off-by: Nicolas De Loof <[email protected]>
2025-11-13 09:32:43 +01:00
Sebastiaan van Stijn 5165b0f814 internal/tracing: replace go-multierror.Group with sync.WaitGroup
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

This patch replaces the go-multierror.Group for a sync.WaitGroup (we
probably don't need to limit concurrency for this one) and stdlib multi-
errors.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
2025-08-25 11:22:25 +02:00
Guillaume Lours efc939dcee add info about models usage to OpenTelemetry spans
Signed-off-by: Guillaume Lours <[email protected]>
2025-07-24 16:01:28 +02:00
Nicolas De Loof 6fa173124a (reactoring) avoid a global variable by introducing logConsumer decorator
Signed-off-by: Nicolas De Loof <[email protected]>
2025-07-01 12:29:05 +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
Guillaume Lours 517f87a372 bump google.golang.org/grpc to v1.67.1
Signed-off-by: Guillaume Lours <[email protected]>
2024-10-29 12:07:34 +01:00
Joana Hrotko 407d825705 Remove feature flag integration with Docker Desktop for ComposeUI and ComposeNav
Signed-off-by: Joana Hrotko <[email protected]>
2024-10-07 20:08:12 +02:00
Guillaume Lours 24a281fa5d bump buildkit to v0.14.0 and buildx to v0.15.0
Signed-off-by: Guillaume Lours <[email protected]>
2024-06-18 10:52:41 +02:00
Nicolas De Loof 1adc4cb16f drop COMPOSE_EXPERIMENTAL_OTEL as docker/cli has opentelemetry in
Signed-off-by: Nicolas De Loof <[email protected]>
2024-05-24 10:27:23 +02:00
Guillaume Lours 2ed40e8042 add gui/composeview as part of available commands
Signed-off-by: Guillaume Lours <[email protected]>
2024-05-23 19:19:59 +02:00
Nicolas De Loof 7ad73c2899 fix opentelemetry
Signed-off-by: Nicolas De Loof <[email protected]>
2024-05-23 15:58:24 +02:00
Joana Hrotko e9dc82011f Add Navigation Menu to compose up
Signed-off-by: Joana Hrotko <[email protected]>
2024-03-22 17:48:25 +01:00
Nicolas De Loof 3b541b071c Bump docker v26.0.0
Signed-off-by: Nicolas De Loof <[email protected]>
2024-03-22 14:33:56 +01:00
Guillaume Lours 4f97edf355 reduce timeout of the Otel tracing command
Signed-off-by: Guillaume Lours <[email protected]>
2024-03-18 08:40:36 +01:00
Milas Bowman 17d4229e57 feat(desktop): add Docker Desktop detection and client skeleton (#11593) 2024-03-12 09:47:41 -04:00
Nicolas De Loof 0aad322140 use listeners to collect include metrics
Signed-off-by: Nicolas De Loof <[email protected]>
2024-02-15 11:20:09 +01:00
jhrotko 16c8099cf8 Use listener for file metadata
Signed-off-by: jhrotko <[email protected]>
2024-02-14 16:51:56 +00:00
jhrotko 2eca9313c2 Add OTEL specs: build, depends_on, capabilities (gpu/tpu)
Signed-off-by: jhrotko <[email protected]>
2024-02-09 10:55:07 +00:00
Milas Bowman acf2ffb0c7 feat(tracing): add project hash attr
Hash the project config and add it as an attribute. This can be
used to group multiple spans.

Signed-off-by: Milas Bowman <[email protected]>
2024-02-08 15:47:25 +01:00
Milas Bowman d688d3bf22 fix(tracing): batch span exports to prevent blocking
This was a bad configuration (my fault) that meant each span was
exported synchronously, as it ended. That can cause weird behavior
such as stuttering/blocking.

There's really no reason to NOT use the batch processor, it's the
recommended way to configure it. In the future, it might make sense
to tune the intervals based on the fact that Compose is a CLI vs
a long-running server app, but we handle flushing out on exit
already, so it's not a huge deal.

Signed-off-by: Milas Bowman <[email protected]>
2024-01-17 21:17:16 +01:00
Laura Brehm 7781b7c992 deps: update docker/cli to fix go version selection issue
see: https://github.com/docker/cli/commit/70216b662dc440faaebab531deb35f0f0c633d17

Signed-off-by: Laura Brehm <[email protected]>
2023-12-19 14:15:16 +00:00
Nicolas De Loof 138facea62 project.Services is a map
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 c79f67fead otel: add include to project up span
Flatten the list of included files and add as a slice attribute.

Signed-off-by: Milas Bowman <[email protected]>
2023-08-22 16:10:18 +02:00
Milas Bowman 0be8e4a676 trace: do not block connecting to OTLP endpoint (#10882)
This was left over from debugging, but we should not block.
OTel will handle the connection in the background.

Signed-off-by: Milas Bowman <[email protected]>
2023-08-08 15:47:18 -04:00
Milas Bowman 1ae191a936 trace: instrument compose up at a high-level
* Image pull
* Image build
* Service apply
  * Scale down/up (event)
  * Recreate container (event)
  * Scale up (event)
  * Container start (event)

Signed-off-by: Milas Bowman <[email protected]>
2023-07-19 11:26:12 +02:00
Milas Bowman e1f8603a62 otel: refactor root command span reporting
* Move all the initialization code out of `main.go`
* Ensure spans are reported when there's an error with the
  command
* Attach the Compose version & active Docker context to the
  resource instead of the span
* Name the root CLI span `cli/<cmd>` for clarity and grab
  the full subcommand path (e.g. `alpha-viz` instead of just
  `viz`)

Signed-off-by: Milas Bowman <[email protected]>
2023-06-20 17:25:58 +02:00
Milas Bowman ff3984e609 otel: fix initialization / error-handling (#10717)
* If there's no `otel` key (or the value is `null`) in the config,
  don't return an error
* Propagate error from the exporter instead of panicking

Signed-off-by: Milas Bowman <[email protected]>
2023-06-15 12:43:15 -04:00
Milas Bowman 3c8a56dbf3 trace: add OTEL initialization (#10526)
This is a bunch of OTEL initialization code. It's all in
`internal/` because there are re-usable parts here, but Compose
isn't the right spot. Once we've stabilized the interfaces a bit
and the need arises, we can move it to a separate module.

Currently, a single span is produced to wrap the root Compose
command.

Compose will respect the standard OTEL environment variables
as well as OTEL metadata from the Docker context. Both can be
used simultaneously. The latter is intended for local system
integration and is restricted to Unix sockets / named pipes.

None of this is enabled by default. It requires setting the
`COMPOSE_EXPERIMENTAL_OTEL=1` environment variable to
gate it during development.

Signed-off-by: Milas Bowman <[email protected]>
2023-06-08 16:46:07 -04:00