-
Notifications
You must be signed in to change notification settings - Fork 127
Add progress flag if docker compose is used #1628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
internal/compose/compose.go
Outdated
| } | ||
|
|
||
| v, ok = os.LookupEnv(DisableProgressOutputComposeEnv) | ||
| if !c.dockerComposeV1 && !c.dockerComposeStandalone && ok && strings.ToLower(v) != "false" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option is just available using docker compose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? This behaves the same in docker-compose (trying with standalone docker-compose v2.23.3).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying with docker-compose with version 2.17.2 (same version that was set previously in CI for it). In that version there is no --progress flag.
I see that in the latest version of docker-compose standalone (v2.24.1), that version is already in place.
f76c295 to
4662354
Compare
.buildkite/pipeline.yml
Outdated
| # ELASTIC_PACKAGE_COMPOSE_DISABLE_PROGRESS_OUTPUT: "true" | ||
| ELASTIC_PACKAGE_COMPOSE_PROGRESS_OUTPUT: "quiet" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsoriano any preference about which environment would be best to set ?
ELASTIC_PACKAGE_COMPOSE_DISABLE_PROGRESS_OUTPUT would be just to set true or false, and we would need to decide if we want plain or quiet for the --progress flag.
In ELASTIC_PACKAGE_COMPOSE_PROGRESS_OUTPUT var, a few values would be allowed (auto, plain or quiet) and the user could choose which one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For CI quite looks good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or plain, with --quiet-pull also looks good for CI.
| * `stack.serverless.region` can be used to select the region to use when starting | ||
| serverless projects. | ||
|
|
||
| ## Useful environment variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK there is no docs about all the environment variables that are defined in elastic-package. Just added this section to include all these references
WDYT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
4662354 to
00c34ad
Compare
internal/compose/compose.go
Outdated
| DisableProgressOutputComposeEnv = environment.WithElasticPackagePrefix("COMPOSE_DISABLE_PROGRESS_OUTPUT") | ||
| ProgressOutputComposeEnv = environment.WithElasticPackagePrefix("COMPOSE_PROGRESS_OUTPUT") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should decide which one to use here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COMPOSE_DISABLE_PROGRESS_OUTPUT sounds good to me, we don't need to expose all the options.
00c34ad to
f8f7578
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest Buildkite builds that are executing the docker compose for all the commands under elastic-package looks like are not honoring the parameter
--ansi never.
I think it is not a matter of docker-compose vs docker compose but about a regression(?) on recent versions. Trying locally with standalone docker-compose v2.23.3 it neither honors --ansi never.
Given the differences between the different versions I wonder if instead of exposing the different flags, we should have a single flag to enable or disable this verbose output, that under the hood uses any flag known to work for each version.
.buildkite/pipeline.yml
Outdated
| # ELASTIC_PACKAGE_COMPOSE_DISABLE_PROGRESS_OUTPUT: "true" | ||
| ELASTIC_PACKAGE_COMPOSE_PROGRESS_OUTPUT: "quiet" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For CI quite looks good 👍
| * `stack.serverless.region` can be used to select the region to use when starting | ||
| serverless projects. | ||
|
|
||
| ## Useful environment variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
.buildkite/pipeline.yml
Outdated
| # ELASTIC_PACKAGE_COMPOSE_DISABLE_PROGRESS_OUTPUT: "true" | ||
| ELASTIC_PACKAGE_COMPOSE_PROGRESS_OUTPUT: "quiet" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or plain, with --quiet-pull also looks good for CI.
internal/compose/compose.go
Outdated
| DisableProgressOutputComposeEnv = environment.WithElasticPackagePrefix("COMPOSE_DISABLE_PROGRESS_OUTPUT") | ||
| ProgressOutputComposeEnv = environment.WithElasticPackagePrefix("COMPOSE_PROGRESS_OUTPUT") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COMPOSE_DISABLE_PROGRESS_OUTPUT sounds good to me, we don't need to expose all the options.
internal/compose/compose.go
Outdated
| } | ||
|
|
||
| v, ok = os.LookupEnv(DisableProgressOutputComposeEnv) | ||
| if !c.dockerComposeV1 && !c.dockerComposeStandalone && ok && strings.ToLower(v) != "false" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? This behaves the same in docker-compose (trying with standalone docker-compose v2.23.3).
Just tried with the latest version (v2.24.1) and it happens the same,
Should we use a new flag, for instance just Not sure if adding just one variable would just force to update docker-compose versions to users. If it is kept different environment variables, probably it is easier to set up by users depending on their versions. Or maybe having all these environment variables make more difficult to know which one to use... WDYT ? @jsoriano And checking with the latest-version, it looks also that # docker-compose v2.24.1
$ docker-compose --ansi=never down ; echo "-----" ; docker rmi ubuntu:latest ; echo "--------" ; docker-compose --ansi=never up -d --quiet-pull
[+] Running 2/2
✔ Container dockertest-ubuntu-1 Removed 10.3s
✔ Network dockertest_default Removed 0.4s
-----
Untagged: ubuntu:latest
Untagged: ubuntu@sha256:e6173d4dc55e76b87c4af8db8821b1feae4146dd47341e4d431118c7dd060a74
Deleted: sha256:e34e831650c1bb0be9b6f61c6755749cb8ea2053ba91c6cda27fded9e089811f
Deleted: sha256:8e87ff28f1b5ff2d5131999ccfa1e674cb252631c50683f5ee43fad59cbea8e1
--------
[+] Running 1/1
✔ ubuntu Pulled 5.8s
[+] Running 1/2
⠴ Network dockertest_default Created 0.4s
✔ Container dockertest-ubuntu-1 Started |
|
buildkite test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
💚 Build Succeeded
History
cc @mrodm |
Latest Buildkite builds that are executing the
docker composefor all the commands under elastic-package looks like are not honoring the parameter--ansi neverThis
--ansiparameter is a valid parameter as it is mentioned in the docs: https://docs.docker.com/engine/reference/commandline/compose/#optionsThese are two BK buildsexamples where it can be seen these changes in the output of
docker composevsdocker-composecommands:docker-compose: https://buildkite.com/elastic/elastic-package/builds/2030#018c5a4b-7d43-4804-bdbe-0adc2ca4fa7b/67-337docker compose: https://buildkite.com/elastic/elastic-package/builds/2134#018d1ca8-6837-4bfb-87fb-151b5da99ec1/63-336In this PR, it is added a new parameter
--progressavailable just fordocker composecommand. If usedplainas value, results are similar to what--ansi neverdoes. If usedquietas value, there is no output at all.--progress plain: https://buildkite.com/elastic/elastic-package/builds/2138--progress quiet: https://buildkite.com/elastic/elastic-package/builds/2139A new section is added to the README , to include all the environment variables available that could be used when using
elastic-packageCLI.Testing this parameter locally