Commit Graph

56 Commits

Author SHA1 Message Date
Guillaume Lours 3f5898f8d0 push empty descriptor layer when using OCI version 1.1 for Compose artifact
it fixes a repository creation issue when pushing the 1st time a Compose OCI artifact on the Hub

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-11-13 13:36:31 +01:00
Guillaume Lours a000978980 remove ArtifactType from Config in OCI v1.1 definition of the artifact
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-11-05 15:10:56 +01:00
Guillaume Lours 517f87a372 bump google.golang.org/grpc to v1.67.1
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-10-29 12:07:34 +01:00
Guillaume Lours 26064d4b60 allow usage of -f flag with oci Compose artifact
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-10-25 17:36:04 +02:00
David Scott 38e3d670a9 desktop: allow this client to be identified via user-agent
Previously the HTTP requests were sent with a generic Go-http-client
user-agent which made it hard to determine where the requests are
coming from. It's important that we can find clients so that they
can be updated if APIs change in future.

Signed-off-by: David Scott <dave@recoil.org>
2024-10-15 13:59:49 +02:00
Joana Hrotko 407d825705 Remove feature flag integration with Docker Desktop for ComposeUI and ComposeNav
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-10-07 20:08:12 +02:00
Suleiman Dibirov d9df7aab6e fix(push): Fix unexpected EOF on alpha publish
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-09-30 10:38:18 +02:00
Alexandr Hacicheant 16652ed26a Fixed possible `nil` pointer dereference
Signed-off-by: Alexandr Hacicheant <a.hacicheant@gmail.com>
2024-09-13 22:10:35 +02:00
Guillaume Lours 24a281fa5d bump buildkit to v0.14.0 and buildx to v0.15.0
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
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 <nicolas.deloof@gmail.com>
2024-05-24 10:27:23 +02:00
Guillaume Lours 2ed40e8042 add gui/composeview as part of available commands
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-05-23 19:19:59 +02:00
Nicolas De Loof 7ad73c2899 fix opentelemetry
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-05-23 15:58:24 +02:00
Kirill A. Korinsky fb25e88a03 Backport OpenBSD patches
Here a trivial patch whcih I've used inside OpenBSD port to build it

Signed-off-by: Kirill A. Korinsky <kirill@korins.ky>
2024-05-22 11:35:37 +02:00
Guillaume Lours 3635303372 add new navigation menu to open Compose app configuration in Docker Desktop
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-05-22 11:34:10 +02:00
Milas Bowman fd532a37e7
fix(desktop): remove overly-aggressive feature flag check (#11748) 2024-04-19 16:06:57 -04:00
Nicolas De Loof b3792dd258 progress for resource can be restarted after more Working event comes
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-04-15 22:05:46 +02:00
Milas Bowman 3371227794 chore(desktop): revised feature detection for file shares
Unfortunately, the feature flag mechanism for experimental features
isn't adequate. To avoid some edge cases where Compose might try to
use Synchronized file shares with Desktop when the feature isn't
available, we need to query a new endpoint.

Before we move any of this out of experimental, we need to improve
the integration here with Desktop & Compose so that we get all the
necessary feature/experiment state up-front to reduce the quantity
of IPC calls needed up-front.

For now, there's some intentional redundancy to avoid making this
extra call if we can avoid it. The actual endpoint is very cheap/
fast, but every IPC call is a potential point of of failure, so
it's worth it.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2024-03-22 18:16:27 +01:00
Joana Hrotko e9dc82011f Add Navigation Menu to compose up
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-03-22 17:48:25 +01:00
Nicolas De Loof 3b541b071c Bump docker v26.0.0
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-03-22 14:33:56 +01:00
Milas Bowman db4ed89528
feat(desktop): synchronized file share integration (#11614) 2024-03-20 14:41:24 -04:00
Milas Bowman 1b5fa3b93f
feat(experiments): add experimental feature state (#11633)
Use environment variable for global opt-out and Docker Desktop (if
available) to determine specific experiment states.

In the future, we'll allow per-feature opt-in/opt-out via env vars
as well, but currently there is a single `COMPOSE_EXPERIMENTAL` env
var that can be used to opt-out of all experimental features
independently of Docker Desktop configuration.
2024-03-20 13:44:27 +00:00
Guillaume Lours 4f97edf355 reduce timeout of the Otel tracing command
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
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
Guillaume Lours 9b0d1ffcf8
Add a fallback check of Watch pid on Windows
False positives were detected when checking the previous watch process state

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2024-02-19 15:01:38 +01:00
Nicolas De Loof 0aad322140
use listeners to collect include metrics
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-02-15 11:20:09 +01:00
Guillaume Lours a220043ca0
Merge pull request #11497 from milas/rm-docker-cp-syncer
chore(watch): remove old `docker cp` implementation
2024-02-14 21:26:05 +01:00
jhrotko 16c8099cf8 Use listener for file metadata
Signed-off-by: jhrotko <joana.hrotko@docker.com>
2024-02-14 16:51:56 +00: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 <milas.bowman@docker.com>
2024-02-13 12:56:53 -05:00
jhrotko 2eca9313c2 Add OTEL specs: build, depends_on, capabilities (gpu/tpu)
Signed-off-by: jhrotko <joana.hrotko@docker.com>
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 <milas.bowman@docker.com>
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 <milas.bowman@docker.com>
2024-01-17 21:17:16 +01:00
Nicolas De Loof 575f2ed7f2
watch: remove requirements for tar binary and for sync target to be rw
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-01-09 15:43:34 +01:00
Laura Brehm 7781b7c992
deps: update docker/cli to fix go version selection issue
see: 70216b662d

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-12-19 14:15:16 +00:00
Nicolas De Loof 26aca867d8 avoid use of service.Name when iterating on project.Services
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-05 18:54:31 +01:00
Nicolas De Loof 138facea62 project.Services is a map
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-05 18:54:31 +01:00
Nicolas De Loof cda04f288e adopt compose-go/v2
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-12-05 18:54:31 +01:00
Milas Bowman 9c29d2236d use custom config type for OCI v1.0
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-12-05 18:08:38 +01:00
Milas Bowman 7c8ff36d78 move around OCI logic, auto fallback/retry 1.1 -> 1.0
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-12-05 18:08:38 +01:00
Nicolas De Loof 0d905a896d add a copyright notice with original author
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-02 11:16:35 +01:00
Nicolas De Loof b847c7f5a4 implement runtime file selection
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-11-02 11:16:35 +01:00
Matthieu MOREL 4f694919ff deps: remove deprecated github.com/pkg/errors
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-09-29 06:28:58 +02:00
Milas Bowman 19f66918cc watch: only allow a single instance per-project
This is a good place to start introducing (local) exclusivity
to Compose. Now, when `alpha watch` launches, it will check for
the existence of a PID file in the user XDG runtime directory,
and create one if the existing one is stale or does not exist.
If the PID file exists and is valid, an error is returned and
Compose exits.

A slight tweak to the experimental remote Git loader has been
made to use the XDG package for consistency.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-08-25 15:49:28 +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 <milas.bowman@docker.com>
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 <milas.bowman@docker.com>
2023-08-08 15:47:18 -04: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 <milas.bowman@docker.com>
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 <milas.bowman@docker.com>
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 <milas.bowman@docker.com>
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 <milas.bowman@docker.com>
2023-07-19 12:25:13 +02: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 <milas.bowman@docker.com>
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 <milas.bowman@docker.com>
2023-06-20 17:25:58 +02:00