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
[#6026] Added -q, --quiet option to 'up' and 'down' commands to suppress parallel stream messages. #6194
Conversation
… suppress parallel stream messages. Signed-off-by: Ben Ellis <ben.ellis@softweyr.co.uk>
Thanks for the contribution @BEllis ! |
I did actually do that first, but then I thought it would cause side-effects for backwards compatibility. I'm happy to change it back to take effect when logging-level < WARNING |
I'll raise a separate PR with that approach. |
Closing as superseded by #6217 |
This Docker Compose CLI utility wrapper allows users to hide *Starting <...>* / *Stopping <...>* and similar messages from `docker-compose`'s output. Docker Compose is overly verbose when starting containers for a service: ```bash $ docker-compose --project-name test run --rm test_service bash Creating network "test-bash_default" with the default driver Creating test-bash_postgresql-server_1 ... done Creating test-bash_solr-zookeeper_1 ... done Creating test-bash_extract-article-from-page_1 ... done Creating test-bash_rabbitmq-server_1 ... done Creating test-bash_solr-shard-01_1 ... done Creating test-bash_import-solr-data-for-testing_1 ... done $ docker-compose --project-name test down --volumes Stopping test-bash_import-solr-data-for-testing_1 ... done Stopping test-bash_solr-shard-01_1 ... done Stopping test-bash_postgresql-server_1 ... done Stopping test-bash_solr-zookeeper_1 ... done Stopping test-bash_extract-article-from-page_1 ... done Stopping test-bash_rabbitmq-server_1 ... done Removing test-bash_import-solr-data-for-testing_1 ... done Removing test-bash_solr-shard-01_1 ... done Removing test-bash_postgresql-server_1 ... done Removing test-bash_solr-zookeeper_1 ... done Removing test-bash_extract-article-from-page_1 ... done Removing test-bash_rabbitmq-server_1 ... done Removing network test-bash_default ``` Setting `--log-level` to `WARNING` doesn't seem to help, and multiple issues and PRs to address the issue have been unsuccessful so far: * <docker/compose#6217> * <docker/compose#6194> * <docker/compose#6026> This wrapper monkey-patches [`ParallelStreamWriter`](https://github.com/docker/compose/blob/master/compose/parallel.py#L259-L320) for it to take into account `--log-level` setting and make the output quieter, and then runs Compose's CLI normally.
Docker Compose is overly verbose when starting containers for a service: ``` $ docker-compose --project-name test run --rm test_service bash Creating network "test-bash_default" with the default driver Creating test-bash_postgresql-server_1 ... done Creating test-bash_solr-zookeeper_1 ... done Creating test-bash_extract-article-from-page_1 ... done Creating test-bash_rabbitmq-server_1 ... done Creating test-bash_solr-shard-01_1 ... done Creating test-bash_import-solr-data-for-testing_1 ... done ``` Setting `--log-level` to `WARNING` doesn't seem to help, and multiple issues and PRs to address the issue have been unsuccessful so far: * docker/compose#6217 * docker/compose#6194 * docker/compose#6026 So, use a wrapper for `docker-compose` that monkey-patches Docker Compose for it to respect `--log-level`. The wrapper is basically this script: https://github.com/docker/compose/blob/master/bin/docker-compose with some extra sauce to shut up the extra verbose logging; that makes it 100% compatible with vanilla `docker-compose` utility. Scripts under `./dev/` will run in "quiet mode" by default unless an extra `-v` (`--verbose`) flag gets passed, e.g.: ``` $ ./dev/run.py postgresql-server pwd / $ ``` Wrapper itself is available as a separate repo as it's potentially useful to others and could count as one of our open-source projects: https://github.com/berkmancenter/mediacloud-docker-compose-just-quieter
Docker Compose is overly verbose when starting containers for a service: ``` $ docker-compose --project-name test run --rm test_service bash Creating network "test-bash_default" with the default driver Creating test-bash_postgresql-server_1 ... done Creating test-bash_solr-zookeeper_1 ... done Creating test-bash_extract-article-from-page_1 ... done Creating test-bash_rabbitmq-server_1 ... done Creating test-bash_solr-shard-01_1 ... done Creating test-bash_import-solr-data-for-testing_1 ... done ``` Setting `--log-level` to `WARNING` doesn't seem to help, and multiple issues and PRs to address the issue have been unsuccessful so far: * docker/compose#6217 * docker/compose#6194 * docker/compose#6026 So, use a wrapper for `docker-compose` that monkey-patches Docker Compose for it to respect `--log-level`. The wrapper is basically this script: https://github.com/docker/compose/blob/master/bin/docker-compose with some extra sauce to shut up the extra verbose logging; that makes it 100% compatible with vanilla `docker-compose` utility. Scripts under `./dev/` will run in "quiet mode" by default unless an extra `-v` (`--verbose`) flag gets passed, e.g.: ``` $ ./dev/run.py postgresql-server pwd / $ ``` Wrapper itself is available as a separate repo as it's potentially useful to others and could count as one of our open-source projects: https://github.com/berkmancenter/mediacloud-docker-compose-just-quieter
Added -q, --quiet option to 'up' and 'down' commands to suppress parallel stream messages.
Resolves #6026